This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pl.kpob.utils.extensions | |
| import android.app.Activity | |
| import android.content.Context | |
| import android.graphics.Color | |
| import android.support.v4.content.ContextCompat | |
| import android.view.WindowManager | |
| import flow.Flow | |
| import org.jetbrains.anko.AlertDialogBuilder | |
| import pl.sisms.gminformix.utils.extensions.supportsLollipop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline fun <T> createObservable(scheduler: Scheduler = Schedulers.io(), crossinline func: () -> T) : Observable<T> = | |
| Observable.create<T> { | |
| try { | |
| it.onNext(func()) | |
| it.onCompleted() | |
| } catch(e: Throwable) { | |
| it.onError(e) | |
| } | |
| }.subscribeOn(scheduler).observeOn(AndroidSchedulers.mainThread()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package <yourPackage>; | |
| import android.annotation.SuppressLint; | |
| import android.app.Activity; | |
| import android.content.Intent; | |
| import android.database.Cursor; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.net.Uri; | |
| import android.os.Build; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, categories); | |
| adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); | |
| spinner.setAdapter(adapter); | |
| spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | |
| @Override | |
| public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | |
| presenter.onItemSelected(adapter.getItem(position)); | |
| } | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Drawable newDrawable = drawable.getConstantState().newDrawable(); |