This file contains 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
// Method in retrofit Ws | |
suspend fun getDestinyRequestR() : Response<List<ResponseDestinyRequest>> | |
// Method in repository | |
override suspend fun getDestinyRequest(): List<DestinyRequest> { | |
val response = destinyRequestWs.getDestinyRequestR() | |
//Do stuff | |
return response | |
} |
This file contains 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.djangomx.airsale.utils.dialogs | |
import android.content.Context | |
import androidx.appcompat.app.AlertDialog | |
typealias onClickAllow = (Boolean) -> Unit | |
object Dialogs { | |
var alertDialog: AlertDialog.Builder? = null |
This file contains 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
private val database = FirebaseDatabase.getInstance() | |
override fun getSummary(): Observable<OweSummaryDomain> = | |
Observable.create { emitter -> | |
val summary = database.getReference("summary") | |
summary.addValueEventListener(object : ValueEventListener { | |
override fun onCancelled(error: DatabaseError) { | |
Timber.e("summary error: ${error.message}") | |
emitter.onError(error.toException()) | |
} |
This file contains 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.example.cleanarchme.data | |
import android.app.Application | |
import android.widget.Toast | |
import androidx.biometric.BiometricPrompt | |
import androidx.fragment.app.FragmentActivity | |
import com.example.data.auth.Auth | |
import java.util.concurrent.Executor | |
class AuthImpl(private val context: Application, private var activity: FragmentActivity) : Auth { |
This file contains 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.example.data.repository | |
import com.example.data.UserPreferences | |
import com.example.data.auth.Auth | |
import com.example.data.auth.AuthValidator | |
import com.example.data.source.LocalDataSource | |
class UserRepository( | |
private val auth: Auth, | |
private val authValidator: AuthValidator, |
This file contains 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 MyFirebaseMessagingService : FirebaseMessagingService() { | |
private val userPreferences: UserPreferences by inject() | |
override fun onMessageReceived(remoteMessage: RemoteMessage) { | |
// ... | |
// TODO(developer): Handle FCM messages here. | |
// Not getting messages here? See why this may be: https://goo.gl/39bRNJ | |
Timber.e("From: %s", remoteMessage.from) |
This file contains 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 UserPreferences(context: Context) { | |
companion object { | |
const val USER_PREFERENCES = "USER_PREFERENCES" | |
const val USER_TOKEN = "USER_TOKEN" | |
} | |
private val preferences = context.applicationContext | |
.getSharedPreferences(USER_PREFERENCES, Context.MODE_PRIVATE) |
This file contains 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 Application.initDi() { | |
startKoin { | |
androidLogger() | |
androidContext(this@initDi) | |
modules(listOf(appModule, dataModule, summaryModule, oweModule)) | |
} | |
} | |
val appModule = module { | |
single<FirebaseDataSource> { |
This file contains 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.example.cleanarchme.views | |
import android.animation.ObjectAnimator | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Color | |
import android.util.AttributeSet | |
import android.util.Log | |
import android.view.Gravity | |
import android.view.View |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/custom_switch_container" | |
android:layout_width="222dp" | |
android:layout_height="33dp" | |
android:background="@drawable/shape" | |
android:backgroundTint="#82BC00" | |
android:clickable="true" |
OlderNewer