|
@ -18,6 +18,14 @@
|
|||
*/
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
/**
|
||||
* Gradle script for signing applications
|
||||
* Just apply this script to your application build.gradle file.
|
||||
* DON'T FORGET TO IGNORE signing.properties FROM YOUR VERSION CONTROL!!!
|
||||
*
|
||||
* @author Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
*/
|
||||
|
||||
android {
|
||||
|
||||
signingConfigs {
|
||||
|
|
|
@ -209,6 +209,7 @@ public interface IntentConstants {
|
|||
public static final String EXTRA_MY_FOLLOWING_ONLY = "my_following_only";
|
||||
public static final String EXTRA_RESTART_ACTIVITY = "restart_activity";
|
||||
public static final String EXTRA_FROM_USER = "from_user";
|
||||
public static final String EXTRA_SHOW_MEDIA_PREVIEW = "show_media_preview";
|
||||
public static final String EXTRA_BITMAP = "bitmap";
|
||||
public static final String EXTRA_SOURCE = "source";
|
||||
public static final String EXTRA_DESTINATION = "destination";
|
||||
|
|
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 19 KiB |
|
@ -1,22 +0,0 @@
|
|||
<!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ This program 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 program 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.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">twidere.component.jsonserializer</string>
|
||||
</resources>
|
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 19 KiB |
|
@ -1,22 +0,0 @@
|
|||
<!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ This program 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 program 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.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">twidere.component.sqlquerybuilder</string>
|
||||
</resources>
|
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 19 KiB |
|
@ -1,22 +0,0 @@
|
|||
<!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ This program 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 program 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.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">twidere.library.extension</string>
|
||||
</resources>
|
|
@ -71,7 +71,7 @@ dependencies {
|
|||
compile 'com.diegocarloslima:byakugallery:0.1.0'
|
||||
compile 'com.rengwuxian.materialedittext:library:1.8.3'
|
||||
compile 'com.pnikosis:materialish-progress:1.4'
|
||||
compile 'com.squareup.okhttp:okhttp:2.2.0'
|
||||
compile 'com.squareup.okhttp:okhttp:2.3.0'
|
||||
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.2'
|
||||
aarLinkSources 'com.squareup.okhttp:okhttp:2.2.0:sources@jar'
|
||||
googleCompile 'com.google.android.gms:play-services-maps:6.5.87'
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
|
||||
|
||||
<application>
|
||||
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.version"
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
|
||||
package org.mariotaku.twidere.activity.support;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class GoogleMapViewerActivity extends BaseActionBarActivity implements Co
|
|||
finish();
|
||||
return;
|
||||
}
|
||||
final ActionBar actionBar = getActionBar();
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
|
|
@ -18,12 +18,13 @@
|
|||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/center"
|
||||
android:icon="@drawable/ic_action_my_location"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/center"/>
|
||||
<item
|
||||
android:id="@id/center"
|
||||
android:icon="@drawable/ic_action_my_location"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/center"/>
|
||||
|
||||
</menu>
|
|
@ -59,7 +59,7 @@
|
|||
android:allowBackup="true"
|
||||
android:backupAgent="org.mariotaku.twidere.backup.TwidereBackupAgentHelper"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@drawable/logo5"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Blank">
|
||||
<uses-library
|
||||
|
@ -90,7 +90,7 @@
|
|||
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:icon="@drawable/logo5"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/Theme.Launcher"
|
||||
|
|
|
@ -59,7 +59,7 @@ public class SpiceAsyUploadTask extends AsyncTask<Void, Void, Void> {
|
|||
String serverResponseCode = client.getResponse();
|
||||
|
||||
|
||||
if (serverResponseCode.indexOf("00") > -1) {
|
||||
if (serverResponseCode.contains("00")) {
|
||||
SpiceProfilingUtil.log(context, "server has already received file " + tmp.getName());
|
||||
tmp.delete();
|
||||
} else {
|
||||
|
@ -92,7 +92,7 @@ public class SpiceAsyUploadTask extends AsyncTask<Void, Void, Void> {
|
|||
final File root = context.getFilesDir();
|
||||
final File[] spiceFiles = root.listFiles(new SpiceFileFilter());
|
||||
uploadToServer(spiceFiles);
|
||||
prefs.edit().putLong(LAST_UPLOAD_DATE, System.currentTimeMillis()).commit();
|
||||
prefs.edit().putLong(LAST_UPLOAD_DATE, System.currentTimeMillis()).apply();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -119,11 +119,11 @@ public class SpiceAsyUploadTask extends AsyncTask<Void, Void, Void> {
|
|||
copyStream(is, os);
|
||||
is.close();
|
||||
os.close();
|
||||
success = true;
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
success = true;
|
||||
|
||||
if (success && tmp.renameTo(profile) && tmp.delete()) {
|
||||
SpiceProfilingUtil.log(context, "put profile back success");
|
||||
|
|
|
@ -1,136 +1,136 @@
|
|||
package edu.ucdavis.earlybird;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.copyStream;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.provider.Settings.Secure;
|
||||
|
||||
import twitter4j.TwitterException;
|
||||
import twitter4j.http.HttpClientWrapper;
|
||||
import twitter4j.http.HttpParameter;
|
||||
import twitter4j.http.HttpResponse;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import twitter4j.TwitterException;
|
||||
import twitter4j.http.HttpClientWrapper;
|
||||
import twitter4j.http.HttpParameter;
|
||||
import twitter4j.http.HttpResponse;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.copyStream;
|
||||
|
||||
public class UploadTask extends AsyncTask<Void, Void, Void> {
|
||||
|
||||
private static final String LAST_UPLOAD_DATE = "last_upload_time";
|
||||
private static final double MILLSECS_HALF_DAY = 1000 * 60 * 60 * 12;
|
||||
private static final String LAST_UPLOAD_DATE = "last_upload_time";
|
||||
private static final double MILLSECS_HALF_DAY = 1000 * 60 * 60 * 12;
|
||||
|
||||
private final String device_id;
|
||||
private final Context context;
|
||||
private final String device_id;
|
||||
private final Context context;
|
||||
|
||||
private final HttpClientWrapper client = new HttpClientWrapper();
|
||||
private final HttpClientWrapper client = new HttpClientWrapper();
|
||||
|
||||
private static final String PROFILE_SERVER_URL = "http://weik.metaisle.com/profiles";
|
||||
private static final String PROFILE_SERVER_URL = "http://weik.metaisle.com/profiles";
|
||||
|
||||
// private static final String PROFILE_SERVER_URL =
|
||||
// "http://192.168.0.105:3000/profiles";
|
||||
// private static final String PROFILE_SERVER_URL =
|
||||
// "http://192.168.0.105:3000/profiles";
|
||||
|
||||
public UploadTask(final Context context) {
|
||||
this.context = context;
|
||||
device_id = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
|
||||
}
|
||||
public UploadTask(final Context context) {
|
||||
this.context = context;
|
||||
device_id = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
|
||||
}
|
||||
|
||||
public void uploadMultipart(final String url, final File file) {
|
||||
final String app_root = file.getParent();
|
||||
final File tmp_dir = new File(app_root + "/tmp");
|
||||
if (!tmp_dir.exists()) {
|
||||
if (!tmp_dir.mkdirs()) {
|
||||
ProfilingUtil.log(context, "cannot create tmp, do nothing.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
final File tmp = new File(tmp_dir, file.getName());
|
||||
file.renameTo(tmp);
|
||||
public void uploadMultipart(final String url, final File file) {
|
||||
final String app_root = file.getParent();
|
||||
final File tmp_dir = new File(app_root + "/tmp");
|
||||
if (!tmp_dir.exists()) {
|
||||
if (!tmp_dir.mkdirs()) {
|
||||
ProfilingUtil.log(context, "cannot create tmp, do nothing.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
final File tmp = new File(tmp_dir, file.getName());
|
||||
file.renameTo(tmp);
|
||||
|
||||
try {
|
||||
final HttpParameter param = new HttpParameter("upload", tmp);
|
||||
final HttpResponse resp = client.post(url, null, new HttpParameter[] { param });
|
||||
try {
|
||||
final HttpParameter param = new HttpParameter("upload", tmp);
|
||||
final HttpResponse resp = client.post(url, null, new HttpParameter[]{param});
|
||||
|
||||
// Responses from the server (code and message)
|
||||
final int serverResponseCode = resp.getStatusCode();
|
||||
// Responses from the server (code and message)
|
||||
final int serverResponseCode = resp.getStatusCode();
|
||||
|
||||
ProfilingUtil.log(context, "server response code " + serverResponseCode);
|
||||
ProfilingUtil.log(context, "server response code " + serverResponseCode);
|
||||
|
||||
if (serverResponseCode / 100 == 2) {
|
||||
tmp.delete();
|
||||
} else {
|
||||
putBackProfile(context, tmp, file);
|
||||
}
|
||||
if (serverResponseCode / 100 == 2) {
|
||||
tmp.delete();
|
||||
} else {
|
||||
putBackProfile(context, tmp, file);
|
||||
}
|
||||
|
||||
} catch (final TwitterException e) {
|
||||
e.printStackTrace();
|
||||
putBackProfile(context, tmp, file);
|
||||
}
|
||||
}
|
||||
} catch (final TwitterException e) {
|
||||
e.printStackTrace();
|
||||
putBackProfile(context, tmp, file);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(final Void... params) {
|
||||
@Override
|
||||
protected Void doInBackground(final Void... params) {
|
||||
|
||||
final SharedPreferences prefs = context.getSharedPreferences("ucd_data_profiling", Context.MODE_PRIVATE);
|
||||
final SharedPreferences prefs = context.getSharedPreferences("ucd_data_profiling", Context.MODE_PRIVATE);
|
||||
|
||||
if (prefs.contains(LAST_UPLOAD_DATE)) {
|
||||
final long lastUpload = prefs.getLong(LAST_UPLOAD_DATE, System.currentTimeMillis());
|
||||
final double deltaDays = (System.currentTimeMillis() - lastUpload) / (MILLSECS_HALF_DAY * 2);
|
||||
if (deltaDays < 1) {
|
||||
ProfilingUtil.log(context, "Uploaded less than 1 day ago.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (prefs.contains(LAST_UPLOAD_DATE)) {
|
||||
final long lastUpload = prefs.getLong(LAST_UPLOAD_DATE, System.currentTimeMillis());
|
||||
final double deltaDays = (System.currentTimeMillis() - lastUpload) / (MILLSECS_HALF_DAY * 2);
|
||||
if (deltaDays < 1) {
|
||||
ProfilingUtil.log(context, "Uploaded less than 1 day ago.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
final File root = context.getFilesDir();
|
||||
final File[] files = root.listFiles(new CSVFileFilter());
|
||||
final File root = context.getFilesDir();
|
||||
final File[] files = root.listFiles(new CSVFileFilter());
|
||||
|
||||
uploadToNode(files);
|
||||
prefs.edit().putLong(LAST_UPLOAD_DATE, System.currentTimeMillis()).commit();
|
||||
return null;
|
||||
}
|
||||
uploadToNode(files);
|
||||
prefs.edit().putLong(LAST_UPLOAD_DATE, System.currentTimeMillis()).apply();
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean uploadToNode(final File... files) {
|
||||
for (final File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
final String url = PROFILE_SERVER_URL + "/" + device_id + "/"
|
||||
+ file.getName().replaceFirst("[.][^.]+$", "");
|
||||
ProfilingUtil.log(context, url);
|
||||
uploadMultipart(url, file);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private boolean uploadToNode(final File... files) {
|
||||
for (final File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
final String url = PROFILE_SERVER_URL + "/" + device_id + "/"
|
||||
+ file.getName().replaceFirst("[.][^.]+$", "");
|
||||
ProfilingUtil.log(context, url);
|
||||
uploadMultipart(url, file);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void putBackProfile(final Context context, final File tmp, final File profile) {
|
||||
boolean success;
|
||||
if (profile.exists()) {
|
||||
try {
|
||||
final FileOutputStream os = new FileOutputStream(tmp, true);
|
||||
final FileInputStream is = new FileInputStream(profile);
|
||||
copyStream(is, os);
|
||||
is.close();
|
||||
os.close();
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
success = true;
|
||||
public static void putBackProfile(final Context context, final File tmp, final File profile) {
|
||||
boolean success;
|
||||
if (profile.exists()) {
|
||||
try {
|
||||
final FileOutputStream os = new FileOutputStream(tmp, true);
|
||||
final FileInputStream is = new FileInputStream(profile);
|
||||
copyStream(is, os);
|
||||
is.close();
|
||||
os.close();
|
||||
success = true;
|
||||
} catch (final IOException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
|
||||
if (success && tmp.renameTo(profile) && tmp.delete()) {
|
||||
ProfilingUtil.log(context, "put profile back success");
|
||||
} else {
|
||||
ProfilingUtil.log(context, "put profile back failed");
|
||||
}
|
||||
} else {
|
||||
if (tmp.renameTo(profile)) {
|
||||
ProfilingUtil.log(context, "put profile back success");
|
||||
} else {
|
||||
ProfilingUtil.log(context, "put profile back failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (success && tmp.renameTo(profile) && tmp.delete()) {
|
||||
ProfilingUtil.log(context, "put profile back success");
|
||||
} else {
|
||||
ProfilingUtil.log(context, "put profile back failed");
|
||||
}
|
||||
} else {
|
||||
if (tmp.renameTo(profile)) {
|
||||
ProfilingUtil.log(context, "put profile back success");
|
||||
} else {
|
||||
ProfilingUtil.log(context, "put profile back failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.mariotaku.twidere.activity.support;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
|
@ -13,6 +13,7 @@ import org.mariotaku.twidere.fragment.iface.IBaseFragment;
|
|||
import org.mariotaku.twidere.fragment.support.AccountsManagerFragment;
|
||||
|
||||
/**
|
||||
* Accounts manager
|
||||
* Created by mariotaku on 14/10/26.
|
||||
*/
|
||||
public class AccountsManagerActivity extends BaseActionBarActivity {
|
||||
|
@ -31,7 +32,7 @@ public class AccountsManagerActivity extends BaseActionBarActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
final ActionBar actionBar = getActionBar();
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import android.app.Fragment;
|
|||
import android.app.FragmentTransaction;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
@ -46,9 +47,12 @@ public class BrowserActivity extends BaseActionBarActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
super.onCreate(savedInstanceState);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
mUri = getIntent().getData();
|
||||
if (mUri == null) {
|
||||
Toast.makeText(this, R.string.error_occurred, Toast.LENGTH_SHORT).show();
|
||||
|
|
|
@ -47,9 +47,7 @@ import android.os.Environment;
|
|||
import android.os.Parcelable;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.NotificationCompat.Action;
|
||||
import android.support.v4.util.LongSparseArray;
|
||||
|
@ -92,6 +90,7 @@ import org.mariotaku.dynamicgridview.DraggableArrayAdapter;
|
|||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.app.TwidereApplication;
|
||||
import org.mariotaku.twidere.fragment.support.BaseSupportDialogFragment;
|
||||
import org.mariotaku.twidere.fragment.support.ViewStatusDialogFragment;
|
||||
import org.mariotaku.twidere.model.DraftItem;
|
||||
import org.mariotaku.twidere.model.ParcelableAccount;
|
||||
import org.mariotaku.twidere.model.ParcelableLocation;
|
||||
|
@ -107,7 +106,6 @@ import org.mariotaku.twidere.task.TwidereAsyncTask;
|
|||
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
|
||||
import org.mariotaku.twidere.util.ContentValuesCreator;
|
||||
import org.mariotaku.twidere.util.ImageLoaderWrapper;
|
||||
import org.mariotaku.twidere.util.ImageLoadingHandler;
|
||||
import org.mariotaku.twidere.util.MathUtils;
|
||||
import org.mariotaku.twidere.util.ParseUtils;
|
||||
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
|
||||
|
@ -121,7 +119,6 @@ import org.mariotaku.twidere.view.ActionIconView;
|
|||
import org.mariotaku.twidere.view.BadgeView;
|
||||
import org.mariotaku.twidere.view.ShapedImageView;
|
||||
import org.mariotaku.twidere.view.StatusTextCountView;
|
||||
import org.mariotaku.twidere.view.holder.StatusViewHolder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -856,7 +853,7 @@ public class ComposeActivity extends ThemedFragmentActivity implements TextWatch
|
|||
new AddMediaTask(this, extraStream, createTempImageUri(), ParcelableMedia.TYPE_IMAGE, false).executeTask();
|
||||
} else if (data != null) {
|
||||
new AddMediaTask(this, data, createTempImageUri(), ParcelableMedia.TYPE_IMAGE, false).executeTask();
|
||||
} else if (intent.hasExtra(EXTRA_SHARE_SCREENSHOT)) {
|
||||
} else if (intent.hasExtra(EXTRA_SHARE_SCREENSHOT) && Utils.useShareScreenshot()) {
|
||||
final Bitmap bitmap = intent.getParcelableExtra(EXTRA_SHARE_SCREENSHOT);
|
||||
if (bitmap != null) {
|
||||
try {
|
||||
|
@ -1560,55 +1557,4 @@ public class ComposeActivity extends ThemedFragmentActivity implements TextWatch
|
|||
}
|
||||
}
|
||||
|
||||
public static class ViewStatusDialogFragment extends BaseSupportDialogFragment {
|
||||
|
||||
private StatusViewHolder mHolder;
|
||||
private View mStatusContainer;
|
||||
|
||||
public ViewStatusDialogFragment() {
|
||||
setStyle(STYLE_NO_TITLE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup parent, final Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.dialog_scrollable_status, parent, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mStatusContainer = view.findViewById(R.id.status_container);
|
||||
mHolder = new StatusViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(final Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
final Bundle args = getArguments();
|
||||
if (args == null || args.getParcelable(EXTRA_STATUS) == null) {
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
final TwidereApplication application = getApplication();
|
||||
final FragmentActivity activity = getActivity();
|
||||
final ImageLoaderWrapper loader = application.getImageLoaderWrapper();
|
||||
final ImageLoadingHandler handler = new ImageLoadingHandler(R.id.media_preview_progress);
|
||||
final AsyncTwitterWrapper twitter = getTwitterWrapper();
|
||||
final SharedPreferencesWrapper preferences = SharedPreferencesWrapper.getInstance(activity,
|
||||
SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
|
||||
final ParcelableStatus status = args.getParcelable(EXTRA_STATUS);
|
||||
final int profileImageStyle = Utils.getProfileImageStyle(preferences.getString(KEY_PROFILE_IMAGE_STYLE, null));
|
||||
final int mediaPreviewStyle = Utils.getMediaPreviewStyle(preferences.getString(KEY_MEDIA_PREVIEW_STYLE, null));
|
||||
final boolean nameFirst = preferences.getBoolean(KEY_NAME_FIRST, true);
|
||||
final boolean nicknameOnly = preferences.getBoolean(KEY_NICKNAME_ONLY, false);
|
||||
final boolean displayMediaPreview = preferences.getBoolean(KEY_MEDIA_PREVIEW, false);
|
||||
|
||||
mHolder.displayStatus(activity, loader, handler, twitter, displayMediaPreview, true,
|
||||
true, nameFirst, nicknameOnly, profileImageStyle, mediaPreviewStyle, status, null);
|
||||
mStatusContainer.findViewById(R.id.item_menu).setVisibility(View.GONE);
|
||||
mStatusContainer.findViewById(R.id.action_buttons).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.mariotaku.twidere.activity.support;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.NotificationManager;
|
||||
|
@ -39,6 +38,7 @@ 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;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.util.Log;
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.view.ActionMode;
|
||||
|
@ -98,7 +98,7 @@ public class DraftsActivity extends BaseActionBarActivity implements LoaderCallb
|
|||
final Cursor c = mAdapter.getCursor();
|
||||
if (c == null || c.isClosed()) return false;
|
||||
final SparseBooleanArray checked = mListView.getCheckedItemPositions();
|
||||
final List<DraftItem> list = new ArrayList<DraftItem>();
|
||||
final List<DraftItem> list = new ArrayList<>();
|
||||
final DraftItem.CursorIndices indices = new DraftItem.CursorIndices(c);
|
||||
for (int i = 0, j = checked.size(); i < j; i++) {
|
||||
if (checked.valueAt(i) && c.moveToPosition(checked.keyAt(i))) {
|
||||
|
@ -189,7 +189,7 @@ public class DraftsActivity extends BaseActionBarActivity implements LoaderCallb
|
|||
mPreferences = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
|
||||
mTextSize = mPreferences.getInt(KEY_TEXT_SIZE, getDefaultTextSize(this));
|
||||
setContentView(R.layout.activity_drafts);
|
||||
final ActionBar actionBar = getActionBar();
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
|
|
@ -47,9 +47,9 @@ import com.diegocarloslima.byakugallery.lib.TileBitmapDrawable.OnInitializeListe
|
|||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.mariotaku.twidere.Constants;
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.activity.support.ComposeActivity.ViewStatusDialogFragment;
|
||||
import org.mariotaku.twidere.adapter.support.SupportFixedFragmentStatePagerAdapter;
|
||||
import org.mariotaku.twidere.fragment.support.BaseSupportFragment;
|
||||
import org.mariotaku.twidere.fragment.support.ViewStatusDialogFragment;
|
||||
import org.mariotaku.twidere.loader.support.TileImageLoader;
|
||||
import org.mariotaku.twidere.loader.support.TileImageLoader.DownloadListener;
|
||||
import org.mariotaku.twidere.loader.support.TileImageLoader.Result;
|
||||
|
@ -144,6 +144,7 @@ public final class MediaViewerActivity extends ThemedActionBarActivity implement
|
|||
final Fragment f = new ViewStatusDialogFragment();
|
||||
final Bundle args = new Bundle();
|
||||
args.putParcelable(EXTRA_STATUS, intent.getParcelableExtra(EXTRA_STATUS));
|
||||
args.putBoolean(EXTRA_SHOW_MEDIA_PREVIEW, false);
|
||||
f.setArguments(args);
|
||||
ft.replace(R.id.media_status, f);
|
||||
ft.commit();
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package org.mariotaku.twidere.activity.support;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ContentResolver;
|
||||
|
@ -33,6 +32,7 @@ import android.graphics.Color;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Menu;
|
||||
|
@ -61,8 +61,8 @@ import org.mariotaku.twidere.util.ThemeUtils;
|
|||
import org.mariotaku.twidere.util.TwitterContentUtils;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
import org.mariotaku.twidere.util.accessor.ViewAccessor;
|
||||
import org.mariotaku.twidere.util.net.TwidereHostResolverFactory;
|
||||
import org.mariotaku.twidere.util.net.OkHttpClientFactory;
|
||||
import org.mariotaku.twidere.util.net.TwidereHostResolverFactory;
|
||||
|
||||
import twitter4j.Twitter;
|
||||
import twitter4j.TwitterConstants;
|
||||
|
@ -282,15 +282,15 @@ public class SignInActivity extends BaseActionBarActivity implements TwitterCons
|
|||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
super.onCreate(savedInstanceState);
|
||||
mPreferences = getSharedPreferences(SHARED_PREFERENCES_NAME, MODE_PRIVATE);
|
||||
mResolver = getContentResolver();
|
||||
mApplication = TwidereApplication.getInstance(this);
|
||||
setContentView(R.layout.activity_sign_in);
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
final long[] account_ids = getActivatedAccountIds(this);
|
||||
final ActionBar actionBar = getActionBar();
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(account_ids.length > 0);
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ public class SignInActivity extends BaseActionBarActivity implements TwitterCons
|
|||
}
|
||||
}
|
||||
}
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
mEditPassword.setEnabled(true);
|
||||
mEditUsername.setEnabled(true);
|
||||
mSignInButton.setEnabled(true);
|
||||
|
@ -495,7 +495,7 @@ public class SignInActivity extends BaseActionBarActivity implements TwitterCons
|
|||
}
|
||||
|
||||
void onSignInStart() {
|
||||
setProgressBarIndeterminateVisibility(true);
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
mEditPassword.setEnabled(false);
|
||||
mEditUsername.setEnabled(false);
|
||||
mSignInButton.setEnabled(false);
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A concrete BaseAdapter that is backed by an array of arbitrary
|
||||
|
@ -47,6 +48,7 @@ import java.util.List;
|
|||
* or to have some of data besides toString() results fill the views,
|
||||
* override {@link #getView(int, View, ViewGroup)} to return the type of view you want.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
|
||||
/**
|
||||
* Contains the list of objects that represent the data of this ArrayAdapter.
|
||||
|
@ -162,7 +164,8 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
|
|||
*
|
||||
* @param items The items to add at the end of the array.
|
||||
*/
|
||||
public void addAll(T... items) {
|
||||
@SafeVarargs
|
||||
public final void addAll(T... items) {
|
||||
synchronized (mLock) {
|
||||
if (mOriginalValues != null) {
|
||||
Collections.addAll(mOriginalValues, items);
|
||||
|
@ -437,7 +440,7 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
|
|||
results.values = list;
|
||||
results.count = list.size();
|
||||
} else {
|
||||
String prefixString = prefix.toString().toLowerCase();
|
||||
String prefixString = prefix.toString().toLowerCase(Locale.getDefault());
|
||||
|
||||
ArrayList<T> values;
|
||||
synchronized (mLock) {
|
||||
|
@ -449,7 +452,7 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final T value = values.get(i);
|
||||
final String valueText = value.toString().toLowerCase();
|
||||
final String valueText = value.toString().toLowerCase(Locale.getDefault());
|
||||
|
||||
// First match against the whole, non-splitted value
|
||||
if (valueText.startsWith(prefixString)) {
|
||||
|
@ -459,8 +462,8 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable {
|
|||
final int wordCount = words.length;
|
||||
|
||||
// Start at index 0, in case valueText starts with space(s)
|
||||
for (int k = 0; k < wordCount; k++) {
|
||||
if (words[k].startsWith(prefixString)) {
|
||||
for (String word : words) {
|
||||
if (word.startsWith(prefixString)) {
|
||||
newValues.add(value);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class DataProfilingSettingsFragment extends BaseFragment implements OnCli
|
|||
editor.putBoolean(KEY_SPICE_DATA_PROFILING, mCheckBox.isChecked());
|
||||
editor.putBoolean(KEY_SHOW_SPICE_DATA_PROFILING_REQUEST, false);
|
||||
//end
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
getActivity().onBackPressed();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
*
|
||||
* This program 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 program 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.mariotaku.twidere.fragment.support;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.app.TwidereApplication;
|
||||
import org.mariotaku.twidere.model.ParcelableStatus;
|
||||
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
|
||||
import org.mariotaku.twidere.util.ImageLoaderWrapper;
|
||||
import org.mariotaku.twidere.util.ImageLoadingHandler;
|
||||
import org.mariotaku.twidere.util.SharedPreferencesWrapper;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
import org.mariotaku.twidere.view.holder.StatusViewHolder;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 15/3/17.
|
||||
*/
|
||||
public class ViewStatusDialogFragment extends BaseSupportDialogFragment {
|
||||
|
||||
private StatusViewHolder mHolder;
|
||||
private View mStatusContainer;
|
||||
|
||||
public ViewStatusDialogFragment() {
|
||||
setStyle(STYLE_NO_TITLE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup parent, final Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.dialog_scrollable_status, parent, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mStatusContainer = view.findViewById(R.id.status_container);
|
||||
mHolder = new StatusViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(final Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
final Bundle args = getArguments();
|
||||
if (args == null || args.getParcelable(EXTRA_STATUS) == null) {
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
final TwidereApplication application = getApplication();
|
||||
final FragmentActivity activity = getActivity();
|
||||
final ImageLoaderWrapper loader = application.getImageLoaderWrapper();
|
||||
final ImageLoadingHandler handler = new ImageLoadingHandler(R.id.media_preview_progress);
|
||||
final AsyncTwitterWrapper twitter = getTwitterWrapper();
|
||||
final SharedPreferencesWrapper preferences = SharedPreferencesWrapper.getInstance(activity,
|
||||
SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
|
||||
final ParcelableStatus status = args.getParcelable(EXTRA_STATUS);
|
||||
final int profileImageStyle = Utils.getProfileImageStyle(preferences.getString(KEY_PROFILE_IMAGE_STYLE, null));
|
||||
final int mediaPreviewStyle = Utils.getMediaPreviewStyle(preferences.getString(KEY_MEDIA_PREVIEW_STYLE, null));
|
||||
final boolean nameFirst = preferences.getBoolean(KEY_NAME_FIRST, true);
|
||||
final boolean nicknameOnly = preferences.getBoolean(KEY_NICKNAME_ONLY, false);
|
||||
final boolean displayMediaPreview;
|
||||
if (args.containsKey(EXTRA_SHOW_MEDIA_PREVIEW)) {
|
||||
displayMediaPreview = args.getBoolean(EXTRA_SHOW_MEDIA_PREVIEW);
|
||||
} else {
|
||||
displayMediaPreview = preferences.getBoolean(KEY_MEDIA_PREVIEW, false);
|
||||
}
|
||||
mHolder.displayStatus(activity, loader, handler, twitter, displayMediaPreview, true,
|
||||
true, nameFirst, nicknameOnly, profileImageStyle, mediaPreviewStyle, status, null);
|
||||
mStatusContainer.findViewById(R.id.item_menu).setVisibility(View.GONE);
|
||||
mStatusContainer.findViewById(R.id.action_buttons).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -64,7 +64,7 @@ abstract class MultiSelectListPreference extends DialogPreference implements OnM
|
|||
for (int i = 0; i < length; i++) {
|
||||
editor.putBoolean(mKeys[i], mValues[i]);
|
||||
}
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import edu.tsinghua.spice.Utilies.SpiceProfilingUtil;
|
|||
|
||||
public class ConnectivityStateReceiver extends BroadcastReceiver implements Constants {
|
||||
|
||||
private static final String RECEIVER_LOGTAG = LOGTAG + "." + "ConnectivityStateReceiver";
|
||||
private static final String RECEIVER_LOGTAG = LOGTAG + "." + "Connectivity";
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, final Intent intent) {
|
||||
|
|
|
@ -3956,6 +3956,10 @@ public final class Utils implements Constants, TwitterConstants {
|
|||
resolver.insert(CachedRelationships.CONTENT_URI, values);
|
||||
}
|
||||
|
||||
public static boolean useShareScreenshot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Drawable getMetadataDrawable(final PackageManager pm, final ActivityInfo info, final String key) {
|
||||
if (pm == null || info == null || info.metaData == null || key == null || !info.metaData.containsKey(key))
|
||||
return null;
|
||||
|
|
|
@ -48,6 +48,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import twitter4j.http.HostAddressResolver;
|
||||
|
||||
|
@ -79,6 +80,7 @@ public class TwidereHostAddressResolver implements Constants, HostAddressResolve
|
|||
mLocalMappingOnly = localOnly;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public synchronized void removeCachedHost(final String host) {
|
||||
mHostCache.remove(host);
|
||||
}
|
||||
|
@ -206,7 +208,7 @@ public class TwidereHostAddressResolver implements Constants, HostAddressResolve
|
|||
|
||||
private static boolean hostMatches(final String host, final String rule) {
|
||||
if (rule == null || host == null) return false;
|
||||
if (rule.startsWith(".")) return host.toLowerCase().endsWith(rule.toLowerCase());
|
||||
if (rule.startsWith(".")) return host.matches("(?i).*" + Pattern.quote(rule));
|
||||
return host.equalsIgnoreCase(rule);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.mariotaku.twidere.view.themed;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.os.Build;
|
||||
|
@ -43,8 +44,14 @@ public class ThemedSwitch extends Switch implements IThemedView {
|
|||
@Override
|
||||
public void setThemeTintColor(ColorStateList color) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
DrawableCompat.setTintList(getThumbDrawable(), color);
|
||||
DrawableCompat.setTintList(getTrackDrawable(), color);
|
||||
setDrawableTint(color);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
private void setDrawableTint(ColorStateList color) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) return;
|
||||
DrawableCompat.setTintList(getThumbDrawable(), color);
|
||||
DrawableCompat.setTintList(getTrackDrawable(), color);
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 31 KiB |
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2012 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<org.mariotaku.gallery3d.ui.GLRootView
|
||||
android:id="@+id/gl_root_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/gl_root_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black"/>
|
||||
|
||||
</merge>
|
|
@ -1,21 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/select_account"
|
||||
android:actionProviderClass="org.mariotaku.twidere.menu.AccountActionProvider"
|
||||
android:icon="@drawable/ic_action_user"
|
||||
android:showAsAction="always"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/select_account"/>
|
||||
<item
|
||||
android:id="@id/reply"
|
||||
android:icon="@drawable/ic_action_reply"
|
||||
android:showAsAction="always"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/reply"/>
|
||||
<item
|
||||
android:id="@+id/mute_submenu"
|
||||
android:icon="@drawable/ic_action_speaker_muted"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/add_to_filter">
|
||||
<menu>
|
||||
<item
|
||||
|
@ -30,7 +31,7 @@
|
|||
<item
|
||||
android:id="@+id/block_submenu"
|
||||
android:icon="@drawable/ic_action_block"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/block">
|
||||
<menu>
|
||||
<item
|
||||
|
@ -45,7 +46,7 @@
|
|||
<item
|
||||
android:id="@+id/report_spam_submenu"
|
||||
android:icon="@drawable/ic_action_warning"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/report_for_spam">
|
||||
<menu>
|
||||
<item
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/delete"
|
||||
android:icon="@drawable/ic_action_delete"
|
||||
android:showAsAction="ifRoom|withText"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:title="@string/delete"/>
|
||||
<item
|
||||
android:id="@id/send"
|
||||
android:icon="@drawable/ic_action_send"
|
||||
android:showAsAction="ifRoom|withText"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:title="@string/send"/>
|
||||
|
||||
</menu>
|
|
@ -1,15 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/inverse_selection"
|
||||
android:icon="@drawable/ic_action_inverse_selection"
|
||||
android:showAsAction="ifRoom|withText"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:title="@string/inverse_selection"/>
|
||||
<item
|
||||
android:id="@id/delete"
|
||||
android:icon="@drawable/ic_action_delete"
|
||||
android:showAsAction="ifRoom|withText"
|
||||
app:showAsAction="ifRoom|withText"
|
||||
android:title="@string/delete"/>
|
||||
|
||||
</menu>
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@android:id/copyUrl"
|
||||
android:icon="@drawable/ic_action_web"
|
||||
android:showAsAction="always|withText"
|
||||
app:showAsAction="always|withText"
|
||||
android:title="@android:string/copyUrl"/>
|
||||
|
||||
</menu>
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="AppCompatResource"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/add_submenu"
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@id/save"
|
||||
android:icon="@drawable/ic_action_save"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/save"/>
|
||||
|
||||
</menu>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@id/cancel"
|
||||
android:icon="@drawable/ic_action_cancel"
|
||||
android:showAsAction="always"
|
||||
android:title="@android:string/cancel"/>
|
||||
|
||||
</menu>
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/add"
|
||||
android:icon="@drawable/ic_action_add"
|
||||
android:showAsAction="always"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/add_host_mapping"/>
|
||||
|
||||
</menu>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@id/share"
|
||||
android:icon="@drawable/ic_action_share"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/share">
|
||||
<menu/>
|
||||
</item>
|
||||
<item
|
||||
android:id="@id/open_in_browser"
|
||||
android:icon="@drawable/ic_action_web"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/open_in_browser"/>
|
||||
<item
|
||||
android:id="@id/save"
|
||||
android:icon="@drawable/ic_action_save"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/save"/>
|
||||
|
||||
</menu>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@id/refresh"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/refresh"/>
|
||||
|
||||
</menu>
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/save"
|
||||
android:icon="@drawable/ic_action_save"
|
||||
android:showAsAction="always"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/save"/>
|
||||
|
||||
</menu>
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="AppCompatResource">
|
||||
|
||||
<item
|
||||
android:id="@id/toggle"
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@id/mention"
|
||||
android:icon="@drawable/ic_action_at"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/mention_this_user"/>
|
||||
<item
|
||||
android:id="@id/send_direct_message"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="profile_image_size" translatable="false">bigger</string>
|
||||
<string name="profile_image_size">bigger</string>
|
||||
|
||||
</resources>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="default_tab_display_option" translatable="false">both</string>
|
||||
<string name="default_tab_display_option">both</string>
|
||||
|
||||
</resources>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="profile_image_size" translatable="false">reasonably_small</string>
|
||||
<string name="profile_image_size">reasonably_small</string>
|
||||
|
||||
</resources>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="default_tab_display_option" translatable="false">icon</string>
|
||||
<string name="profile_image_size" translatable="false">normal</string>
|
||||
<string name="default_tab_display_option">icon</string>
|
||||
<string name="profile_image_size">normal</string>
|
||||
|
||||
</resources>
|
|
@ -1,6 +1,7 @@
|
|||
<?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/hidden_settings">
|
||||
|
||||
<Preference android:layout="@layout/header_hidden_settings"/>
|
||||
|
@ -9,6 +10,23 @@
|
|||
android:defaultValue="false"
|
||||
android:key="force_using_private_apis"
|
||||
android:title="@string/force_using_private_apis"/>
|
||||
<org.mariotaku.twidere.preference.SeekBarDialogPreference
|
||||
android:defaultValue="10"
|
||||
android:key="connection_timeout"
|
||||
android:title="@string/connection_timeout"
|
||||
app:max="30"
|
||||
app:min="5"
|
||||
app:progressTextSuffix="s"/>
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="ignore_ssl_error"
|
||||
android:summary="@string/ignore_ssl_error_summary"
|
||||
android:title="@string/ignore_ssl_error"/>
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="gzip_compressing"
|
||||
android:summary="@string/gzip_compressing_summary"
|
||||
android:title="@string/gzip_compressing"/>
|
||||
|
||||
<org.mariotaku.twidere.preference.AutoFixEditTextPreference
|
||||
android:defaultValue="140"
|
||||
|
|
|
@ -1,30 +1,17 @@
|
|||
<?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/network">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="category_connectivity"
|
||||
android:title="@string/connectivity">
|
||||
<org.mariotaku.twidere.preference.SeekBarDialogPreference
|
||||
android:defaultValue="10"
|
||||
android:key="connection_timeout"
|
||||
android:title="@string/connection_timeout"
|
||||
app:max="30"
|
||||
app:min="5"
|
||||
app:progressTextSuffix="s"/>
|
||||
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="fast_image_loading"
|
||||
android:summary="@string/fast_image_loading_summary"
|
||||
android:title="@string/fast_image_loading"/>
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="ignore_ssl_error"
|
||||
android:summary="@string/ignore_ssl_error_summary"
|
||||
android:title="@string/ignore_ssl_error"/>
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="tcp_dns_query"
|
||||
|
@ -73,11 +60,6 @@
|
|||
<PreferenceCategory
|
||||
android:key="category_api"
|
||||
android:title="@string/api">
|
||||
<org.mariotaku.twidere.preference.AutoFixCheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="gzip_compressing"
|
||||
android:summary="@string/gzip_compressing_summary"
|
||||
android:title="@string/gzip_compressing"/>
|
||||
|
||||
<org.mariotaku.twidere.preference.DefaultAPIPreference
|
||||
android:summary="@string/default_api_settings_summary"
|
||||
|
|