Make all text respect dark mode

This commit is contained in:
Moez Bhatti
2017-12-05 19:24:21 -05:00
parent bacd1f7712
commit 8a89a08156
28 changed files with 254 additions and 96 deletions
@@ -5,13 +5,14 @@ import com.moez.QKSMS.presentation.compose.ComposeActivity
import com.moez.QKSMS.presentation.compose.ComposeViewModel
import com.moez.QKSMS.presentation.compose.DetailedChipView
import com.moez.QKSMS.presentation.compose.MessagesAdapter
import com.moez.QKSMS.presentation.main.ConversationsAdapter
import com.moez.QKSMS.presentation.main.MainActivity
import com.moez.QKSMS.presentation.main.MainViewModel
import com.moez.QKSMS.presentation.settings.SettingsActivity
import com.moez.QKSMS.presentation.settings.SettingsViewModel
import com.moez.QKSMS.presentation.view.AvatarView
import com.moez.QKSMS.presentation.view.QkEditText
import com.moez.QKSMS.presentation.view.QkSwitch
import com.moez.QKSMS.presentation.view.QkTextView
import com.moez.QKSMS.receiver.*
import dagger.Component
import javax.inject.Singleton
@@ -35,7 +36,9 @@ interface AppComponent {
fun inject(receiver: RemoteMessagingReceiver)
fun inject(view: AvatarView)
fun inject(view: QkEditText)
fun inject(view: QkSwitch)
fun inject(view: QkTextView)
fun inject(viewModel: MainViewModel)
fun inject(viewModel: ComposeViewModel)
@@ -26,15 +26,30 @@ class Colors @Inject constructor(context: Context, prefs: Preferences) {
.map { res -> context.resources.getColor(res) }
val textPrimary: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.textPrimaryLight else R.color.textPrimary }
.map { dark -> if (dark) R.color.textPrimaryDark else R.color.textPrimary }
.map { res -> context.resources.getColor(res) }
val textSecondary: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.textSecondaryLight else R.color.textSecondary }
.map { dark -> if (dark) R.color.textSecondaryDark else R.color.textSecondary }
.map { res -> context.resources.getColor(res) }
val textTertiary: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.textTertiaryLight else R.color.textTertiary }
.map { dark -> if (dark) R.color.textTertiaryDark else R.color.textTertiary }
.map { res -> context.resources.getColor(res) }
// TODO make this result depend on the theme color
val textPrimaryOnTheme: Observable<Int> = prefs.theme.asObservable()
.map { theme -> R.color.textPrimaryDark }
.map { res -> context.resources.getColor(res) }
// TODO make this result depend on the theme color
val textSecondaryOnTheme: Observable<Int> = prefs.dark.asObservable()
.map { theme -> R.color.textSecondaryDark }
.map { res -> context.resources.getColor(res) }
// TODO make this result depend on the theme color
val textTertiaryOnTheme: Observable<Int> = prefs.dark.asObservable()
.map { theme -> R.color.textTertiaryDark }
.map { res -> context.resources.getColor(res) }
val bubble: Observable<Int> = prefs.dark.asObservable()
@@ -42,19 +57,19 @@ class Colors @Inject constructor(context: Context, prefs: Preferences) {
.map { res -> context.resources.getColor(res) }
val switchThumbEnabled: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.switch_thumb_enabled_dark else R.color.switch_thumb_enabled_light }
.map { dark -> if (dark) R.color.switchThumbEnabledDark else R.color.switchThumbEnabledLight }
.map { res -> context.resources.getColor(res) }
val switchThumbDisabled: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.switch_thumb_disabled_dark else R.color.switch_thumb_disabled_light }
.map { dark -> if (dark) R.color.switchThumbDisabledDark else R.color.switchThumbDisabledLight }
.map { res -> context.resources.getColor(res) }
val switchTrackEnabled: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.switch_track_enabled_dark else R.color.switch_track_enabled_light }
.map { dark -> if (dark) R.color.switchTrackEnabledDark else R.color.switchTrackEnabledLight }
.map { res -> context.resources.getColor(res) }
val switchTrackDisabled: Observable<Int> = prefs.dark.asObservable()
.map { dark -> if (dark) R.color.switch_track_disabled_dark else R.color.switch_track_disabled_light }
.map { dark -> if (dark) R.color.switchTrackDisabledDark else R.color.switchTrackDisabledLight }
.map { res -> context.resources.getColor(res) }
}
@@ -1,12 +1,11 @@
package com.moez.QKSMS.presentation.compose
import android.content.Context
import android.support.v4.content.ContextCompat
import android.support.v7.widget.AppCompatEditText
import android.support.v7.widget.RecyclerView
import android.text.InputType
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.widget.EditText
@@ -34,7 +33,7 @@ class ChipsAdapter(
}
private val hint: String = context.getString(R.string.title_compose)
private val editText: EditText = AppCompatEditText(context)
private val editText = View.inflate(context, R.layout.chip_input_list_item, null) as EditText
val chipDeleted: PublishSubject<Contact> = PublishSubject.create<Contact>()
val textChanges = editText.textChanges()
@@ -48,8 +47,6 @@ class ChipsAdapter(
editText.hint = hint
editText.textSize = 16f
editText.setTextColor(ContextCompat.getColor(context, R.color.textPrimary))
editText.setHintTextColor(ContextCompat.getColor(context, R.color.textTertiary))
editText.setBackgroundResource(android.R.color.transparent)
editText.inputType = InputType.TYPE_TEXT_VARIATION_FILTER or InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
editText.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
@@ -81,7 +81,9 @@ class ComposeActivity : QkActivity<ComposeViewModel>(), ComposeView {
.combineLatest(colors.theme, colors.textTertiary, { theme, textTertiary ->
ColorStateList(states, intArrayOf(theme, textTertiary))
})
.subscribe { tintList -> send.imageTintList = tintList }
.doOnNext { tintList -> attach.imageTintList = tintList }
.doOnNext { tintList -> send.imageTintList = tintList }
.subscribe()
disposables += colors.background
.subscribe { color -> composeBar.setBackgroundColor(color) }
@@ -78,7 +78,7 @@ class MainActivity : QkActivity<MainViewModel>(), MainView {
val rowBackground = {
StateListDrawable().apply {
addState(intArrayOf(android.R.attr.state_selected), getDrawable(R.color.row_selected))
addState(intArrayOf(android.R.attr.state_selected), getDrawable(R.color.rowSelected))
addState(intArrayOf(-android.R.attr.state_selected), getDrawable(R.drawable.ripple))
mutate()
}
@@ -96,6 +96,7 @@ class MainActivity : QkActivity<MainViewModel>(), MainView {
.doOnNext { tintList -> archivedIcon.imageTintList = tintList }
.doOnNext { tintList -> scheduledIcon.imageTintList = tintList }
.doOnNext { tintList -> blockedIcon.imageTintList = tintList }
.doOnNext { tintList -> settingsIcon.imageTintList = tintList }
.subscribe()
inbox.background = rowBackground()
@@ -0,0 +1,63 @@
package com.moez.QKSMS.presentation.view
import android.content.Context
import android.util.AttributeSet
import android.widget.EditText
import com.moez.QKSMS.R
import com.moez.QKSMS.common.di.appComponent
import com.moez.QKSMS.common.util.Colors
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign
import javax.inject.Inject
open class QkEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : EditText(context, attrs) {
@Inject lateinit var colors: Colors
private val disposables = CompositeDisposable()
private var textColorObservable: Observable<Int>? = null
private var textColorHintObservable: Observable<Int>? = null
init {
appComponent.inject(this)
context.obtainStyledAttributes(attrs, R.styleable.QkEditText)?.run {
textColorObservable = when (getInt(R.styleable.QkEditText_textColor, -1)) {
0 -> colors.textPrimary
1 -> colors.textSecondary
2 -> colors.textTertiary
3 -> colors.textPrimaryOnTheme
4 -> colors.textSecondaryOnTheme
5 -> colors.textTertiaryOnTheme
else -> null
}
textColorHintObservable = when (getInt(R.styleable.QkEditText_textColorHint, -1)) {
0 -> colors.textPrimary
1 -> colors.textSecondary
2 -> colors.textTertiary
else -> null
}
recycle()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
textColorObservable?.let { observable ->
disposables += observable.subscribe { color -> setTextColor(color) }
}
textColorHintObservable?.let { observable ->
disposables += observable.subscribe { color -> setHintTextColor(color) }
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
disposables.dispose()
}
}
@@ -0,0 +1,52 @@
package com.moez.QKSMS.presentation.view
import android.content.Context
import android.util.AttributeSet
import android.widget.TextView
import com.moez.QKSMS.R
import com.moez.QKSMS.common.di.appComponent
import com.moez.QKSMS.common.util.Colors
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign
import javax.inject.Inject
open class QkTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : TextView(context, attrs) {
@Inject lateinit var colors: Colors
private val disposables = CompositeDisposable()
private var textColorObservable: Observable<Int>? = null
init {
appComponent.inject(this)
context.obtainStyledAttributes(attrs, R.styleable.QkTextView)?.run {
textColorObservable = when (getInt(R.styleable.QkTextView_textColor, -1)) {
0 -> colors.textPrimary
1 -> colors.textSecondary
2 -> colors.textTertiary
3 -> colors.textPrimaryOnTheme
4 -> colors.textSecondaryOnTheme
5 -> colors.textTertiaryOnTheme
else -> null
}
recycle()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
textColorObservable?.let { observable ->
disposables += observable.subscribe { color -> setTextColor(color) }
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
disposables.dispose()
}
}
@@ -2,9 +2,8 @@ package com.moez.QKSMS.presentation.view
import android.content.Context
import android.util.AttributeSet
import android.widget.TextView
class TightTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : TextView(context, attrs) {
class TightTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : QkTextView(context, attrs) {
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
@@ -10,7 +10,7 @@
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/list_separator"/>
<solid android:color="@color/listSeparator"/>
<corners android:radius="18dp"/>
</shape>
</item>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/list_separator" />
<solid android:color="@color/listSeparator" />
<corners android:radius="4dp" />
</shape>
+3 -2
View File
@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<merge android:id="@+id/avatar"
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:layout_width="match_parent"
android:layout_height="match_parent"
tools:background="@color/tools_theme"
tools:parentTag="com.moez.QKSMS.presentation.view.AvatarView">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/initial"
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textAllCaps="true"
android:textColor="@color/textPrimaryLight"
android:textSize="20sp"
app:textColor="primaryOnTheme"
tools:text="M" />
<ImageView
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.moez.QKSMS.presentation.view.QkEditText xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:textColor="primary"
app:textColorHint="tertiary" />
@@ -45,7 +45,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/list_separator" />
android:background="@color/listSeparator" />
<LinearLayout
android:id="@+id/composeBar"
@@ -59,10 +59,9 @@
android:layout_height="56dp"
android:background="@drawable/ripple"
android:padding="16dp"
android:src="@drawable/ic_add_circle_black_24dp"
android:tint="@color/textSecondary" />
android:src="@drawable/ic_add_circle_black_24dp" />
<EditText
<com.moez.QKSMS.presentation.view.QkEditText
android:id="@+id/message"
style="@style/TextPrimary"
android:layout_width="0dp"
@@ -85,8 +84,7 @@
android:layout_height="56dp"
android:background="@drawable/ripple"
android:padding="16dp"
android:src="@drawable/ic_send_black_24dp"
android:tint="@color/textTertiary" />
android:src="@drawable/ic_send_black_24dp" />
</LinearLayout>
+3 -2
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/container"
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:layout_width="wrap_content"
android:layout_height="wrap_content">
@@ -18,16 +19,16 @@
android:layout_width="36dp"
android:layout_height="36dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginRight="12dp"
android:textColor="@color/textPrimary"
android:textSize="14sp"
android:textStyle="bold"
app:textColor="primary"
tools:text="Moez Bhatti" />
</LinearLayout>
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -11,7 +12,6 @@
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@drawable/rounded_rectangle_2dp"
android:backgroundTint="@color/textSecondary"
android:elevation="8dp"
android:gravity="center_vertical">
@@ -27,27 +27,25 @@
android:layout_weight="1"
android:orientation="vertical">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/name"
style="@style/TextPrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="true"
android:textColor="@color/textPrimaryLight"
android:textSize="16sp"
tools:text="Moez Bhatti" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/info"
style="@style/TextSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="true"
android:textColor="@color/textSecondaryLight"
android:textSize="14sp"
tools:text="(123) 456-7890" />
</LinearLayout>
@@ -21,18 +21,18 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/name"
style="@style/TextPrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textPrimary"
tools:text="Moez Bhatti" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/address"
style="@style/TextSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textTertiary"
tools:text="(123) 456-7890" />
</LinearLayout>
@@ -27,7 +27,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/title"
style="@style/TextPrimary"
android:layout_width="0dp"
@@ -37,7 +37,7 @@
android:layout_weight="1"
tools:text="Moez Bhatti" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/date"
style="@style/TextTertiary"
android:layout_width="wrap_content"
@@ -46,7 +46,7 @@
</LinearLayout>
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/snippet"
style="@style/TextSecondary"
android:layout_width="wrap_content"
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -27,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/title"
style="@style/TextPrimary"
android:layout_width="0dp"
@@ -38,18 +39,18 @@
android:textStyle="bold"
tools:text="Moez Bhatti" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/date"
style="@style/TextTertiary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textPrimary"
android:textStyle="bold"
app:textColor="primary"
tools:text="Oct 11" />
</LinearLayout>
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/snippet"
style="@style/TextSecondary"
android:layout_width="wrap_content"
@@ -58,8 +59,8 @@
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="3"
android:textColor="@color/textPrimary"
android:textStyle="bold"
app:textColor="primary"
tools:text="Hey! How's it going?" />
</LinearLayout>
+7 -6
View File
@@ -15,7 +15,7 @@
style="@style/DrawerIcon"
android:src="@drawable/ic_inbox_black_24dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
style="@style/DrawerText"
android:text="@string/drawer_inbox" />
@@ -30,7 +30,7 @@
style="@style/DrawerIcon"
android:src="@drawable/ic_folder_black_24dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
style="@style/DrawerText"
android:text="@string/drawer_archived" />
@@ -45,7 +45,7 @@
style="@style/DrawerIcon"
android:src="@drawable/ic_event_black_24dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
style="@style/DrawerText"
android:text="@string/drawer_scheduled" />
@@ -60,7 +60,7 @@
style="@style/DrawerIcon"
android:src="@drawable/ic_block_black_24dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
style="@style/DrawerText"
android:text="@string/drawer_blocked" />
@@ -71,17 +71,18 @@
android:layout_height="1dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@color/list_separator" />
android:background="@color/listSeparator" />
<LinearLayout
android:id="@+id/settings"
style="@style/DrawerRow">
<ImageView
android:id="@+id/settingsIcon"
style="@style/DrawerIcon"
android:src="@drawable/ic_settings_black_24dp" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
style="@style/DrawerText"
android:text="@string/drawer_settings" />
@@ -3,11 +3,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/ripple"
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/timestamp"
style="@style/TextSecondary"
android:layout_width="match_parent"
@@ -45,18 +46,17 @@
android:layout_height="wrap_content"
android:layout_gravity="start"
android:background="@drawable/message_only"
android:backgroundTint="@color/bubbleLight"
android:gravity="start|center_vertical"
android:minHeight="36dp"
android:paddingBottom="8dp"
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingTop="8dp"
android:textColor="@color/textPrimaryLight"
app:textColor="primaryOnTheme"
tools:backgroundTint="@color/tools_theme"
tools:text="@tools:sample/lorem/random" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/status"
android:layout_width="0dp"
android:layout_height="0dp"
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -7,7 +8,7 @@
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/timestamp"
style="@style/TextSecondary"
android:layout_width="match_parent"
@@ -44,7 +45,6 @@
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingTop="8dp"
android:textColor="@color/textPrimary"
tools:backgroundTint="@color/white"
tools:text="Hey! How's it going?" />
@@ -52,14 +52,14 @@
</LinearLayout>
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="12dp"
android:paddingTop="4dp"
android:textColor="@color/textTertiary"
app:textColor="tertiary"
tools:text="Sending..." />
</LinearLayout>
@@ -13,14 +13,14 @@
android:orientation="vertical"
android:padding="16dp">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/titleView"
style="@style/TextPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Default SMS App" />
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/summaryView"
style="@style/TextSecondary"
android:layout_width="match_parent"
+3 -4
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
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:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/white"
android:gravity="center_vertical"
android:minHeight="56dp">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/toolbarTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -16,9 +16,8 @@
android:gravity="left|center_vertical"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/textPrimary"
android:textColorHint="@color/textTertiary"
android:textSize="20sp"
app:textColor="primary"
tools:text="Conversations" />
</android.support.v7.widget.Toolbar>
+3 -4
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:minHeight="56dp">
<TextView
<com.moez.QKSMS.presentation.view.QkTextView
android:id="@+id/toolbarTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -16,9 +16,8 @@
android:gravity="left|center_vertical"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/textPrimary"
android:textColorHint="@color/textTertiary"
android:textSize="20sp"
app:textColor="primary"
tools:text="Conversations" />
<android.support.v7.widget.RecyclerView
+4 -3
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
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:layout_width="match_parent"
android:layout_height="56dp"
@@ -8,7 +9,7 @@
android:gravity="center_vertical"
android:minHeight="56dp">
<EditText
<com.moez.QKSMS.presentation.view.QkEditText
android:id="@+id/toolbarTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -16,9 +17,9 @@
android:gravity="left|center_vertical"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/textPrimary"
android:textColorHint="@color/textTertiary"
android:textSize="16sp"
app:textColor="primary"
app:textColorHint="tertiary"
tools:hint="Search something" />
</android.support.v7.widget.Toolbar>
+22
View File
@@ -1,6 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="textColor" format="enum">
<enum name="primary" value="0" />
<enum name="secondary" value="1" />
<enum name="tertiary" value="2" />
<enum name="primaryOnTheme" value="3" />
<enum name="secondaryOnTheme" value="4" />
<enum name="tertiaryOnTheme" value="5" />
</attr>
<declare-styleable name="QkTextView">
<attr name="textColor" />
</declare-styleable>
<declare-styleable name="QkEditText">
<attr name="textColor" />
<attr name="textColorHint" format="enum">
<enum name="primary" value="0" />
<enum name="secondary" value="1" />
<enum name="tertiary" value="2" />
</attr>
</declare-styleable>
<declare-styleable name="PreferenceView">
<attr name="title" format="string" />
<attr name="summary" format="string" />
+15 -14
View File
@@ -6,9 +6,9 @@
<color name="textSecondary">#70808D</color>
<color name="textTertiary">#B7B9C0</color>
<color name="textPrimaryLight">#FFFFFFFF</color>
<color name="textSecondaryLight">#ccffffff</color>
<color name="textTertiaryLight">#80ffffff</color>
<color name="textPrimaryDark">#FFFFFFFF</color>
<color name="textSecondaryDark">#ccffffff</color>
<color name="textTertiaryDark">#80ffffff</color>
<color name="bubbleLight">#FFFFFF</color>
<color name="bubbleDark">#333333</color>
@@ -16,19 +16,20 @@
<color name="backgroundLight">#F2F2F2</color>
<color name="backgroundDark">#212121</color>
<color name="statusLight">#F1F1F1</color>
<color name="listSeparator">#F2F2F2</color>
<color name="rowSelected">#F5F5F5</color>
<color name="list_separator">#F2F2F2</color>
<color name="row_selected">#F5F5F5</color>
<color name="switchThumbEnabledLight">#ECECEC</color>
<color name="switchThumbEnabledDark">#B9B9B9</color>
<color name="switch_thumb_enabled_light">#ECECEC</color>
<color name="switch_track_enabled_light">#A6A6A6</color>
<color name="switch_thumb_disabled_light">#B9B9B9</color>
<color name="switch_track_disabled_light">#D6D6D6</color>
<color name="switch_thumb_enabled_dark">#B9B9B9</color>
<color name="switch_track_enabled_dark">#646464</color>
<color name="switch_thumb_disabled_dark">#595959</color>
<color name="switch_track_disabled_dark">#383838</color>
<color name="switchTrackEnabledLight">#A6A6A6</color>
<color name="switchTrackEnabledDark">#646464</color>
<color name="switchThumbDisabledLight">#B9B9B9</color>
<color name="switchThumbDisabledDark">#595959</color>
<color name="switchTrackDisabledLight">#D6D6D6</color>
<color name="switchTrackDisabledDark">#383838</color>
<!-- This colour should only ever be used for attrs with the tools tag -->
<color name="tools_theme">#008389</color>
+4 -7
View File
@@ -6,23 +6,21 @@
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/white</item>
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/statusLight</item>
</style>
<style name="TextPrimary">
<item name="android:textColor">@color/textPrimary</item>
<item name="android:textColorHint">@color/textTertiary</item>
<item name="android:textSize">16sp</item>
<item name="textColor">primary</item>
</style>
<style name="TextSecondary">
<item name="android:textColor">@color/textTertiary</item>
<item name="android:textSize">14sp</item>
<item name="textColor">tertiary</item>
</style>
<style name="TextTertiary">
<item name="android:textColor">@color/textTertiary</item>
<item name="android:textSize">12sp</item>
<item name="textColor">tertiary</item>
</style>
<style name="DrawerRow">
@@ -39,16 +37,15 @@
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:lines">1</item>
<item name="android:textColor">@color/textPrimary</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
<item name="textColor">primary</item>
</style>
<style name="DrawerIcon">
<item name="android:layout_height">24dp</item>
<item name="android:layout_width">24dp</item>
<item name="android:layout_marginEnd">32dp</item>
<item name="android:tint">@color/textSecondary</item>
</style>
</resources>