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
val anyList: List<Any> = listOf("One", 2, "Three", "Four", 4.5, "Five", 6.0f) | |
val observable: Observable<Any> = anyList.toObservable() | |
val observer: Observer<Any> = object : Observer<Any> { | |
override fun onComplete() { | |
log("All Completed") | |
} | |
override fun onSubscribe(d: Disposable) { |
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
class GetUsersAsyncTask : AsyncTask<Void, Void, ArrayList<User>?>() { | |
override fun doInBackground(vararg params: Void?): ArrayList<User>? { | |
var urlConnection: HttpURLConnection? = null | |
var reader: BufferedReader? = null | |
val userList = ArrayList<User>() | |
try { |
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
data class User( | |
val createdAt: String? = null, | |
val isPro: Boolean? = null, | |
val name: String? = null, | |
val id: String? = null, | |
val avatar: String? = null, | |
val job: String? = null, | |
val username: String? = null | |
) : Serializable |
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
[ | |
{ | |
"id": "1", | |
"createdAt": "2019-04-19T20:29:46.523Z", | |
"name": "Martin Kuvalis", | |
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/aluisio_azevedo/128.jpg", | |
"job": "Designer", | |
"username": "Stella_Kautzer", | |
"is_pro": true | |
}, |
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
class FirebaseAuthManager { | |
private var mAuth: FirebaseAuth? = null | |
init { | |
this.mAuth = FirebaseAuth.getInstance() | |
} | |
fun initializeAuthListener(authListener: IFirebaseAuthListener) { | |
this.mAuth?.addAuthStateListener { firebaseAuth -> |
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
class SplashActivity : AppCompatActivity(), SplashActivityContract.View { | |
private lateinit var progressView: SpinKitView | |
@Inject | |
lateinit var mPresenter: SplashActivityPresenter | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_splash) |
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
class SplashActivityPresenter @Inject constructor() : SplashActivityContract.Presenter { | |
private lateinit var mView: SplashActivityContract.View | |
@Inject | |
lateinit var mHandlerProcessManagement: HandlerProcessManagement | |
@Inject | |
lateinit var mIntentHelper: IntentHelper |
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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/colorPrimaryDark"> | |
<com.github.ybq.android.spinkit.SpinKitView | |
android:id="@+id/sk_progress" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
style="@style/SpinKitView.Large.Wave" |
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
@Component( | |
modules = [ | |
(AppModule::class), | |
(IntentModule::class), | |
(SplashActivityModule::class) | |
] | |
) | |
interface SplashActivityComponent { | |
fun inject(activity: SplashActivity) |
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
@Module | |
class SplashActivityModule { | |
@Provides | |
fun provideHandlerProcessManagement(): HandlerProcessManagement { | |
return HandlerProcessManagement() | |
} | |
} |
NewerOlder