Skip to content

Commit

Permalink
force app to be dark mode on load for robo tests, and more screen com…
Browse files Browse the repository at this point in the history
…patibility
  • Loading branch information
ewhang5 committed Jun 19, 2024
1 parent b156cce commit f324589
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 28 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/org/ole/planet/myplanet/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.os.StrictMode
import android.os.StrictMode.VmPolicy
import android.provider.Settings
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatDelegate
import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.PeriodicWorkRequest
import androidx.work.WorkManager
Expand Down Expand Up @@ -66,6 +67,8 @@ class MainApplication : Application(), Application.ActivityLifecycleCallbacks {
override fun onCreate() {
super.onCreate()
initialize(CoroutineScope(Dispatchers.IO))
// REMOVE AFTER DARK MODE DEVELOPMENT
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)


context = this
Expand Down
30 changes: 20 additions & 10 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
android:layout_height="0dp"
android:layout_weight="5"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:background="@color/login_info_bg">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
Expand Down Expand Up @@ -71,7 +72,8 @@
android:layout_marginTop="15dp"
android:padding="@dimen/padding_normal"
android:text="@string/dash_4"
android:textAlignment="center" />
android:textAlignment="center"
android:textColor="@color/card_text" />

<ImageButton
android:id="@+id/imgBtnSetting"
Expand Down Expand Up @@ -111,6 +113,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/hint_name"
android:textColorHint="@color/card_text"
android:labelFor="@+id/inputName"
app:boxBackgroundColor="@color/md_white_1000"
app:boxStrokeColor="@color/md_white_1000"
Expand All @@ -132,7 +135,8 @@
android:inputType="text"
android:paddingStart="10dp"
android:paddingEnd="8dp"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text"
android:backgroundTint="@color/card_text" />
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
Expand All @@ -141,6 +145,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/password"
android:textColorHint="@color/card_text"
android:labelFor="@+id/input_password"
app:boxBackgroundColor="@color/md_white_1000"
app:boxStrokeColor="@color/md_white_1000"
Expand All @@ -162,15 +167,16 @@
android:inputType="textPassword"
android:paddingStart="10dp"
android:paddingEnd="8dp"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text"
android:backgroundTint="@color/card_text" />
</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/btn_signin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/colorPrimary"
android:background="@color/mainColor"
android:contentDescription="@string/btn_sign_in"
android:text="@string/btn_sign_in"
android:textColor="@android:color/white"
Expand Down Expand Up @@ -199,7 +205,8 @@
android:contentDescription="@string/btn_guest_login"
android:text="@string/btn_guest_login"
android:textSize="14sp"
android:theme="@style/PrimaryFlatButton" />
android:theme="@style/PrimaryFlatButton"
android:textColor="@color/card_text" />

<Button
android:id="@+id/become_member"
Expand All @@ -209,7 +216,8 @@
android:layout_marginTop="@dimen/padding_normal"
android:contentDescription="@string/become_a_member"
android:text="@string/become_a_member"
android:theme="@style/PrimaryFlatButton" />
android:theme="@style/PrimaryFlatButton"
android:textColor="@color/card_text" />

<Button
android:id="@+id/btn_feedback"
Expand All @@ -219,7 +227,8 @@
android:layout_marginTop="@dimen/padding_normal"
android:contentDescription="@string/feedback"
android:text="@string/feedback"
android:theme="@style/PrimaryFlatButton" />
android:theme="@style/PrimaryFlatButton"
android:textColor="@color/card_text" />

<Button
android:id="@+id/open_community"
Expand All @@ -230,7 +239,8 @@
android:contentDescription="@string/open_community"
android:text="@string/open_community"
android:textSize="14sp"
android:theme="@style/PrimaryFlatButton" />
android:theme="@style/PrimaryFlatButton"
android:textColor="@color/card_text" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Expand All @@ -242,7 +252,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="@color/colorPrimary"
android:background="@color/mainColor"
android:orientation="vertical"
android:weightSum="5">

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/fragment_library_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
android:layout_gravity="center"
android:gravity="center"
android:padding="4dp"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text" />

<androidx.appcompat.widget.AppCompatRatingBar
android:id="@+id/rating_bar"
Expand Down Expand Up @@ -150,7 +150,7 @@
android:gravity="center"
android:padding="4dp"
android:text="@string/zero_point_zero"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textSize="@dimen/text_size_large"
android:textStyle="bold" />

Expand All @@ -159,7 +159,8 @@
android:id="@+id/average"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/average" />
android:text="@string/average"
android:textColor="@color/hint_color" />

</LinearLayout>
</LinearLayout>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_news.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/padding_normal"
android:background="@color/secondary_bg"
tools:context=".ui.news.NewsFragment">

<LinearLayout
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/res/layout/fragment_team.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/secondary_bg"
android:padding="@dimen/padding_normal"
tools:context=".ui.team.TeamFragment">

Expand All @@ -15,13 +16,15 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:labelFor="@+id/et_search"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:textColorHint="@color/hint_color">

<EditText
android:id="@+id/et_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search"
android:backgroundTint="@color/hint_color"
android:padding="@dimen/padding_normal" />
</com.google.android.material.textfield.TextInputLayout>

Expand All @@ -45,7 +48,7 @@
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:text="@string/name_normal"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />

<TextView
Expand All @@ -55,7 +58,7 @@
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:text="@string/created_on"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />

<TextView
Expand All @@ -65,7 +68,7 @@
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:text="@string/type"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />

<TextView
Expand All @@ -76,7 +79,7 @@
android:alpha="0.8"
android:padding="@dimen/padding_small"
android:text="@string/total_visits"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />

<TextView
Expand All @@ -85,7 +88,7 @@
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:text="@string/action"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />
</TableRow>
</TableLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_team_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="37dp"
android:background="@color/secondary_bg"
app:tabTextColor="@color/card_text"
app:tabMode="scrollable" />

<androidx.viewpager2.widget.ViewPager2
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_team_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textStyle="bold" />

<TextView
Expand All @@ -28,23 +28,23 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text" />

<TextView
android:id="@+id/type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text" />

<TextView
android:id="@+id/no_of_visits"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding_small"
android:textColor="@color/md_black_1000" />
android:textColor="@color/card_text" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ltButtons"
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/res/layout/row_news.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/card_bg"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
app:contentPadding="@dimen/padding_normal">
Expand All @@ -13,8 +15,8 @@

<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="392dp"
android:layout_height="69dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

Expand All @@ -40,7 +42,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/md_black_1000"
android:textColor="@color/card_text"
android:textSize="14sp"
android:textStyle="bold" />

Expand All @@ -49,7 +51,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="@color/colorPrimary"
android:textColor="@color/card_text"
android:textSize="14sp" />

</LinearLayout>
Expand Down Expand Up @@ -133,6 +135,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/reply"
android:textColor="@color/card_text"
android:theme="@style/PrimaryFlatButton"
app:layout_constraintEnd_toStartOf="@+id/btn_show_reply"
app:layout_constraintHorizontal_chainStyle="spread_inside"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<color name="card_text">@color/textColorPrimary</color>
<color name="hint_color">#808080</color>
<color name="text_highlight_color">@color/hint_color</color>
<color name="login_info_bg">@color/colorPrimary</color>
<color name="mainColor">@color/md_blue_700</color>


<color name="black_overlay">#66000000</color>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<color name="card_text">@color/md_black_1000</color>
<color name="hint_color">#808080</color>
<color name="text_highlight_color">@color/colorPrimary</color>
<color name="login_info_bg">#FFFFFF</color>
<color name="mainColor">@color/colorPrimary</color>


<color name="black_overlay">#66000000</color>
Expand Down

0 comments on commit f324589

Please sign in to comment.