https://gist.github.com/benelog/903e21cad1624263fd7825131f67ff82
https://medium.com/google-developers/scheduling-jobs-like-a-pro-with-jobscheduler-286ef8510129
https://developers-kr.googleblog.com/2017/10/working-with-multiple-jobservices.html
http://gdgand.github.io/lollipop/2015/03/12/lollipop.html
https://codelabs.developers.google.com/codelabs/android-migrate-to-jobs/index.html
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
abstract class BaseViewModel : ViewModel() { | |
private val disposables = CompositeDisposable() | |
override fun onCleared() { | |
disposables.dispose() | |
super.onCleared() | |
} |
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
<navigation app:startDestination="@+id/first"> | |
<!-- Global Action --> | |
<action | |
android:id="@+id/action_to_second" | |
app:destination="@id/second" /> | |
<!-- Destination --> | |
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
// Generated by Navigation Architecture Components. | |
class SecondFragmentDirections private constructor() { | |
private data class ActionToThird(val label: String?) : NavDirections { | |
override fun getActionId(): Int = R.id.action_to_third | |
@Suppress("CAST_NEVER_SUCCEEDS") | |
override fun getArguments(): Bundle { | |
val result = Bundle() | |
if (Parcelable::class.java.isAssignableFrom(String::class.java)) { | |
result.putParcelable("label", this.label as Parcelable?) |
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
// Generated by Navigation Architecture Components. | |
data class ThirdActivityArgs(val label: String?) : NavArgs { | |
@Suppress("CAST_NEVER_SUCCEEDS") | |
fun toBundle(): Bundle { | |
val result = Bundle() | |
if (Parcelable::class.java.isAssignableFrom(String::class.java)) { | |
result.putParcelable("label", this.label as Parcelable?) | |
} else if (Serializable::class.java.isAssignableFrom(String::class.java)) { | |
result.putSerializable("label", this.label as Serializable?) | |
} else { |
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
<fragment | |
android:id="@+id/navHostFragment" | |
android:name="androidx.navigation.fragment.NavHostFragment" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:defaultNavHost="true" | |
app:navGraph="@navigation/{graph_name}" /> |
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
// SpeakerFragment.kt | |
class SpeakerFragment : BaseFragment() { | |
private val speakerViewModel by viewModel<SpeakerViewModel>() | |
} | |
// BaseFragment.kt | |
abstract class BaseFragment : DaggerFragment() { | |
@Inject |
OlderNewer