migrating to ViewBinding part 3: EmojiPreference (#2094)
This commit is contained in:
parent
ff69a2ad0d
commit
22bed19d90
3 changed files with 83 additions and 103 deletions
|
@ -2,7 +2,6 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/emojicompat_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
|
@ -11,7 +10,7 @@
|
|||
|
||||
<!--This is a thumbnail picture-->
|
||||
<ImageView
|
||||
android:id="@+id/emojicompat_thumb"
|
||||
android:id="@+id/emojiThumbnail"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="16dp"
|
||||
|
@ -25,22 +24,22 @@
|
|||
|
||||
<!--This is the font's name-->
|
||||
<TextView
|
||||
android:id="@+id/emojicompat_name"
|
||||
android:id="@+id/emojiName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="72dp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="?attr/status_text_medium"
|
||||
app:layout_constraintBottom_toTopOf="@+id/emojicompat_caption"
|
||||
app:layout_constraintBottom_toTopOf="@+id/emojiCaption"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/emojicompat_thumb"
|
||||
app:layout_constraintStart_toEndOf="@+id/emojiThumbnail"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/system_default" />
|
||||
|
||||
<!--A short caption…-->
|
||||
<TextView
|
||||
android:id="@+id/emojicompat_caption"
|
||||
android:id="@+id/emojiCaption"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="72dp"
|
||||
|
@ -49,14 +48,14 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="@id/emojicompat_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/emojicompat_name"
|
||||
app:layout_constraintStart_toStartOf="@id/emojiName"
|
||||
app:layout_constraintTop_toBottomOf="@id/emojiName"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="@string/caption_blobmoji" />
|
||||
|
||||
<!--This progress bar is shown while the font is downloading.-->
|
||||
<ProgressBar
|
||||
android:id="@+id/emojicompat_progress"
|
||||
android:id="@+id/emojiProgress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -65,12 +64,12 @@
|
|||
android:indeterminate="false"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/emojicompat_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/emojicompat_name" />
|
||||
app:layout_constraintStart_toStartOf="@id/emojiName"
|
||||
app:layout_constraintTop_toBottomOf="@id/emojiName" />
|
||||
|
||||
<!--Click on it and the font will be downloaded!-->
|
||||
<ImageButton
|
||||
android:id="@+id/emojicompat_download"
|
||||
android:id="@+id/emojiDownload"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
|
@ -80,13 +79,13 @@
|
|||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/emojicompat_caption"
|
||||
app:layout_constraintStart_toEndOf="@id/emojiCaption"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_file_download_black_24dp" />
|
||||
|
||||
<!--You should be able to cancel the download-->
|
||||
<ImageButton
|
||||
android:id="@+id/emojicompat_download_cancel"
|
||||
android:id="@+id/emojiDownloadCancel"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
|
@ -96,20 +95,20 @@
|
|||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/emojicompat_name"
|
||||
app:layout_constraintStart_toEndOf="@id/emojiName"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_cancel_24dp" />
|
||||
|
||||
<!--You'll probably want to select an emoji font, don't you?-->
|
||||
<androidx.appcompat.widget.AppCompatRadioButton
|
||||
android:id="@+id/emojicompat_radio"
|
||||
android:id="@+id/emojiRadioButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:buttonTint="@color/compound_button_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/emojicompat_name"
|
||||
app:layout_constraintStart_toEndOf="@id/emojiName"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Add table
Add a link
Reference in a new issue