fixed link highlight export

This commit is contained in:
Mariotaku Lee 2016-06-09 21:28:02 +08:00
parent 1bf52fd433
commit f70c7d4f19
5 changed files with 18 additions and 56 deletions

View File

@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:2.1.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {

View File

@ -91,14 +91,6 @@ public interface SharedPreferenceConstants {
String VALUE_COMPOSE_NOW_ACTION_TAKE_PHOTO = "take_photo";
String VALUE_COMPOSE_NOW_ACTION_PICK_IMAGE = "pick_image";
String VALUE_CARD_HIGHLIGHT_OPTION_NONE = VALUE_NONE;
String VALUE_CARD_HIGHLIGHT_OPTION_BACKGROUND = "background";
String VALUE_CARD_HIGHLIGHT_OPTION_LINE = "line";
int VALUE_CARD_HIGHLIGHT_OPTION_CODE_NONE = 0x0;
int VALUE_CARD_HIGHLIGHT_OPTION_CODE_BACKGROUND = 0x1;
int VALUE_CARD_HIGHLIGHT_OPTION_CODE_LINE = 0x2;
String DEFAULT_THEME = VALUE_THEME_NAME_LIGHT;
String DEFAULT_THEME_BACKGROUND = VALUE_THEME_BACKGROUND_DEFAULT;
String DEFAULT_THEME_FONT_FAMILY = VALUE_THEME_FONT_FAMILY_REGULAR;
@ -127,7 +119,6 @@ public interface SharedPreferenceConstants {
int DEFAULT_DATABASE_ITEM_LIMIT = 100;
int DEFAULT_LOAD_ITEM_LIMIT = 20;
String DEFAULT_CARD_HIGHLIGHT_OPTION = VALUE_CARD_HIGHLIGHT_OPTION_BACKGROUND;
@Preference(type = INT, hasDefault = true, defaultInt = DEFAULT_DATABASE_ITEM_LIMIT)
String KEY_DATABASE_ITEM_LIMIT = "database_item_limit";
@ -147,8 +138,6 @@ public interface SharedPreferenceConstants {
String KEY_THEME_FONT_FAMILY = "theme_font_family";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_DISPLAY_PROFILE_IMAGE = "display_profile_image";
@Preference(type = BOOLEAN)
String KEY_LEFTSIDE_COMPOSE_BUTTON = "leftside_compose_button";
@Preference(type = BOOLEAN, exportable = false, hasDefault = true, defaultBoolean = false)
String KEY_ATTACH_LOCATION = "attach_location";
@Preference(type = BOOLEAN, exportable = false, hasDefault = true, defaultBoolean = true)
@ -234,17 +223,12 @@ public interface SharedPreferenceConstants {
String KEY_DISPLAY_SENSITIVE_CONTENTS = "display_sensitive_contents";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_PHISHING_LINK_WARNING = "phishing_link_warning";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = false)
String KEY_FAST_SCROLL_THUMB = "fast_scroll_thumb";
@Preference(type = STRING, hasDefault = true, defaultString = VALUE_LINK_HIGHLIGHT_OPTION_NONE)
String KEY_LINK_HIGHLIGHT_OPTION = "link_highlight_option";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_INDICATE_MY_STATUS = "indicate_my_status";
String KEY_PRELOAD_PROFILE_IMAGES = "preload_profile_images";
String KEY_PRELOAD_PREVIEW_IMAGES = "preload_preview_images";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_PRELOAD_WIFI_ONLY = "preload_wifi_only";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_LINK_TO_QUOTED_TWEET = "link_to_quoted_tweet";
@Preference(type = BOOLEAN)
String KEY_NO_CLOSE_AFTER_TWEET_SENT = "no_close_after_tweet_sent";
@Preference(type = STRING, hasDefault = false)
@ -262,8 +246,6 @@ public interface SharedPreferenceConstants {
String KEY_SETTINGS_WIZARD_COMPLETED = "settings_wizard_completed";
String KEY_CONSUMER_KEY_SECRET_SET = "consumer_key_secret_set";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_CARD_ANIMATION = "card_animation";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_UNREAD_COUNT = "unread_count";
String KEY_NOTIFICATION = "notification";
String KEY_NOTIFICATION_TYPE_HOME = "notification_type_home";
@ -291,8 +273,6 @@ public interface SharedPreferenceConstants {
String KEY_TRANSLATION_DESTINATION = "translation_destination";
@Preference(type = STRING)
String KEY_TAB_DISPLAY_OPTION = "tab_display_option";
@Preference(type = STRING)
String KEY_CARD_HIGHLIGHT_OPTION = "card_highlight_option";
@Preference(type = INT, exportable = false)
String KEY_LIVE_WALLPAPER_SCALE = "live_wallpaper_scale";
@Preference(type = LONG, exportable = false)
@ -317,8 +297,6 @@ public interface SharedPreferenceConstants {
String KEY_BUG_REPORTS = "bug_reports";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = false)
String KEY_COMBINED_NOTIFICATIONS = "combined_notifications";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = true)
String KEY_TWITTER_OPTIMIZED_SEARCHES = "twitter_optimized_searches";
@Preference(type = BOOLEAN, hasDefault = true, defaultBoolean = false)
String KEY_I_WANT_MY_STARS_BACK = "i_want_my_stars_back";
@Preference(type = STRING, hasDefault = false)

View File

@ -29,6 +29,7 @@ import android.support.annotation.NonNull;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
import android.support.v4.content.Loader;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@ -42,8 +43,6 @@ import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import com.afollestad.materialdialogs.AlertDialogWrapper;
import org.mariotaku.restfu.annotation.method.GET;
import org.mariotaku.restfu.http.HttpRequest;
import org.mariotaku.restfu.http.HttpResponse;
@ -290,7 +289,7 @@ public class APIEditorActivity extends BaseActivity implements OnCheckedChangeLi
final Context context = getContext();
List<CustomAPIConfig> configs = CustomAPIConfig.listDefault(context);
mAdapter = new CustomAPIConfigArrayAdapter(context, configs);
final AlertDialogWrapper.Builder builder = new AlertDialogWrapper.Builder(context);
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setAdapter(mAdapter, this);
if (!BuildConfig.DEBUG) {
getLoaderManager().initLoader(0, null, this);

View File

@ -1152,22 +1152,24 @@ public class SignInActivity extends BaseActivity implements OnClickListener, Tex
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final MaterialDialog.Builder builder = new MaterialDialog.Builder(getContext());
builder.positiveText(R.string.sign_in);
builder.negativeText(android.R.string.cancel);
builder.customView(R.layout.dialog_password_sign_in, true);
builder.onPositive(new MaterialDialog.SingleButtonCallback() {
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setPositiveButton(R.string.sign_in, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
EditText editUsername = (EditText) dialog.findViewById(R.id.username);
EditText editPassword = (EditText) dialog.findViewById(R.id.password);
public void onClick(DialogInterface dialog, int which) {
AlertDialog alertDialog = (AlertDialog) dialog;
EditText editUsername = (EditText) alertDialog.findViewById(R.id.username);
EditText editPassword = (EditText) alertDialog.findViewById(R.id.password);
SignInActivity activity = (SignInActivity) getActivity();
activity.setUsernamePassword(String.valueOf(editUsername.getText()),
String.valueOf(editPassword.getText()));
activity.doLogin();
}
});
builder.showListener(new DialogInterface.OnShowListener() {
builder.setNegativeButton(android.R.string.cancel, null);
builder.setView(R.layout.dialog_password_sign_in);
final AlertDialog alertDialog = builder.create();
alertDialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
@ -1197,7 +1199,7 @@ public class SignInActivity extends BaseActivity implements OnClickListener, Tex
editPassword.addTextChangedListener(textWatcher);
}
});
return builder.build();
return alertDialog;
}
}

View File

@ -641,7 +641,8 @@ public final class Utils implements Constants {
fragment = new GroupFragment();
final String paramGroupId = uri.getQueryParameter(QUERY_PARAM_GROUP_ID);
final String paramGroupName = uri.getQueryParameter(QUERY_PARAM_GROUP_NAME);
if (TextUtils.isEmpty(paramGroupId) && TextUtils.isEmpty(paramGroupName)) return null;
if (TextUtils.isEmpty(paramGroupId) && TextUtils.isEmpty(paramGroupName))
return null;
args.putString(EXTRA_GROUP_ID, paramGroupId);
args.putString(EXTRA_GROUP_NAME, paramGroupName);
break;
@ -1128,24 +1129,6 @@ public final class Utils implements Constants {
return Color.TRANSPARENT;
}
public static String getCardHighlightOption(final Context context) {
if (context == null) return null;
final String defaultOption = context.getString(R.string.default_tab_display_option);
final SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
return prefs.getString(KEY_TAB_DISPLAY_OPTION, defaultOption);
}
public static int getCardHighlightOptionInt(final Context context) {
return getCardHighlightOptionInt(getCardHighlightOption(context));
}
public static int getCardHighlightOptionInt(final String option) {
if (VALUE_CARD_HIGHLIGHT_OPTION_NONE.equals(option))
return VALUE_CARD_HIGHLIGHT_OPTION_CODE_NONE;
else if (VALUE_CARD_HIGHLIGHT_OPTION_LINE.equals(option))
return VALUE_CARD_HIGHLIGHT_OPTION_CODE_LINE;
return VALUE_CARD_HIGHLIGHT_OPTION_CODE_BACKGROUND;
}
public static Selectable getColumnsFromProjection(final String... projection) {
if (projection == null) return new AllColumns();