Fix free label showing when Pro is enable #934
This commit is contained in:
parent
a39a9bd592
commit
2f4632fd67
4 changed files with 11 additions and 45 deletions
|
@ -33,9 +33,7 @@ import androidx.viewpager.widget.ViewPager
|
||||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||||
import code.name.monkey.retromusic.App
|
import code.name.monkey.retromusic.App
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.colorButtons
|
import code.name.monkey.retromusic.extensions.*
|
||||||
import code.name.monkey.retromusic.extensions.colorControlNormal
|
|
||||||
import code.name.monkey.retromusic.extensions.materialDialog
|
|
||||||
import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
import code.name.monkey.retromusic.fragments.AlbumCoverStyle
|
||||||
import code.name.monkey.retromusic.fragments.AlbumCoverStyle.*
|
import code.name.monkey.retromusic.fragments.AlbumCoverStyle.*
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil
|
import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
|
@ -126,9 +124,10 @@ class AlbumCoverStylePreferenceDialog : DialogFragment(),
|
||||||
Glide.with(context).load(albumCoverStyle.drawableResId).into(image)
|
Glide.with(context).load(albumCoverStyle.drawableResId).into(image)
|
||||||
title.setText(albumCoverStyle.titleRes)
|
title.setText(albumCoverStyle.titleRes)
|
||||||
if (isAlbumCoverStyle(albumCoverStyle)) {
|
if (isAlbumCoverStyle(albumCoverStyle)) {
|
||||||
|
proText.show()
|
||||||
proText.setText(R.string.pro)
|
proText.setText(R.string.pro)
|
||||||
} else {
|
} else {
|
||||||
proText.setText(R.string.free)
|
proText.hide()
|
||||||
}
|
}
|
||||||
return layout
|
return layout
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,7 @@ import androidx.viewpager.widget.ViewPager
|
||||||
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEDialogPreference
|
||||||
import code.name.monkey.retromusic.App
|
import code.name.monkey.retromusic.App
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.colorButtons
|
import code.name.monkey.retromusic.extensions.*
|
||||||
import code.name.monkey.retromusic.extensions.colorControlNormal
|
|
||||||
import code.name.monkey.retromusic.extensions.materialDialog
|
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen.*
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen.*
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil
|
import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
|
@ -93,7 +91,7 @@ class NowPlayingScreenPreferenceDialog : DialogFragment(), ViewPager.OnPageChang
|
||||||
val nowPlayingScreen = values()[viewPagerPosition]
|
val nowPlayingScreen = values()[viewPagerPosition]
|
||||||
if (isNowPlayingThemes(nowPlayingScreen)) {
|
if (isNowPlayingThemes(nowPlayingScreen)) {
|
||||||
val result =
|
val result =
|
||||||
getString(nowPlayingScreen.titleRes) + " theme is Pro version feature."
|
"${getString(nowPlayingScreen.titleRes)} theme is Pro version feature."
|
||||||
Toast.makeText(context, result, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, result, Toast.LENGTH_SHORT).show()
|
||||||
NavigationUtil.goToProVersion(requireContext())
|
NavigationUtil.goToProVersion(requireContext())
|
||||||
} else {
|
} else {
|
||||||
|
@ -131,9 +129,10 @@ private class NowPlayingScreenAdapter(private val context: Context) : PagerAdapt
|
||||||
Glide.with(context).load(nowPlayingScreen.drawableResId).into(image)
|
Glide.with(context).load(nowPlayingScreen.drawableResId).into(image)
|
||||||
title.setText(nowPlayingScreen.titleRes)
|
title.setText(nowPlayingScreen.titleRes)
|
||||||
if (isNowPlayingThemes(nowPlayingScreen)) {
|
if (isNowPlayingThemes(nowPlayingScreen)) {
|
||||||
|
proText.show()
|
||||||
proText.setText(R.string.pro)
|
proText.setText(R.string.pro)
|
||||||
} else {
|
}else{
|
||||||
proText.setText(R.string.free)
|
proText.hide()
|
||||||
}
|
}
|
||||||
return layout
|
return layout
|
||||||
}
|
}
|
||||||
|
@ -160,14 +159,5 @@ private class NowPlayingScreenAdapter(private val context: Context) : PagerAdapt
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isNowPlayingThemes(screen: NowPlayingScreen): Boolean {
|
private fun isNowPlayingThemes(screen: NowPlayingScreen): Boolean {
|
||||||
return (screen == Full ||
|
return (screen == Full || screen == Card || screen == Plain || screen == Blur || screen == Color || screen == Simple || screen == BlurCard || screen == Circle || screen == Adaptive) && !App.isProVersion()
|
||||||
screen == Card ||
|
|
||||||
screen == Plain ||
|
|
||||||
screen == Blur ||
|
|
||||||
screen == Color ||
|
|
||||||
screen == Simple ||
|
|
||||||
screen == BlurCard ||
|
|
||||||
screen == Circle ||
|
|
||||||
screen == Adaptive)
|
|
||||||
&& !App.isProVersion()
|
|
||||||
}
|
}
|
|
@ -127,29 +127,6 @@
|
||||||
android:textColor="@color/md_white_1000" />
|
android:textColor="@color/md_white_1000" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
app:srcCompat="@drawable/ic_check_circle"
|
|
||||||
app:tint="@color/md_white_1000" />
|
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:text="@string/window_corner_edges"
|
|
||||||
android:textAppearance="@style/TextViewSubtitle1"
|
|
||||||
android:textColor="@color/md_white_1000" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:text="@string/pro"
|
|
||||||
android:textAppearance="@style/TextViewHeadline6"
|
android:textAppearance="@style/TextViewHeadline6"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:text="@string/pro" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue