prepare for new library preference
This commit is contained in:
parent
5346c66f9a
commit
518352f7a0
6 changed files with 18 additions and 18 deletions
|
|
@ -5,20 +5,20 @@ import android.util.AttributeSet;
|
|||
|
||||
import com.kabouzeid.appthemehelper.common.prefs.supportv7.ATEDialogPreference;
|
||||
|
||||
public class LibraryPreference extends ATEDialogPreference {
|
||||
public LibraryPreference(Context context) {
|
||||
public class CategoryPreference extends ATEDialogPreference {
|
||||
public CategoryPreference(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public LibraryPreference(Context context, AttributeSet attrs) {
|
||||
public CategoryPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public LibraryPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
public CategoryPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public LibraryPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
public CategoryPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
}
|
||||
|
|
@ -17,9 +17,9 @@ import com.dkanada.gramophone.util.PreferenceUtil;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LibraryPreferenceDialog extends DialogFragment {
|
||||
public static LibraryPreferenceDialog newInstance() {
|
||||
return new LibraryPreferenceDialog();
|
||||
public class CategoryPreferenceDialog extends DialogFragment {
|
||||
public static CategoryPreferenceDialog newInstance() {
|
||||
return new CategoryPreferenceDialog();
|
||||
}
|
||||
|
||||
private CategoryInfoAdapter adapter;
|
||||
|
|
@ -24,8 +24,8 @@ import com.kabouzeid.appthemehelper.common.prefs.supportv7.ATEPreferenceFragment
|
|||
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||
import com.dkanada.gramophone.R;
|
||||
import com.dkanada.gramophone.shortcuts.DynamicShortcutManager;
|
||||
import com.dkanada.gramophone.preferences.LibraryPreference;
|
||||
import com.dkanada.gramophone.preferences.LibraryPreferenceDialog;
|
||||
import com.dkanada.gramophone.preferences.CategoryPreference;
|
||||
import com.dkanada.gramophone.preferences.CategoryPreferenceDialog;
|
||||
import com.dkanada.gramophone.preferences.NowPlayingScreenPreference;
|
||||
import com.dkanada.gramophone.preferences.NowPlayingScreenPreferenceDialog;
|
||||
import com.dkanada.gramophone.ui.activities.base.AbsBaseActivity;
|
||||
|
|
@ -120,7 +120,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
|
|||
addPreferencesFromResource(R.xml.pref_library);
|
||||
addPreferencesFromResource(R.xml.pref_colors);
|
||||
addPreferencesFromResource(R.xml.pref_notification);
|
||||
addPreferencesFromResource(R.xml.pref_now_playing_screen);
|
||||
addPreferencesFromResource(R.xml.pref_now_playing);
|
||||
addPreferencesFromResource(R.xml.pref_lockscreen);
|
||||
addPreferencesFromResource(R.xml.pref_audio);
|
||||
addPreferencesFromResource(R.xml.pref_images);
|
||||
|
|
@ -131,8 +131,8 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
|
|||
public DialogFragment onCreatePreferenceDialog(Preference preference) {
|
||||
if (preference instanceof NowPlayingScreenPreference) {
|
||||
return NowPlayingScreenPreferenceDialog.newInstance();
|
||||
} else if (preference instanceof LibraryPreference) {
|
||||
return LibraryPreferenceDialog.newInstance();
|
||||
} else if (preference instanceof CategoryPreference) {
|
||||
return CategoryPreferenceDialog.newInstance();
|
||||
} else if (preference instanceof DirectPlayPreference) {
|
||||
return DirectPlayPreferenceDialog.newInstance();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,14 +123,14 @@ public final class PreferenceUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public final boolean getRememberLastTab() {
|
||||
return mPreferences.getBoolean(REMEMBER_LAST_TAB, true);
|
||||
}
|
||||
|
||||
public final int getPageSize() {
|
||||
return Integer.parseInt(mPreferences.getString(PAGE_SIZE, "100"));
|
||||
}
|
||||
|
||||
public final boolean getRememberLastTab() {
|
||||
return mPreferences.getBoolean(REMEMBER_LAST_TAB, true);
|
||||
}
|
||||
|
||||
public final int getLastTab() {
|
||||
return mPreferences.getInt(LAST_TAB, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<com.kabouzeid.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory android:title="@string/pref_header_library">
|
||||
|
||||
<com.dkanada.gramophone.preferences.LibraryPreference
|
||||
<com.dkanada.gramophone.preferences.CategoryPreference
|
||||
app:iconSpaceReserved="false"
|
||||
android:key="library_categories"
|
||||
android:summary="@string/pref_summary_library_categories"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue