Skip to content

Commit

Permalink
Use customized background colors
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasBielefeld committed Jun 15, 2024
1 parent e3ad81f commit 8bc31aa
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "de.tobiasbielefeld.searchbar"
minSdkVersion 21
targetSdkVersion 34
versionCode 12
versionName "2.0"
versionCode 13
versionName "2.0.1"

vectorDrawables.useSupportLibrary = true
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

LinearLayout layoutContainer = view.findViewById(R.id.changelog_container);

String[] titles = new String[]{"2.0", "1.2", "1.1.4", "1.1.3", "1.1.2", "1.1.1", "1.1", "1.0"};
String[] titles = new String[]{"2.0.1", "2.0", "1.2", "1.1.4", "1.1.3", "1.1.2", "1.1.1", "1.1", "1.0"};

for (int i = 0; i < titles.length; i++) {
CardView card = (CardView) LayoutInflater.from(getContext()).inflate(R.layout.changelog_card_view, null);
Expand Down
15 changes: 12 additions & 3 deletions app/src/main/res/layout/activty_about.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
<LinearLayout
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="match_parent"
android:orientation="vertical"
tools:context=".ui.about.AboutActivity">

<com.google.android.material.appbar.AppBarLayout
Expand All @@ -23,15 +24,23 @@
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabSelectedTextColor="@color/colorAccent"
android:background="@color/mainBackground"
app:tabIndicatorColor="@color/colorAccent"
app:tabMode="auto"
app:tabSelectedTextColor="@color/colorAccent"
app:tabTextAppearance="@style/TextAppearance.AppCompat.Medium" />
</com.google.android.material.appbar.AppBarLayout>

<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider" />

<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<color name="shadow_themed">#50FFFFFF</color>
<color name="toolbarHint">#8D8D8D</color>
<color name="toolbarText">#4F4F4F</color>
<color name="mainBackground">#FF141218</color>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-v23/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
<item name="switchStyle">@style/CustomSwitchStyle</item>
<item name="materialSwitchStyle">@style/CustomSwitchStyle</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowBackground">@color/mainBackground</item>
<item name="actionOverflowMenuStyle">@style/CustomOverflowMenuStyle</item>
</style>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings-changelog.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="changelog_9_1" translatable="false">Use white as app background in light mode again</string>

<string name="changelog_8_1" translatable="false">Made app compatible with Android 14</string>
<string name="changelog_8_2" translatable="false">Added 5 machine-created translations</string>
<string name="changelog_8_3" translatable="false">Use Android 13 language change system</string>
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<item name="switchStyle">@style/CustomSwitchStyle</item>
<item name="actionBarStyle">@style/CustomActionbarStyle</item>
<item name="materialSwitchStyle">@style/CustomSwitchStyle</item>
<item name="android:windowBackground">@color/mainBackground</item>
<item name="actionOverflowMenuStyle">@style/CustomOverflowMenuStyle</item>
</style>

<style name="Base.AppThemeNoActionBar" parent="Theme.Material3.DayNight.NoActionBar">
Expand All @@ -32,8 +34,11 @@
<item name="radioButtonStyle">@style/CustomRadioButtonStyle</item>
<item name="switchStyle">@style/CustomSwitchStyle</item>
<item name="materialSwitchStyle">@style/CustomSwitchStyle</item>
<item name="android:windowBackground">@color/mainBackground</item>
<item name="actionOverflowMenuStyle">@style/CustomOverflowMenuStyle</item>
</style>


<!-- Use overwritten styles in themes v23 -->
<style name="AppThemeActionBar" parent="Base.AppThemeActionBar" />
<style name="AppThemeActionBarNoDrawer" parent="Base.AppThemeActionBar" />
Expand Down Expand Up @@ -83,4 +88,9 @@
<item name="buttonTint">@color/colorAccent</item>
</style>

<!-- popup dialog theme in actionbar, to have completely white background -->
<style name="CustomOverflowMenuStyle" parent="Widget.Material3.PopupMenu">
<item name="android:popupBackground">@color/colorDialogBackground</item>
</style>

</resources>

0 comments on commit 8bc31aa

Please sign in to comment.