Skip to content

Instantly share code, notes, and snippets.

<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially">
<!-- first we need to immediately reset state -->
<objectAnimator
android:duration="0"
android:propertyName="trimPathStart"
android:valueFrom="0.45"
android:valueTo="0.45"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="line"
android:pathData="M5.705,5.705 L18.295,18.295"
android:strokeWidth="2"
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="line"
android:pathData="M5.705,5.705 L18.295,18.295"
Layout:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/processed_image_background">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/image_selector"
fun AppCompatActivity.navigate(frag: Fragment) {
val fragmentTransaction = supportFragmentManager.beginTransaction()
fragmentTransaction.replace(content.id, frag);
fragmentTransaction.commit();
}
fun Fragment.userError(msg: String?) {
Snackbar.make(view, msg, Snackbar.LENGTH_LONG).show()
}
s?.length ?: -1
if (s != null) ? s.length() : 0
view.setOnClickListener({//click handling})
view.setOnClickListener({/**click handling*/})
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//click handling
}
});