Skip to content

Commit 2c4a122

Browse files
committed
Update to new colors (with dark mode!)
1 parent fc50328 commit 2c4a122

File tree

12 files changed

+77
-33
lines changed

12 files changed

+77
-33
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies {
4747
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
4848
implementation 'com.beust:klaxon:5.5'
4949
implementation 'com.squareup.okhttp3:okhttp:4.3.0'
50-
implementation 'com.google.android.material:material:1.1.0-beta02'
50+
implementation 'com.google.android.material:material:1.4.0'
5151
implementation 'net.swiftzer.semver:semver:1.1.1'
5252
implementation 'io.sentry:sentry-android:1.7.27'
5353
implementation 'org.slf4j:slf4j-nop:1.7.25'

app/src/main/java/tech/httptoolkit/android/ApplicationListActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import android.view.MenuItem
99
import android.view.View
1010
import android.widget.PopupMenu
1111
import androidx.appcompat.app.AppCompatActivity
12+
import androidx.appcompat.view.ContextThemeWrapper
1213
import androidx.core.widget.doAfterTextChanged
1314
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
1415
import kotlinx.android.synthetic.main.apps_list.*
@@ -146,7 +147,7 @@ class ApplicationListActivity : AppCompatActivity(), SwipeRefreshLayout.OnRefres
146147
override fun onClick(v: View?) {
147148
when (v?.id) {
148149
R.id.apps_list_more_menu -> {
149-
PopupMenu(this, apps_list_more_menu).apply {
150+
PopupMenu(ContextThemeWrapper(this, R.style.PopupMenu), apps_list_more_menu).apply {
150151
this.inflate(R.menu.menu_app_list)
151152
this.menu.findItem(R.id.action_show_system).isChecked = showSystem
152153
this.menu.findItem(R.id.action_show_enabled).isChecked = showEnabledOnly

app/src/main/java/tech/httptoolkit/android/PortListActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.content.Intent
44
import android.os.Bundle
55
import android.widget.PopupMenu
66
import androidx.appcompat.app.AppCompatActivity
7+
import androidx.appcompat.view.ContextThemeWrapper
78
import androidx.core.widget.doAfterTextChanged
89
import kotlinx.android.synthetic.main.ports_list.*
910
import kotlinx.coroutines.*
@@ -55,7 +56,7 @@ class PortListActivity : AppCompatActivity(), CoroutineScope by MainScope() {
5556

5657
// Show the menu, and listen for clicks:
5758
ports_list_more_menu.setOnClickListener {
58-
PopupMenu(this, ports_list_more_menu).apply {
59+
PopupMenu(ContextThemeWrapper(this, R.style.PopupMenu), ports_list_more_menu).apply {
5960
this.inflate(R.menu.menu_ports_list)
6061

6162
this.menu.findItem(R.id.action_reset_ports).isEnabled =

app/src/main/res/layout/app_interception_status.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
style="@style/ConnectionStatusButtonText"
2727
android:layout_width="wrap_content"
2828
android:layout_height="match_parent"
29-
android:drawableStart="@drawable/ic_apps_24"
29+
app:drawableStartCompat="@drawable/ic_apps_24"
3030
android:text="@string/all_apps" />
3131

3232
</com.google.android.material.card.MaterialCardView>
@@ -47,7 +47,7 @@
4747
style="@style/ConnectionStatusButtonText"
4848
android:layout_width="wrap_content"
4949
android:layout_height="wrap_content"
50-
android:drawableStart="@drawable/ic_network_ports_24"
50+
app:drawableStartCompat="@drawable/ic_network_ports_24"
5151
android:text="@string/default_ports" />
5252

5353
</com.google.android.material.card.MaterialCardView>

app/src/main/res/layout/apps_list.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
android:layout_height="wrap_content"
1212
android:layout_marginLeft="16dp"
1313
android:layout_marginRight="16dp"
14-
app:cardBackgroundColor="#FFFFFF"
14+
15+
app:cardBackgroundColor="@color/textInputBackground"
1516
app:cardCornerRadius="2dp"
1617
app:cardElevation="4dp"
1718
app:cardUseCompatPadding="true">
@@ -26,6 +27,8 @@
2627
android:layout_height="match_parent"
2728
android:layout_weight="1"
2829
android:background="@android:color/transparent"
30+
android:textColor="@color/textInputColor"
31+
android:textColorHint="@color/textInputPlaceholderColor"
2932
android:hint="@string/all_applications"
3033
android:padding="16dp"
3134
android:textSize="18sp"
@@ -37,6 +40,7 @@
3740
android:layout_height="wrap_content"
3841
android:id="@+id/apps_list_more_menu"
3942
android:padding="16dp"
43+
app:tint="@color/textInputColor"
4044
app:srcCompat="@drawable/ic_baseline_more_vert_24"
4145
tools:ignore="ContentDescription" />
4246
</LinearLayout>

app/src/main/res/layout/item_app_row.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
android:layout_toEndOf="@id/row_app_icon_image"
2525
android:paddingStart="16dp"
2626
android:paddingEnd="16dp"
27+
android:textColor="@color/textColor"
2728
tools:text="@tools:sample/full_names" />
2829

2930
<TextView
@@ -37,6 +38,7 @@
3738
android:maxLines="2"
3839
android:paddingStart="16dp"
3940
android:paddingEnd="16dp"
41+
android:textColor="@color/textColor"
4042
tools:text="@tools:sample/lorem/random" />
4143

4244
<com.google.android.material.switchmaterial.SwitchMaterial

app/src/main/res/layout/item_port_row.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
android:layout_toStartOf="@id/row_port_delete"
1515
android:paddingStart="16dp"
1616
android:paddingEnd="16dp"
17+
android:textColor="@color/textColor"
1718
tools:text="@tools:sample/us_phones" />
1819

1920
<TextView
@@ -26,6 +27,7 @@
2627
android:maxLines="2"
2728
android:paddingStart="16dp"
2829
android:paddingEnd="16dp"
30+
android:textColor="@color/textColor"
2931
tools:text="@tools:sample/lorem/random" />
3032

3133
<ImageView
@@ -36,6 +38,7 @@
3638
android:layout_height="wrap_content"
3739
android:layout_alignParentEnd="true"
3840
android:layout_centerVertical="true"
41+
android:tint="@color/textColor"
3942
android:minWidth="0dp"
4043
android:minHeight="0dp" />
4144
</RelativeLayout>

app/src/main/res/layout/ports_list.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
android:layout_height="wrap_content"
2121
android:layout_marginLeft="16dp"
2222
android:layout_marginRight="16dp"
23-
app:cardBackgroundColor="#FFFFFF"
23+
24+
app:cardBackgroundColor="@color/textInputBackground"
2425
app:cardCornerRadius="2dp"
2526
app:cardElevation="4dp"
2627
app:cardUseCompatPadding="true">
@@ -35,6 +36,8 @@
3536
android:layout_height="match_parent"
3637
android:layout_weight="1"
3738
android:background="@android:color/transparent"
39+
android:textColor="@color/textInputColor"
40+
android:textColorHint="@color/textInputPlaceholderColor"
3841
android:hint="@string/add_port_prompt"
3942
android:padding="16dp"
4043
android:textSize="18sp"
@@ -51,6 +54,7 @@
5154
android:layout_height="wrap_content"
5255
android:minWidth="0dp"
5356
android:minHeight="0dp"
57+
app:tint="@color/textInputColor"
5458
tools:ignore="ContentDescription,RtlSymmetry" />
5559

5660
<ImageView
@@ -59,6 +63,7 @@
5963
android:layout_height="wrap_content"
6064
android:padding="16dp"
6165
android:paddingStart="8dp"
66+
app:tint="@color/textInputColor"
6267
app:srcCompat="@drawable/ic_baseline_more_vert_24"
6368
tools:ignore="ContentDescription,RtlSymmetry" />
6469
</LinearLayout>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="textColor">#ffffff</color>
4+
<color name="popColor">#e1421f</color>
5+
<color name="lowLightColor">#9a9da8</color>
6+
7+
<color name="successColor">#4caf7d</color>
8+
<color name="warningColor">#f1971f</color>
9+
10+
<color name="containerBackground">#1e2028</color>
11+
<color name="mainBackground">#32343b</color>
12+
13+
<color name="primaryInputBackground">#2d4cbd</color>
14+
<color name="primaryInputColor">#ffffff</color>
15+
16+
<color name="textInputBackground">#16181e</color>
17+
<color name="textInputColor">#ffffff</color>
18+
<color name="textInputPlaceholderColor">#818490</color>
19+
20+
<color name="transparent">#00000000</color>
21+
</resources>

app/src/main/res/values-v23/styles.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)