Skip to content

Instantly share code, notes, and snippets.

@mancj
Last active March 27, 2020 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mancj/97f1378bc929379f65da542f2d5e927c to your computer and use it in GitHub Desktop.
Save mancj/97f1378bc929379f65da542f2d5e927c to your computer and use it in GitHub Desktop.
Android boilerplate code
fun startViewIntent(uri: Uri) {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = uri
try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
e.printStackTrace()
}
}

Если не собирается билд с ошибкой @Generated not found javax.annotation.processing.Generated

Probably this happened because the system JDK_HOME is more upgraded then the JDK that comes with Android Studio

open ~/.config/fish/config.fish

добавить строчку set -gx JDK_HOME "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"

сохранить

source ~/.config/fish/config.fish

<style name="EditTextStyle">
<!-- Underline color normal -->
<item name="colorControlNormal">@color/alto</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:textColorHint">@color/silver</item>
</style>
<!-- Apply style above -->
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/EditTextStyle">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment