Skip to content

Commit

Permalink
all: better dark mode (fixes #2061) (#2122)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Sep 25, 2024
1 parent 17e89de commit 9660679
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class SSHTunnelFragment : BaseSSHTunnelFragment() {
portsName = it.data?.portNames; hostsName = it.data?.hostNames
adapter = TunnelUtils.getPortAdapter(requireContext(), portsName)
bind.sshPorts.adapter = adapter
adapter2 = ArrayAdapter(requireContext(), R.layout.support_simple_spinner_dropdown_item, hostsName!!)
adapter2 = ArrayAdapter(requireContext(), R.layout.simple_list_item, hostsName!!)
dialogSshTunnelPortsBinding.hosts.adapter = adapter2
}
Status.LOADING -> {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_rpi_dialog_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
android:background="#00000000"
android:id="@+id/rpi_close_button"
android:text="Cancel"
android:textColor="@color/red"
android:textColor="@color/dialog_button_color"
app:layout_constraintBottom_toBottomOf="@id/rpi_switch"
app:layout_constraintTop_toTopOf="@id/rpi_switch"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/dialog_speedtest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/daynight_textColor"
android:layout_marginStart="@dimen/margin_huge"
android:layout_marginLeft="@dimen/margin_huge"
android:text="Start Test" />
Expand Down
42 changes: 20 additions & 22 deletions app/src/main/res/layout/dialog_sshtunnel_ports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:background="@drawable/alertdialog_background"
android:orientation="vertical"
android:padding="@dimen/margin_medium"
android:background="@drawable/alertdialog_background">
android:padding="@dimen/margin_medium">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -33,7 +33,6 @@
android:background="@null"
android:scaleType="fitEnd"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/textView2"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -44,36 +43,36 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Spinner
android:id="@+id/hosts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="80dp"


android:spinnerMode="dropdown"/>
<Spinner
android:id="@+id/hosts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/CustomPopupMenu"
android:popupBackground="@color/card_background"
android:textSize="80sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/TLexternal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/TLexternal">
android:layout_height="wrap_content">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/ExternalTextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textColorHint="@color/expandable_child_text"
android:textColor="@color/daynight_textColor"
android:hint="External"
android:inputType="number"
android:maxLength="5"
/>
android:textColor="@color/daynight_textColor"
android:textColorHint="@color/expandable_child_text" />

</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
Expand All @@ -84,21 +83,20 @@
android:orientation="horizontal">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/TLinternal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/TLinternal">
android:layout_height="wrap_content">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/InternalTextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/daynight_textColor"
android:textColorHint="@color/expandable_child_text"
android:fontFamily="sans-serif"
android:hint="Internal"
android:inputType="number"
android:maxLength="5"
/>
android:textColor="@color/daynight_textColor"
android:textColorHint="@color/expandable_child_text" />

</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
Expand All @@ -108,9 +106,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:text="Add Port"
android:background="@drawable/addport_button"
android:enabled="false"
android:textColor="#FFFFFF"/>
android:text="Add Port"
android:textColor="#FFFFFF" />

</LinearLayout>
14 changes: 5 additions & 9 deletions app/src/main/res/layout/simple_list_item.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:textColor="@color/daynight_textColor"
android:id="@+id/spinner_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight" />
android:padding="8dp"
android:textColor="@color/daynight_textColor"
android:textSize="16sp"
android:textStyle="bold" />
3 changes: 2 additions & 1 deletion app/src/main/res/values-night/color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@

<color name="disconnect_button">#BC5C5C</color>
<color name="disconnect_button_light">#c48787</color>
</resources>
<color name="dialog_button_color">@color/colorAccent</color>
</resources>
9 changes: 9 additions & 0 deletions app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,13 @@
<item name="buttonTint">@color/bg_white</item>
<item name="android:textColor">@color/bg_white</item>
</style>

<style name="PopupMenu" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:popupBackground">@color/card_background</item>
</style>

<style name="CustomPopupMenu" parent="Widget.AppCompat.PopupMenu">
<item name="android:popupMenuStyle">@style/PopupMenu</item>
<item name="android:textColor">@color/daynight_textColor</item>
</style>
</resources>
3 changes: 2 additions & 1 deletion app/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@
<color name="key_background_layout">#55000000</color>
<color name="key_separator">#00000000</color>
<color name="keyboard_background">#55b0b0f0</color>
</resources>
<color name="dialog_button_color">@color/colorAccent</color>
</resources>
10 changes: 10 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,14 @@
<item name="android:padding">@dimen/padding_large</item>
<item name="android:gravity">center</item>
</style>

<style name="PopupMenu" parent="ThemeOverlay.AppCompat.Dark">
<item name="android:popupBackground">@color/card_background</item>
</style>

<style name="CustomPopupMenu" parent="Widget.AppCompat.PopupMenu">
<item name="android:popupMenuStyle">@style/PopupMenu</item>
<item name="android:textColor">@color/daynight_textColor</item>
</style>

</resources>

0 comments on commit 9660679

Please sign in to comment.