class SimpleSingleton {
private static SimpleSingleton sInstance;
private SimpleSingleton() {}
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
| import io.ktor.client.HttpClient | |
| import io.ktor.client.call.call | |
| import io.ktor.client.engine.okhttp.OkHttp | |
| import io.ktor.client.request.forms.MultiPartFormDataContent | |
| import io.ktor.client.request.forms.formData | |
| import io.ktor.client.request.url | |
| import io.ktor.http.Headers | |
| import io.ktor.http.HttpHeaders | |
| import io.ktor.http.HttpMethod | |
| import kotlinx.coroutines.GlobalScope |
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
| /* NetworkBoundSource - using Observable in RxJava/RxAndroid */ | |
| abstract class NetworkBoundResource<ResultType, RequestType> @MainThread | |
| protected constructor() { | |
| private val asObservable: Observable<Resource<ResultType>> | |
| init { | |
| val source: Observable<Resource<ResultType>> | |
| if (shouldFetch()) { |
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
| fun klog(@IntRange(from = 2, to = 6) level: Int, message: Any?) { | |
| if (!BuildConfig.DEBUG) return | |
| Throwable().stackTrace[1].run { | |
| val tag = "commontag" | |
| val fullMessage = "($fileName:$lineNumber): $message" | |
| when (level) { | |
| Log.VERBOSE -> Log.v(tag, fullMessage) | |
| Log.DEBUG -> Log.d(tag, fullMessage) | |
| Log.INFO -> Log.i(tag, fullMessage) | |
| Log.WARN -> Log.w(tag, fullMessage) |
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 com.nieldeokar.whatsappaudiorecorder.recorder; | |
| import android.media.AudioFormat; | |
| import android.media.AudioRecord; | |
| import android.media.MediaCodec; | |
| import android.media.MediaCodecInfo; | |
| import android.media.MediaFormat; | |
| import android.media.MediaRecorder; | |
| import android.os.Build; | |
| import android.util.Log; |
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 com.your.package | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import com.your.package.R | |
| import com.google.android.material.bottomsheet.BottomSheetDialog | |
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
| /** | |
| * BottomSheetDialog fragment that uses a custom |
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
| public class MyApplication extends Application { | |
| @Override | |
| public void onCreate() { | |
| super.onCreate(); | |
| // Call helper to start Koin | |
| JavaAppKoinKt.start(this); | |
| } | |
| } |
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
| Author | Quote | |
|---|---|---|
| Thomas Edison | Genius is one percent inspiration and ninety-nine percent perspiration. | |
| Yogi Berra | You can observe a lot just by watching. | |
| Abraham Lincoln | A house divided against itself cannot stand. | |
| Johann Wolfgang von Goethe | Difficulties increase the nearer we get to the goal. | |
| Byron Pulsifer | Fate is in your hands and no one elses | |
| Lao Tzu | Be the chief but never the lord. | |
| Carl Sandburg | Nothing happens unless first we dream. | |
| Aristotle | Well begun is half done. | |
| Yogi Berra | Life is a learning experience, only if you learn. |
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 com.google.firebase.udacity.friendlychat | |
| import com.google.firebase.database.ChildEventListener | |
| import com.google.firebase.database.DataSnapshot | |
| import com.google.firebase.database.DatabaseError | |
| class _ChildEventListener( | |
| private val _onCancelled: (DatabaseError) -> Unit, | |
| private val _onChildMoved: (DataSnapshot, String?) -> Unit, | |
| private val _onChildChanged: (DataSnapshot, String?) -> Unit, |