mirror of
https://github.com/Michatec/Radio.git
synced 2026-06-05 00:02:16 +02:00
181ebd47df
Introduce a new custom theme feature that allows users to personalize the application background color using RGB sliders, hex input, or a set of predefined palettes. Key changes include: * **Custom Theme Engine**: Added `CustomThemeFragment` and `ThemeHelper` to manage color selection and application. The UI dynamically updates the background color across the `MainActivity` and `PlayerFragment` when preferences change. * **Android TV Support**: Provided a specialized layout for television devices (`fragment_custom_theme.xml` in `layout-television`) with optimized focus handling for D-pad navigation. * **Share Feature**: Implemented a "Share App" preference in `SettingsFragment` that triggers a standard Android share intent and displays a thank-you notification upon use. * **Localization**: Added Ukrainian language support and updated string resources for multiple locales (DE, DA, EL, FR, JA, NL, PL, RU) to include the new theme and share options. * **Persistence**: Updated `PreferencesHelper` and `Keys` to store theme-related settings, including the enabled state, selected color, and predefined color index.
80 lines
3.5 KiB
XML
80 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main_root"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="?android:attr/colorBackground"
|
|
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
|
|
android:fitsSystemWindows="true"
|
|
tools:context=".MainActivity">
|
|
|
|
<com.google.android.material.appbar.MaterialToolbar
|
|
android:id="@+id/main_toolbar"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:minHeight="?attr/actionBarSize"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
tools:visibility="gone" />
|
|
|
|
<androidx.fragment.app.FragmentContainerView
|
|
android:id="@+id/main_host_container"
|
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
app:defaultNavHost="true"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/main_toolbar"
|
|
app:navGraph="@navigation/nav_graph_main" />
|
|
|
|
<!-- SPLASH / LOADING SCREEN -->
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:id="@+id/loading_layout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="@color/splashBackgroundColor"
|
|
android:elevation="10dp"
|
|
android:visibility="visible">
|
|
|
|
<ImageView
|
|
android:id="@+id/loading_logo"
|
|
android:layout_width="160dp"
|
|
android:layout_height="160dp"
|
|
android:contentDescription="@string/icon_launcher"
|
|
android:src="@mipmap/ic_launcher"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintVertical_bias="0.4" />
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="24dp"
|
|
android:text="@string/loading"
|
|
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
|
|
android:textColor="@color/default_neutral_white"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/loading_logo" />
|
|
|
|
<ProgressBar
|
|
style="?android:attr/progressBarStyleHorizontal"
|
|
android:layout_width="200dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="16dp"
|
|
android:indeterminate="true"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/loading_logo"
|
|
android:visibility="invisible" />
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout> |