Change status bar color on multi-selection
This commit is contained in:
parent
b2a1cb1e2e
commit
4abf9645e0
1 changed files with 6 additions and 2 deletions
|
@ -6,9 +6,11 @@ import android.view.MenuItem
|
||||||
import androidx.annotation.MenuRes
|
import androidx.annotation.MenuRes
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.interfaces.ICabCallback
|
import code.name.monkey.retromusic.interfaces.ICabCallback
|
||||||
import code.name.monkey.retromusic.interfaces.ICabHolder
|
import code.name.monkey.retromusic.interfaces.ICabHolder
|
||||||
|
import code.name.monkey.retromusic.util.RetroColorUtil
|
||||||
import com.afollestad.materialcab.attached.AttachedCab
|
import com.afollestad.materialcab.attached.AttachedCab
|
||||||
import com.afollestad.materialcab.attached.destroy
|
import com.afollestad.materialcab.attached.destroy
|
||||||
import com.afollestad.materialcab.attached.isActive
|
import com.afollestad.materialcab.attached.isActive
|
||||||
|
@ -21,6 +23,8 @@ abstract class AbsMultiSelectAdapter<V : RecyclerView.ViewHolder?, I>(
|
||||||
private val checked: MutableList<I>
|
private val checked: MutableList<I>
|
||||||
private var menuRes: Int
|
private var menuRes: Int
|
||||||
override fun onCabCreated(cab: AttachedCab, menu: Menu): Boolean {
|
override fun onCabCreated(cab: AttachedCab, menu: Menu): Boolean {
|
||||||
|
activity.window.statusBarColor =
|
||||||
|
RetroColorUtil.shiftBackgroundColor(ATHUtil.resolveColor(activity, R.attr.colorSurface))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +60,8 @@ abstract class AbsMultiSelectAdapter<V : RecyclerView.ViewHolder?, I>(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract fun getIdentifier(position: Int): I?
|
protected abstract fun getIdentifier(position: Int): I?
|
||||||
protected open fun getName(`object`: I): String? {
|
protected open fun getName(i: I): String? {
|
||||||
return `object`.toString()
|
return i.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun isChecked(identifier: I): Boolean {
|
protected fun isChecked(identifier: I): Boolean {
|
||||||
|
|
Loading…
Reference in a new issue