Hmm somethings are changed

main
hemanths@live.com 2019-01-02 09:25:55 +05:30
parent 8dfb0dc8dd
commit 423b26be66
76 changed files with 410 additions and 234 deletions

View File

@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 274
versionName '3.0.520'
versionCode 277
versionName '3.0.530'
multiDexEnabled true
@ -130,7 +130,7 @@ dependencies {
implementation "androidx.legacy:legacy-preference-v14:$supportLibVersion"
implementation "com.google.android.material:material:$supportLibVersion"
implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation "com.squareup.retrofit2:retrofit:2.5.0"
implementation "com.squareup.retrofit2:converter-gson:2.4.0"
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0"
@ -163,6 +163,7 @@ dependencies {
implementation 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5'
implementation 'com.github.jetradarmobile:android-snowfall:1.2.0'
implementation 'com.github.takahirom.downloadable.calligraphy:downloadable-calligraphy:0.1.3'
kapt 'com.github.bumptech.glide:compiler:4.8.0'
}

View File

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.0.501</h4> <h3>Highlights</h3> <ul style="line-height=150%"> <li>Kotlin conversion from Good old Java</li> <li>Outline style system icons</li> <li>New Material Design principles and Guide lines</li> <li>Holiday Theme</li> </ul> <h3>Changelog</h3> <ul style="line-height:150%"> <li>Updated translations</li> <li>By default theme will be dark</li> <li>Now you can add search app shortcut in home screen</li> <li>Last selected Lyrics options saved</li> <li>Fonts are removed to make it fast loading</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings(Works only one normal theme)</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> <li>Updated image loading libraries(might loose your current artist images)</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.0.501</h4> <h3>Highlights</h3> <ul style="line-height=150%"> <li>Kotlin conversion from Good old Java</li> <li>Outline style system icons</li> <li>New Material Design principles and Guide lines</li> <li>Holiday Theme</li> </ul> <h3>Changelog</h3> <ul style="line-height:150%"> <li>Fixed app clear data when crash happens</li> <li>Updated translations</li> <li>By default theme will be dark</li> <li>Now you can add search app shortcut in home screen</li> <li>Last selected Lyrics options saved</li> <li>Fonts are removed to make it fast loading</li> <li>Now you can add plain text home screen widget</li> <li>Good old side navigation bar for options</li> <li>Bug report for better tracking with milestones</li> <li>Snow fall effect can be enable from other settings(Works only one normal theme)</li> <li>Click new music mix to play songs</li> <li>Gradient image option for gird list</li> <li>Clear button for playing queue</li> <li>Folder list back button</li> <li>New theme Fit</li> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> <li>Updated image loading libraries(might loose your current artist images)</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -8,7 +8,8 @@ import code.name.monkey.appthemehelper.util.VersionUtils
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
import com.anjlab.android.iab.v3.BillingProcessor
import com.anjlab.android.iab.v3.TransactionDetails
import com.bumptech.glide.Glide
import uk.co.chrisjenx.calligraphy.CalligraphyConfig
class App : MultiDexApplication() {
@ -30,6 +31,11 @@ class App : MultiDexApplication() {
DynamicShortcutManager(this).initDynamicShortcuts()
CalligraphyConfig.initDefault(CalligraphyConfig.Builder()
.setDefaultFont(R.font.circular_std_book)
.build()
)
// automatically restores purchases
billingProcessor = BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSING_KEY,
object : BillingProcessor.IBillingHandler {
@ -45,18 +51,6 @@ class App : MultiDexApplication() {
})
}
private fun setupErrorHandler() {
Thread.setDefaultUncaughtExceptionHandler { _, throwable -> handleUncaughtException(throwable) }
}
private fun handleUncaughtException(throwable: Throwable) {
throwable.printStackTrace()
deleteAppData()
//Intent intent = new Intent(this, ErrorHandlerActivity.class);
//intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(intent);
}
override fun onTerminate() {
super.onTerminate()
billingProcessor.release()
@ -74,20 +68,5 @@ class App : MultiDexApplication() {
val isProVersion: Boolean
get() = BuildConfig.DEBUG || instance.billingProcessor.isPurchased(PRO_VERSION_PRODUCT_ID)
fun deleteAppData() {
try {
// clearing app data
val packageName = instance.packageName
val runtime = Runtime.getRuntime()
runtime.exec("pm clear $packageName")
System.exit(0)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
}

View File

@ -76,6 +76,8 @@ object Constants {
@JvmField
val FAQ_LINK = "https://github.com/h4h13/RetroMusicPlayer/blob/master/FAQ.md"
@JvmField
val PINTEREST = "https://in.pinterest.com/retromusicapp/"
@JvmField
val CAST_SERVER_PORT = 8080
const val BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''"

View File

@ -8,7 +8,6 @@ import android.text.TextUtils
import android.view.View
import android.widget.RemoteViews
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.App.Companion.context
import code.name.monkey.retromusic.Constants
import code.name.monkey.retromusic.R

View File

@ -7,11 +7,11 @@ import code.name.monkey.retromusic.R
object HorizontalAdapterHelper {
val LAYOUT_RES = R.layout.item_image
const val LAYOUT_RES = R.layout.item_image
val TYPE_FIRST = 1
val TYPE_MIDDLE = 2
val TYPE_LAST = 3
const val TYPE_FIRST = 1
const val TYPE_MIDDLE = 2
const val TYPE_LAST = 3
fun applyMarginToLayoutParams(context: Context,
layoutParams: ViewGroup.MarginLayoutParams, viewType: Int) {

View File

@ -0,0 +1,21 @@
package code.name.monkey.retromusic.misc;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
public SpacesItemDecoration(int space) {
this.space = space;
}
@Override
public void getItemOffsets(Rect outRect, View view,
RecyclerView parent, RecyclerView.State state) {
outRect.right = space;
outRect.bottom = space;
}
}

View File

@ -18,6 +18,7 @@ import code.name.monkey.retromusic.Constants.DISCORD_LINK
import code.name.monkey.retromusic.Constants.FAQ_LINK
import code.name.monkey.retromusic.Constants.GITHUB_PROJECT
import code.name.monkey.retromusic.Constants.GOOGLE_PLUS_COMMUNITY
import code.name.monkey.retromusic.Constants.PINTEREST
import code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY
import code.name.monkey.retromusic.Constants.TELEGRAM_CHANGE_LOG
import code.name.monkey.retromusic.Constants.TRANSLATE
@ -111,10 +112,12 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener {
twitterLink.setOnClickListener(this)
changelog.setOnClickListener(this)
openSource.setOnClickListener(this)
pinterestLink.setOnClickListener(this)
}
override fun onClick(view: View) {
when (view.id) {
R.id.pinterestLink->openUrl(PINTEREST)
R.id.faqLink -> openUrl(FAQ_LINK)
R.id.telegramLink -> openUrl(APP_TELEGRAM_LINK)
R.id.discordLink -> openUrl(DISCORD_LINK)

View File

@ -141,7 +141,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsContrac
toolbar!!.layoutParams = params
}
appBarLayout!!.apply {
appBarLayout?.apply {
addOnOffsetChangedListener(object : AppBarStateChangeListener() {
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
val color: Int = when (state) {

View File

@ -140,24 +140,22 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
toolbar!!.layoutParams = params
}
if (appBarLayout != null) {
appBarLayout!!.addOnOffsetChangedListener(object : AppBarStateChangeListener() {
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
val color: Int = when (state) {
AppBarStateChangeListener.State.COLLAPSED -> {
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context)))
ThemeStore.primaryColor(appBarLayout.context)
}
AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> {
setLightStatusbar(false)
Color.TRANSPARENT
}
appBarLayout?.addOnOffsetChangedListener(object : AppBarStateChangeListener() {
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
val color: Int = when (state) {
AppBarStateChangeListener.State.COLLAPSED -> {
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context)))
ThemeStore.primaryColor(appBarLayout.context)
}
ToolbarContentTintHelper.setToolbarContentColorBasedOnToolbarColor(appBarLayout.context, toolbar, color)
AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> {
setLightStatusbar(false)
Color.TRANSPARENT
}
}
})
}
ToolbarContentTintHelper.setToolbarContentColorBasedOnToolbarColor(appBarLayout.context, toolbar, color)
}
})
}
private fun setupRecyclerView() {

View File

@ -107,7 +107,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP
if (intent.hasExtra("expand")) {
if (intent.getBooleanExtra("expand", false)) {
//expandPanel();
expandPanel()
intent.putExtra("expand", false)
}
}

View File

@ -1,6 +1,7 @@
package code.name.monkey.retromusic.ui.activities.base
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.media.AudioManager
@ -12,8 +13,8 @@ import android.view.KeyEvent
import android.view.View
import androidx.core.app.ActivityCompat
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R
import com.google.android.material.snackbar.Snackbar
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper
abstract class AbsBaseActivity : AbsThemeActivity() {
@ -31,7 +32,7 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
}
fun getPermissionDeniedMessage(): String {
return if (permissionDeniedMessage == null) getString(R.string.permissions_denied) else permissionDeniedMessage!!
return if (permissionDeniedMessage == null) getString(code.name.monkey.retromusic.R.string.permissions_denied) else permissionDeniedMessage!!
}
@ -80,7 +81,7 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
protected fun showOverflowMenu() {
}
protected open fun requestPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(permissions, PERMISSION_REQUEST)
@ -108,14 +109,14 @@ abstract class AbsBaseActivity : AbsThemeActivity() {
//User has deny from permission dialog
Snackbar.make(snackBarContainer, permissionDeniedMessage!!,
Snackbar.LENGTH_INDEFINITE)
.setAction(R.string.action_grant) { requestPermissions() }
.setAction(code.name.monkey.retromusic.R.string.action_grant) { requestPermissions() }
.setActionTextColor(ThemeStore.accentColor(this))
.show()
} else {
// User has deny permission and checked never show permission dialog so you can redirect to Application settings page
Snackbar.make(snackBarContainer, permissionDeniedMessage!!,
Snackbar.LENGTH_INDEFINITE)
.setAction(R.string.action_settings) {
.setAction(code.name.monkey.retromusic.R.string.action_settings) {
val intent = Intent()
intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
val uri = Uri.fromParts("package", this@AbsBaseActivity.packageName, null)

View File

@ -237,7 +237,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
slidingLayout.panelState = PanelState.COLLAPSED
}
private fun expandPanel() {
fun expandPanel() {
slidingLayout.panelState = PanelState.EXPANDED
}

View File

@ -57,16 +57,6 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
currentColorReceiver = colorReceiver
currentColorReceiverPosition = position
}
/*val fragment = getFragment(position) as AlbumCoverFragment
if (fragment != null) {
currentColorReceiver = null
currentColorReceiverPosition = -1
fragment.receiveColor(colorReceiver, position)
} else {
currentColorReceiver = colorReceiver
currentColorReceiverPosition = position
}*/
}
class AlbumCoverFragment : Fragment() {

View File

@ -65,6 +65,14 @@ class HorizontalAlbumAdapter(activity: AppCompatActivity, dataSet: ArrayList<Alb
return HorizontalAdapterHelper.getItemViewtype(position, itemCount)
}
override fun getItemCount(): Int {
return when {
dataSet.size < 5 -> dataSet.size
dataSet.size >= 5 -> 5
else -> super.getItemCount()
}
}
companion object {
val TAG: String = AlbumAdapter::class.java.simpleName
}

View File

@ -45,6 +45,7 @@ class PlayerAlbumCoverFragment : AbsMusicServiceFragment(), ViewPager.OnPageChan
//noinspection ConstantConditions
if (PreferenceUtil.getInstance().carouselEffect() &&
!((PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FULL)
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|| (PreferenceUtil.getInstance().nowPlayingScreen == NowPlayingScreen.FIT))) {
viewPager.clipToPadding = false
viewPager.setPadding(96, 0, 96, 0)

View File

@ -7,10 +7,10 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.AccelerateInterpolator
import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator
import android.widget.SeekBar
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
@ -23,11 +23,9 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_card_blur_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
import kotlinx.android.synthetic.main.volume_controls.*
class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -71,7 +69,6 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
TintHelper.setTintAuto(this, Color.BLACK, false)
setOnClickListener(PlayPauseButtonOnClickHandler())
}
}
private fun updatePlayPauseDrawableState() {
@ -83,7 +80,7 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
private fun setupVolumeControls() {
val volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
volumeFragment.tintWhiteColor()
volumeFragment.setTintable(ContextCompat.getColor(context!!, R.color.md_white_1000))
}
private fun updateProgressTextColor() {

View File

@ -0,0 +1,10 @@
<!-- drawable/pinterest.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/md_white_1000"
android:pathData="M9.04,21.54C10,21.83 10.97,22 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2A10,10 0 0,0 2,12C2,16.25 4.67,19.9 8.44,21.34C8.35,20.56 8.26,19.27 8.44,18.38L9.59,13.44C9.59,13.44 9.3,12.86 9.3,11.94C9.3,10.56 10.16,9.53 11.14,9.53C12,9.53 12.4,10.16 12.4,10.97C12.4,11.83 11.83,13.06 11.54,14.24C11.37,15.22 12.06,16.08 13.06,16.08C14.84,16.08 16.22,14.18 16.22,11.5C16.22,9.1 14.5,7.46 12.03,7.46C9.21,7.46 7.55,9.56 7.55,11.77C7.55,12.63 7.83,13.5 8.29,14.07C8.38,14.13 8.38,14.21 8.35,14.36L8.06,15.45C8.06,15.62 7.95,15.68 7.78,15.56C6.5,15 5.76,13.18 5.76,11.71C5.76,8.55 8,5.68 12.32,5.68C15.76,5.68 18.44,8.15 18.44,11.43C18.44,14.87 16.31,17.63 13.26,17.63C12.29,17.63 11.34,17.11 11,16.5L10.33,18.87C10.1,19.73 9.47,20.88 9.04,21.57V21.54Z" />
</vector>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:font="@font/circular_std_book"
android:fontStyle="normal"
android:fontWeight="400" />
<font
android:font="@font/circular_std_black"
android:fontWeight="900" />
</font-family>

Binary file not shown.

Binary file not shown.

View File

@ -46,56 +46,49 @@
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<androidx.cardview.widget.CardView
<LinearLayout
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="14dp"
app:cardElevation="0dp">
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textStyle="bold"
tools:ignore="MissingPrefix"
tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix"
tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix"
tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix"
tools:text="Title" />
</LinearLayout>
<include layout="@layout/activity_artist_content" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<include layout="@layout/activity_artist_content" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
@ -111,8 +104,8 @@
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="10dp"
app:showTitle="true"
app:setIcon="@drawable/ic_shuffle_white_24dp"
app:setText="@string/action_shuffle_all"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_black_1000" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -15,7 +15,6 @@
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/history"
android:layout_width="match_parent"

View File

@ -26,8 +26,10 @@
android:maxLines="2"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:shadowColor="@color/md_black_1000"
android:shadowRadius="8"
android:text="@string/normal_lyrics"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
android:textColor="@color/md_white_1000" />
<TextView
@ -38,8 +40,10 @@
android:maxLines="1"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:shadowColor="@color/md_grey_800"
android:shadowRadius="6"
android:text="@string/normal_lyrics"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textColor="@color/md_white_1000" />
</LinearLayout>

View File

@ -3,8 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<LinearLayout
@ -98,8 +98,10 @@
android:id="@+id/inputDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:hint="@string/description"
android:inputType="textCapSentences" />
android:inputType="textMultiLine"
android:minLines="3" />
</com.google.android.material.textfield.TextInputLayout>

View File

@ -23,6 +23,48 @@
android:orientation="vertical">
<LinearLayout
android:id="@+id/pinterestLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
android:clickable="true"
android:focusable="true"
android:minHeight="@dimen/md_listitem_height"
android:orientation="horizontal"
tools:ignore="PrivateResource">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_pinterest_white_24dp"
app:tint="@color/md_white_1000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="12dp"
android:paddingTop="8dp"
android:paddingEnd="12dp"
android:paddingBottom="8dp">
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/pinterest_page"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.85"
android:text="@string/pinterest_page_summary" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/instagramLink"
android:layout_width="match_parent"
@ -38,7 +80,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_instagram"
app:srcCompat="@drawable/ic_instagram_white_24dp"
app:tint="@color/md_white_1000" />
<LinearLayout

View File

@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:gravity="center"
android:text="Christmas offer"
android:text="Christmas &amp; New year offer"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
android:textColor="@android:color/black" />
</FrameLayout>

View File

@ -8,7 +8,8 @@
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center">
<com.google.android.material.card.MaterialCardView
android:id="@+id/player_album_art_frame"

View File

@ -22,7 +22,6 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/title"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="end"

View File

@ -82,16 +82,17 @@
android:layout_marginBottom="2dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="16sp"/>
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textSize="16sp" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/text"
style="@style/TextAppearance.AppCompat.Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1" />
android:maxLines="1"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" />
</LinearLayout>
<code.name.monkey.retromusic.views.IconImageView

View File

@ -1 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@mipmap/ic_launcher_background"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/> </adaptive-icon>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@mipmap/ic_launcher_background"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/> </adaptive-icon>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -526,7 +526,7 @@
<string name="made_with_love">Made with ❤️ in India</string>
<string name="clear_app_data">Clear app data</string>
<string name="bug_report_summary">An unexpected error occurred. Sorry you found this bug, if it
keeps crashing \"Clear app data\" or Send an Email </string>
keeps crashing \"Clear app data\" or send an Email </string>
<string name="error">Error</string>
<string name="base_color_theme">Base color theme</string>
<string name="now_playing_themes">9+ now playing themes</string>
@ -591,4 +591,6 @@
<string name="pref_title_blacklist">Blacklist</string>
<string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string>
<string name="send_crash_log">Send crash log</string>
<string name="pinterest_page">Pinterest</string>
<string name="pinterest_page_summary">Hmm</string>
</resources>

View File

@ -43,6 +43,7 @@
<style name="ToolbarTextAppearance">
<item name="android:textStyle">bold</item>
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="BigTitleTextAppearance">
@ -67,7 +68,7 @@
<style name="SubTitleTextAppearance">
<item name="android:textStyle">bold</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Subhead</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_gravity">start|center_vertical</item>
<item name="android:padding">12dp</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>

View File

@ -25,7 +25,7 @@
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
@ -65,6 +65,7 @@
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">
@ -105,6 +106,7 @@
<item name="android:windowSharedElementEnterTransition">@transition/grid_exit</item>
<item name="android:windowSharedElementExitTransition">@transition/grid_exit</item>
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="Theme.RetroMusic.Base.Color" parent="@style/Theme.RetroMusic.Base">

View File

@ -29,7 +29,7 @@
android:title="@string/pref_title_toggle_carousel_effect"
app:iconSpaceReserved="false" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference
<SeekBarPreference
android:defaultValue="12"
android:key="new_blur_amount"
android:max="25"

View File

@ -22,7 +22,7 @@ object ATH {
@SuppressLint("CommitPrefEdits")
fun didThemeValuesChange(context: Context, since: Long): Boolean {
return ThemeStore.isConfigured(context) && ThemeStore.prefs(context).getLong(ThemeStore.VALUES_CHANGED, -1) > since
return ThemeStore.isConfigured(context) && ThemeStore.prefs(context).getLong(ThemeStorePrefKeys.VALUES_CHANGED, -1) > since
}
fun setStatusbarColorAuto(activity: Activity) {
@ -105,7 +105,7 @@ object ATH {
// Task description requires fully opaque color
colorFinal = ColorUtil.stripAlpha(colorFinal)
// Sets color of entry in the system recents page
activity.setTaskDescription(ActivityManager.TaskDescription(activity.title as String, null, colorFinal))
activity.setTaskDescription(ActivityManager.TaskDescription(activity.title as String?, null, colorFinal))
}
}

View File

@ -182,7 +182,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
}
@CheckResult
protected fun prefs(context: Context): SharedPreferences {
fun prefs(context: Context): SharedPreferences {
return context.getSharedPreferences(ThemeStorePrefKeys.CONFIG_PREFS_KEY_DEFAULT, Context.MODE_PRIVATE)
}

View File

@ -1,15 +1,12 @@
package code.name.monkey.appthemehelper.common.prefs
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import android.preference.CheckBoxPreference
import android.preference.Preference
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.CheckBox
import code.name.monkey.appthemehelper.ATH
import code.name.monkey.appthemehelper.R
import code.name.monkey.appthemehelper.ThemeStore
@ -17,12 +14,25 @@ import code.name.monkey.appthemehelper.ThemeStore
/**
* @author Aidan Follestad (afollestad)
*/
class ATECheckBoxPreference @TargetApi(Build.VERSION_CODES.LOLLIPOP) constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : CheckBoxPreference(context, attrs, defStyleAttr, defStyleRes) {
class ATECheckBoxPreference : CheckBoxPreference {
init {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
layoutResource = R.layout.ate_preference_custom

View File

@ -4,23 +4,34 @@ import android.content.Context
import android.preference.Preference
import android.util.AttributeSet
import android.view.View
import code.name.monkey.appthemehelper.R
/**
* @author Aidan Follestad (afollestad)
*/
class ATEColorPreference(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : Preference(context, attrs, defStyleAttr) {
class ATEColorPreference : Preference {
private var mView: View? = null
private var color: Int = 0
private var border: Int = 0
init {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
layoutResource = R.layout.ate_preference_custom
widgetLayoutResource = R.layout.ate_preference_color

View File

@ -1,6 +1,7 @@
package code.name.monkey.appthemehelper.common.prefs
import android.content.Context
import android.util.AttributeSet
import code.name.monkey.appthemehelper.R
import com.afollestad.materialdialogs.prefs.MaterialDialogPreference
@ -8,12 +9,25 @@ import com.afollestad.materialdialogs.prefs.MaterialDialogPreference
/**
* @author Aidan Follestad (afollestad)
*/
class ATEDialogPreference(context: Context) : MaterialDialogPreference(context) {
class ATEDialogPreference : MaterialDialogPreference {
init {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
layoutResource = R.layout.ate_preference_custom
}

View File

@ -8,12 +8,25 @@ import com.afollestad.materialdialogs.prefs.MaterialEditTextPreference
/**
* @author Aidan Follestad (afollestad)
*/
class ATEEditTextPreference(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : MaterialEditTextPreference(context, attrs, defStyleAttr, defStyleRes) {
class ATEEditTextPreference : MaterialEditTextPreference {
init {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
layoutResource = code.name.monkey.appthemehelper.R.layout.ate_preference_custom
}

View File

@ -2,16 +2,27 @@ package code.name.monkey.appthemehelper.common.prefs
import android.content.Context
import android.util.AttributeSet
import com.afollestad.materialdialogs.prefs.MaterialListPreference
import code.name.monkey.appthemehelper.R
import com.afollestad.materialdialogs.prefs.MaterialListPreference
/**
* @author Aidan Follestad (afollestad)
*/
class ATEMultiSelectPreference(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : MaterialListPreference(context, attrs, defStyleAttr, defStyleRes) {
class ATEMultiSelectPreference : MaterialListPreference {
init {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}

View File

@ -1,23 +1,32 @@
package code.name.monkey.appthemehelper.common.prefs
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import android.preference.Preference
import android.util.AttributeSet
import code.name.monkey.appthemehelper.R
/**
* @author Aidan Follestad (afollestad)
*/
class ATEPreference @TargetApi(Build.VERSION_CODES.LOLLIPOP) constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : Preference(context, attrs, defStyleAttr, defStyleRes) {
init {
init(context, attrs)
class ATEPreference : Preference {
constructor(context: Context) : super(context) {
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
layoutResource = R.layout.ate_preference_custom
}
}

View File

@ -1,16 +1,28 @@
package code.name.monkey.appthemehelper.common.prefs
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import android.preference.PreferenceCategory
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
import code.name.monkey.appthemehelper.ThemeStore
class ATEPreferenceCategory @TargetApi(Build.VERSION_CODES.LOLLIPOP) constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : PreferenceCategory(context, attrs, defStyleAttr, defStyleRes) {
class ATEPreferenceCategory : PreferenceCategory {
constructor(context: Context) : super(context) {
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
}
override fun onBindView(view: View) {
super.onBindView(view)

View File

@ -1,11 +1,8 @@
package code.name.monkey.appthemehelper.common.prefs.supportv7
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.preference.CheckBoxPreference
import android.util.AttributeSet
import androidx.preference.CheckBoxPreference
import code.name.monkey.appthemehelper.R
@ -15,23 +12,22 @@ import code.name.monkey.appthemehelper.R
class ATECheckBoxPreference : CheckBoxPreference {
constructor(context: Context) : super(context) {
init(context, null)
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
init()
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_custom_support
widgetLayoutResource = R.layout.ate_preference_checkbox
}

View File

@ -13,22 +13,22 @@ import code.name.monkey.appthemehelper.R
open class ATEDialogPreference : DialogPreference {
constructor(context: Context) : super(context) {
init(context, null)
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_custom_support
}
}

View File

@ -10,25 +10,26 @@ import code.name.monkey.appthemehelper.R
/**
* @author Aidan Follestad (afollestad)
*/
class ATEEditTextPreference : EditTextPreference {
class ATEEditTextPreference : EditTextPreference {
constructor(context: Context) : super(context) {
init(context, null)
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_custom_support
}
}

View File

@ -12,22 +12,22 @@ import code.name.monkey.appthemehelper.R
class ATEListPreference : ListPreference {
constructor(context: Context) : super(context) {
init(context, null)
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_custom_support
if (summary == null || summary.toString().trim { it <= ' ' }.isEmpty())
summary = "%s"

View File

@ -1,11 +1,8 @@
package code.name.monkey.appthemehelper.common.prefs.supportv7
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.preference.Preference
import android.util.AttributeSet
import androidx.preference.Preference
import code.name.monkey.appthemehelper.R
/**
@ -14,23 +11,23 @@ import code.name.monkey.appthemehelper.R
class ATEPreference : Preference {
constructor(context: Context) : super(context) {
init(context, null)
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
init()
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
init()
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_custom_support
}
}

View File

@ -1,42 +1,39 @@
package code.name.monkey.appthemehelper.common.prefs.supportv7
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceViewHolder
import android.util.AttributeSet
import android.widget.TextView
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceViewHolder
import code.name.monkey.appthemehelper.R
import code.name.monkey.appthemehelper.ThemeStore
class ATEPreferenceCategory : PreferenceCategory {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init(context, attrs)
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context, attrs)
init()
}
constructor(context: Context) : super(context) {
init(context, null)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
override fun onBindViewHolder(holder: PreferenceViewHolder) {
super.onBindViewHolder(holder)
val mTitle = holder.itemView as TextView
mTitle.setTextColor(ThemeStore.accentColor(context))
}
private fun init(context: Context, attrs: AttributeSet?) {
private fun init() {
layoutResource = R.layout.ate_preference_category
}
}

View File

@ -2,7 +2,37 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7
import android.content.Context
import android.util.AttributeSet
import android.widget.SeekBar
import androidx.preference.PreferenceViewHolder
import androidx.preference.SeekBarPreference
import code.name.monkey.appthemehelper.R
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.TintHelper
class ATESeekBarPreference(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : SeekBarPreference(context, attrs, defStyleAttr, defStyleRes)
class ATESeekBarPreference : SeekBarPreference {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
init()
}
private fun init() {
}
override fun onBindViewHolder(view: PreferenceViewHolder) {
super.onBindViewHolder(view)
val seekBar = view.findViewById(R.id.seekbar) as SeekBar
TintHelper.setTintAuto(seekBar, ThemeStore.accentColor(context), true)
}
}

View File

@ -14,8 +14,8 @@ object ATHUtil {
}
@JvmOverloads
fun resolveColor(context: Context, @AttrRes attr: Int, fallback: Int = 0): Int {
val a = context.theme.obtainStyledAttributes(intArrayOf(attr))
fun resolveColor(context: Context?, @AttrRes attr: Int, fallback: Int = 0): Int {
val a = context!!.theme.obtainStyledAttributes(intArrayOf(attr))
try {
return a.getColor(0, fallback)
} finally {

View File

@ -12,33 +12,33 @@ object MaterialValueHelper {
@SuppressLint("PrivateResource")
@ColorInt
fun getPrimaryTextColor(context: Context, dark: Boolean): Int {
fun getPrimaryTextColor(context: Context?, dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(context, R.color.primary_text_default_material_light)
} else ContextCompat.getColor(context, R.color.primary_text_default_material_dark)
ContextCompat.getColor(context!!, R.color.primary_text_default_material_light)
} else ContextCompat.getColor(context!!, R.color.primary_text_default_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun getSecondaryTextColor(context: Context, dark: Boolean): Int {
fun getSecondaryTextColor(context: Context?, dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(context, R.color.secondary_text_default_material_light)
} else ContextCompat.getColor(context, R.color.secondary_text_default_material_dark)
ContextCompat.getColor(context!!, R.color.secondary_text_default_material_light)
} else ContextCompat.getColor(context!!, R.color.secondary_text_default_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun getPrimaryDisabledTextColor(context: Context, dark: Boolean): Int {
fun getPrimaryDisabledTextColor(context: Context?, dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(context, R.color.primary_text_disabled_material_light)
} else ContextCompat.getColor(context, R.color.primary_text_disabled_material_dark)
ContextCompat.getColor(context!!, R.color.primary_text_disabled_material_light)
} else ContextCompat.getColor(context!!, R.color.primary_text_disabled_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun getSecondaryDisabledTextColor(context: Context, dark: Boolean): Int {
fun getSecondaryDisabledTextColor(context: Context?, dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(context, R.color.secondary_text_disabled_material_light)
} else ContextCompat.getColor(context, R.color.secondary_text_disabled_material_dark)
ContextCompat.getColor(context!!, R.color.secondary_text_disabled_material_light)
} else ContextCompat.getColor(context!!, R.color.secondary_text_disabled_material_dark)
}
}