1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-02-12 17:50:38 +01:00

improved account selection

This commit is contained in:
Mariotaku Lee 2014-10-29 16:58:42 +08:00
parent 8c6802a9b2
commit 582a9e221f
21 changed files with 684 additions and 581 deletions

View File

@ -108,6 +108,7 @@ public interface Constants extends TwidereConstants {
public static final int MENU_PROGRESS = R.id.progress;
public static final int MENU_OPEN_WITH_ACCOUNT = R.id.open_with_account;
public static final int MENU_ACCOUNTS = R.id.accounts;
public static final int MENU_INVERSE_SELECTION = R.id.inverse_selection;
public static final int LINK_ID_STATUS = 1;
public static final int LINK_ID_USER = 2;

View File

@ -5,6 +5,7 @@ import android.app.Dialog;
import android.content.Context;
import android.graphics.PorterDuff.Mode;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.Menu;
import android.view.MenuItem;
@ -22,13 +23,16 @@ import org.mariotaku.twidere.util.ThemeUtils;
public abstract class MenuDialogFragment extends BaseSupportDialogFragment implements OnItemClickListener {
private MenuAdapter mAdapter;
@NonNull
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
final Context context = getThemedContext();
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
final MenuAdapter adapter = new MenuAdapter(context);
mAdapter = new MenuAdapter(context);
final ListView listView = new ListView(context);
listView.setAdapter(adapter);
listView.setAdapter(mAdapter);
listView.setOnItemClickListener(this);
builder.setView(listView);
final Menu menu = MenuUtils.createMenu(context);
@ -36,7 +40,7 @@ public abstract class MenuDialogFragment extends BaseSupportDialogFragment imple
final int itemColor = ThemeUtils.getThemeForegroundColor(context);
final int highlightColor = ThemeUtils.getUserAccentColor(context);
ThemeUtils.applyColorFilterToMenuIcon(menu, itemColor, highlightColor, Mode.SRC_ATOP);
adapter.setMenu(menu);
mAdapter.setMenu(menu);
return builder.create();
}
@ -49,7 +53,7 @@ public abstract class MenuDialogFragment extends BaseSupportDialogFragment imple
final Fragment parentFragment = getParentFragment();
final MenuItem item = (MenuItem) parent.getItemAtPosition(position);
if (item.hasSubMenu()) {
mAdapter.setMenu(item.getSubMenu());
} else if (parentFragment instanceof OnMenuItemClickListener) {
((OnMenuItemClickListener) parentFragment).onMenuItemClick(item);
dismiss();

View File

@ -30,12 +30,13 @@ import com.mobeta.android.dslv.SimpleDragSortCursorAdapter;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.adapter.iface.IBaseAdapter;
import org.mariotaku.twidere.app.TwidereApplication;
import org.mariotaku.twidere.provider.TweetStore.Accounts;
import org.mariotaku.twidere.util.ImageLoaderWrapper;
import org.mariotaku.twidere.view.holder.AccountViewHolder;
public class AccountsAdapter extends SimpleDragSortCursorAdapter implements Constants {
public class AccountsAdapter extends SimpleDragSortCursorAdapter implements Constants, IBaseAdapter {
private final ImageLoaderWrapper mImageLoader;
private final SharedPreferences mPreferences;
@ -94,23 +95,94 @@ public class AccountsAdapter extends SimpleDragSortCursorAdapter implements Cons
return view;
}
@Override
public ImageLoaderWrapper getImageLoader() {
return mImageLoader;
}
@Override
public int getLinkHighlightColor() {
return 0;
}
@Override
public int getLinkHighlightOption() {
return 0;
}
@Override
public float getTextSize() {
return 0;
}
@Override
public boolean isDisplayNameFirst() {
return false;
}
@Override
public boolean isDisplayProfileImage() {
return mDisplayProfileImage;
}
@Override
public boolean isNicknameOnly() {
return false;
}
@Override
public boolean isShowAccountColor() {
return false;
}
@Override
public void notifyDataSetChanged() {
mDefaultAccountId = mPreferences.getLong(KEY_DEFAULT_ACCOUNT_ID, -1);
super.notifyDataSetChanged();
}
@Override
public void setDisplayNameFirst(boolean nameFirst) {
}
public void setChoiceMode(final int mode) {
if (mChoiceMode == mode) return;
mChoiceMode = mode;
notifyDataSetChanged();
}
@Override
public void setDisplayProfileImage(final boolean display) {
mDisplayProfileImage = display;
notifyDataSetChanged();
}
@Override
public void setLinkHighlightColor(int color) {
}
@Override
public void setLinkHighlightOption(String option) {
}
@Override
public void setNicknameOnly(boolean nicknameOnly) {
}
@Override
public void setShowAccountColor(boolean show) {
}
@Override
public void setTextSize(float textSize) {
}
@Override
public Cursor swapCursor(final Cursor cursor) {
if (cursor != null) {

View File

@ -19,8 +19,6 @@
package org.mariotaku.twidere.adapter;
import static org.mariotaku.twidere.util.Utils.getLinkHighlightOptionInt;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
@ -33,119 +31,124 @@ import org.mariotaku.twidere.util.TwidereLinkify;
import java.util.Collection;
import static org.mariotaku.twidere.util.Utils.getLinkHighlightOptionInt;
public class BaseArrayAdapter<T> extends ArrayAdapter<T> implements IBaseAdapter, OnSharedPreferenceChangeListener {
private final TwidereLinkify mLinkify;
private final TwidereLinkify mLinkify;
private float mTextSize;
private int mLinkHighlightOption, mLinkHighlightColor;
private float mTextSize;
private int mLinkHighlightOption, mLinkHighlightColor;
private boolean mDisplayProfileImage, mNicknameOnly, mDisplayNameFirst, mShowAccountColor;
private boolean mDisplayProfileImage, mNicknameOnly, mDisplayNameFirst, mShowAccountColor;
private final SharedPreferences mNicknamePrefs, mColorPrefs;
private final ImageLoaderWrapper mImageLoader;
private final SharedPreferences mNicknamePrefs, mColorPrefs;
private final ImageLoaderWrapper mImageLoader;
public BaseArrayAdapter(final Context context, final int layoutRes) {
this(context, layoutRes, null);
}
public BaseArrayAdapter(final Context context, final int layoutRes) {
this(context, layoutRes, null);
}
public BaseArrayAdapter(final Context context, final int layoutRes, final Collection<? extends T> collection) {
super(context, layoutRes, collection);
final TwidereApplication app = TwidereApplication.getInstance(context);
mLinkify = new TwidereLinkify(new OnLinkClickHandler(context, app.getMultiSelectManager()));
mImageLoader = app.getImageLoaderWrapper();
mNicknamePrefs = context.getSharedPreferences(USER_NICKNAME_PREFERENCES_NAME, Context.MODE_PRIVATE);
mColorPrefs = context.getSharedPreferences(USER_COLOR_PREFERENCES_NAME, Context.MODE_PRIVATE);
mNicknamePrefs.registerOnSharedPreferenceChangeListener(this);
mColorPrefs.registerOnSharedPreferenceChangeListener(this);
}
public BaseArrayAdapter(final Context context, final int layoutRes, final Collection<? extends T> collection) {
super(context, layoutRes, collection);
final TwidereApplication app = TwidereApplication.getInstance(context);
mLinkify = new TwidereLinkify(new OnLinkClickHandler(context, app.getMultiSelectManager()));
mImageLoader = app.getImageLoaderWrapper();
mNicknamePrefs = context.getSharedPreferences(USER_NICKNAME_PREFERENCES_NAME, Context.MODE_PRIVATE);
mColorPrefs = context.getSharedPreferences(USER_COLOR_PREFERENCES_NAME, Context.MODE_PRIVATE);
mNicknamePrefs.registerOnSharedPreferenceChangeListener(this);
mColorPrefs.registerOnSharedPreferenceChangeListener(this);
}
@Override
public ImageLoaderWrapper getImageLoader() {
return mImageLoader;
}
@Override
public ImageLoaderWrapper getImageLoader() {
return mImageLoader;
}
@Override
public final int getLinkHighlightColor() {
return mLinkHighlightColor;
}
@Override
public final int getLinkHighlightColor() {
return mLinkHighlightColor;
}
@Override
public final int getLinkHighlightOption() {
return mLinkHighlightOption;
}
@Override
public final int getLinkHighlightOption() {
return mLinkHighlightOption;
}
public final TwidereLinkify getLinkify() {
return mLinkify;
}
public final TwidereLinkify getLinkify() {
return mLinkify;
}
@Override
public final float getTextSize() {
return mTextSize;
}
@Override
public final float getTextSize() {
return mTextSize;
}
@Override
public final boolean isDisplayNameFirst() {
return mDisplayNameFirst;
}
@Override
public final boolean isDisplayNameFirst() {
return mDisplayNameFirst;
}
@Override
public final boolean isDisplayProfileImage() {
return mDisplayProfileImage;
}
@Override
public final boolean isDisplayProfileImage() {
return mDisplayProfileImage;
}
@Override
public final boolean isNicknameOnly() {
return mNicknameOnly;
}
@Override
public final boolean isNicknameOnly() {
return mNicknameOnly;
}
@Override
public final boolean isShowAccountColor() {
return mShowAccountColor;
}
@Override
public final boolean isShowAccountColor() {
return mShowAccountColor;
}
@Override
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) {
notifyDataSetChanged();
}
@Override
public void onSharedPreferenceChanged(final SharedPreferences preferences, final String key) {
if (KEY_NICKNAME_ONLY.equals(key) || KEY_DISPLAY_PROFILE_IMAGE.equals(key)
|| KEY_DISPLAY_IMAGE_PREVIEW.equals(key) || KEY_DISPLAY_SENSITIVE_CONTENTS.equals(key)) {
notifyDataSetChanged();
}
}
@Override
public final void setDisplayNameFirst(final boolean nameFirst) {
mDisplayNameFirst = nameFirst;
}
@Override
public final void setDisplayNameFirst(final boolean nameFirst) {
mDisplayNameFirst = nameFirst;
}
@Override
public final void setDisplayProfileImage(final boolean display) {
mDisplayProfileImage = display;
}
@Override
public final void setDisplayProfileImage(final boolean display) {
mDisplayProfileImage = display;
}
@Override
public final void setLinkHighlightColor(final int color) {
mLinkify.setLinkTextColor(color);
mLinkHighlightColor = color;
}
@Override
public final void setLinkHighlightColor(final int color) {
mLinkify.setLinkTextColor(color);
mLinkHighlightColor = color;
}
@Override
public final void setLinkHighlightOption(final String option) {
final int optionInt = getLinkHighlightOptionInt(option);
mLinkify.setHighlightOption(optionInt);
if (optionInt == mLinkHighlightOption) return;
mLinkHighlightOption = optionInt;
}
@Override
public final void setLinkHighlightOption(final String option) {
final int optionInt = getLinkHighlightOptionInt(option);
mLinkify.setHighlightOption(optionInt);
if (optionInt == mLinkHighlightOption) return;
mLinkHighlightOption = optionInt;
}
@Override
public final void setNicknameOnly(final boolean nickname_only) {
mNicknameOnly = nickname_only;
}
@Override
public final void setNicknameOnly(final boolean nicknameOnly) {
mNicknameOnly = nicknameOnly;
}
@Override
public final void setShowAccountColor(final boolean show) {
mShowAccountColor = show;
}
@Override
public final void setShowAccountColor(final boolean show) {
mShowAccountColor = show;
}
@Override
public final void setTextSize(final float textSize) {
mTextSize = textSize;
}
@Override
public final void setTextSize(final float textSize) {
mTextSize = textSize;
}
}

View File

@ -144,9 +144,9 @@ public class BaseCursorAdapter extends SimpleCursorAdapter implements IBaseAdapt
}
@Override
public final void setNicknameOnly(final boolean nickname_only) {
if (mNicknameOnly == nickname_only) return;
mNicknameOnly = nickname_only;
public final void setNicknameOnly(final boolean nicknameOnly) {
if (mNicknameOnly == nicknameOnly) return;
mNicknameOnly = nicknameOnly;
notifyDataSetChanged();
}
@ -158,9 +158,9 @@ public class BaseCursorAdapter extends SimpleCursorAdapter implements IBaseAdapt
}
@Override
public final void setTextSize(final float text_size) {
if (text_size == mTextSize) return;
mTextSize = text_size;
public final void setTextSize(final float textSize) {
if (textSize == mTextSize) return;
mTextSize = textSize;
notifyDataSetChanged();
}

View File

@ -52,9 +52,9 @@ public interface IBaseAdapter extends Constants, ListAdapter {
public void setLinkHighlightOption(String option);
public void setNicknameOnly(boolean nickname_only);
public void setNicknameOnly(boolean nicknameOnly);
public void setShowAccountColor(boolean show);
public void setTextSize(float text_size);
public void setTextSize(float textSize);
}

View File

@ -19,8 +19,6 @@
package org.mariotaku.twidere.fragment;
import static org.mariotaku.twidere.util.Utils.getDisplayName;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
@ -34,6 +32,7 @@ import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.util.SparseBooleanArray;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
@ -52,255 +51,264 @@ import org.mariotaku.twidere.R;
import org.mariotaku.twidere.fragment.support.BaseSupportListFragment;
import org.mariotaku.twidere.provider.TweetStore.Filters;
import static org.mariotaku.twidere.util.Utils.getDisplayName;
public abstract class BaseFiltersFragment extends BaseSupportListFragment implements LoaderManager.LoaderCallbacks<Cursor>,
MultiChoiceModeListener {
MultiChoiceModeListener {
private ListView mListView;
private ListView mListView;
private SimpleCursorAdapter mAdapter;
private SimpleCursorAdapter mAdapter;
private ContentResolver mResolver;
private ContentResolver mResolver;
private ActionMode mActionMode;
private ActionMode mActionMode;
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (getActivity() == null || !isAdded() || isDetached()) return;
final String action = intent.getAction();
if (BROADCAST_FILTERS_UPDATED.equals(action)) {
getLoaderManager().restartLoader(0, null, BaseFiltersFragment.this);
}
}
@Override
public void onReceive(final Context context, final Intent intent) {
if (getActivity() == null || !isAdded() || isDetached()) return;
final String action = intent.getAction();
if (BROADCAST_FILTERS_UPDATED.equals(action)) {
getLoaderManager().restartLoader(0, null, BaseFiltersFragment.this);
}
}
};
};
public abstract Uri getContentUri();
public abstract Uri getContentUri();
@Override
public boolean onActionItemClicked(final ActionMode mode, final MenuItem item) {
switch (item.getItemId()) {
case MENU_DELETE: {
final Where where = Where.in(new Column(Filters._ID), new RawItemArray(mListView.getCheckedItemIds()));
mResolver.delete(getContentUri(), where.getSQL(), null);
break;
}
default: {
return false;
}
}
mode.finish();
return true;
}
@Override
public boolean onActionItemClicked(final ActionMode mode, final MenuItem item) {
switch (item.getItemId()) {
case MENU_DELETE: {
final Where where = Where.in(new Column(Filters._ID), new RawItemArray(mListView.getCheckedItemIds()));
mResolver.delete(getContentUri(), where.getSQL(), null);
break;
}
case MENU_INVERSE_SELECTION: {
final SparseBooleanArray positions = mListView.getCheckedItemPositions();
for (int i = 0, j = mListView.getCount(); i < j; i++) {
mListView.setItemChecked(i, !positions.get(i));
}
return true;
}
default: {
return false;
}
}
mode.finish();
return true;
}
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
mResolver = getContentResolver();
super.onActivityCreated(savedInstanceState);
mAdapter = createListAdapter();
setListAdapter(mAdapter);
mListView = getListView();
mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
mListView.setMultiChoiceModeListener(this);
setEmptyText(getString(R.string.no_rule));
getLoaderManager().initLoader(0, null, this);
setListShown(false);
}
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
mResolver = getContentResolver();
super.onActivityCreated(savedInstanceState);
mAdapter = createListAdapter();
setListAdapter(mAdapter);
mListView = getListView();
mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
mListView.setMultiChoiceModeListener(this);
setEmptyText(getString(R.string.no_rule));
getLoaderManager().initLoader(0, null, this);
setListShown(false);
}
@Override
public boolean onCreateActionMode(final ActionMode mode, final Menu menu) {
mActionMode = mode;
getActivity().getMenuInflater().inflate(R.menu.action_multi_select_items, menu);
return true;
}
@Override
public boolean onCreateActionMode(final ActionMode mode, final Menu menu) {
mActionMode = mode;
getActivity().getMenuInflater().inflate(R.menu.action_multi_select_items, menu);
return true;
}
@Override
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
return new CursorLoader(getActivity(), getContentUri(), getContentColumns(), null, null, null);
}
@Override
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
return new CursorLoader(getActivity(), getContentUri(), getContentColumns(), null, null, null);
}
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
final View view = super.onCreateView(inflater, container, savedInstanceState);
final View lv = view.findViewById(android.R.id.list);
final Resources res = getResources();
final float density = res.getDisplayMetrics().density;
final int padding = (int) density * 16;
lv.setId(android.R.id.list);
lv.setPadding(padding, 0, padding, 0);
return view;
}
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
final View view = super.onCreateView(inflater, container, savedInstanceState);
final View lv = view.findViewById(android.R.id.list);
final Resources res = getResources();
final float density = res.getDisplayMetrics().density;
final int padding = (int) density * 16;
lv.setId(android.R.id.list);
lv.setPadding(padding, 0, padding, 0);
return view;
}
@Override
public void onDestroyActionMode(final ActionMode mode) {
@Override
public void onDestroyActionMode(final ActionMode mode) {
}
}
@Override
public void onItemCheckedStateChanged(final ActionMode mode, final int position, final long id,
final boolean checked) {
updateTitle(mode);
}
@Override
public void onItemCheckedStateChanged(final ActionMode mode, final int position, final long id,
final boolean checked) {
updateTitle(mode);
}
@Override
public void onLoaderReset(final Loader<Cursor> loader) {
mAdapter.swapCursor(null);
}
@Override
public void onLoaderReset(final Loader<Cursor> loader) {
mAdapter.swapCursor(null);
}
@Override
public void onLoadFinished(final Loader<Cursor> loader, final Cursor data) {
mAdapter.swapCursor(data);
setListShown(true);
}
@Override
public void onLoadFinished(final Loader<Cursor> loader, final Cursor data) {
mAdapter.swapCursor(data);
setListShown(true);
}
@Override
public boolean onPrepareActionMode(final ActionMode mode, final Menu menu) {
updateTitle(mode);
return true;
}
@Override
public boolean onPrepareActionMode(final ActionMode mode, final Menu menu) {
updateTitle(mode);
return true;
}
@Override
public void onStart() {
super.onStart();
final IntentFilter filter = new IntentFilter(BROADCAST_FILTERS_UPDATED);
registerReceiver(mStateReceiver, filter);
}
@Override
public void onStart() {
super.onStart();
final IntentFilter filter = new IntentFilter(BROADCAST_FILTERS_UPDATED);
registerReceiver(mStateReceiver, filter);
}
@Override
public void onStop() {
unregisterReceiver(mStateReceiver);
super.onStop();
}
@Override
public void onStop() {
unregisterReceiver(mStateReceiver);
super.onStop();
}
@Override
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (!isVisibleToUser && mActionMode != null) {
mActionMode.finish();
}
}
@Override
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (!isVisibleToUser && mActionMode != null) {
mActionMode.finish();
}
}
protected SimpleCursorAdapter createListAdapter() {
return new FilterListAdapter(getActivity());
}
protected SimpleCursorAdapter createListAdapter() {
return new FilterListAdapter(getActivity());
}
protected abstract String[] getContentColumns();
protected abstract String[] getContentColumns();
private void updateTitle(final ActionMode mode) {
if (mListView == null || mode == null || getActivity() == null) return;
final int count = mListView.getCheckedItemCount();
mode.setTitle(getResources().getQuantityString(R.plurals.Nitems_selected, count, count));
}
private void updateTitle(final ActionMode mode) {
if (mListView == null || mode == null || getActivity() == null) return;
final int count = mListView.getCheckedItemCount();
mode.setTitle(getResources().getQuantityString(R.plurals.Nitems_selected, count, count));
}
public static final class FilteredKeywordsFragment extends BaseFiltersFragment {
public static final class FilteredKeywordsFragment extends BaseFiltersFragment {
@Override
public String[] getContentColumns() {
return Filters.Keywords.COLUMNS;
}
@Override
public String[] getContentColumns() {
return Filters.Keywords.COLUMNS;
}
@Override
public Uri getContentUri() {
return Filters.Keywords.CONTENT_URI;
}
@Override
public Uri getContentUri() {
return Filters.Keywords.CONTENT_URI;
}
}
}
public static final class FilteredLinksFragment extends BaseFiltersFragment {
public static final class FilteredLinksFragment extends BaseFiltersFragment {
@Override
public String[] getContentColumns() {
return Filters.Links.COLUMNS;
}
@Override
public String[] getContentColumns() {
return Filters.Links.COLUMNS;
}
@Override
public Uri getContentUri() {
return Filters.Links.CONTENT_URI;
}
@Override
public Uri getContentUri() {
return Filters.Links.CONTENT_URI;
}
}
}
public static final class FilteredSourcesFragment extends BaseFiltersFragment {
public static final class FilteredSourcesFragment extends BaseFiltersFragment {
@Override
public String[] getContentColumns() {
return Filters.Sources.COLUMNS;
}
@Override
public String[] getContentColumns() {
return Filters.Sources.COLUMNS;
}
@Override
public Uri getContentUri() {
return Filters.Sources.CONTENT_URI;
}
@Override
public Uri getContentUri() {
return Filters.Sources.CONTENT_URI;
}
}
}
public static final class FilteredUsersFragment extends BaseFiltersFragment {
public static final class FilteredUsersFragment extends BaseFiltersFragment {
@Override
public String[] getContentColumns() {
return Filters.Users.COLUMNS;
}
@Override
public String[] getContentColumns() {
return Filters.Users.COLUMNS;
}
@Override
public Uri getContentUri() {
return Filters.Users.CONTENT_URI;
}
@Override
public Uri getContentUri() {
return Filters.Users.CONTENT_URI;
}
@Override
protected SimpleCursorAdapter createListAdapter() {
return new FilterUsersListAdapter(getActivity());
}
@Override
protected SimpleCursorAdapter createListAdapter() {
return new FilterUsersListAdapter(getActivity());
}
private static final class FilterUsersListAdapter extends SimpleCursorAdapter {
private static final class FilterUsersListAdapter extends SimpleCursorAdapter {
private int mUserIdIdx, mNameIdx, mScreenNameIdx;
private int mUserIdIdx, mNameIdx, mScreenNameIdx;
private final boolean mNameFirst, mNicknameOnly;
private final boolean mNameFirst, mNicknameOnly;
public FilterUsersListAdapter(final Context context) {
super(context, android.R.layout.simple_list_item_activated_1, null, new String[0], new int[0], 0);
final SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME,
Context.MODE_PRIVATE);
mNameFirst = prefs.getBoolean(KEY_NAME_FIRST, true);
mNicknameOnly = prefs.getBoolean(KEY_NICKNAME_ONLY, false);
}
public FilterUsersListAdapter(final Context context) {
super(context, android.R.layout.simple_list_item_activated_1, null, new String[0], new int[0], 0);
final SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME,
Context.MODE_PRIVATE);
mNameFirst = prefs.getBoolean(KEY_NAME_FIRST, true);
mNicknameOnly = prefs.getBoolean(KEY_NICKNAME_ONLY, false);
}
@Override
public void bindView(final View view, final Context context, final Cursor cursor) {
super.bindView(view, context, cursor);
final TextView text1 = (TextView) view.findViewById(android.R.id.text1);
final long user_id = cursor.getLong(mUserIdIdx);
final String name = cursor.getString(mNameIdx);
final String screen_name = cursor.getString(mScreenNameIdx);
final String display_name = getDisplayName(context, user_id, name, screen_name, mNameFirst,
mNicknameOnly);
text1.setText(display_name);
}
@Override
public void bindView(final View view, final Context context, final Cursor cursor) {
super.bindView(view, context, cursor);
final TextView text1 = (TextView) view.findViewById(android.R.id.text1);
final long user_id = cursor.getLong(mUserIdIdx);
final String name = cursor.getString(mNameIdx);
final String screen_name = cursor.getString(mScreenNameIdx);
final String display_name = getDisplayName(context, user_id, name, screen_name, mNameFirst,
mNicknameOnly);
text1.setText(display_name);
}
@Override
public Cursor swapCursor(final Cursor c) {
final Cursor old = super.swapCursor(c);
if (c != null) {
mUserIdIdx = c.getColumnIndex(Filters.Users.USER_ID);
mNameIdx = c.getColumnIndex(Filters.Users.NAME);
mScreenNameIdx = c.getColumnIndex(Filters.Users.SCREEN_NAME);
}
return old;
}
@Override
public Cursor swapCursor(final Cursor c) {
final Cursor old = super.swapCursor(c);
if (c != null) {
mUserIdIdx = c.getColumnIndex(Filters.Users.USER_ID);
mNameIdx = c.getColumnIndex(Filters.Users.NAME);
mScreenNameIdx = c.getColumnIndex(Filters.Users.SCREEN_NAME);
}
return old;
}
}
}
}
}
private static final class FilterListAdapter extends SimpleCursorAdapter {
private static final class FilterListAdapter extends SimpleCursorAdapter {
private static final String[] from = new String[] { Filters.VALUE };
private static final String[] from = new String[]{Filters.VALUE};
private static final int[] to = new int[] { android.R.id.text1 };
private static final int[] to = new int[]{android.R.id.text1};
public FilterListAdapter(final Context context) {
super(context, android.R.layout.simple_list_item_activated_1, null, from, to, 0);
}
public FilterListAdapter(final Context context) {
super(context, android.R.layout.simple_list_item_activated_1, null, from, to, 0);
}
}
}
}

View File

@ -4,6 +4,7 @@ import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
@ -14,16 +15,20 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.mobeta.android.dslv.DragSortListView;
import com.mobeta.android.dslv.DragSortListView.DropListener;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.activity.support.SignInActivity;
import org.mariotaku.twidere.adapter.AccountsAdapter;
import org.mariotaku.twidere.menu.TwidereMenuInflater;
import org.mariotaku.twidere.provider.TweetStore.Accounts;
import org.mariotaku.twidere.util.Utils;
/**
* Created by mariotaku on 14/10/26.
*/
public class AccountsManagerFragment extends BaseSupportListFragment implements LoaderCallbacks<Cursor> {
public class AccountsManagerFragment extends BaseSupportListFragment implements LoaderCallbacks<Cursor>, DropListener {
private AccountsAdapter mAdapter;
@ -49,8 +54,12 @@ public class AccountsManagerFragment extends BaseSupportListFragment implements
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
mAdapter = new AccountsAdapter(getActivity());
final FragmentActivity activity = getActivity();
mAdapter = new AccountsAdapter(activity);
Utils.configBaseAdapter(activity, mAdapter);
setListAdapter(mAdapter);
final DragSortListView listView = (DragSortListView) getListView();
listView.setDropListener(this);
getLoaderManager().initLoader(0, null, this);
}
@ -79,4 +88,10 @@ public class AccountsManagerFragment extends BaseSupportListFragment implements
public void onLoaderReset(Loader<Cursor> loader) {
mAdapter.changeCursor(null);
}
@Override
public void drop(int from, int to) {
}
}

View File

@ -28,8 +28,8 @@ public class UserListMenuDialogFragment extends MenuDialogFragment {
extensionsExtras.putParcelable(EXTRA_USER_LIST, user);
extensionsIntent.putExtras(extensionsExtras);
addIntentToMenu(getThemedContext(), menu, extensionsIntent);
final boolean longclickToOpenMenu = prefs.getBoolean(KEY_LONG_CLICK_TO_OPEN_MENU, false);
Utils.setMenuItemAvailability(menu, MENU_MULTI_SELECT, longclickToOpenMenu);
final boolean longClickToOpenMenu = prefs.getBoolean(KEY_LONG_CLICK_TO_OPEN_MENU, false);
Utils.setMenuItemAvailability(menu, MENU_MULTI_SELECT, longClickToOpenMenu);
}
protected void onPrepareItemMenu(final Menu menu, final ParcelableUserList userList) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
<org.mariotaku.twidere.view.MainFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.FiltersActivity">
<org.mariotaku.twidere.view.ExtendedViewPager
@ -8,4 +11,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</merge>
</org.mariotaku.twidere.view.MainFrameLayout>

View File

@ -31,10 +31,9 @@
android:id="@+id/drag_handle"
android:layout_width="24dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_weight="0"
android:background="@drawable/list_drag_handle"/>
<ImageView
@ -56,12 +55,27 @@
android:orientation="vertical"
android:padding="@dimen/element_spacing_normal">
<TextView
android:id="@android:id/text1"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"/>
android:orientation="horizontal">
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="@+id/default_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/default_account"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
<TextView
android:id="@android:id/text2"
@ -80,16 +94,4 @@
android:clickable="false"
android:focusable="false"/>
<TextView
android:id="@+id/default_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@android:id/icon"
android:layout_alignLeft="@android:id/icon"
android:background="#80000000"
android:singleLine="true"
android:text="@string/default_account"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/white"/>
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>

View File

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@id/delete"
android:icon="@drawable/ic_action_delete"
android:showAsAction="ifRoom|withText"
android:title="@string/delete"/>
<item
android:id="@id/inverse_selection"
android:icon="@drawable/ic_action_inverse_selection"
android:showAsAction="ifRoom|withText"
android:title="@string/inverse_selection"/>
<item
android:id="@id/delete"
android:icon="@drawable/ic_action_delete"
android:showAsAction="ifRoom|withText"
android:title="@string/delete"/>
</menu>

View File

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@id/take_photo"
android:icon="@drawable/ic_action_camera"
android:showAsAction="ifRoom"
android:title="@string/take_photo"/>
<item
android:id="@id/add_image"
android:icon="@drawable/ic_action_gallery"
android:showAsAction="ifRoom"
android:title="@string/add_image"/>
<item
android:id="@id/add_location"
android:checkable="true"
android:icon="@drawable/ic_action_mylocation"
android:showAsAction="ifRoom"
android:title="@string/location"/>
<item
android:id="@id/view"
android:icon="@drawable/ic_action_reply"
android:showAsAction="ifRoom"
android:title="@string/original_status"
android:visible="false"/>
<item
android:id="@id/drafts"
android:icon="@drawable/ic_action_draft"
android:showAsAction="ifRoom"
android:title="@string/drafts"/>
<item
android:id="@id/toggle_sensitive"
android:checkable="true"
android:icon="@drawable/ic_action_warning"
android:title="@string/mark_as_sensitive"/>
<item
android:id="@id/take_photo"
android:icon="@drawable/ic_action_camera"
android:showAsAction="ifRoom"
android:title="@string/take_photo"/>
<item
android:id="@id/add_image"
android:icon="@drawable/ic_action_gallery"
android:showAsAction="ifRoom"
android:title="@string/add_image"/>
<item
android:id="@id/add_location"
android:checkable="true"
android:icon="@drawable/ic_action_mylocation"
android:showAsAction="ifRoom"
android:title="@string/location"/>
<item
android:id="@id/view"
android:icon="@drawable/ic_action_reply"
android:showAsAction="ifRoom"
android:title="@string/original_status"
android:visible="false"/>
<item
android:id="@id/drafts"
android:icon="@drawable/ic_action_draft"
android:showAsAction="ifRoom"
android:title="@string/drafts"/>
<item
android:id="@id/toggle_sensitive"
android:checkable="true"
android:icon="@drawable/ic_action_warning"
android:title="@string/mark_as_sensitive"/>
</menu>

View File

@ -1,160 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="entries_refresh_interval">
<item>@string/item_3_minutes</item>
<item>@string/item_5_minutes</item>
<item>@string/item_10_minutes</item>
<item>@string/item_15_minutes</item>
<item>@string/item_30_minutes</item>
<item>@string/item_1_hour</item>
<item>@string/item_2_hours</item>
<item>@string/item_4_hours</item>
</string-array>
<string-array name="values_refresh_interval">
<item>3</item>
<item>5</item>
<item>10</item>
<item>15</item>
<item>30</item>
<item>60</item>
<item>120</item>
<item>240</item>
</string-array>
<string-array name="entries_auto_refresh_content">
<item>@string/home</item>
<item>@string/mentions</item>
<item>@string/inbox</item>
<item>@string/trends</item>
</string-array>
<string-array name="entries_notification_content">
<item>@string/home</item>
<item>@string/mentions</item>
<item>@string/inbox</item>
</string-array>
<string-array name="entries_home_refresh_content">
<item>@string/mentions</item>
<item>@string/inbox</item>
<item>@string/trends</item>
</string-array>
<string-array name="entries_image_preload_option">
<item>@string/profile_images</item>
<item>@string/preview_images</item>
</string-array>
<string-array name="entries_compose_quit_action">
<item>@string/ask</item>
<item>@string/save</item>
<item>@string/discard</item>
</string-array>
<string-array name="values_compose_quit_action">
<item>ask</item>
<item>save</item>
<item>discard</item>
</string-array>
<string-array name="entries_official_consumer_key_secret">
<item>Twitter for Android</item>
<item>Twitter for iPhone</item>
<item>Twitter for iPad</item>
<item>Twitter for Mac</item>
<item>Twitter for Windows Phone</item>
<item>Twitter for Google TV</item>
</string-array>
<string-array name="values_official_consumer_key_secret">
<item>3nVuSoBZnx6U4vzUxf5w;Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys</item>
<item>IQKbtAYlXLripLGPWd0HUA;GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU</item>
<item>CjulERsDeqhhjSme66ECg;IQWdVyqFxghAtURHGeGiWAsmCAGmdW3WmbEx6Hck</item>
<item>3rJOl1ODzm9yZy63FACdg;5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8</item>
<item>yN3DUNVO0Me63IAQdhTfCA;c768oTKdzAjIYCmpSNIdZbGaG0t6rOhSFQP0S5uC79g</item>
<item>iAtYJ4HpUVfIUoNnif1DA;172fOpzuZoYzNYaU3mMYvE8m8MEyLbztOdbrUolU</item>
</string-array>
<string-array name="entries_theme">
<item>@string/theme_twidere</item>
<item>@string/theme_light</item>
<item>@string/theme_dark</item>
</string-array>
<string-array name="values_theme">
<item>twidere</item>
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="values_theme_background">
<item>default</item>
<item>solid</item>
<item>transparent</item>
</string-array>
<string-array name="entries_theme_background">
<item>@string/theme_background_default</item>
<item>@string/theme_background_solid</item>
<item>@string/theme_background_transparent</item>
</string-array>
<string-array name="dependency_values_actionbar_theme">
<item>twidere</item>
<item>light</item>
</string-array>
<string-array name="dependency_values_theme_background_alpha">
<item>transparent</item>
</string-array>
<string-array name="dependency_values_true">
<item>true</item>
</string-array>
<string-array name="dependency_values_false">
<item>false</item>
</string-array>
<string-array name="values_tab_display_option">
<item>icon</item>
<item>label</item>
<item>both</item>
</string-array>
<string-array name="entries_tab_display_option">
<item>@string/tab_display_option_icon</item>
<item>@string/tab_display_option_label</item>
<item>@string/tab_display_option_icon_and_label</item>
</string-array>
<string-array name="entries_settings_export">
<item>@string/accounts</item>
<item>@string/drafts</item>
<item>@string/settings</item>
<item>@string/tabs</item>
<item>@string/filters</item>
<item>@string/nicknames</item>
<item>@string/user_colors</item>
<item>@string/custom_host_mapping</item>
</string-array>
<string-array name="values_compose_now_action">
<item>compose</item>
<item>take_photo</item>
<item>pick_image</item>
</string-array>
<string-array name="entries_compose_now_action">
<item>@string/compose</item>
<item>@string/take_photo</item>
<item>@string/add_image</item>
</string-array>
<string-array name="values_card_highlight_option">
<item>background</item>
<item>line</item>
<item>none</item>
</string-array>
<string-array name="entries_card_highlight_option">
<item>@string/card_highlight_option_highlight</item>
<item>@string/card_highlight_option_line</item>
<item>@string/none</item>
</string-array>
<string-array name="values_image_preview_scale_type">
<item>CENTER_CROP</item>
<item>FIT_CENTER</item>
</string-array>
<string-array name="entries_image_preview_scale_type">
<item>@string/image_preview_scale_type_crop</item>
<item>@string/image_preview_scale_type_fit_center</item>
</string-array>
<string-array name="entries_image_sources">
<item>@string/from_camera</item>
<item>@string/from_gallery</item>
</string-array>
<string-array name="value_image_sources">
<item>camera</item>
<item>gallery</item>
</string-array>
<string-array name="entries_refresh_interval">
<item>@string/item_3_minutes</item>
<item>@string/item_5_minutes</item>
<item>@string/item_10_minutes</item>
<item>@string/item_15_minutes</item>
<item>@string/item_30_minutes</item>
<item>@string/item_1_hour</item>
<item>@string/item_2_hours</item>
<item>@string/item_4_hours</item>
</string-array>
<string-array name="values_refresh_interval">
<item>3</item>
<item>5</item>
<item>10</item>
<item>15</item>
<item>30</item>
<item>60</item>
<item>120</item>
<item>240</item>
</string-array>
<string-array name="entries_auto_refresh_content">
<item>@string/home</item>
<item>@string/mentions</item>
<item>@string/inbox</item>
<item>@string/trends</item>
</string-array>
<string-array name="entries_notification_content">
<item>@string/home</item>
<item>@string/mentions</item>
<item>@string/inbox</item>
</string-array>
<string-array name="entries_home_refresh_content">
<item>@string/mentions</item>
<item>@string/inbox</item>
<item>@string/trends</item>
</string-array>
<string-array name="entries_image_preload_option">
<item>@string/profile_images</item>
<item>@string/preview_images</item>
</string-array>
<string-array name="entries_compose_quit_action">
<item>@string/ask</item>
<item>@string/save</item>
<item>@string/discard</item>
</string-array>
<string-array name="values_compose_quit_action">
<item>ask</item>
<item>save</item>
<item>discard</item>
</string-array>
<string-array name="entries_official_consumer_key_secret">
<item>Twitter for Android</item>
<item>Twitter for iPhone</item>
<item>Twitter for iPad</item>
<item>Twitter for Mac</item>
<item>Twitter for Windows Phone</item>
<item>Twitter for Google TV</item>
</string-array>
<string-array name="values_official_consumer_key_secret">
<item>3nVuSoBZnx6U4vzUxf5w;Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys</item>
<item>IQKbtAYlXLripLGPWd0HUA;GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU</item>
<item>CjulERsDeqhhjSme66ECg;IQWdVyqFxghAtURHGeGiWAsmCAGmdW3WmbEx6Hck</item>
<item>3rJOl1ODzm9yZy63FACdg;5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8</item>
<item>yN3DUNVO0Me63IAQdhTfCA;c768oTKdzAjIYCmpSNIdZbGaG0t6rOhSFQP0S5uC79g</item>
<item>iAtYJ4HpUVfIUoNnif1DA;172fOpzuZoYzNYaU3mMYvE8m8MEyLbztOdbrUolU</item>
</string-array>
<string-array name="entries_theme">
<item>@string/theme_light</item>
<item>@string/theme_dark</item>
</string-array>
<string-array name="values_theme">
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="values_theme_background">
<item>default</item>
<item>solid</item>
<item>transparent</item>
</string-array>
<string-array name="entries_theme_background">
<item>@string/theme_background_default</item>
<item>@string/theme_background_solid</item>
<item>@string/theme_background_transparent</item>
</string-array>
<string-array name="dependency_values_actionbar_theme">
<item>twidere</item>
<item>light</item>
</string-array>
<string-array name="dependency_values_theme_background_alpha">
<item>transparent</item>
</string-array>
<string-array name="dependency_values_true">
<item>true</item>
</string-array>
<string-array name="dependency_values_false">
<item>false</item>
</string-array>
<string-array name="values_tab_display_option">
<item>icon</item>
<item>label</item>
<item>both</item>
</string-array>
<string-array name="entries_tab_display_option">
<item>@string/tab_display_option_icon</item>
<item>@string/tab_display_option_label</item>
<item>@string/tab_display_option_icon_and_label</item>
</string-array>
<string-array name="entries_settings_export">
<item>@string/accounts</item>
<item>@string/drafts</item>
<item>@string/settings</item>
<item>@string/tabs</item>
<item>@string/filters</item>
<item>@string/nicknames</item>
<item>@string/user_colors</item>
<item>@string/custom_host_mapping</item>
</string-array>
<string-array name="values_compose_now_action">
<item>compose</item>
<item>take_photo</item>
<item>pick_image</item>
</string-array>
<string-array name="entries_compose_now_action">
<item>@string/compose</item>
<item>@string/take_photo</item>
<item>@string/add_image</item>
</string-array>
<string-array name="values_card_highlight_option">
<item>background</item>
<item>line</item>
<item>none</item>
</string-array>
<string-array name="entries_card_highlight_option">
<item>@string/card_highlight_option_highlight</item>
<item>@string/card_highlight_option_line</item>
<item>@string/none</item>
</string-array>
<string-array name="values_image_preview_scale_type">
<item>CENTER_CROP</item>
<item>FIT_CENTER</item>
</string-array>
<string-array name="entries_image_preview_scale_type">
<item>@string/image_preview_scale_type_crop</item>
<item>@string/image_preview_scale_type_fit_center</item>
</string-array>
<string-array name="entries_image_sources">
<item>@string/from_camera</item>
<item>@string/from_gallery</item>
</string-array>
<string-array name="value_image_sources">
<item>camera</item>
<item>gallery</item>
</string-array>
</resources>

View File

@ -75,4 +75,5 @@
<item name="progress" type="id"/>
<item name="open_with_account" type="id"/>
<item name="accounts" type="id"/>
<item name="inverse_selection" type="id"/>
</resources>

View File

@ -646,5 +646,6 @@
<string name="exclude_this_host">Exclude this host</string>
<string name="api_url_format_help">[DOMAIN]: Twitter API domain.\nExample: https://[DOMAIN].twitter.com/ will be replaced to https://api.twitter.com/.</string>
<string name="no_version_suffix">No version suffix</string>
<string name="inverse_selection">Inverse selection</string>
</resources>

View File

@ -1,69 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/theme">
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/theme">
<PreferenceCategory
android:key="cat_theme_preview"
android:order="11"
android:title="@string/preview">
<org.mariotaku.twidere.preference.ThemePreviewPreference android:key="theme_preview"/>
</PreferenceCategory>
<PreferenceCategory
android:key="cat_theme_preview"
android:order="11"
android:title="@string/preview">
<org.mariotaku.twidere.preference.ThemePreviewPreference android:key="theme_preview"/>
</PreferenceCategory>
<org.mariotaku.twidere.preference.AutoInvalidateListPreference
android:defaultValue="twidere"
android:entries="@array/entries_theme"
android:entryValues="@array/values_theme"
android:key="theme"
android:order="21"
android:summary="%s"
android:title="@string/theme"/>
<org.mariotaku.twidere.preference.AutoInvalidateListPreference
android:defaultValue="default"
android:entries="@array/entries_theme_background"
android:entryValues="@array/values_theme_background"
android:key="theme_background"
android:order="22"
android:summary="%s"
android:title="@string/theme_background"/>
<org.mariotaku.twidere.preference.SummaryListPreference
android:defaultValue="twidere"
android:entries="@array/entries_theme"
android:entryValues="@array/values_theme"
android:key="theme"
android:order="21"
android:title="@string/theme"/>
<org.mariotaku.twidere.preference.SummaryListPreference
android:defaultValue="default"
android:entries="@array/entries_theme_background"
android:entryValues="@array/values_theme_background"
android:key="theme_background"
android:order="22"
android:title="@string/theme_background"/>
<org.mariotaku.twidere.preference.ValueDependencySeekBarDialogPreference
android:defaultValue="160"
android:key="theme_background_alpha"
android:order="23"
android:title="@string/theme_background_alpha"
app:dependencyKey="theme_background"
app:dependencyValueDefault="default"
app:dependencyValues="@array/dependency_values_theme_background_alpha"
app:max="255"
app:min="0"/>
<org.mariotaku.twidere.preference.ValueDependencySeekBarDialogPreference
android:defaultValue="160"
android:key="theme_background_alpha"
android:order="23"
android:title="@string/theme_background_alpha"
app:dependencyKey="theme_background"
app:dependencyValueDefault="default"
app:dependencyValues="@array/dependency_values_theme_background_alpha"
app:max="255"
app:min="0"/>
<org.mariotaku.twidere.preference.ValueDependencyCheckBoxPreference
android:defaultValue="true"
android:key="theme_dark_actionbar"
android:order="24"
android:title="@string/theme_dark_actionbar"
app:dependencyKey="theme"
app:dependencyValueDefault="twidere"
app:dependencyValues="@array/dependency_values_actionbar_theme"/>
<org.mariotaku.twidere.preference.ColorPickerPreference
android:defaultValue="@android:color/holo_blue_light"
android:key="theme_color"
android:order="25"
android:title="@string/theme_color"/>
<org.mariotaku.twidere.preference.ColorPickerPreference
android:defaultValue="@android:color/holo_blue_light"
android:key="theme_color"
android:order="25"
android:title="@string/theme_color"/>
<org.mariotaku.twidere.preference.ThemeFontFamilyPreference
android:defaultValue="sans-serif-light"
android:enabled="@bool/has_font_family"
android:key="theme_font_family"
android:order="26"
android:title="@string/theme_font_family"/>
<org.mariotaku.twidere.preference.ThemeFontFamilyPreference
android:defaultValue="sans-serif-light"
android:enabled="@bool/has_font_family"
android:key="theme_font_family"
android:order="26"
android:title="@string/theme_font_family"/>
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
android:defaultValue="true"
android:key="dark_drawer"
android:order="27"
android:title="@string/dark_drawer"/>
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
android:defaultValue="true"
android:key="dark_drawer"
android:order="27"
android:title="@string/dark_drawer"/>
</PreferenceScreen>