style: fix style issues
Fix some style issues that came from the colorAccent reworks.
This commit is contained in:
@@ -134,7 +134,6 @@ class MainFragment : Fragment() {
|
||||
*/
|
||||
private fun navigateWithItem(navController: NavController, item: MenuItem): Boolean {
|
||||
if (navController.currentDestination!!.id != item.itemId) {
|
||||
// Create custom NavOptions myself so that animations work
|
||||
val options = NavOptions.Builder()
|
||||
.setLaunchSingleTop(true)
|
||||
.setEnterAnim(R.animator.nav_default_enter_anim)
|
||||
|
||||
@@ -56,7 +56,7 @@ class PlaybackFragment : Fragment(), SeekBar.OnSeekBarChangeListener {
|
||||
): View {
|
||||
val normalTextColor = binding.playbackDurationCurrent.currentTextColor
|
||||
val accentColor = Accent.get().getStateList(requireContext())
|
||||
val controlColor = R.color.control_color.toStateList(requireContext())
|
||||
val controlColor = R.color.control.toStateList(requireContext())
|
||||
|
||||
// Can't set the tint of a MenuItem below Android 8, so use icons instead.
|
||||
val iconQueueActive = R.drawable.ic_queue.toDrawable(requireContext())
|
||||
|
||||
@@ -436,14 +436,14 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable animation on CompactPlaybackFragment
|
||||
* Enable animation on the play/pause button, usually done after the first LiveData fire
|
||||
*/
|
||||
fun enableAnimation() {
|
||||
mCanAnimate = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable animation on CompactPlaybackFragment
|
||||
* Disable animation on play/pause button, usually done after when a UI is created
|
||||
*/
|
||||
fun disableAnimation() {
|
||||
mCanAnimate = false
|
||||
|
||||
@@ -84,7 +84,7 @@ class AccentAdapter(
|
||||
selectedViewHolder?.setSelected(false)
|
||||
selectedViewHolder = this
|
||||
|
||||
R.color.surface_color.toStateList(context)
|
||||
R.color.surface.toStateList(context)
|
||||
} else {
|
||||
android.R.color.transparent.toStateList(context)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import org.oxycblt.auxio.BuildConfig
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.DialogAccentBinding
|
||||
import org.oxycblt.auxio.logD
|
||||
@@ -102,6 +103,6 @@ class AccentDialog : LifecycleDialog() {
|
||||
|
||||
companion object {
|
||||
const val TAG = "TAG_ACCENT_DIALOG"
|
||||
const val KEY_PENDING_ACCENT = "AXKEY_PEND_ACCENT"
|
||||
const val KEY_PENDING_ACCENT = BuildConfig.APPLICATION_ID + ".key.PENDING_ACCENT"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ class BlacklistDialog : LifecycleDialog() {
|
||||
val typeAndPath = DocumentsContract.getTreeDocumentId(docUri).split(":")
|
||||
|
||||
// Only the main drive is supported, since thats all we can get from MediaColumns.DATA
|
||||
// Unless I change the system to use the drive/directory system, but thats limited to
|
||||
// Android 10
|
||||
if (typeAndPath[0] == "primary") {
|
||||
return getRootPath() + "/" + typeAndPath.last()
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ abstract class LifecycleDialog : AppCompatDialogFragment() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val builder = MaterialAlertDialogBuilder(requireActivity(), theme)
|
||||
|
||||
// Setting the background in XML will also apply it to the tooltip for some inane reason
|
||||
// Setting the background in XML will also apply it to the tooltip for some insane reason
|
||||
// so we have to do it programmatically instead.
|
||||
builder.background = R.attr.colorSurface.resolveAttr(requireContext()).toDrawable()
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ const val INTENT_REQUEST_CODE = 0xA0A0
|
||||
*/
|
||||
fun ImageButton.disable() {
|
||||
if (isEnabled) {
|
||||
imageTintList = R.color.inactive_color.toStateList(context)
|
||||
imageTintList = R.color.inactive.toStateList(context)
|
||||
isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,9 +124,8 @@ class WidgetProvider : AppWidgetProvider() {
|
||||
updateAppWidget(name, RemoteViews(views))
|
||||
} else {
|
||||
// Otherwise, we try our best to backport the responsive behavior to older versions.
|
||||
// This is mostly a guess based on RemoteView's documentation, and it has some
|
||||
// problems [most notably UI jittering when resizing]. Its better than just using
|
||||
// one layout though. It may be improved once Android 12's source is released.
|
||||
// This is mostly a guess based on RemoteView's documentation. It may be improved when
|
||||
// Android 12's source is released.
|
||||
|
||||
// Each widget has independent dimensions, so we iterate through them all
|
||||
// and do this for each.
|
||||
|
||||
Reference in New Issue
Block a user