Upgrade to AndroidX, move to MaterialComponents theme (#953)

* upgrade to AndroidX, upgrade libraries

* move to MaterialComponents theme

* make sure the compose button looks good everywhere

* fix tollbar title/button alignment on tablet

* move to new material color theming, consolidate colors and themes

* fix build, fix imports

* set error on TextInputLayout instead of EditText

* fix imports, TootButton when

* improve snackbar style

* fix task description color
This commit is contained in:
Konrad Pozniak 2018-12-17 15:25:35 +01:00 committed by GitHub
commit a445c12094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
179 changed files with 862 additions and 866 deletions

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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/activity_compose"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
@ -21,13 +21,13 @@
android:padding="8dp"
tools:ignore="ContentDescription" />
<!--content description will be set in code -->
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<android.support.v4.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="@dimen/compose_activity_scrollview_height"
android:layout_marginBottom="52dp"
android:layout_marginTop="?attr/actionBarSize">
android:layout_marginTop="?attr/actionBarSize"
android:layout_marginBottom="52dp">
<LinearLayout
android:layout_width="match_parent"
@ -38,9 +38,9 @@
android:id="@+id/composeReplyView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="6dp"
android:drawablePadding="6dp"
android:textSize="?attr/status_text_small"
android:textStyle="bold"
@ -48,17 +48,17 @@
tools:text="Reply to @username"
tools:visibility="visible" />
<android.support.text.emoji.widget.EmojiTextView
<androidx.emoji.widget.EmojiTextView
android:id="@+id/composeReplyContentView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:background="?attr/compose_reply_content_background"
android:lineSpacingMultiplier="1.1"
android:paddingBottom="4dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="4dp"
android:paddingRight="16dp"
android:paddingBottom="4dp"
android:textSize="?attr/status_text_small"
android:visibility="gone"
tools:text="Post content which may be preeettyy long, so please, make sure there's enough room for everything, okay? Not kidding. I wish Eugen answered me more often, sigh."
@ -70,7 +70,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.text.emoji.widget.EmojiEditText
<androidx.emoji.widget.EmojiEditText
android:id="@+id/composeContentWarningField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -103,10 +103,10 @@
android:hint="@string/hint_compose"
android:inputType="text|textMultiLine|textCapSentences"
android:lineSpacingMultiplier="1.1"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp"
android:paddingRight="16dp"
android:paddingBottom="8dp"
android:textColorHint="?android:attr/textColorTertiary"
android:textSize="?attr/status_text_large" />
@ -130,7 +130,7 @@
</HorizontalScrollView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:id="@+id/addMediaBottomSheet"
@ -139,13 +139,13 @@
android:background="?android:colorBackground"
android:elevation="12dp"
android:orientation="vertical"
android:paddingBottom="52dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="52dp"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<TextView
android:id="@+id/action_photo_take"
@ -166,7 +166,7 @@
android:textSize="?attr/status_text_medium" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emojiView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -174,13 +174,13 @@
android:clipToPadding="false"
android:elevation="12dp"
android:orientation="horizontal"
android:paddingBottom="60dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="60dp"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior" />
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />
<com.keylesspalace.tusky.view.ComposeOptionsView
android:id="@+id/composeOptionsBottomSheet"
@ -188,13 +188,13 @@
android:layout_height="wrap_content"
android:background="?android:colorBackground"
android:elevation="12dp"
android:paddingBottom="52dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="52dp"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior" />
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />
<LinearLayout
android:layout_width="match_parent"
@ -203,10 +203,10 @@
android:background="?android:colorBackground"
android:elevation="12dp"
android:gravity="center_vertical"
android:paddingBottom="4dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingTop="4dp">
android:paddingTop="4dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp">
<ImageButton
android:id="@+id/composeAddMediaButton"
@ -232,26 +232,26 @@
<ImageButton
android:id="@+id/composeHideMediaButton"
style="?attr/image_button_style"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="4dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/action_hide_media"
android:padding="4dp"
android:tooltipText="@string/action_hide_media"
android:visibility="gone"
tools:src="@drawable/ic_eye_24dp" />
<Button
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/composeContentWarningButton"
style="?attr/image_button_style"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="4dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/action_content_warning"
android:padding="4dp"
android:text="@string/text_content_warning_button"
android:textColor="?android:textColorTertiary"
android:tooltipText="@string/action_content_warning" />
<ImageButton
@ -265,7 +265,7 @@
android:tooltipText="@string/action_emoji_keyboard"
app:srcCompat="@drawable/ic_emoji_24dp" />
<android.support.v4.widget.Space
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
@ -280,13 +280,12 @@
<com.keylesspalace.tusky.view.TootButton
android:id="@+id/composeTootButton"
style="@style/Widget.AppCompat.Button.Colored"
style="@style/TuskyButton"
android:layout_width="@dimen/toot_button_width"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:textColor="@android:color/white"
android:textSize="?attr/status_text_medium" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>