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
/* | |
* 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 |
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
/* | |
* 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 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 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 android.app.LocaleManager | |
import android.content.Context | |
import android.os.Build | |
import android.os.LocaleList | |
import androidx.appcompat.app.AppCompatDelegate | |
import androidx.core.os.LocaleListCompat | |
import java.util.Locale | |
/// Change Langauage Extenstion |
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
/** | |
* Default implementation of [LocaleHelperKt]. | |
*/ | |
class DefaultLocaleHelper private constructor(context: Context) : BaseLocaleHelper(context) { | |
companion object { | |
/* Mark the instance as Volatile*/ | |
@Volatile | |
private var instance: LocaleHelperKt? = null | |
private var LOCK: Any = Any() |
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
public class MyContextWrapper extends ContextWrapper { | |
public MyContextWrapper(Context base) { | |
super(base); | |
} | |
@SuppressWarnings("deprecation") | |
public static ContextWrapper wrap(Context context, String language) { | |
Configuration config = context.getResources().getConfiguration(); | |
Locale sysLocale = 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
import java.util.Random; | |
/** | |
* | |
* @author Vijini | |
*/ | |
//Main class | |
public class SimpleDemoGA { |