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
echo "# arguments called with ----> ${@} " | |
echo "# \$1 ----------------------> $1 " | |
echo "# \$2 ----------------------> $2 " | |
echo "# path to me ---------------> ${0} " | |
echo "# parent path --------------> ${0%/*} " | |
echo "# my name ------------------> ${0##*/} " |
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
-assumenosideeffects class kotlin.jvm.internal.Intrinsics { | |
public static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkFieldIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String); | |
public static void checkNotNull(java.lang.Object); | |
public static void checkNotNull(java.lang.Object, java.lang.String); | |
public static void checkNotNullExpressionValue(java.lang.Object, java.lang.String); | |
public static void checkNotNullParameter(java.lang.Object, java.lang.String); | |
public static void checkParameterIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String); |
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 final class a { | |
public String a; | |
public final String a() { | |
String var1 = this.a; | |
if (var1 == null) { | |
b.b("importantVar"); | |
} | |
return var1; | |
} |
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
// removed some of the irrelevant code for simplicity | |
public final class SomeClass { | |
@NotNull public String importantVar; | |
@NotNull | |
public final String getImportantVar() { | |
String var10000 = this.importantVar; | |
if (var10000 == null) { | |
Intrinsics.throwUninitializedPropertyAccessException("importantVar"); | |
} |
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
// note: this code is for example purposes, i know its not the right why to do things :) | |
class SomeClass { | |
lateinit var importantVar: String | |
fun funcWithParams(importantString: String, importantList: List<Int>) { | |
} | |
fun String.importantExtensionFunc() { | |
} | |
} |
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 LocaleSafeWebView : WebView { | |
constructor(context: Context) : super(context) { | |
overrideLocale() | |
} | |
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { | |
overrideLocale() | |
} |
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
object RuntimeLocaleChanger { | |
fun wrapContext(context: Context): Context { ... } | |
fun overrideLocale(context: Context) { | |
val savedLocale = createLocaleFromSavedLanguage() // load the user picked language from persistence (e.g SharedPreferences) | |
?: return // nothing to do in this case | |
// as part of creating a new context that contains the new locale we also need to override the default locale. |
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 App : Application() { | |
override fun attachBaseContext(base: Context) { ... } | |
override fun onConfigurationChanged(newConfig: Configuration) { | |
super.onConfigurationChanged(newConfig) | |
RuntimeLocaleChanger.overrideLocale(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
class App : Application() { | |
override fun attachBaseContext(base: Context) { | |
super.attachBaseContext(RuntimeLocaleChanger.wrapContext(base)) | |
} | |
} |
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
object RuntimeLocaleChanger { | |
fun wrapContext(context: Context): Context { | |
val savedLocale = createLocaleFromSavedLanguage() // load the user picked language from persistence (e.g SharedPreferences) | |
?: return context // else return the original untouched context | |
// as part of creating a new context that contains the new locale we also need to override the default locale. | |
Locale.setDefault(savedLocale) |
NewerOlder