内容へ移動
猫型iPS細胞研究所
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
INDEX
»
android
»
Material Components for Android
トレース:
android:materialcomponentsforandroid
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== Material Components for Android ====== [[https://qiita.com/Reyurnible/items/20457d2ef9572b0eee94|Goodbye `shape` - AndroidのMaterialButtonがすごい良かった話]] [[https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md|Getting started with Material Components for Android]] ====== MaterialButton ====== ===== Filled, elevated button (default) ===== <html>style="@style/Widget.MaterialComponents.Button"</html> {{:android:pasted:20191023-223642.png}} ===== Filled, unelevated button ===== <html>style="@style/Widget.MaterialComponents.Button.UnelevatedButton"</html> {{:android:pasted:20191023-223807.png}} ===== Outlined button ===== <html>style="@style/Widget.MaterialComponents.Button.OutlinedButton"</html> {{:android:pasted:20191023-223858.png}} ===== Text button ===== <html>style="@style/Widget.MaterialComponents.Button.TextButton"</html> {{:android:pasted:20191023-223943.png}} ===== Icon button ===== <html>style="@style/Widget.MaterialComponents.Button.Icon"</html> {{:android:pasted:20191023-224018.png}} <html>style="@style/Widget.MaterialComponents.Button.TextButton.Icon"</html> {{:android:pasted:20191023-224054.png}} ====== 使い方 ====== <code xml build.gradle(Project)> repositories { google() // ←確認 jcenter() } </code> <code xml build.gradle(app)> dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'com.google.android.material:material:1.0.0-alpha1' // ←追加 testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } </code> <code xml activity_main.xml> <com.google.android.material.button.MaterialButton android:textAppearance="@style/TextAppearance.MaterialComponents.Button" app:backgroundTint="@color/colorPrimary" android:id="@+id/buttonClear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_clear" app:layout_constraintBottom_toBottomOf="@+id/imageView" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/imageView" app:layout_constraintTop_toTopOf="@+id/imageView" /> </code> {{:android:pasted:20191022-200640.png}}
android/materialcomponentsforandroid.txt
· 最終更新: 2019/10/23 22:43 by
ips
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ