From 66560b6f46228c86ce9944d2ab4ac905c06ae195 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Sat, 23 Nov 2019 19:47:29 -0500 Subject: [PATCH] White background for compose --- .../QKSMS/feature/compose/ComposeActivity.kt | 1 - .../QKSMS/feature/qkreply/QkReplyActivity.kt | 7 ++- .../res/drawable/compose_bar_background.xml | 28 --------- .../res/drawable/rounded_rectangle_22dp.xml | 2 +- .../src/main/res/layout/compose_activity.xml | 58 ++++++++----------- .../src/main/res/layout/contact_chip.xml | 2 +- .../src/main/res/layout/qkreply_activity.xml | 28 ++++----- .../src/main/res/values-night/themes.xml | 7 +-- presentation/src/main/res/values/colors.xml | 4 +- presentation/src/main/res/values/themes.xml | 9 +-- 10 files changed, 47 insertions(+), 99 deletions(-) delete mode 100644 presentation/src/main/res/drawable/compose_bar_background.xml diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index e5eb83ba..5f1b44b2 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -156,7 +156,6 @@ class ComposeActivity : QkThemedActivity(), ComposeView { // These theme attributes don't apply themselves on API 21 if (Build.VERSION.SDK_INT <= 22) { messageBackground.setBackgroundTint(resolveThemeColor(R.attr.bubbleColor)) - composeBackground.setBackgroundTint(resolveThemeColor(R.attr.composeBackground)) } } diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/qkreply/QkReplyActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/qkreply/QkReplyActivity.kt index ead2fe26..9612bcce 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/qkreply/QkReplyActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/qkreply/QkReplyActivity.kt @@ -62,6 +62,7 @@ class QkReplyActivity : QkThemedActivity(), QkReplyView { setFinishOnTouchOutside(prefs.qkreplyTapDismiss.get()) setContentView(R.layout.qkreply_activity) + window.setBackgroundDrawable(null) window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) viewModel.bindView(this) @@ -77,10 +78,10 @@ class QkReplyActivity : QkThemedActivity(), QkReplyView { // These theme attributes don't apply themselves on API 21 if (Build.VERSION.SDK_INT <= 22) { toolbar.setBackgroundTint(resolveThemeColor(R.attr.colorPrimary)) - background.setBackgroundTint(resolveThemeColor(R.attr.composeBackground)) + background.setBackgroundTint(resolveThemeColor(android.R.attr.windowBackground)) messageBackground.setBackgroundTint(resolveThemeColor(R.attr.bubbleColor)) - composeBackgroundGradient.setBackgroundTint(resolveThemeColor(R.attr.composeBackground)) - composeBackgroundSolid.setBackgroundTint(resolveThemeColor(R.attr.composeBackground)) + composeBackgroundGradient.setBackgroundTint(resolveThemeColor(android.R.attr.windowBackground)) + composeBackgroundSolid.setBackgroundTint(resolveThemeColor(android.R.attr.windowBackground)) } } diff --git a/presentation/src/main/res/drawable/compose_bar_background.xml b/presentation/src/main/res/drawable/compose_bar_background.xml deleted file mode 100644 index 4c963a18..00000000 --- a/presentation/src/main/res/drawable/compose_bar_background.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/presentation/src/main/res/drawable/rounded_rectangle_22dp.xml b/presentation/src/main/res/drawable/rounded_rectangle_22dp.xml index d1754416..7a6af7bb 100755 --- a/presentation/src/main/res/drawable/rounded_rectangle_22dp.xml +++ b/presentation/src/main/res/drawable/rounded_rectangle_22dp.xml @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/presentation/src/main/res/layout/compose_activity.xml b/presentation/src/main/res/layout/compose_activity.xml index 39d1d0e2..0e6c4a30 100644 --- a/presentation/src/main/res/layout/compose_activity.xml +++ b/presentation/src/main/res/layout/compose_activity.xml @@ -23,7 +23,7 @@ android:id="@+id/contentView" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/composeBackground" + android:background="?android:attr/windowBackground" android:orientation="vertical" tools:context="com.moez.QKSMS.feature.compose.ComposeActivity"> @@ -31,12 +31,12 @@ android:id="@+id/messageList" android:layout_width="0dp" android:layout_height="0dp" + android:layout_marginBottom="12dp" android:clipChildren="false" android:clipToPadding="false" android:paddingTop="8dp" - android:paddingBottom="16dp" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" - app:layout_constraintBottom_toBottomOf="@id/composeBackground" + app:layout_constraintBottom_toTopOf="@id/messageBackground" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/sendAsGroupBackground" @@ -135,31 +135,29 @@ android:id="@+id/composeBar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:constraint_referenced_ids="composeBackground,messageBackground,attachments,attach,message,counter,send" /> + app:constraint_referenced_ids="messageBackground,attachments,attach,message,counter,send" /> + android:id="@+id/composeDivider" + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginBottom="12dp" + android:background="?android:attr/divider" + android:visibility="gone" + app:layout_constraintBottom_toTopOf="@id/messageBackground" + app:layout_goneMarginBottom="12dp" /> @@ -174,7 +172,6 @@ android:id="@+id/scheduledTitle" android:layout_width="0dp" android:layout_height="wrap_content" - android:elevation="4dp" android:paddingStart="16dp" android:paddingEnd="16dp" android:text="@string/compose_scheduled_for" @@ -191,7 +188,6 @@ android:id="@+id/scheduledTime" android:layout_width="0dp" android:layout_height="wrap_content" - android:elevation="4dp" android:paddingStart="16dp" android:paddingEnd="16dp" android:textColor="?android:attr/textColorTertiary" @@ -206,7 +202,6 @@ android:id="@+id/scheduledCancel" android:layout_width="44dp" android:layout_height="56dp" - android:elevation="4dp" android:padding="10dp" android:src="@drawable/ic_cancel_black_24dp" android:tint="?android:attr/textColorSecondary" @@ -218,7 +213,6 @@ android:layout_width="0dp" android:layout_height="1dp" android:background="?android:attr/divider" - android:elevation="4dp" app:layout_constraintBottom_toTopOf="@id/attachments" app:layout_constraintEnd_toEndOf="@id/messageBackground" app:layout_constraintStart_toStartOf="@id/messageBackground" /> @@ -229,7 +223,6 @@ android:layout_height="wrap_content" android:clipChildren="false" android:clipToPadding="false" - android:elevation="4dp" android:orientation="horizontal" android:paddingStart="8dp" android:paddingEnd="8dp" @@ -246,7 +239,6 @@ android:layout_height="wrap_content" android:layout_weight="1" android:background="@null" - android:elevation="4dp" android:gravity="center_vertical" android:hint="@string/compose_hint" android:inputType="textLongMessage|textCapSentences|textMultiLine" @@ -263,12 +255,11 @@ + app:layout_constraintEnd_toEndOf="parent" /> diff --git a/presentation/src/main/res/layout/contact_chip.xml b/presentation/src/main/res/layout/contact_chip.xml index 76805b05..6627a443 100755 --- a/presentation/src/main/res/layout/contact_chip.xml +++ b/presentation/src/main/res/layout/contact_chip.xml @@ -30,7 +30,7 @@ android:layout_height="36dp" android:layout_margin="4dp" android:background="@drawable/chip_background" - android:backgroundTint="?attr/composeBackground" + android:backgroundTint="?attr/bubbleColor" android:orientation="horizontal"> + tools:context=".feature.qkreply.QkReplyActivity"> @@ -83,10 +81,9 @@ style="@style/TextPrimary" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginBottom="8dp" + android:layout_marginStart="12dp" + android:layout_marginBottom="12dp" android:background="@null" - android:elevation="4dp" android:gravity="center_vertical" android:hint="@string/compose_hint" android:inputType="textLongMessage|textCapSentences|textMultiLine" @@ -107,18 +104,16 @@ android:layout_height="44dp" android:background="?attr/selectableItemBackground" android:contentDescription="@string/compose_sim_cd" - android:elevation="4dp" android:padding="10dp" android:src="@drawable/ic_sim_card_black_24dp" android:tint="?android:attr/textColorSecondary" app:layout_constraintBottom_toBottomOf="@id/message" - app:layout_constraintEnd_toStartOf="@id/send" /> + app:layout_constraintEnd_toEndOf="@id/messageBackground" /> @color/bubbleDark @color/toolbarDark @color/statusBarDark - @color/backgroundDark @drawable/ripple_dark @color/switchThumbEnabledDark @color/switchThumbDisabledDark @@ -48,12 +47,11 @@ @color/text_primary @color/text_secondary @color/text_tertiary - @android:color/transparent + @color/backgroundDark @style/PopupTheme @color/bubbleDark @color/toolbarDark @color/statusBarDark - @color/backgroundDark @drawable/ripple_dark false @@ -70,14 +68,13 @@ @color/black @color/black @color/black - @color/black