This file contains hidden or 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 StarInterpolator implements Interpolator { | |
| public StarInterpolator() { | |
| } | |
| @SuppressWarnings({"UnusedDeclaration"}) | |
| public StarInterpolator(Context context, AttributeSet attrs) { | |
| } | |
| private static float bounce(float t) { |
This file contains hidden or 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 android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| public class TemplateCustomView extends View { | |
| private long mLastInvalidate; | |
| private boolean mIsOnDetachedFromWindow; |
This file contains hidden or 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 PreLoadLayoutManager extends LinearLayoutManager { | |
| private final int mDisplayHeight; | |
| public PreLoadLayoutManager(Context context) { | |
| super(context); | |
| mDisplayHeight = context.getResources().getDisplayMetrics().heightPixels; | |
| } | |
| @Override |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <android.support.v7.widget.CardView | |
| android:id="@+id/card_view" | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:card_view="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_marginBottom="4dp" | |
| android:layout_marginLeft="8dp" |
This file contains hidden or 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 DatabindingableNumberPicker : NumberPicker { | |
| constructor(context: Context) : super(context) | |
| constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) | |
| constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr) | |
| private var isCallSetMaxValueBeforeSetValue = false | |
| private var tempValue = 0 | |
| override fun setValue(value: Int) { | |
| if (!isCallSetMaxValueBeforeSetValue) { |
This file contains hidden or 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 TestData { | |
| @Language("XML") | |
| static String USE_NUMBER_PICKER_WHEN_USE_DATABINDING = "" + | |
| "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + | |
| "<layout>\n" + | |
| "\n" + | |
| " <data>\n" + | |
| "\n" + | |
| " <variable\n" + | |
| " name=\"hgoe\"\n" + |
This file contains hidden or 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 android.support.v7.util.DiffUtil | |
| class DiffUtilCallback<T>(private val oldList: List<T>, private val newList: List<T>) : DiffUtil.Callback() { | |
| override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = oldList[oldItemPosition] == newList[newItemPosition] | |
| override fun getOldListSize(): Int = oldList.size | |
| override fun getNewListSize(): Int = newList.size |
This file contains hidden or 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 TransparentActivity : AppCompatActivity() { | |
| companion object { | |
| fun createIntent(context: Context): Intent = Intent(context, TransparentActivity::class.java) | |
| } | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_transparent) | |
| val rootView = window.decorView.findViewById<View>(android.R.id.content).rootView |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:orientation="horizontal" | |
| app:flexWrap="wrap"> | |
| <TextView | |
| android:layout_width="wrap_content" |
This file contains hidden or 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 NonSwipeViewPager @JvmOverloads constructor( | |
| context: Context, | |
| attrs: AttributeSet? = null, | |
| defStyleAttr: Int = 0 | |
| ) : ViewPager(context, attrs) { | |
| override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean = false | |
| override fun onTouchEvent(ev: MotionEvent?): Boolean = false | |
| override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean = | |
| when (event?.action) { |