improve color contrast when in light mode

This commit is contained in:
Öppen 2020-09-04 11:36:48 +01:00
parent 9498ae53a5
commit 5a5fcfa248
14 changed files with 43 additions and 7 deletions

View File

@ -199,9 +199,11 @@ class TvaActivity : AppCompatActivity() {
private fun renderGemtext(state: TvaState.ResponseGemtext) = runOnUiThread {
loadingView(false)
val addressSpan = SpannableString(state.uri.toString())
addressSpan.set(0, 9, ForegroundColorSpan(resources.getColor(R.color.protocol_address)))
binding.addressEdit.setText(addressSpan)
//todo - colours didn't change when switching themes, so disabled for now
//val addressSpan = SpannableString(state.uri.toString())
//addressSpan.set(0, 9, ForegroundColorSpan(resources.getColor(R.color.protocol_address)))
binding.addressEdit.setText(state.uri.toString())
adapter.render(state.lines)
history.add(state.uri.toString())

View File

@ -3,7 +3,7 @@
android:height="24.5dp"
android:viewportWidth="48"
android:viewportHeight="49"
android:tint="?attr/colorControlNormal">
android:tint="@color/stroke">
<path
android:pathData="M47.723,19.3306L24.481,0.1701C24.3393,0.0567 24.1692,0 24.0086,0C23.8385,0 23.6685,0.0567 23.5362,0.1701L11.5845,10.0054V0.7464C11.5845,0.3307 11.2444,0 10.8381,0C10.4318,0 10.0917,0.3401 10.0917,0.7464V11.2431L0.2753,19.3306C-0.046,19.5951 -0.0932,20.0675 0.1713,20.3887C0.4359,20.71 0.9083,20.7572 1.2295,20.4927L4.2056,18.0456V45.0007C4.2056,46.6541 5.5472,48.0052 7.2101,48.0052H40.8071C42.4605,48.0052 43.8115,46.6635 43.8115,45.0007V18.0362L46.7877,20.4832C46.9294,20.5966 47.0994,20.6533 47.2601,20.6533C47.4774,20.6533 47.6947,20.5588 47.8364,20.3793C48.0915,20.0675 48.0442,19.5951 47.723,19.3306ZM35.2422,46.4935H25.2652V34.0977H35.2422V46.4935ZM42.2999,45.0007C42.2999,45.8321 41.6291,46.5029 40.7976,46.5029H36.7445V33.3419C36.7445,32.9262 36.4043,32.5955 35.9981,32.5955H24.5188C24.1031,32.5955 23.7724,32.9356 23.7724,33.3419V46.4935H7.2006C6.3692,46.4935 5.6984,45.8227 5.6984,44.9913V16.7985L23.9991,1.7195L42.2999,16.7985V45.0007Z"
android:fillColor="#000000"/>

View File

@ -15,7 +15,7 @@
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:background="@color/header_background"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout

View File

@ -10,6 +10,7 @@
android:paddingTop="@dimen/default_margin"
android:paddingBottom="@dimen/default_margin"
android:fontFamily="monospace"
android:textColor="@color/stroke"
android:background="@color/code_background"
android:textIsSelectable="true"
android:layout_width="match_parent"

View File

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gemtext_text_textview"
android:textSize="@dimen/h1_text_size"
android:textColor="@color/stroke"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"

View File

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gemtext_text_textview"
android:textSize="@dimen/h2_text_size"
android:textColor="@color/stroke"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"

View File

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gemtext_text_textview"
android:textSize="@dimen/h3_text_size"
android:textColor="@color/stroke"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"

View File

@ -2,6 +2,7 @@
<androidx.appcompat.widget.AppCompatTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gemtext_text_link"
android:textColor="@color/stroke"
android:textSize="@dimen/default_text_size"
android:clickable="true"
android:focusable="true"

View File

@ -3,6 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gemtext_text_monospace_textview"
android:textSize="@dimen/default_text_size"
android:textColor="@color/stroke"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:paddingLeft="@dimen/default_margin"

View File

@ -5,6 +5,7 @@
android:textSize="@dimen/default_text_size"
android:paddingLeft="@dimen/default_margin"
android:paddingRight="@dimen/default_margin"
android:textColor="@color/stroke"
android:textIsSelectable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

View File

@ -7,4 +7,7 @@
<color name="player_background">#1d1d1d</color>
<color name="protocol_address">#ffdede</color>
<color name="address_background">#2e2e2e</color>
<color name="header_background">#1d1d1d</color>
<color name="stroke">#d2d2d2</color>
</resources>

View File

@ -0,0 +1,20 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@color/header_background</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="DayNightDialog" parent="Theme.AppCompat.DayNight.Dialog.Alert"/>
</resources>

View File

@ -7,4 +7,7 @@
<color name="player_background">#efefef</color>
<color name="protocol_address">#002121</color>
<color name="address_background">#dfdfdf</color>
<color name="header_background">#eeeeee</color>
<color name="stroke">#0d0d0d</color>
</resources>

View File

@ -1,12 +1,13 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="android:statusBarColor">@color/header_background</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
</style>