Skip to content

Commit

Permalink
fix(app): update app styles
Browse files Browse the repository at this point in the history
resolves #556
  • Loading branch information
ashutoshgngwr committed Apr 23, 2021
1 parent 94d6887 commit 3339b03
Show file tree
Hide file tree
Showing 18 changed files with 196 additions and 164 deletions.
8 changes: 3 additions & 5 deletions app/src/fdroid/res/drawable/ic_donate_opencollective.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="248.3dp"
android:height="40dp"
android:alpha="0.87"
android:viewportWidth="596"
android:viewportHeight="96">
<path
android:fillColor="@color/colorAccent"
android:fillColor="#3385ff"
android:pathData="M548,96H48C21.6,96 0,74.4 0,48v0C0,21.6 21.6,0 48,0l500,0c26.4,0 48,21.6 48,48v0C596,74.4 574.4,96 548,96z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M548,48m-44,0a44,44 0,1 1,88 0a44,44 0,1 1,-88 0" />
<path
android:fillAlpha="0.5"
android:fillColor="@color/colorAccent"
android:fillColor="#b8d3f4"
android:pathData="M565.93,48c0,3.52 -1.07,6.88 -2.91,9.79l7.32,7.34c3.66,-4.9 5.65,-10.86 5.65,-16.99c0,-6.43 -2.14,-12.24 -5.8,-16.98l-7.18,7.19c1.89,2.86 2.9,6.21 2.91,9.64L565.93,48z" />
<path
android:fillColor="@color/colorAccent"
android:fillColor="#3385ff"
android:pathData="M547.92,66.05c-9.93,-0.02 -17.98,-8.09 -18,-18.05c0.02,-9.97 8.07,-18.04 18,-18.06c3.66,0 7.02,1.08 9.77,2.91l7.17,-7.2c-4.89,-3.67 -10.83,-5.66 -16.94,-5.65C532.51,20 520,32.54 520,48c0,15.45 12.51,28 27.92,28c6.14,0.02 12.1,-2.03 16.94,-5.82l-7.32,-7.34C554.94,64.98 551.59,66.05 547.92,66.05L547.92,66.05z" />
<path
android:fillColor="#FFFFFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppIntroActivity : AppIntro() {
isColorTransitionsEnabled = true
showStatusBar(true)

setStatusBarColor(ActivityCompat.getColor(this, R.color.colorStatusBar))
setStatusBarColor(ActivityCompat.getColor(this, R.color.status_bar))
setTransformer(
AppIntroPageTransformerType.Parallax(
titleParallaxFactor = 1.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
customTabsIntent = CustomTabsIntent.Builder()
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams.Builder()
.setToolbarColor(ResourcesCompat.getColor(resources, R.color.colorActionBar, theme))
.setToolbarColor(ResourcesCompat.getColor(resources, R.color.action_bar, theme))
.build()
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.ashutoshgngwr.noice.fragment
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand All @@ -15,6 +14,7 @@ import androidx.core.content.pm.ShortcutManagerCompat
import androidx.core.graphics.drawable.IconCompat
import androidx.fragment.app.Fragment
import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import com.github.ashutoshgngwr.noice.InAppReviewFlowManager
import com.github.ashutoshgngwr.noice.MediaPlayerService
Expand Down Expand Up @@ -69,8 +69,9 @@ class PresetFragment : Fragment() {
dataSet = Preset.readAllFromUserPreferences(requireContext()).toMutableList()
adapter = PresetListAdapter(requireContext())
binding.presetList.also {
it.setHasFixedSize(true)
it.adapter = adapter
it.setHasFixedSize(true)
it.addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL))
}

EventBus.getDefault().register(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.widget.Toast
import androidx.annotation.LayoutRes
import androidx.annotation.VisibleForTesting
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import com.github.ashutoshgngwr.noice.InAppReviewFlowManager
import com.github.ashutoshgngwr.noice.MediaPlayerService
Expand Down Expand Up @@ -101,8 +102,9 @@ class SoundLibraryFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
adapter = SoundListAdapter(requireContext())
binding.soundList.also {
it.setHasFixedSize(true)
it.adapter = adapter
it.setHasFixedSize(true)
it.addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL))
}

binding.savePresetButton.setOnLongClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:tint="@color/colorPrimary"
android:tint="@color/primary"
android:viewportWidth="108"
android:viewportHeight="108">
<group
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/popup_menu_bg.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<solid android:color="@color/colorPopupBackground" />
<solid android:color="@color/background_dark" />
</shape>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?android:attr/colorBackground"
android:background="@color/background_dark"
app:menu="@menu/main" />

</androidx.drawerlayout.widget.DrawerLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/preset_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorBackground"
android:background="@color/background"
android:elevation="20dp"
android:padding="15dp"
android:text="@string/show_saved_preset_on_startup"
Expand Down
74 changes: 34 additions & 40 deletions app/src/main/res/layout/preset_list_item.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
style="?attr/materialCardViewStyle"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">

<LinearLayout
android:layout_width="match_parent"
<CheckBox
android:id="@+id/play_button"
style="?attr/checkboxStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
android:layout_margin="5dp"
android:background="?android:selectableItemBackgroundBorderless"
android:button="@drawable/ic_action_play_stop_circled_toggle"
android:buttonTint="?attr/colorAccent"
android:contentDescription="@string/play_pause" />

<CheckBox
android:id="@+id/play_button"
style="?attr/checkboxStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="?android:selectableItemBackgroundBorderless"
android:button="@drawable/ic_action_play_stop_circled_toggle"
android:buttonTint="?attr/colorAccent"
android:contentDescription="@string/play_pause" />

<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="?attr/textAppearanceListItem" />

<ImageButton
style="?attr/imageButtonStyle"
android:id="@+id/menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackgroundBorderless"
android:src="@drawable/ic_action_expand"
android:tint="?attr/colorOnSurface"
android:contentDescription="@string/open_context_menu" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?attr/textAppearanceListItem" />

</LinearLayout>
<ImageButton
android:id="@+id/menu_button"
style="?attr/imageButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackgroundBorderless"
android:contentDescription="@string/open_context_menu"
android:src="@drawable/ic_action_expand"
android:tint="?attr/colorOnSurface" />

</com.google.android.material.card.MaterialCardView>
</LinearLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/layout/sound_group_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingTop="16dp"
android:background="@color/background_dark"
android:paddingBottom="8dp"
android:textAppearance="?attr/textAppearanceButton" />
129 changes: 61 additions & 68 deletions app/src/main/res/layout/sound_list_item.xml
Original file line number Diff line number Diff line change
@@ -1,93 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="?attr/materialCardViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="16dp">

<CheckBox
android:id="@+id/play_button"
style="?attr/checkboxStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="?android:selectableItemBackgroundBorderless"
android:button="@drawable/ic_action_play_stop_circled_toggle"
android:buttonTint="?attr/colorAccent"
android:contentDescription="@string/play_pause" />

<!-- Lot of linear layouts because performance -->
<LinearLayout
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
android:layout_marginStart="15dp"
android:layout_weight="1"
android:orientation="vertical">

<CheckBox
android:id="@+id/play_button"
style="?attr/checkboxStyle"
android:layout_width="wrap_content"
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="?android:selectableItemBackgroundBorderless"
android:button="@drawable/ic_action_play_stop_circled_toggle"
android:buttonTint="?attr/colorAccent"
android:contentDescription="@string/play_pause" />
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?attr/textAppearanceListItem" />

<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_weight="1"
android:orientation="vertical">
android:gravity="center_vertical"
android:orientation="horizontal">

<TextView
android:id="@+id/title"
android:layout_width="match_parent"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textAppearance="?attr/textAppearanceListItem" />
android:contentDescription="@string/volume"
android:src="@drawable/ic_action_volume"
app:tint="?attr/colorAccent" />

<LinearLayout
android:layout_width="match_parent"
<com.google.android.material.slider.Slider
android:id="@+id/volume_slider"
style="@style/Widget.App.SoundLibrary.Slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/volume"
android:src="@drawable/ic_action_volume"
app:tint="?attr/colorAccent" />
android:layout_weight="1"
android:stepSize="1.0" />

<com.google.android.material.slider.Slider
android:id="@+id/volume_slider"
style="@style/Widget.App.SoundLibrary.Slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stepSize="1.0" />
</LinearLayout>

</LinearLayout>
<LinearLayout
android:id="@+id/time_period_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">

<LinearLayout
android:id="@+id/time_period_layout"
android:layout_width="match_parent"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/repeat_time_period"
android:src="@drawable/ic_action_time_period"
app:tint="?attr/colorAccent" />
android:contentDescription="@string/repeat_time_period"
android:src="@drawable/ic_action_time_period"
app:tint="?attr/colorAccent" />

<com.google.android.material.slider.Slider
android:id="@+id/time_period_slider"
style="@style/Widget.App.SoundLibrary.Slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stepSize="1" />

</LinearLayout>
<com.google.android.material.slider.Slider
android:id="@+id/time_period_slider"
style="@style/Widget.App.SoundLibrary.Slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stepSize="1" />

</LinearLayout>

</LinearLayout>

</com.google.android.material.card.MaterialCardView>
</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/wake_up_timer_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
android:text="@string/device_media_volume"
android:textAppearance="?textAppearanceBody1"
app:drawableStartCompat="@drawable/ic_action_volume"
app:drawableTint="@color/colorPrimary" />
app:drawableTint="@color/primary" />

<CheckBox
android:id="@+id/should_update_media_volume"
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorBackground">#282832</color>
<color name="colorCardBackground">#23232d</color>
<color name="colorPopupBackground">#202028</color>
<color name="action_bar">@color/shark_1</color>
<color name="background">@color/shark_0</color>
<color name="background_dark">@color/shark_1</color>

<!-- Following is needed because AboutPage doesn't have any way to define custom style.
This is supposed to override its default background color -->
<color name="about_background_color">@color/colorBackground</color>
<color name="about_background_color">@color/background</color>
</resources>
Loading

0 comments on commit 3339b03

Please sign in to comment.