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()
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="6dp"
|
||||
android:layout_marginEnd="58dp"
|
||||
android:layout_marginStart="58dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
app:iconBackgroundColor="@color/md_blue_A700"
|
||||
app:iconBackgroundColor="@color/md_blue_500"
|
||||
app:srcCompat="@drawable/ic_access_time_white_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
@ -77,7 +77,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
app:iconBackgroundColor="@color/md_red_A700"
|
||||
app:iconBackgroundColor="@color/md_red_500"
|
||||
app:srcCompat="@drawable/ic_library_add_white_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
@ -101,7 +101,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
app:iconBackgroundColor="@color/md_deep_purple_A700"
|
||||
app:iconBackgroundColor="@color/md_deep_purple_500"
|
||||
app:srcCompat="@drawable/ic_trending_up_white_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
@ -125,7 +125,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
app:iconBackgroundColor="@color/md_green_A700"
|
||||
app:iconBackgroundColor="@color/md_green_500"
|
||||
app:srcCompat="@drawable/ic_shuffle_white_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
|
|
@ -69,7 +69,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_margin="8dp">
|
||||
android:layout_margin="8dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<code.name.monkey.retromusic.views.CircularImageView
|
||||
android:id="@+id/userImage"
|
||||
|
@ -102,6 +103,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:visibility="gone"
|
||||
app:hintAnimationEnabled="true">
|
||||
|
||||
|
||||
|
@ -123,6 +125,7 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:visibility="gone"
|
||||
app:hintAnimationEnabled="true">
|
||||
|
||||
|
||||
|
|
|
@ -89,7 +89,8 @@
|
|||
android:descendantFocusability="blocksDescendants"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<include layout="@layout/abs_playlists" />
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<!-- Deep Purple -->
|
||||
<color name="md_deep_purple_A400">#651FFF</color>
|
||||
<color name="md_deep_purple_500A12">#30673AB7</color>
|
||||
<color name="md_deep_purple_500">#673AB7</color>
|
||||
<color name="md_deep_purple_A700">#6200EA</color>
|
||||
|
||||
<!-- Indigo -->
|
||||
|
@ -36,6 +37,7 @@
|
|||
|
||||
<color name="md_green_A200">#69F0AE</color>
|
||||
<color name="md_green_A700">#00C853</color>
|
||||
<color name="md_green_500">#4CAF50</color>
|
||||
<color name="md_green_500A12">#304CAF50</color>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue