Fix dialog text color

main
h4h13 2019-05-11 21:07:22 +05:30
parent 8500241b83
commit b24a7caff0
6 changed files with 97 additions and 33 deletions

View File

@ -0,0 +1,36 @@
/*
* Copyright (c) 2019 Hemanth Savarala.
*
* Licensed under the GNU General Public License v3
*
* This is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation either version 3 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
package code.name.monkey.retromusic.extensions
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import androidx.annotation.DimenRes
import androidx.annotation.DrawableRes
fun Context.scaledDrawableResources(@DrawableRes id: Int, @DimenRes width: Int, @DimenRes height: Int): Drawable {
val w = resources.getDimension(width).toInt()
val h = resources.getDimension(height).toInt()
return scaledDrawable(id, w, h)
}
fun Context.scaledDrawable(@DrawableRes id: Int, width: Int, height: Int): Drawable {
val bmp = BitmapFactory.decodeResource(resources, id)
val bmpScaled = Bitmap.createScaledBitmap(bmp, width, height, false)
return BitmapDrawable(resources, bmpScaled)
}

View File

@ -66,15 +66,15 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
val entriesValues = arguments?.getStringArrayList(EXTRA_ENTRIES_VALUES)
return MaterialDialog(activity!!, BottomSheet())
.show {
title(text = materialListPreference.title.toString())
positiveButton(R.string.set)
listItemsSingleChoice(items = entries, initialSelection = position, waitForPositiveButton = true) { _, index, _ ->
materialListPreference.callChangeListener(entriesValues!![index])
materialListPreference.setCustomValue(entriesValues[index])
materialListPreference.summary = entries!![index]
dismiss()
}
}
title(text = materialListPreference.title.toString())
positiveButton(R.string.set)
listItemsSingleChoice(items = entries, initialSelection = position, waitForPositiveButton = true) { _, index, _ ->
materialListPreference.callChangeListener(entriesValues!![index])
materialListPreference.setCustomValue(entriesValues[index])
materialListPreference.summary = entries!![index]
dismiss()
}
}
}
override fun onDialogClosed(positiveResult: Boolean) {

View File

@ -33,6 +33,10 @@ import java.util.Objects;
import code.name.monkey.retromusic.App;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.activities.MainActivity;
import code.name.monkey.retromusic.fragments.AlbumCoverStyle;
import code.name.monkey.retromusic.fragments.NowPlayingScreen;
import code.name.monkey.retromusic.fragments.mainactivity.folders.FoldersFragment;
import code.name.monkey.retromusic.helper.SortOrder;
import code.name.monkey.retromusic.transform.CascadingPageTransformer;
import code.name.monkey.retromusic.transform.DepthTransformation;
@ -41,10 +45,6 @@ import code.name.monkey.retromusic.transform.HorizontalFlipTransformation;
import code.name.monkey.retromusic.transform.NormalPageTransformer;
import code.name.monkey.retromusic.transform.VerticalFlipTransformation;
import code.name.monkey.retromusic.transform.VerticalStackTransformer;
import code.name.monkey.retromusic.activities.MainActivity;
import code.name.monkey.retromusic.fragments.AlbumCoverStyle;
import code.name.monkey.retromusic.fragments.NowPlayingScreen;
import code.name.monkey.retromusic.fragments.mainactivity.folders.FoldersFragment;
public final class PreferenceUtil {
@ -651,9 +651,6 @@ public final class PreferenceUtil {
return mPreferences.getBoolean(TOGGLE_HEADSET, false);
}
public boolean tabTitles() {
return mPreferences.getBoolean(TOGGLE_TAB_TITLES, true);
}
public boolean isDominantColor() {
return mPreferences.getBoolean(DOMINANT_COLOR, false);
@ -757,6 +754,10 @@ public final class PreferenceUtil {
}
}
public boolean tabTitles() {
return getTabTitleMode() != LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED;
}
@LayoutRes
public int getHomeGridStyle(Context context) {
int pos = Integer.parseInt(mPreferences.getString(HOME_ARTIST_GRID_STYLE, "0"));

View File

@ -3,16 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:elevation="0dp"
app:elevation="0dp"
android:id="@+id/appBarLayout"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
android:fitsSystemWindows="true"
app:elevation="0dp">
<LinearLayout
android:layout_width="match_parent"
@ -31,7 +32,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="8dp"
app:cardCornerRadius="25dp"
app:cardElevation="0dp">
@ -42,7 +42,7 @@
android:background="@null"
android:hint="@string/action_search"
android:inputType="text|textAutoComplete"
android:padding="14dp">
android:padding="12dp">
<requestFocus />
</code.name.monkey.appthemehelper.common.views.ATEEditText>
@ -61,9 +61,9 @@
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<androidx.appcompat.widget.AppCompatTextView
android:id="@android:id/empty"
@ -87,12 +87,13 @@
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</FrameLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:layout_width="wrap_content"
android:id="@+id/keyboardPopup"
android:text="Keyboard"
android:layout_margin="16dp"
android:layout_gravity="bottom|end"
app:icon="@drawable/ic_keyboard_white_24dp"
android:layout_height="wrap_content"/>
android:id="@+id/keyboardPopup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:text="Keyboard"
app:icon="@drawable/ic_keyboard_white_24dp" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2019 Hemanth Savarala.
~
~ Licensed under the GNU General Public License v3
~
~ This is free software: you can redistribute it and/or modify it under
~ the terms of the GNU General Public License as published by
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ See the GNU General Public License for more details.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
app:showAsAction="always"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/action_search" />
</menu>

View File

@ -7,6 +7,7 @@
<item name="md_font_title">@font/circular</item>
<item name="md_font_body">@font/circular</item>
<item name="md_font_button">@font/circular</item>
<item name="md_color_button_text">@color/md_white_1000</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
@ -52,6 +53,8 @@
<item name="colorPrimary">@color/md_deep_purple_A400</item>
<item name="android:colorPrimary">?colorPrimary</item>
<item name="android:windowBackground">?colorPrimary</item>
<item name="md_color_button_text">@color/md_white_1000</item>
</style>
@ -88,6 +91,7 @@
<item name="md_font_title">@font/circular</item>
<item name="md_font_body">@font/circular</item>
<item name="md_font_button">@font/circular</item>
<item name="md_color_button_text">@color/md_black_1000</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>