Code Cleanup
This commit is contained in:
parent
c8ce98b1df
commit
ea4a54d404
10 changed files with 23 additions and 24 deletions
|
@ -292,6 +292,18 @@
|
||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
android:resource="@xml/app_widget_md3_info" />
|
android:resource="@xml/app_widget_md3_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
<receiver
|
||||||
|
android:name=".appwidgets.AppWidgetCircle"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="@string/app_widget_circle_name">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/app_widget_circle_info" />
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".service.MusicService"
|
android:name=".service.MusicService"
|
||||||
|
|
|
@ -395,12 +395,10 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
bottomSheetBehavior.peekHeight = -windowInsets.safeGetBottomInsets()
|
bottomSheetBehavior.peekHeight = -windowInsets.safeGetBottomInsets()
|
||||||
bottomSheetBehavior.state = STATE_COLLAPSED
|
bottomSheetBehavior.state = STATE_COLLAPSED
|
||||||
libraryViewModel.setFabMargin(if (isBottomNavVisible) dip(R.dimen.bottom_nav_height) else 0)
|
libraryViewModel.setFabMargin(if (isBottomNavVisible) dip(R.dimen.bottom_nav_height) else 0)
|
||||||
binding.slidingPanel.elevation = 0F
|
|
||||||
binding.bottomNavigationView.elevation = 10F
|
|
||||||
} else {
|
} else {
|
||||||
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
||||||
binding.slidingPanel.elevation = 0F
|
binding.slidingPanel.elevation = 0F
|
||||||
binding.bottomNavigationView.elevation = 10F
|
binding.bottomNavigationView.elevation = 5F
|
||||||
if (isBottomNavVisible) {
|
if (isBottomNavVisible) {
|
||||||
println("List")
|
println("List")
|
||||||
if (animate) {
|
if (animate) {
|
||||||
|
|
|
@ -109,8 +109,7 @@ class AlbumCoverStylePreferenceDialog : DialogFragment(),
|
||||||
val albumCoverStyle = values()[position]
|
val albumCoverStyle = values()[position]
|
||||||
|
|
||||||
val inflater = LayoutInflater.from(context)
|
val inflater = LayoutInflater.from(context)
|
||||||
val binding = PreferenceNowPlayingScreenItemBinding.inflate(inflater, collection, false)
|
val binding = PreferenceNowPlayingScreenItemBinding.inflate(inflater, collection, true)
|
||||||
collection.addView(binding.root)
|
|
||||||
|
|
||||||
Glide.with(context).load(albumCoverStyle.drawableResId).into(binding.image)
|
Glide.with(context).load(albumCoverStyle.drawableResId).into(binding.image)
|
||||||
binding.title.setText(albumCoverStyle.titleRes)
|
binding.title.setText(albumCoverStyle.titleRes)
|
||||||
|
|
|
@ -115,14 +115,13 @@ private class NowPlayingScreenAdapter(private val context: Context) : PagerAdapt
|
||||||
val nowPlayingScreen = values()[position]
|
val nowPlayingScreen = values()[position]
|
||||||
|
|
||||||
val inflater = LayoutInflater.from(context)
|
val inflater = LayoutInflater.from(context)
|
||||||
val binding = PreferenceNowPlayingScreenItemBinding.inflate(inflater, collection, false )
|
val binding = PreferenceNowPlayingScreenItemBinding.inflate(inflater, collection, true)
|
||||||
collection.addView(binding.root)
|
|
||||||
Glide.with(context).load(nowPlayingScreen.drawableResId).into(binding.image)
|
Glide.with(context).load(nowPlayingScreen.drawableResId).into(binding.image)
|
||||||
binding.title.setText(nowPlayingScreen.titleRes)
|
binding.title.setText(nowPlayingScreen.titleRes)
|
||||||
if (isNowPlayingThemes(nowPlayingScreen)) {
|
if (isNowPlayingThemes(nowPlayingScreen)) {
|
||||||
binding.proText.show()
|
binding.proText.show()
|
||||||
binding.proText.setText(R.string.pro)
|
binding.proText.setText(R.string.pro)
|
||||||
}else{
|
} else {
|
||||||
binding.proText.hide()
|
binding.proText.hide()
|
||||||
}
|
}
|
||||||
return binding.root
|
return binding.root
|
||||||
|
|
|
@ -21,11 +21,9 @@ class HomeImageLayout @JvmOverloads constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (PreferenceUtil.isHomeBanner) {
|
if (PreferenceUtil.isHomeBanner) {
|
||||||
bannerImageBinding = BannerImageLayoutBinding.inflate(LayoutInflater.from(context))
|
bannerImageBinding = BannerImageLayoutBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
addView(bannerImageBinding!!.root)
|
|
||||||
} else {
|
} else {
|
||||||
userImageBinding = UserImageLayoutBinding.inflate(LayoutInflater.from(context))
|
userImageBinding = UserImageLayoutBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
addView(userImageBinding!!.root)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ class ListItemView : FrameLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun init(context: Context, attrs: AttributeSet?) {
|
private fun init(context: Context, attrs: AttributeSet?) {
|
||||||
binding = ListItemViewNoCardBinding.inflate(LayoutInflater.from(context))
|
binding = ListItemViewNoCardBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
addView(binding.root)
|
|
||||||
|
|
||||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ListItemView)
|
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ListItemView)
|
||||||
if (typedArray.hasValue(R.styleable.ListItemView_listItemIcon)) {
|
if (typedArray.hasValue(R.styleable.ListItemView_listItemIcon)) {
|
||||||
|
|
|
@ -22,8 +22,7 @@ class PermissionItem @JvmOverloads constructor(
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val attributes = context.obtainStyledAttributes(attrs, R.styleable.PermissionItem, 0, 0)
|
val attributes = context.obtainStyledAttributes(attrs, R.styleable.PermissionItem, 0, 0)
|
||||||
binding = ItemPermissionBinding.inflate(LayoutInflater.from(context))
|
binding = ItemPermissionBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
addView(binding.root)
|
|
||||||
|
|
||||||
binding.title.text = attributes.getText(R.styleable.PermissionItem_permissionTitle)
|
binding.title.text = attributes.getText(R.styleable.PermissionItem_permissionTitle)
|
||||||
binding.summary.text =
|
binding.summary.text =
|
||||||
|
|
|
@ -30,11 +30,9 @@ class SettingListItemView @JvmOverloads constructor(
|
||||||
defStyleAttr: Int = -1,
|
defStyleAttr: Int = -1,
|
||||||
defStyleRes: Int = -1
|
defStyleRes: Int = -1
|
||||||
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {
|
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {
|
||||||
private var binding: ListSettingItemViewBinding =
|
|
||||||
ListSettingItemViewBinding.inflate(LayoutInflater.from(context))
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
addView(binding.root)
|
val binding: ListSettingItemViewBinding =
|
||||||
|
ListSettingItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
val typedArray =
|
val typedArray =
|
||||||
context.obtainStyledAttributes(attrs, R.styleable.SettingListItemView)
|
context.obtainStyledAttributes(attrs, R.styleable.SettingListItemView)
|
||||||
binding.icon
|
binding.icon
|
||||||
|
|
|
@ -183,9 +183,6 @@
|
||||||
|
|
||||||
<style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet">
|
<style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet">
|
||||||
<item name="android:maxWidth">@empty</item>
|
<item name="android:maxWidth">@empty</item>
|
||||||
<item name="paddingBottomSystemWindowInsets">false</item>
|
|
||||||
<item name="marginLeftSystemWindowInsets">false</item>
|
|
||||||
<item name="marginRightSystemWindowInsets">false</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="MaterialCardViewStroke">
|
<style name="MaterialCardViewStroke">
|
||||||
|
|
|
@ -4,7 +4,7 @@ buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.6.10'
|
kotlin_version = '1.6.10'
|
||||||
navigation_version = '2.4.0-rc01'
|
navigation_version = '2.4.0-rc01'
|
||||||
mdc_version = '1.6.0-alpha01'
|
mdc_version = '1.5.0'
|
||||||
preference_version = '1.2.0-rc01'
|
preference_version = '1.2.0-rc01'
|
||||||
appcompat_version = '1.4.1'
|
appcompat_version = '1.4.1'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue