Removed colors

Removed text color from Album and Artist details
main
Hemanth S 2020-05-12 22:13:00 +05:30
parent 2e22c74fef
commit 54e6a8fb81
12 changed files with 98 additions and 109 deletions

View File

@ -268,15 +268,6 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
}
private fun setColors(color: Int) {
val textColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
color.ripAlpha()
else
ATHUtil.resolveColor(this, android.R.attr.textColorPrimary)
songTitle.setTextColor(textColor)
moreTitle.setTextColor(textColor)
aboutAlbumTitle.setTextColor(textColor)
val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
color.ripAlpha()
else

View File

@ -250,20 +250,10 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailsView,
override fun onColorReady(colors: MediaNotificationProcessor) {
setColors(colors.backgroundColor)
}
})
}
private fun setColors(color: Int) {
val textColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
color.ripAlpha()
else
ATHUtil.resolveColor(this, android.R.attr.textColorPrimary)
albumTitle.setTextColor(textColor)
songTitle.setTextColor(textColor)
biographyTitle.setTextColor(textColor)
val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
color.ripAlpha()
else

View File

@ -45,8 +45,6 @@ import com.h6ah4i.android.widget.advrecyclerview.touchguard.RecyclerViewTouchAct
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
import kotlinx.android.synthetic.main.fragment_classic_controls.*
import kotlinx.android.synthetic.main.fragment_classic_player.*
import kotlinx.android.synthetic.main.status_bar.*
class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
MusicProgressViewUpdateHelper.Callback {
@ -80,6 +78,7 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
override fun onStateChanged(bottomSheet: View, newState: Int) {
val activity = requireActivity() as AbsSlidingMusicPanelActivity
val isDark = ATHUtil.isWindowBackgroundDark(requireContext());
when (newState) {
BottomSheetBehavior.STATE_EXPANDED,
BottomSheetBehavior.STATE_DRAGGING -> {

View File

@ -2,6 +2,7 @@ package code.name.monkey.retromusic.fragments.player.color
import android.animation.ValueAnimator
import android.os.Bundle
import android.os.Handler
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -36,14 +37,16 @@ class ColorFragment : AbsPlayerFragment() {
playbackControlsFragment.setDark(color)
navigationColor = color.backgroundColor
callbacks?.onPaletteColorChanged()
ToolbarContentTintHelper.colorizeToolbar(
playerToolbar,
color.secondaryTextColor,
requireActivity()
)
colorGradientBackground?.setBackgroundColor(color.backgroundColor)
playerActivity?.setLightNavigationBar(ColorUtil.isColorLight(color.backgroundColor))
Handler().postDelayed(Runnable {
ToolbarContentTintHelper.colorizeToolbar(
playerToolbar,
color.secondaryTextColor,
requireActivity()
)
}, 100)
}
override fun onFavoriteToggled() {

View File

@ -31,6 +31,9 @@ import androidx.palette.graphics.Palette;
import java.util.List;
import code.name.monkey.appthemehelper.util.ATHUtil;
import code.name.monkey.appthemehelper.util.ColorUtil;
import static androidx.core.graphics.ColorUtils.RGBToXYZ;
/**
@ -477,13 +480,13 @@ public class MediaNotificationProcessor {
}
public int getMightyColor() {
if (isColorLight(backgroundColor)) {
return primaryTextColor;
} else if (isColorLight(primaryTextColor)) {
return secondaryTextColor;
} else {
return backgroundColor;
if (ATHUtil.INSTANCE.isWindowBackgroundDark(context)) {
if (!ColorUtil.INSTANCE.isColorLight(primaryTextColor)) {
return NotificationColorUtil.ensureTextContrastOnBlack(primaryTextColor);
}
return NotificationColorUtil.ensureTextBackgroundColor(backgroundColor, primaryTextColor, secondaryTextColor);
}
return primaryTextColor;
}
public interface OnPaletteLoadedListener {

View File

@ -33,6 +33,7 @@ import androidx.annotation.ColorInt;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import java.util.WeakHashMap;
@ -348,28 +349,26 @@ public class NotificationColorUtil {
return ColorUtilsFromCompat.LABToColor(result[0], result[1], result[2]);
}
// public static int resolvePrimaryColor(Context context, int backgroundColor) {
// boolean useDark = shouldUseDark(backgroundColor);
// if (useDark) {
// return context.getColor(
// com.android.internal.R.color.notification_primary_text_color_light);
// } else {
// return context.getColor(
// com.android.internal.R.color.notification_primary_text_color_dark);
// }
// }
//
// public static int resolveSecondaryColor(Context context, int backgroundColor) {
// boolean useDark = shouldUseDark(backgroundColor);
// if (useDark) {
// return context.getColor(
// com.android.internal.R.color.notification_secondary_text_color_light);
// } else {
// return context.getColor(
// com.android.internal.R.color.notification_secondary_text_color_dark);
// }
// }
//
public static int resolvePrimaryColor(Context context, int backgroundColor) {
boolean useDark = shouldUseDark(backgroundColor);
if (useDark) {
return ContextCompat.getColor(context, android.R.color.primary_text_light);
} else {
return ContextCompat.getColor(context, android.R.color.primary_text_light);
}
}
public static int resolveSecondaryColor(Context context, int backgroundColor) {
boolean useDark = shouldUseDark(backgroundColor);
if (useDark) {
return ContextCompat.getColor(context,
android.R.color.secondary_text_light);
} else {
return ContextCompat.getColor(context, android.R.color.secondary_text_dark);
}
}
public static int resolveActionBarColor(Context context, int backgroundColor) {
if (backgroundColor == Notification.COLOR_DEFAULT) {
return Color.BLACK;
@ -377,16 +376,16 @@ public class NotificationColorUtil {
return getShiftedColor(backgroundColor, 7);
}
// /**
// * Resolves {@param color} to an actual color if it is {@link Notification#COLOR_DEFAULT}
// */
// public static int resolveColor(Context context, int color) {
// if (color == Notification.COLOR_DEFAULT) {
// return context.getColor(com.android.internal.R.color.notification_icon_default_color);
// }
// return color;
// }
//
/**
* Resolves {@param color} to an actual color if it is {@link Notification#COLOR_DEFAULT}
*/
public static int resolveColor(Context context, int color) {
if (color == Notification.COLOR_DEFAULT) {
return ContextCompat.getColor(context, android.R.color.background_dark);
}
return color;
}
//
// public static int resolveContrastColor(Context context, int notificationColor,
// int backgroundColor) {
@ -449,24 +448,24 @@ public class NotificationColorUtil {
return ColorUtilsFromCompat.LABToColor(result[0], result[1], result[2]);
}
// public static int resolveAmbientColor(Context context, int notificationColor) {
// final int resolvedColor = resolveColor(context, notificationColor);
//
// int color = resolvedColor;
// color = NotificationColorUtil.ensureTextContrastOnBlack(color);
//
// if (color != resolvedColor) {
// if (DEBUG){
// Log.w(TAG, String.format(
// "Ambient contrast of notification for %s is %s (over black)"
// + " by changing #%s to #%s",
// context.getPackageName(),
// NotificationColorUtil.contrastChange(resolvedColor, color, Color.BLACK),
// Integer.toHexString(resolvedColor), Integer.toHexString(color)));
// }
// }
// return color;
// }
public static int resolveAmbientColor(Context context, int notificationColor) {
final int resolvedColor = resolveColor(context, notificationColor);
int color = resolvedColor;
color = NotificationColorUtil.ensureTextContrastOnBlack(color);
if (color != resolvedColor) {
if (DEBUG) {
Log.w(TAG, String.format(
"Ambient contrast of notification for %s is %s (over black)"
+ " by changing #%s to #%s",
context.getPackageName(),
NotificationColorUtil.contrastChange(resolvedColor, color, Color.BLACK),
Integer.toHexString(resolvedColor), Integer.toHexString(color)));
}
}
return color;
}
private static boolean shouldUseDark(int backgroundColor) {
boolean useDark = backgroundColor == Notification.COLOR_DEFAULT;

View File

@ -45,6 +45,7 @@
android:padding="16dp"
android:text="@string/songs"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -69,6 +70,7 @@
android:padding="16dp"
android:text="@string/songs"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
@ -101,6 +103,7 @@
android:padding="12dp"
android:text="@string/songs"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -42,6 +42,7 @@
android:padding="16dp"
android:text="@string/albums"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
@ -69,6 +70,7 @@
android:padding="16dp"
android:text="@string/songs"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
@ -92,6 +94,7 @@
android:padding="16dp"
android:text="@string/biography"
android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constrainedWidth="true"

View File

@ -18,15 +18,15 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:layout_scrollFlags="scroll|enterAlways"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:subtitleTextAppearance="@style/TextViewSubtitle1"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:subtitleTextAppearance="@style/TextViewCaption"
app:titleMargin="0dp"
app:titleMarginStart="0dp"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal"
app:titleTextAppearance="@style/TextViewSubtitle1"
tools:subtitle="@tools:sample/full_names"
tools:title="@tools:sample/full_names" />

View File

@ -38,10 +38,12 @@
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Caption"
app:subtitleTextAppearance="@style/TextViewCaption"
app:titleMargin="0dp"
app:titleMarginStart="0dp"
app:titleTextAppearance="@style/TextAppearance.AppCompat.Subhead" />
app:titleTextAppearance="@style/TextViewSubtitle1"
tools:subtitle="@tools:sample/full_names"
tools:title="@tools:sample/full_names" />
</FrameLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
<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:layout_width="match_parent"
@ -17,4 +17,4 @@
tools:ignore="ContentDescription,UnusedAttribute"
tools:srcCompat="@tools:sample/backgrounds/scenic[7]" />
</androidx.fragment.app.FragmentContainerView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -11,7 +11,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/playerAlbumCoverFragment"
android:name="code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment"
@ -20,18 +19,20 @@
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
<View
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@drawable/shadow_down_strong"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/shadow_down_strong"
app:layout_constraintBottom_toBottomOf="@id/dummy_statusbar_actionbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/dummy_statusbar_actionbar" />
<LinearLayout
android:id="@+id/dummy_statusbar_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -39,12 +40,10 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
<code.name.monkey.retromusic.views.StatusBarView
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
android:layout_height="@dimen/status_bar_padding" />
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/playerToolbar"
@ -53,7 +52,6 @@
android:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.card.MaterialCardView
@ -88,7 +86,6 @@
android:id="@+id/player_queue_sub_header"
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:background="?attr/colorSurface"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
@ -100,7 +97,6 @@
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:overScrollMode="never"
tools:listitem="@layout/item_list" />
</LinearLayout>