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
/* ----------------------------------------- Activity ------------------------------------------ */ | |
/* make sure you have at least 'androidx.activity:activity-ktx:1.6.0-rc01' at your dependencies | |
(just to let you know this dependency is not stable yet ) | |
*/ | |
implementation 'androidx.activity:activity-ktx:1.6.0-rc01' | |
fun AppCompatActivity.onBackPressed(isEnabled: Boolean, callback: () -> Unit) { | |
onBackPressedDispatcher.addCallback(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
object LocalData { | |
/** | |
* Set any type of shared preferences value | |
* @param key of the shared preferences which the caller is desire to set | |
* @param value any type | |
*/ | |
operator fun<T> set(key: String?, value: T) { | |
/* below you can put whatever shared preferences api you use, I prefer Hawk | |
* it helps to store objects immediately without need to use GSON in shared preferences | |
* */ |
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
/* | |
* Created by Qamar A. Safadi on 6/13/22, 9:50 PM | |
* Copyright (c) 2022 . | |
*/ | |
package com.example.qamar.ui.base | |
import android.app.Dialog | |
import android.graphics.Color | |
import android.graphics.drawable.ColorDrawable |
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
/* | |
* Copyright (c) 2022. Qamar A. Safadi | |
*/ | |
package com.qamar.test.base | |
import android.os.Bundle | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.view.WindowManager |
NewerOlder