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 SplashView extends View { | |
| private Bitmap bitmap; | |
| public SplashView(Context context) { | |
| super(context); | |
| init(); | |
| } | |
| private void init() { | |
| bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.logo); |
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
| // Using R.layout.activity_main from the main source set | |
| import kotlinx.android.synthetic.main.activity_main.* | |
| public class MyActivity : Activity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| textView.setText("Hello, world!") // Instead of findView(R.id.textView) as TextView | |
| } | |
| } |
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
| view.setOnClickListener(new View.OnClickListener() { | |
| @Override | |
| public void onClick(View v) { | |
| //click handling | |
| } | |
| }); |
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
| view.setOnClickListener({/**click handling*/}) |
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
| view.setOnClickListener({//click handling}) |
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
| if (s != null) ? s.length() : 0 |
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
| s?.length ?: -1 |
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
| 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() | |
| } | |
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
| 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" |
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"?> | |
| <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" |
OlderNewer