From 2c4a122fb0bcb893952447e8ec871ed1dc5cd3c2 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Wed, 8 May 2024 15:56:15 +0200 Subject: [PATCH 01/10] Update to new colors (with dark mode!) --- app/build.gradle | 2 +- .../android/ApplicationListActivity.kt | 3 +- .../httptoolkit/android/PortListActivity.kt | 3 +- .../res/layout/app_interception_status.xml | 4 +-- app/src/main/res/layout/apps_list.xml | 6 +++- app/src/main/res/layout/item_app_row.xml | 2 ++ app/src/main/res/layout/item_port_row.xml | 3 ++ app/src/main/res/layout/ports_list.xml | 7 ++++- app/src/main/res/values-night/colors.xml | 21 ++++++++++++++ app/src/main/res/values-v23/styles.xml | 17 ----------- app/src/main/res/values/colors.xml | 14 ++++++---- app/src/main/res/values/styles.xml | 28 ++++++++++++++++--- 12 files changed, 77 insertions(+), 33 deletions(-) create mode 100644 app/src/main/res/values-night/colors.xml delete mode 100644 app/src/main/res/values-v23/styles.xml diff --git a/app/build.gradle b/app/build.gradle index 2718d09..80a3bc4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ dependencies { implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'com.beust:klaxon:5.5' implementation 'com.squareup.okhttp3:okhttp:4.3.0' - implementation 'com.google.android.material:material:1.1.0-beta02' + implementation 'com.google.android.material:material:1.4.0' implementation 'net.swiftzer.semver:semver:1.1.1' implementation 'io.sentry:sentry-android:1.7.27' implementation 'org.slf4j:slf4j-nop:1.7.25' diff --git a/app/src/main/java/tech/httptoolkit/android/ApplicationListActivity.kt b/app/src/main/java/tech/httptoolkit/android/ApplicationListActivity.kt index 40f7b5d..3244d21 100644 --- a/app/src/main/java/tech/httptoolkit/android/ApplicationListActivity.kt +++ b/app/src/main/java/tech/httptoolkit/android/ApplicationListActivity.kt @@ -9,6 +9,7 @@ import android.view.MenuItem import android.view.View import android.widget.PopupMenu import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.view.ContextThemeWrapper import androidx.core.widget.doAfterTextChanged import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import kotlinx.android.synthetic.main.apps_list.* @@ -146,7 +147,7 @@ class ApplicationListActivity : AppCompatActivity(), SwipeRefreshLayout.OnRefres override fun onClick(v: View?) { when (v?.id) { R.id.apps_list_more_menu -> { - PopupMenu(this, apps_list_more_menu).apply { + PopupMenu(ContextThemeWrapper(this, R.style.PopupMenu), apps_list_more_menu).apply { this.inflate(R.menu.menu_app_list) this.menu.findItem(R.id.action_show_system).isChecked = showSystem this.menu.findItem(R.id.action_show_enabled).isChecked = showEnabledOnly diff --git a/app/src/main/java/tech/httptoolkit/android/PortListActivity.kt b/app/src/main/java/tech/httptoolkit/android/PortListActivity.kt index c177712..a0d787e 100644 --- a/app/src/main/java/tech/httptoolkit/android/PortListActivity.kt +++ b/app/src/main/java/tech/httptoolkit/android/PortListActivity.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.os.Bundle import android.widget.PopupMenu import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.view.ContextThemeWrapper import androidx.core.widget.doAfterTextChanged import kotlinx.android.synthetic.main.ports_list.* import kotlinx.coroutines.* @@ -55,7 +56,7 @@ class PortListActivity : AppCompatActivity(), CoroutineScope by MainScope() { // Show the menu, and listen for clicks: ports_list_more_menu.setOnClickListener { - PopupMenu(this, ports_list_more_menu).apply { + PopupMenu(ContextThemeWrapper(this, R.style.PopupMenu), ports_list_more_menu).apply { this.inflate(R.menu.menu_ports_list) this.menu.findItem(R.id.action_reset_ports).isEnabled = diff --git a/app/src/main/res/layout/app_interception_status.xml b/app/src/main/res/layout/app_interception_status.xml index 3ad490b..a20f48c 100644 --- a/app/src/main/res/layout/app_interception_status.xml +++ b/app/src/main/res/layout/app_interception_status.xml @@ -26,7 +26,7 @@ style="@style/ConnectionStatusButtonText" android:layout_width="wrap_content" android:layout_height="match_parent" - android:drawableStart="@drawable/ic_apps_24" + app:drawableStartCompat="@drawable/ic_apps_24" android:text="@string/all_apps" /> @@ -47,7 +47,7 @@ style="@style/ConnectionStatusButtonText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:drawableStart="@drawable/ic_network_ports_24" + app:drawableStartCompat="@drawable/ic_network_ports_24" android:text="@string/default_ports" /> diff --git a/app/src/main/res/layout/apps_list.xml b/app/src/main/res/layout/apps_list.xml index d5d5478..24a7801 100644 --- a/app/src/main/res/layout/apps_list.xml +++ b/app/src/main/res/layout/apps_list.xml @@ -11,7 +11,8 @@ android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" - app:cardBackgroundColor="#FFFFFF" + + app:cardBackgroundColor="@color/textInputBackground" app:cardCornerRadius="2dp" app:cardElevation="4dp" app:cardUseCompatPadding="true"> @@ -26,6 +27,8 @@ android:layout_height="match_parent" android:layout_weight="1" android:background="@android:color/transparent" + android:textColor="@color/textInputColor" + android:textColorHint="@color/textInputPlaceholderColor" android:hint="@string/all_applications" android:padding="16dp" android:textSize="18sp" @@ -37,6 +40,7 @@ android:layout_height="wrap_content" android:id="@+id/apps_list_more_menu" android:padding="16dp" + app:tint="@color/textInputColor" app:srcCompat="@drawable/ic_baseline_more_vert_24" tools:ignore="ContentDescription" /> diff --git a/app/src/main/res/layout/item_app_row.xml b/app/src/main/res/layout/item_app_row.xml index 1a0a401..463d382 100644 --- a/app/src/main/res/layout/item_app_row.xml +++ b/app/src/main/res/layout/item_app_row.xml @@ -24,6 +24,7 @@ android:layout_toEndOf="@id/row_app_icon_image" android:paddingStart="16dp" android:paddingEnd="16dp" + android:textColor="@color/textColor" tools:text="@tools:sample/full_names" /> \ No newline at end of file diff --git a/app/src/main/res/layout/ports_list.xml b/app/src/main/res/layout/ports_list.xml index 36f96ff..a9b048c 100644 --- a/app/src/main/res/layout/ports_list.xml +++ b/app/src/main/res/layout/ports_list.xml @@ -20,7 +20,8 @@ android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" - app:cardBackgroundColor="#FFFFFF" + + app:cardBackgroundColor="@color/textInputBackground" app:cardCornerRadius="2dp" app:cardElevation="4dp" app:cardUseCompatPadding="true"> @@ -35,6 +36,8 @@ android:layout_height="match_parent" android:layout_weight="1" android:background="@android:color/transparent" + android:textColor="@color/textInputColor" + android:textColorHint="@color/textInputPlaceholderColor" android:hint="@string/add_port_prompt" android:padding="16dp" android:textSize="18sp" @@ -51,6 +54,7 @@ android:layout_height="wrap_content" android:minWidth="0dp" android:minHeight="0dp" + app:tint="@color/textInputColor" tools:ignore="ContentDescription,RtlSymmetry" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 0000000..6725b65 --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,21 @@ + + + #ffffff + #e1421f + #9a9da8 + + #4caf7d + #f1971f + + #1e2028 + #32343b + + #2d4cbd + #ffffff + + #16181e + #ffffff + #818490 + + #00000000 + diff --git a/app/src/main/res/values-v23/styles.xml b/app/src/main/res/values-v23/styles.xml deleted file mode 100644 index 454351f..0000000 --- a/app/src/main/res/values-v23/styles.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 0fec6b8..8b480c3 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,17 +1,21 @@ - #222222 + #1e2028 #e1421f - #808f8f + #818490 #4caf7d #f1971f - #d8e2e6 + #e4e8ed #fafafa - #1076b9 - #fafafa + #2d4cbd + #ffffff + + #ffffff + #1e2028 + #53565e #00000000 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c8ce23e..bcfe042 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,16 +1,26 @@ - + + + + From 55db49db0403948f994c07ab859cf14cbd4d4325 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Wed, 8 May 2024 16:13:35 +0200 Subject: [PATCH 02/10] Improve contrast of (How?) link color --- app/src/main/res/layout/connection_status_user.xml | 1 - app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/connection_status_user.xml b/app/src/main/res/layout/connection_status_user.xml index a5fe926..ae8b2fd 100644 --- a/app/src/main/res/layout/connection_status_user.xml +++ b/app/src/main/res/layout/connection_status_user.xml @@ -42,7 +42,6 @@ style="@style/ConnectionStatusText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColorLink="@color/primaryInputBackground" android:text="@string/user_connection_status_details" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 6725b65..3ea0a8f 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -3,6 +3,7 @@ #ffffff #e1421f #9a9da8 + #567BFF #4caf7d #f1971f diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 8b480c3..532afdf 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,6 +3,7 @@ #1e2028 #e1421f #818490 + #0C36CF #4caf7d #f1971f diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index bcfe042..6d956e2 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -2,6 +2,7 @@