diff --git a/app/app.iml b/app/app.iml index 200f1b2d..0254e2ab 100644 --- a/app/app.iml +++ b/app/app.iml @@ -56,7 +56,6 @@ - @@ -70,7 +69,6 @@ - @@ -154,6 +152,8 @@ + + @@ -205,86 +205,86 @@ - + - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + + + - - - + + - - - + + + + + + + - - - + + + + - - - - - + + - + + - - - + + - - + + + + + - - - - - - - - - + + + - + + - - - - - + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 5c5ee566..ff8fe881 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,24 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +static def gitBranch() { + def branch = 'GitHub' + try { + def gitcheck = 'command -v git >/dev/null 2>&1'.execute() + gitcheck.waitFor() + if (gitcheck.exitValue() == 0) { + def proc = 'git rev-parse --abbrev-ref HEAD'.execute() + proc.in.eachLine { line -> branch = line } + proc.err.eachLine { line -> println line } + proc.waitFor() + } + } catch (Exception e) { + // Do nothing + println e + } + branch +} + android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -13,8 +31,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 260 - versionName '3.0.010' + versionCode 262 + versionName '3.0.030' multiDexEnabled true @@ -39,7 +57,7 @@ android { } debug { applicationIdSuffix '.debug' - versionNameSuffix ' DEBUG' + versionNameSuffix ' DEBUG (' + gitBranch() + ')' resValue "string", "cast_app_id", "BA9C3F5E" } @@ -56,6 +74,7 @@ android { } sans { dimension "default" + versionName defaultConfig.versionName + "_" + getDate() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/dialogs/SongDetailDialog.kt b/app/src/main/java/code/name/monkey/retromusic/dialogs/SongDetailDialog.kt index 412fef9e..1465a31d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/dialogs/SongDetailDialog.kt +++ b/app/src/main/java/code/name/monkey/retromusic/dialogs/SongDetailDialog.kt @@ -23,20 +23,33 @@ import org.jaudiotagger.tag.TagException import java.io.File import java.io.IOException +inline fun ViewGroup.forEach(action: (View) -> Unit) { + for (i in 0 until childCount) { + action(getChildAt(i)) + } +} + class SongDetailDialog : RoundedBottomSheetDialogFragment() { - private fun setTextColor(textColor: List) { - for (textView in textColor) { - - textView.setTextColor(ThemeStore.textColorPrimary(context!!)) + private fun setTextColor(view: ViewGroup) { + view.forEach { + if (it is TextView) { + it.setTextColor(ThemeStore.textColorPrimary(context!!)) + } } } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - val dialogView = inflater.inflate(R.layout.dialog_file_details, container, false) - val context = context + return inflater.inflate(R.layout.dialog_file_details, container, false) + } - fileName.text = makeTextWithTitle(context!!, R.string.label_file_name, "-") + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + val context = context!! + + setTextColor(view as ViewGroup) + + fileName.text = makeTextWithTitle(context, R.string.label_file_name, "-") filePath.text = makeTextWithTitle(context, R.string.label_file_path, "-") fileSize.text = makeTextWithTitle(context, R.string.label_file_size, "-") fileFormat.text = makeTextWithTitle(context, R.string.label_file_format, "-") @@ -83,13 +96,11 @@ class SongDetailDialog : RoundedBottomSheetDialogFragment() { trackLength.text = makeTextWithTitle(context, R.string.label_track_length, MusicUtil.getReadableDurationString(song.duration)) } } - - return dialogView } companion object { - val TAG = SongDetailDialog::class.java.simpleName + val TAG: String = SongDetailDialog::class.java.simpleName fun create(song: Song): SongDetailDialog { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt index f6cb35c1..7aa0640d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.kt @@ -60,17 +60,17 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener { setTaskDescriptionColorAuto() setNavigationbarColorAuto() - - toolbar.setBackgroundColor(ThemeStore.primaryColor(this)) - toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(this@LyricsActivity, R.drawable.ic_keyboard_backspace_black_24dp), ThemeStore.textColorSecondary(this@LyricsActivity)) appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this)) - setSupportActionBar(toolbar) + toolbar.apply { + setBackgroundColor(ThemeStore.primaryColor(this@LyricsActivity)) + navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(this@LyricsActivity, R.drawable.ic_keyboard_backspace_black_24dp), ThemeStore.textColorSecondary(this@LyricsActivity)) + setSupportActionBar(toolbar) + } TintHelper.setTintAuto(fab, ThemeStore.accentColor(this), true) setupWakelock() - viewPager.apply { adapter = PagerAdapter(supportFragmentManager) } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCheckPiracy.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCheckPiracy.java index eedd49ed..8d154c83 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCheckPiracy.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCheckPiracy.java @@ -2,9 +2,4 @@ package code.name.monkey.retromusic.ui.activities.base; abstract public class AbsCheckPiracy extends AbsBaseActivity { - @Override - protected void onStart() { - super.onStart(); - - } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.kt index 52ce65b3..c12d4fdb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.kt @@ -41,8 +41,8 @@ class BlurPlayerFragment : AbsPlayerFragment() { } private fun setUpSubFragments() { - playbackControlsFragment = childFragmentManager.findFragmentById(R.id.playback_controls_fragment) as BlurPlaybackControlsFragment - val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.player_album_cover_fragment) as PlayerAlbumCoverFragment + playbackControlsFragment = childFragmentManager.findFragmentById(R.id.playbackControlsFragment) as BlurPlaybackControlsFragment + val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment playerAlbumCoverFragment.setCallbacks(this) } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/PersonaizeSettingsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/PersonaizeSettingsFragment.kt index ea0eba88..a5346510 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/PersonaizeSettingsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/PersonaizeSettingsFragment.kt @@ -1,17 +1,11 @@ package code.name.monkey.retromusic.ui.fragments.settings -import android.app.ActivityManager -import android.app.admin.DevicePolicyManager -import android.content.ComponentName -import android.content.Context -import android.content.Intent import android.content.SharedPreferences import android.os.Bundle import android.view.View import androidx.preference.TwoStatePreference import code.name.monkey.retromusic.App import code.name.monkey.retromusic.R -import code.name.monkey.retromusic.ui.activities.SettingsActivity.Companion.RESULT_ENABLE import code.name.monkey.retromusic.util.PreferenceUtil @@ -47,7 +41,7 @@ class PersonaizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnSh override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) PreferenceUtil.getInstance().registerOnSharedPreferenceChangedListener(this) - } + } override fun onDestroyView() { super.onDestroyView() diff --git a/appthemehelper/appthemehelper.iml b/appthemehelper/appthemehelper.iml index 01687c49..948cb99c 100644 --- a/appthemehelper/appthemehelper.iml +++ b/appthemehelper/appthemehelper.iml @@ -64,7 +64,6 @@ - @@ -113,6 +112,8 @@ + + @@ -136,47 +137,47 @@ - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + + + + - - + - + - - - - - + - - - - - - - - - - + + + + + + \ No newline at end of file