Fix color for list dialog

This commit is contained in:
h4h13 2019-09-29 21:35:54 +05:30
parent 2fd6db60ac
commit 9fc6f6ab10
3 changed files with 34 additions and 4 deletions

View file

@ -13,8 +13,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 372
versionName '3.4.000'
versionCode 375
versionName '3.4.100-beta01'
multiDexEnabled true

View file

@ -1,11 +1,14 @@
package code.name.monkey.retromusic.fragments.base
import android.graphics.Canvas
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.NonNull
import androidx.annotation.StringRes
import androidx.core.view.ViewCompat
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.retromusic.R
@ -41,6 +44,33 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
}
recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter
val itemTouchHelper = ItemTouchHelper(object : ItemTouchHelper.Callback() {
override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder): Int {
return -1
}
override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
return false
}
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
}
override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) {
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
ViewCompat.animate(viewHolder.itemView)
.scaleX(0.9f)
.scaleY(0.9f)
.start()
}
override fun onChildDrawOver(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder?, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) {
super.onChildDrawOver(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
}
})
itemTouchHelper.attachToRecyclerView(recyclerView())
}
private fun initAdapter() {

View file

@ -57,7 +57,7 @@
<item name="colorSurface">@color/darkColorSurface</item>
<item name="colorOnSurface">@color/mi_text_color_primary_dark</item>
<item name="colorOnBackground">@color/mi_text_color_secondary_dark</item>
<item name="colorControlNormal">@color/mi_text_color_secondary_light</item>
<item name="colorControlNormal">@color/md_white_1000</item>
</style>
<style name="Theme.RetroMusic.Base.Black" parent="@style/Theme.RetroMusic.Base">
@ -93,7 +93,7 @@
<item name="colorSurface">@color/blackColorSurface</item>
<item name="colorOnSurface">@color/mi_text_color_primary_dark</item>
<item name="colorOnBackground">@color/mi_text_color_secondary_dark</item>
<item name="colorControlNormal">@color/mi_text_color_secondary_light</item>
<item name="colorControlNormal">@color/md_white_1000</item>
</style>
<style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar">