Skip to content

Instantly share code, notes, and snippets.

View dinopriyano's full-sized avatar
🏠
Working from home

Dino Priyano dinopriyano

🏠
Working from home
  • Blibli.com
  • Jakarta, Indonesia
View GitHub Profile
@dinopriyano
dinopriyano / proguard-rules.pro
Created April 1, 2022 07:50 — forked from jemshit/proguard-rules.pro
Proguard rules for common Android libraries
# 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>;
@dinopriyano
dinopriyano / AplTwoPagingAdapter.kt
Last active February 9, 2022 05:18
RadioButton and TextField in Recyclerview using Data Binding
//in my case, i use paging3 adapter, but you can use recyclerview adapter :)
class AplTwoPagingAdapter : PagingDataAdapter<AplTwoQuestionModel, AplTwoPagingAdapter.ViewHolder>(AplTwoQuestioDiffUtils) {
override fun onBindViewHolder(holder: AplTwoPagingAdapter.ViewHolder, position: Int) {
val question = getItem(position)
holder.bind(question)
}
override fun onCreateViewHolder(
parent: ViewGroup,
@dinopriyano
dinopriyano / BaseBottomSheetDialogFragment.kt
Last active April 2, 2022 14:01
Show BottomSheetDialogFragment Fullscreen
abstract class BaseBottomSheetDialogFragment <DB: ViewDataBinding>: BottomSheetDialogFragment() {
private var _binding: DB? = null
protected val binding get() = _binding
protected lateinit var behavior: BottomSheetBehavior<View>
abstract fun bindDataBinding(inflater: LayoutInflater, container: ViewGroup?): DB
abstract fun isFullscreenDialog(): Boolean