Fix banner, shortcut colors
This commit is contained in:
parent
a271a180b5
commit
192ceb4438
10 changed files with 32 additions and 37 deletions
|
@ -28,8 +28,4 @@ object Injection {
|
|||
fun provideSchedulerProvider(): BaseSchedulerProvider {
|
||||
return SchedulerProvider.getInstance()
|
||||
}
|
||||
|
||||
fun provideKuGouApiService(): KuGouApiService {
|
||||
return KogouClient().apiService
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.os.Bundle
|
|||
import android.provider.DocumentsContract
|
||||
import android.provider.MediaStore
|
||||
import android.provider.MediaStore.Images.Media.getBitmap
|
||||
import android.text.TextUtils
|
||||
import android.view.MenuItem
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.FileProvider
|
||||
|
@ -77,7 +76,7 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
showBannerOptions()
|
||||
}
|
||||
next.setOnClickListener {
|
||||
val nameString = name.text.toString().trim { it <= ' ' }
|
||||
/*val nameString = name.text.toString().trim { it <= ' ' }
|
||||
if (TextUtils.isEmpty(nameString)) {
|
||||
Toast.makeText(this, "Umm name is empty", Toast.LENGTH_SHORT).show()
|
||||
return@setOnClickListener
|
||||
|
@ -89,7 +88,7 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
|
||||
}
|
||||
PreferenceUtil.getInstance().userName = nameString
|
||||
PreferenceUtil.getInstance().userBio = bioString
|
||||
PreferenceUtil.getInstance().userBio = bioString*/
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
|
@ -193,11 +192,12 @@ class UserInfoActivity : AbsBaseActivity() {
|
|||
}
|
||||
}
|
||||
CROP_BANNER_REQUEST -> {
|
||||
val extras: Bundle = data.extras!!
|
||||
val selectedBitmap: Bitmap = extras.getParcelable("data")
|
||||
val profileImagePath = saveToInternalStorage(selectedBitmap, USER_BANNER)
|
||||
PreferenceUtil.getInstance().saveProfileImage(profileImagePath)
|
||||
loadImageFromStorage(profileImagePath)
|
||||
val selectedBitmap: Bitmap? = data.extras?.getParcelable("date")
|
||||
val profileImagePath = selectedBitmap?.let { saveToInternalStorage(it, USER_BANNER) }
|
||||
profileImagePath?.let {
|
||||
PreferenceUtil.getInstance().saveProfileImage(it)
|
||||
loadImageFromStorage(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,9 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
toolbar = view.findViewById(R.id.toolbar)
|
||||
|
||||
bannerImage?.setOnClickListener {
|
||||
NavigationUtil.goToUserInfo(activity!!)
|
||||
}
|
||||
if (!PreferenceUtil.getInstance().isHomeBanner)
|
||||
setStatusbarColorAuto(view)
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
|
|||
|
||||
val entries = arguments?.getStringArrayList(EXTRA_ENTRIES)
|
||||
val entriesValues = arguments?.getStringArrayList(EXTRA_ENTRIES_VALUES)
|
||||
return MaterialDialog(activity!!, BottomSheet())
|
||||
materialDialog = MaterialDialog(activity!!, BottomSheet())
|
||||
.show {
|
||||
title(text = materialListPreference.title.toString())
|
||||
positiveButton(R.string.set)
|
||||
|
@ -89,11 +89,14 @@ class MaterialListPreferenceDialog : PreferenceDialogFragmentCompat() {
|
|||
dismiss()
|
||||
}
|
||||
}
|
||||
return materialDialog
|
||||
}
|
||||
|
||||
private lateinit var materialDialog: MaterialDialog
|
||||
|
||||
override fun onDialogClosed(positiveResult: Boolean) {
|
||||
if (positiveResult) {
|
||||
dismiss()
|
||||
materialDialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ import android.content.res.ColorStateList
|
|||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
|
||||
|
@ -47,20 +45,8 @@ class ColorIconsImageView : AppCompatImageView {
|
|||
|
||||
private fun setIconBackgroundColor(color: Int) {
|
||||
setBackgroundResource(R.drawable.color_circle_gradient)
|
||||
|
||||
val alpha = if (ATHUtil.isWindowBackgroundDark(context)) {
|
||||
1.0f
|
||||
} else {
|
||||
0.12f
|
||||
}
|
||||
val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) {
|
||||
ThemeStore.primaryColor(context)
|
||||
} else {
|
||||
color
|
||||
}
|
||||
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, alpha))
|
||||
imageTintList = ColorStateList.valueOf(filterColor)
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
|
||||
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))
|
||||
requestLayout()
|
||||
invalidate()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue