diff --git a/app/src/main/java/code/name/monkey/retromusic/Injection.kt b/app/src/main/java/code/name/monkey/retromusic/Injection.kt index a2c772fd..8023706e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/Injection.kt +++ b/app/src/main/java/code/name/monkey/retromusic/Injection.kt @@ -28,8 +28,4 @@ object Injection { fun provideSchedulerProvider(): BaseSchedulerProvider { return SchedulerProvider.getInstance() } - - fun provideKuGouApiService(): KuGouApiService { - return KogouClient().apiService - } } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt index 8c36a911..30a72cca 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt @@ -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) + } } } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt index 601b7567..4f598139 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt @@ -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) diff --git a/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt b/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt index 5d95bb23..cff272f2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt +++ b/app/src/main/java/code/name/monkey/retromusic/preferences/MaterialListPreference.kt @@ -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() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt index 1d8ff139..5c7fe4e4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt +++ b/app/src/main/java/code/name/monkey/retromusic/views/ColorIconsImageView.kt @@ -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() } diff --git a/app/src/main/res/layout-land/fragment_banner_home.xml b/app/src/main/res/layout-land/fragment_banner_home.xml index 7aa5128c..2b0d1a1e 100644 --- a/app/src/main/res/layout-land/fragment_banner_home.xml +++ b/app/src/main/res/layout-land/fragment_banner_home.xml @@ -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"> diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml index 6dfdc425..1af2a010 100644 --- a/app/src/main/res/layout/abs_playlists.xml +++ b/app/src/main/res/layout/abs_playlists.xml @@ -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" /> + android:layout_margin="8dp" + android:visibility="gone"> @@ -123,6 +125,7 @@ android:layout_marginStart="16dp" android:layout_marginTop="8dp" android:layout_marginEnd="16dp" + android:visibility="gone" app:hintAnimationEnabled="true"> diff --git a/app/src/main/res/layout/fragment_banner_home.xml b/app/src/main/res/layout/fragment_banner_home.xml index ca03d9c4..52b538ee 100644 --- a/app/src/main/res/layout/fragment_banner_home.xml +++ b/app/src/main/res/layout/fragment_banner_home.xml @@ -89,7 +89,8 @@ android:descendantFocusability="blocksDescendants" android:focusable="true" android:focusableInTouchMode="true" - android:orientation="vertical"> + android:orientation="vertical" + android:paddingTop="8dp"> diff --git a/appthemehelper/src/main/res/values/colors_material_design.xml b/appthemehelper/src/main/res/values/colors_material_design.xml index 4084a5e2..3fd119ce 100755 --- a/appthemehelper/src/main/res/values/colors_material_design.xml +++ b/appthemehelper/src/main/res/values/colors_material_design.xml @@ -21,6 +21,7 @@ #651FFF #30673AB7 + #673AB7 #6200EA @@ -36,6 +37,7 @@ #69F0AE #00C853 + #4CAF50 #304CAF50