minor fixes
This commit is contained in:
parent
cbe73ed5e4
commit
96aa205405
8 changed files with 147 additions and 127 deletions
|
@ -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<TextView>) {
|
||||
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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -2,9 +2,4 @@ package code.name.monkey.retromusic.ui.activities.base;
|
|||
|
||||
abstract public class AbsCheckPiracy extends AbsBaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue