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 { project -> | |
project.plugins.withType(com.android.build.gradle.LibraryPlugin) { plugin -> | |
project.android.libraryVariants.all { variant -> | |
// TODO replace with https://issuetracker.google.com/issues/72050365 once released. | |
variant.generateBuildConfigProvider.configure { task -> | |
task.enabled = false | |
} | |
} | |
} | |
} |
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 LifecycleHelper: Application.ActivityLifecycleCallbacks { | |
private var resumed: Int = 0 | |
private var paused: Int = 0 | |
private var started: Int = 0 | |
private var stopped: Int = 0 | |
override fun onActivityPaused(activity: Activity?) { | |
++paused | |
} |
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 NonScrollViewPager : ViewPager { | |
constructor(context: Context) : super(context) | |
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) | |
override fun onTouchEvent(event: MotionEvent): Boolean { | |
return false | |
} |
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 EmojiExcludedEditText : EditText { | |
constructor(context: Context) : super(context) { | |
init() | |
} | |
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { | |
init() | |
} | |
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, |
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 WaveView(context: Context, attrs: AttributeSet) : View(context, attrs) { | |
private val mAbovePath: Path = Path() | |
private val mBelowWavePath: Path = Path() | |
private val mAboveWavePaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG) | |
private val mBelowWavePaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG) | |
private val mDrawFilter: DrawFilter = PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG or Paint.FILTER_BITMAP_FLAG) | |
private var φ: Float = 0.toFloat() |
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 RxBus { | |
private final FlowableProcessor<Object> bus = PublishProcessor.create().toSerialized(); | |
private RxBus() { | |
} | |
private static class InstanceHolder { | |
private static final RxBus sInstance = new RxBus(); | |
} |
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 DataBindingViewHolder<T extends ViewDataBinding> extends RecyclerView.ViewHolder { | |
private T mBinding; | |
public DataBindingViewHolder(T binding) { | |
super(binding.getRoot()); | |
this.mBinding = binding; | |
} | |
public T getBinding() { |
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 abstract class BaseRVAdapter<T extends ViewDataBinding, M> | |
extends RecyclerView.Adapter<DataBindingViewHolder<T>> { | |
List<M> mDataList; | |
public BaseRVAdapter(List<M> mDataList) { | |
this.mDataList = mDataList; | |
} | |
@Override public int getItemCount() { |
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 Singleton { | |
private Singleton() { | |
} | |
public static Singleton getInstance() { | |
return SingletonViewHolder.sInsatnce; | |
} | |
private static class SingletonHolder { |
NewerOlder