Skip to content

Commit

Permalink
mylife: smoother mysubmissions dark mode (fixes #4989) (#5022)
Browse files Browse the repository at this point in the history
Co-authored-by: Gideon Okuro <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent fde639e commit 02b51a7
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 50 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2204
versionName "0.22.4"
versionCode 2205
versionName "0.22.5"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/color/toggle_text_color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/md_white_1000" />
<item android:color="@color/daynight_textColor" />
</selector>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/bg_submission_toggle_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape android:shape="rectangle">
<solid android:color="@color/mainColor" /> <!-- Active background color -->
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/card_bg" /> <!-- Inactive background color -->
<corners android:radius="8dp" />
</shape>
</item>
</selector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/submission_toggle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/card_bg" />
<corners android:radius="10dp" />
<stroke
android:width="2dp"
android:color="@color/mainColor" />
</shape>
103 changes: 55 additions & 48 deletions app/src/main/res/layout/fragment_my_submission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/secondary_bg"
tools:context=".ui.submission.MySubmissionFragment">

Expand All @@ -14,62 +15,68 @@
android:id="@+id/llSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right">
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="10dp">

<RadioGroup
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:gravity="right"
android:orientation="horizontal"
android:padding="@dimen/padding_normal">

<RadioButton
android:id="@+id/rb_exam"
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_green"
android:button="@android:color/transparent"
android:padding="@dimen/padding_normal"
android:text="@string/exams"
android:textSize="20sp" />
<RadioButton
android:id="@+id/rb_survey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_green"
android:button="@android:color/transparent"
android:padding="@dimen/padding_normal"
android:text="@string/survey"
android:textSize="20sp" />
</RadioGroup>
android:orientation="horizontal"
android:gravity="center"
android:background="@drawable/submission_toggle"
android:padding="10dp">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tl_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:textColorHint="@color/hint_color">
<RadioButton
android:id="@+id/rb_exam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:background="@drawable/bg_submission_toggle_button"
android:gravity="center"
android:text="@string/exams"
android:textColor="@color/toggle_text_color"
android:textSize="18sp"
android:paddingVertical="3dp"
android:paddingHorizontal="30dp"
android:layout_marginEnd="5dp" />
<RadioButton
android:id="@+id/rb_survey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:background="@drawable/bg_submission_toggle_button"
android:gravity="center"
android:text="@string/survey"
android:textColor="@color/toggle_text_color"
android:textSize="18sp"
android:paddingVertical="3dp"
android:paddingHorizontal="30dp"
android:layout_marginStart="5dp" />
</RadioGroup>

<EditText
android:id="@+id/et_search"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tl_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/ic_search"
android:drawableTint="@color/daynight_textColor"
android:hint="@string/search"
android:inputType="text"
android:maxLines="1"
android:backgroundTint="@color/hint_color"
android:textColor="@color/daynight_textColor" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
android:layout_marginTop="16dp"
android:textColorHint="@color/hint_color">

<LinearLayout
<EditText
android:id="@+id/et_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_search"
android:drawableTint="@color/daynight_textColor"
android:hint="@string/search"
android:inputType="text"
android:maxLines="1"
android:backgroundTint="@color/hint_color"
android:textColor="@color/daynight_textColor" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

<LinearLayout
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 02b51a7

Please sign in to comment.