Skip to content

Instantly share code, notes, and snippets.

View IvanAbakumov's full-sized avatar

Ivan Abakumov IvanAbakumov

View GitHub Profile
public class MainActivity extends AppCompatActivity {
public static final String FILENAME = "myfile";
private EditText mInput;
private TextView mFromInternal;
private TextView mFromExternal;
private Switch mIsExternalSwitch;
private Button mDelete;
@Override
//////////////////////
РАБОТАЕТ
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_name_dialog"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="@dimen/margin_all_pages"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/layout_select">
class OrderAdapter(val orderClicked: (order: GetUserAllOrderResponse.Order) -> Unit) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
var ordersList: List<OrderListItem> = listOf()
fun setData(list: List<OrderListItem>) {
ordersList = list
notifyDataSetChanged()
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="3dp" android:color="#B1BCBE" />
<corners android:radius="10dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
class CallVideVOIP(private val orderId: String, private val typeInOutCall: String) : SupportAppScreen() {
override fun getActivityIntent(context: Context?): Intent {
return Intent(context, VoiceCVActivity::class.java).putExtra(KEY_TO_CALL, orderId).putExtra(KEY_TYPE_CALL,typeInOutCall)
}
}
"timeSlotDTOs": {
"1572638400000": [
{
"specialtyId": 13,
"slotDate": 1572638400000,
"timeString": "19:00",
"slotId": 59066,
"slotTime": "2019-11-02T15:00:00.000+0000",
"timeUnix": 1572721200
},
import android.app.Dialog
import android.content.Context
import android.view.Window
import ge.redmed.patient.R
class LoaderDialog(private var context: Context) {
private lateinit var dialog: Dialog
fun showDialog() {
# App.class
val customTypeAdapter = object : CustomTypeAdapter<Long> {
override fun decode(@NotNull value: CustomTypeValue<*>): Long {
return value.toString().toLong()
}
@NotNull
override fun encode(@NotNull value: Long): CustomTypeValue<*> {
return CustomTypeValue.GraphQLNumber(value)
}
/**
* To be semantically or contextually correct, maybe change the name
* and signature of this function to something like:
*
* private void showBackButton(boolean show)
* Just a suggestion.
*/
private void enableViews(boolean enable) {
// To keep states of ActionBar and ActionBarDrawerToggle synchronized,
class SMSReceiver : BroadcastReceiver() {
companion object {
private const val VALIDATE_MASK = ".*Maliava auth code:? ([0-9]{6}).*"
}
private var listener: WeakReference<OnSMSReceiveListener>? = null
fun setListener(listener: OnSMSReceiveListener) {
this.listener = listener.weak()