Code refactor

This commit is contained in:
h4h13 2020-01-28 23:17:48 +05:30
parent fdb2ab300e
commit 08033d6a16
31 changed files with 196 additions and 147 deletions

View file

@ -151,7 +151,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:1.5.0'
debugImplementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
transitive = true

View file

@ -145,7 +145,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
}
private fun setupToolbar() {
toolbar.apply {
backgroundTintList = ColorStateList.valueOf(ATHUtil.resolveColor(requireContext(), R.attr.colorSurface))
setNavigationIcon(R.drawable.ic_menu_white_24dp)

View file

@ -32,7 +32,7 @@ import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems
import java.io.File
import java.util.*
import java.util.ArrayList
class BlacklistPreference : ATEDialogPreference {
constructor(context: Context) : super(context)
@ -67,7 +67,7 @@ class BlacklistPreferenceDialog : DialogFragment(), BlacklistFolderChooserDialog
dismiss()
}
neutralButton(text = getString(R.string.clear_action)) {
MaterialDialog(context, BottomSheet(LayoutMode.WRAP_CONTENT)).show {
MaterialDialog(requireContext(), BottomSheet(LayoutMode.WRAP_CONTENT)).show {
title(code.name.monkey.retromusic.R.string.clear_blacklist)
message(code.name.monkey.retromusic.R.string.do_you_want_to_clear_the_blacklist)
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)

View file

@ -47,8 +47,10 @@
android:id="@+id/toolbarContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="?colorSurface"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways">
<FrameLayout

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2019 Hemanth Savarala.
~
~ Licensed under the GNU General Public License v3
~
~ This is free software: you can redistribute it and/or modify it under
~ the terms of the GNU General Public License as published by
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ See the GNU General Public License for more details.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/rectSelector"
android:minHeight="72dp"
android:orientation="horizontal"
android:padding="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="PrivateResource">
<androidx.appcompat.widget.AppCompatImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewSubtitle1"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@android:id/widget_frame"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toTopOf="parent"
tools:maxLines="@string/grid_size_1"
tools:text="@tools:sample/lorem" />
<code.name.monkey.retromusic.views.BaselineGridTextView
android:id="@android:id/summary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="?android:attr/textColorSecondary"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@android:id/widget_frame"
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
app:layout_constraintTop_toBottomOf="@android:id/title"
app:lineHeightHint="20sp"
tools:maxLines="2"
tools:text="@tools:sample/lorem/random" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_front_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="52dp" />
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end|center_vertical"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -21,7 +21,7 @@
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="72dp"
android:paddingStart="70dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:textAppearance="@style/TextViewOverline"

View file

@ -27,7 +27,7 @@
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEColorPreference
android:key="accent_color"
android:layout="@layout/list_item_view"
android:layout="@layout/list_item_color_view"
android:persistent="false"
android:summary="@string/accent_color_desc"
android:title="@string/accent_color"

View file

@ -23,8 +23,6 @@
android:summary="@string/pref_summary_home_banner"
android:title="@string/pref_title_home_banner" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory