White background for compose

This commit is contained in:
Moez Bhatti
2019-11-23 19:47:29 -05:00
parent 056e992b2b
commit 66560b6f46
10 changed files with 47 additions and 99 deletions
@@ -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))
}
}
@@ -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))
}
}
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 Moez Bhatti <moez.bhatti@gmail.com>
~
~ This file is part of QKSMS.
~
~ QKSMS is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ QKSMS is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#00000000"
android:startColor="#ff000000" />
</shape>
@@ -24,4 +24,4 @@
<corners android:radius="22dp" />
</shape>
</shape>
@@ -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" />
<View
android:id="@+id/composeBackground"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/compose_bar_background"
android:backgroundTint="?attr/composeBackground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/messageBackground" />
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" />
<View
android:id="@+id/messageBackground"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_marginBottom="12dp"
android:background="@drawable/rounded_rectangle_22dp"
android:backgroundTint="?attr/bubbleColor"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@id/send"
app:layout_constraintStart_toEndOf="@id/attach"
app:layout_constraintTop_toTopOf="@id/scheduledCancel" />
@@ -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 @@
<ImageView
android:id="@+id/sim"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/compose_sim_cd"
android:elevation="4dp"
android:padding="10dp"
android:padding="8dp"
android:src="@drawable/ic_sim_card_black_24dp"
android:tint="?android:attr/textColorSecondary"
android:visibility="gone"
@@ -279,7 +270,6 @@
android:id="@+id/simIndex"
android:layout_width="0dp"
android:layout_height="0dp"
android:elevation="4dp"
android:gravity="center"
android:textColor="?android:attr/textColorPrimaryInverse"
android:textSize="14dp"
@@ -296,7 +286,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:elevation="4dp"
android:gravity="center"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toTopOf="@id/send"
@@ -309,14 +298,14 @@
android:id="@+id/send"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginEnd="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/compose_send_cd"
android:elevation="4dp"
android:padding="10dp"
android:src="@drawable/ic_send_black_24dp"
android:tint="?android:textColorSecondary"
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
app:layout_constraintEnd_toEndOf="@id/messageBackground"
tools:backgroundTint="@color/tools_theme" />
app:layout_constraintEnd_toEndOf="parent" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@@ -531,14 +520,13 @@
android:id="@+id/attach"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="12dp"
android:background="@drawable/circle"
android:contentDescription="@string/compose_attach_cd"
android:elevation="4dp"
android:padding="10dp"
android:src="@drawable/ic_add_black_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
app:layout_constraintStart_toStartOf="parent"
tools:backgroundTint="@color/tools_theme"
tools:tint="@color/textPrimaryDark" />
@@ -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">
<com.moez.QKSMS.common.widget.AvatarView
@@ -26,9 +26,9 @@
android:layout_gravity="center"
android:layout_margin="24dp"
android:background="@drawable/rounded_rectangle_4dp"
android:backgroundTint="?attr/composeBackground"
android:backgroundTint="?android:attr/windowBackground"
android:elevation="8dp"
tools:context="com.moez.QKSMS.feature.qkreply.QkReplyActivity">
tools:context=".feature.qkreply.QkReplyActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/messages"
@@ -48,19 +48,17 @@
<View
android:id="@+id/composeBackgroundGradient"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_height="12dp"
android:layout_marginTop="8dp"
android:background="@drawable/compose_bar_background"
android:backgroundTint="?attr/composeBackground"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toTopOf="@id/composeBackgroundSolid" />
<View
android:id="@+id/composeBackgroundSolid"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:background="@drawable/rounded_rectangle_bottom_4dp"
android:backgroundTint="?attr/composeBackground"
android:backgroundTint="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/messages"
app:layout_constraintTop_toTopOf="@id/message"
@@ -70,11 +68,11 @@
android:id="@+id/messageBackground"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:background="@drawable/rounded_rectangle_22dp"
android:backgroundTint="?attr/bubbleColor"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="@id/message"
app:layout_constraintEnd_toEndOf="@id/send"
app:layout_constraintEnd_toStartOf="@id/send"
app:layout_constraintStart_toStartOf="@id/message"
app:layout_constraintTop_toTopOf="@id/message" />
@@ -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" />
<com.moez.QKSMS.common.widget.QkTextView
android:id="@+id/simIndex"
android:layout_width="0dp"
android:layout_height="0dp"
android:elevation="4dp"
android:gravity="center"
android:textColor="?android:attr/textColorPrimaryInverse"
android:textSize="14dp"
@@ -135,7 +130,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:elevation="4dp"
android:gravity="center"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toTopOf="@id/send"
@@ -150,7 +144,6 @@
android:layout_height="44dp"
android:layout_marginEnd="8dp"
android:contentDescription="@string/compose_send_cd"
android:elevation="4dp"
android:padding="10dp"
android:src="@drawable/ic_send_black_24dp"
android:tint="?android:textColorSecondary"
@@ -176,6 +169,7 @@
</androidx.appcompat.widget.Toolbar>
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="8dp"
android:background="@drawable/ab_shadow"
@@ -35,7 +35,6 @@
<item name="bubbleColor">@color/bubbleDark</item>
<item name="colorPrimary">@color/toolbarDark</item>
<item name="colorPrimaryDark">@color/statusBarDark</item>
<item name="composeBackground">@color/backgroundDark</item>
<item name="selectableItemBackground">@drawable/ripple_dark</item>
<item name="switchThumbEnabled">@color/switchThumbEnabledDark</item>
<item name="switchThumbDisabled">@color/switchThumbDisabledDark</item>
@@ -48,12 +47,11 @@
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorTertiary">@color/text_tertiary</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowBackground">@color/backgroundDark</item>
<item name="actionBarPopupTheme">@style/PopupTheme</item>
<item name="bubbleColor">@color/bubbleDark</item>
<item name="colorPrimary">@color/toolbarDark</item>
<item name="colorPrimaryDark">@color/statusBarDark</item>
<item name="composeBackground">@color/backgroundDark</item>
<item name="selectableItemBackground">@drawable/ripple_dark</item>
<item name="windowActionBar">false</item>
</style>
@@ -70,14 +68,13 @@
<item name="android:windowBackground">@color/black</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="composeBackground">@color/black</item>
</style>
<style name="AppThemeDialog.Black">
<item name="android:windowBackground">@color/black</item>
<item name="actionBarPopupTheme">@style/PopupTheme.Black</item>
<item name="colorPrimary">@color/black</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="composeBackground">@color/black</item>
</style>
<style name="PopupTheme.Black">
+2 -2
View File
@@ -33,7 +33,7 @@
<color name="toolbarSearchBackgroundLight">#0D000000</color>
<color name="toolbarSearchBackgroundDark">#26000000</color>
<color name="backgroundLight">#ECEFF1</color>
<color name="backgroundLight">#FFFFFF</color>
<color name="backgroundDark">#192025</color>
<color name="textPrimary">#49555F</color>
@@ -48,7 +48,7 @@
<color name="textSecondaryDisabledDark">#67ffffff</color>
<color name="textTertiaryDark">#80ffffff</color>
<color name="bubbleLight">#FFFFFF</color>
<color name="bubbleLight">#ECEFF1</color>
<color name="bubbleDark">#242a2f</color>
<color name="separatorLight">#0C000000</color>
+3 -6
View File
@@ -20,7 +20,6 @@
<resources>
<attr name="bubbleColor" format="reference" />
<attr name="composeBackground" format="reference" />
<attr name="switchThumbEnabled" format="color" />
<attr name="switchThumbDisabled" format="color" />
<attr name="switchTrackEnabled" format="color" />
@@ -41,13 +40,12 @@
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorTertiary">@color/text_tertiary</item>
<item name="android:windowBackground">@color/white</item>
<item name="android:windowBackground">@color/backgroundLight</item>
<item name="android:windowContentTransitions">true</item>
<item name="actionBarPopupTheme">@style/PopupTheme</item>
<item name="bubbleColor">@color/bubbleLight</item>
<item name="colorPrimary">@color/toolbarLight</item>
<item name="colorPrimaryDark">@color/statusBarLight</item>
<item name="composeBackground">@color/backgroundLight</item>
<item name="selectableItemBackground">@drawable/ripple</item>
<item name="switchThumbEnabled">@color/switchThumbEnabledLight</item>
<item name="switchThumbDisabled">@color/switchThumbDisabledLight</item>
@@ -60,18 +58,17 @@
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorTertiary">@color/text_tertiary</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowBackground">@color/backgroundLight</item>
<item name="actionBarPopupTheme">@style/PopupTheme</item>
<item name="bubbleColor">@color/bubbleLight</item>
<item name="colorPrimary">@color/toolbarLight</item>
<item name="colorPrimaryDark">@color/statusBarLight</item>
<item name="composeBackground">@color/backgroundLight</item>
<item name="selectableItemBackground">@drawable/ripple</item>
<item name="windowActionBar">false</item>
</style>
<style name="PopupTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:colorBackground">@color/white</item>
<item name="android:colorBackground">@color/backgroundLight</item>
<item name="android:textColor">@color/textPrimary</item>
</style>