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. , Osama Raddad | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
val namewarehouse = warehouse(Accessibility.LOCAL) { | |
this add module { | |
this add factory(contract = Name::class) { | |
this constructor { FirstName() } | |
this name "osa" | |
} | |
this add factory(contract = Name::class) { | |
this constructor { FirstName() } | |
this name "first" | |
this type Type.SINGLETON |
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
https://github.com/rygelouv/LiteKoin | |
https://proandroiddev.com/lets-build-our-own-simplified-version-of-koin-19a887306258 | |
main() | |
fun main() { | |
val test = 1 | |
val squareFun = squareFun() | |
val xxx = squareFun() |
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 CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> | |
{ | |
private Context context; | |
// The items to display in your RecyclerView | |
private ArrayList<String> items; | |
// Allows to remember the last item shown on screen | |
private int lastPosition = -1; | |
public static class ViewHolder extends RecyclerView.ViewHolder |
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 kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.launch | |
/* | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled |
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
# If your project uses WebView with JS, uncomment the following | |
# and specify the fully qualified class name to the JavaScript interface | |
# class: | |
-keepclassmembers class fqcn.of.javascript.interface.for.webview { | |
public *; | |
} | |
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9) | |
-keep class rx.schedulers.Schedulers { | |
public static <methods>; |
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
dependencies { | |
implementation 'com.github.osama-raddad:FireCrasher:2.0.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
FireCrasher.install(this, object : CrashListener() { | |
override fun onCrash(throwable: Throwable) { | |
evaluate { activity, crashLevel -> | |
recover { | |
Toast.makeText(this@App, "recover", Toast.LENGTH_LONG).show() | |
} | |
} | |
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
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} |
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 onCreate() { | |
super.onCreate() | |
FireCrasher.install(this, object : CrashListener() { | |
override fun onCrash(throwable: Throwable, activity: Activity) { | |
Toast.makeText(activity, throwable.message, Toast.LENGTH_SHORT).show() | |
// start the recovering process | |
recover(activity) |
NewerOlder