Fixed tabs options
This commit is contained in:
parent
f3fb927dc0
commit
640ac4d4c3
5 changed files with 15 additions and 11 deletions
File diff suppressed because one or more lines are too long
|
@ -15,11 +15,11 @@
|
||||||
package code.name.monkey.retromusic.adapter;
|
package code.name.monkey.retromusic.adapter;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.res.ColorStateList;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -27,8 +27,11 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.checkbox.MaterialCheckBox;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.model.CategoryInfo;
|
import code.name.monkey.retromusic.model.CategoryInfo;
|
||||||
import code.name.monkey.retromusic.util.SwipeAndDragHelper;
|
import code.name.monkey.retromusic.util.SwipeAndDragHelper;
|
||||||
|
@ -113,13 +116,14 @@ public class CategoryInfoAdapter extends RecyclerView.Adapter<CategoryInfoAdapte
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
CheckBox checkBox;
|
MaterialCheckBox checkBox;
|
||||||
TextView title;
|
TextView title;
|
||||||
View dragView;
|
View dragView;
|
||||||
|
|
||||||
ViewHolder(View view) {
|
ViewHolder(View view) {
|
||||||
super(view);
|
super(view);
|
||||||
checkBox = view.findViewById(R.id.checkbox);
|
checkBox = view.findViewById(R.id.checkbox);
|
||||||
|
checkBox.setBackgroundTintList(ColorStateList.valueOf(ThemeStore.Companion.accentColor(checkBox.getContext())));
|
||||||
title = view.findViewById(R.id.title);
|
title = view.findViewById(R.id.title);
|
||||||
dragView = view.findViewById(R.id.drag_view);
|
dragView = view.findViewById(R.id.drag_view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,13 +35,13 @@ import java.util.*
|
||||||
|
|
||||||
|
|
||||||
class LibraryPreference : ATEDialogPreference {
|
class LibraryPreference : ATEDialogPreference {
|
||||||
constructor(context: Context) : super(context) {}
|
constructor(context: Context) : super(context)
|
||||||
|
|
||||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
|
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
|
||||||
|
|
||||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
||||||
|
|
||||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
|
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
|
icon?.setColorFilter(ThemeStore.accentColor(context), PorterDuff.Mode.SRC_IN)
|
||||||
|
@ -63,7 +63,7 @@ class LibraryPreferenceDialog : PreferenceDialogFragmentCompat() {
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
categoryInfos = savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES)
|
categoryInfos = savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES)
|
||||||
} else {
|
} else {
|
||||||
categoryInfos = PreferenceUtil.getInstance().getLibraryCategoryInfos()
|
categoryInfos = PreferenceUtil.getInstance().libraryCategoryInfos
|
||||||
}
|
}
|
||||||
adapter = CategoryInfoAdapter(categoryInfos)
|
adapter = CategoryInfoAdapter(categoryInfos)
|
||||||
|
|
||||||
|
@ -73,7 +73,6 @@ class LibraryPreferenceDialog : PreferenceDialogFragmentCompat() {
|
||||||
|
|
||||||
adapter.attachToRecyclerView(recyclerView)
|
adapter.attachToRecyclerView(recyclerView)
|
||||||
|
|
||||||
|
|
||||||
return MaterialDialog(context!!, BottomSheet())
|
return MaterialDialog(context!!, BottomSheet())
|
||||||
.title(code.name.monkey.retromusic.R.string.library_categories)
|
.title(code.name.monkey.retromusic.R.string.library_categories)
|
||||||
.customView(view = view)
|
.customView(view = view)
|
||||||
|
|
|
@ -355,6 +355,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
mediaButtonReceiverComponentName,
|
mediaButtonReceiverComponentName,
|
||||||
mediaButtonReceiverPendingIntent);
|
mediaButtonReceiverPendingIntent);
|
||||||
mediaSession.setCallback(new MediaSessionCompat.Callback() {
|
mediaSession.setCallback(new MediaSessionCompat.Callback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlay() {
|
public void onPlay() {
|
||||||
play();
|
play();
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
tools:gravity="start|center_vertical">
|
tools:gravity="start|center_vertical">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATECheckBox
|
<com.google.android.material.checkbox.MaterialCheckBox
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:gravity="center_vertical" />
|
android:gravity="center_vertical" />
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue