mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2024-12-18 03:28:55 +01:00
removed unused library project
This commit is contained in:
parent
887e6b9acb
commit
0251953f96
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
||||
[submodule "libraries/SlidingMenu"]
|
||||
path = libraries/SlidingMenu
|
||||
url = https://github.com/mariotaku/SlidingMenu-Gradle
|
||||
[submodule "libraries/ColorPicker"]
|
||||
path = libraries/ColorPicker
|
||||
url = https://github.com/uucky/ColorPicker-Android.git
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 1fddbfad5b8cf72073e4bdf95a815b0585078fe1
|
@ -12,7 +12,6 @@ include ':twidere.component.nyan'
|
||||
include ':twidere.extension.streaming'
|
||||
include ':twidere.extension.twitlonger'
|
||||
include ':twidere.extension.push.xiaomi'
|
||||
include ':SlidingMenu', ':ColorPicker'
|
||||
include ':ColorPicker'
|
||||
|
||||
project(':SlidingMenu').projectDir = file('libraries/SlidingMenu/library')
|
||||
project(':ColorPicker').projectDir = file('libraries/ColorPicker/library')
|
@ -23,6 +23,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
@ -31,6 +32,7 @@ import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nostra13.universalimageloader.cache.disc.DiskCache;
|
||||
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
|
||||
@ -69,12 +71,14 @@ import static org.mariotaku.twidere.util.UserColorNameUtils.initUserColor;
|
||||
import static org.mariotaku.twidere.util.Utils.getBestCacheDir;
|
||||
import static org.mariotaku.twidere.util.Utils.getInternalCacheDir;
|
||||
import static org.mariotaku.twidere.util.Utils.initAccountColor;
|
||||
import static org.mariotaku.twidere.util.Utils.startProfilingServiceIfNeeded;
|
||||
import static org.mariotaku.twidere.util.Utils.startRefreshServiceIfNeeded;
|
||||
import static org.mariotaku.twidere.util.Utils.startUsageStatisticsServiceIfNeeded;
|
||||
|
||||
public class TwidereApplication extends MultiDexApplication implements Constants,
|
||||
OnSharedPreferenceChangeListener {
|
||||
|
||||
public static final String KEY_UCD_DATA_PROFILING = "ucd_data_profiling";
|
||||
public static final String KEY_SPICE_DATA_PROFILING = "spice_data_profiling";
|
||||
private Handler mHandler;
|
||||
private MediaLoaderWrapper mMediaLoaderWrapper;
|
||||
private ImageLoader mImageLoader;
|
||||
@ -194,15 +198,9 @@ public class TwidereApplication extends MultiDexApplication implements Constants
|
||||
}
|
||||
setTheme(ThemeUtils.getThemeResource(this));
|
||||
super.onCreate();
|
||||
// TwidereOkHttpPlatform.applyHack(this);
|
||||
mHandler = new Handler();
|
||||
mMessageBus = new Bus();
|
||||
mPreferences = getSharedPreferences(SHARED_PREFERENCES_NAME, MODE_PRIVATE);
|
||||
if (!mPreferences.contains(KEY_USAGE_STATISTICS)) {
|
||||
final boolean prevUsageEnabled = mPreferences.getBoolean("ucd_data_profiling", false)
|
||||
|| mPreferences.getBoolean("spice_data_profiling", false);
|
||||
mPreferences.edit().putBoolean(KEY_USAGE_STATISTICS, prevUsageEnabled).apply();
|
||||
}
|
||||
mPreferences.registerOnSharedPreferenceChangeListener(this);
|
||||
initializeAsyncTask();
|
||||
initAccountColor(this);
|
||||
@ -222,10 +220,29 @@ public class TwidereApplication extends MultiDexApplication implements Constants
|
||||
PackageManager.DONT_KILL_APP);
|
||||
}
|
||||
|
||||
startProfilingServiceIfNeeded(this);
|
||||
|
||||
migrateUsageStatisticsPreferences();
|
||||
|
||||
startUsageStatisticsServiceIfNeeded(this);
|
||||
startRefreshServiceIfNeeded(this);
|
||||
}
|
||||
|
||||
private void migrateUsageStatisticsPreferences() {
|
||||
final boolean hasUsageStatistics = mPreferences.contains(KEY_USAGE_STATISTICS);
|
||||
final boolean hasUCDDataProfiling = mPreferences.contains(KEY_UCD_DATA_PROFILING);
|
||||
final boolean hasSpiceDataProfiling = mPreferences.contains(KEY_SPICE_DATA_PROFILING);
|
||||
Log.d(LOGTAG, String.format("usage: %b, ucd: %b, spice: %b", hasUsageStatistics, hasUCDDataProfiling, hasSpiceDataProfiling));
|
||||
if (!hasUsageStatistics && (hasUCDDataProfiling || hasSpiceDataProfiling)) {
|
||||
final boolean prevUsageEnabled = mPreferences.getBoolean(KEY_UCD_DATA_PROFILING, false)
|
||||
|| mPreferences.getBoolean(KEY_SPICE_DATA_PROFILING, false);
|
||||
final Editor editor = mPreferences.edit();
|
||||
editor.putBoolean(KEY_USAGE_STATISTICS, prevUsageEnabled);
|
||||
editor.remove(KEY_UCD_DATA_PROFILING);
|
||||
editor.remove(KEY_SPICE_DATA_PROFILING);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
if (mMediaLoaderWrapper != null) {
|
||||
@ -244,10 +261,10 @@ public class TwidereApplication extends MultiDexApplication implements Constants
|
||||
reloadConnectivitySettings();
|
||||
} else if (KEY_USAGE_STATISTICS.equals(key)) {
|
||||
stopService(new Intent(this, UCDService.class));
|
||||
startProfilingServiceIfNeeded(this);
|
||||
startUsageStatisticsServiceIfNeeded(this);
|
||||
//spice
|
||||
stopService(new Intent(this, SpiceService.class));
|
||||
startProfilingServiceIfNeeded(this);
|
||||
startUsageStatisticsServiceIfNeeded(this);
|
||||
//end
|
||||
} else if (KEY_CONSUMER_KEY.equals(key) || KEY_CONSUMER_SECRET.equals(key) || KEY_API_URL_FORMAT.equals(key)
|
||||
|| KEY_AUTH_TYPE.equals(key) || KEY_SAME_OAUTH_SIGNING_URL.equals(key)) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
package org.mariotaku.twidere.receiver;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.startProfilingServiceIfNeeded;
|
||||
import static org.mariotaku.twidere.util.Utils.startUsageStatisticsServiceIfNeeded;
|
||||
import static org.mariotaku.twidere.util.Utils.startRefreshServiceIfNeeded;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
@ -44,7 +44,7 @@ public class ConnectivityStateReceiver extends BroadcastReceiver implements Cons
|
||||
Log.d(RECEIVER_LOGTAG, String.format("Received Broadcast %s", intent));
|
||||
}
|
||||
if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) return;
|
||||
startProfilingServiceIfNeeded(context);
|
||||
startUsageStatisticsServiceIfNeeded(context);
|
||||
startRefreshServiceIfNeeded(context);
|
||||
//spice
|
||||
SpiceProfilingUtil.profile(context,SpiceProfilingUtil.FILE_NAME_ONWIFI, NetworkStateUtil.getConnectedType(context));
|
||||
|
@ -30,7 +30,6 @@ import org.mariotaku.twidere.Constants;
|
||||
import org.mariotaku.twidere.model.StringLongPair;
|
||||
import org.mariotaku.twidere.util.collection.CompactHashSet;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class ReadStateManager implements Constants {
|
||||
@ -66,7 +65,7 @@ public class ReadStateManager implements Constants {
|
||||
|
||||
public long getPosition(final String key, final String keyId) {
|
||||
if (TextUtils.isEmpty(key)) return -1;
|
||||
final Set<String> set = mPreferences.getStringSet(key, new HashSet<String>());
|
||||
final Set<String> set = mPreferences.getStringSet(key, null);
|
||||
if (set == null) return -1;
|
||||
final String prefix = keyId + ":";
|
||||
for (String entry : set) {
|
||||
|
@ -3,11 +3,14 @@ package org.mariotaku.twidere.util;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mariotaku.twidere.Constants;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SharedPreferencesWrapper {
|
||||
public class SharedPreferencesWrapper implements Constants {
|
||||
|
||||
private final SharedPreferences mPreferences;
|
||||
private final Class<?> mKeysClass;
|
||||
@ -33,6 +36,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getBoolean(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
@ -42,6 +46,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getFloat(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
@ -51,6 +56,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getInt(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
@ -60,6 +66,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getLong(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
@ -73,6 +80,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getString(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
@ -82,6 +90,7 @@ public class SharedPreferencesWrapper {
|
||||
try {
|
||||
return mPreferences.getStringSet(key, defValue);
|
||||
} catch (final ClassCastException e) {
|
||||
if (Utils.isDebugBuild()) Log.w(LOGTAG, e);
|
||||
mPreferences.edit().remove(key).apply();
|
||||
return defValue;
|
||||
}
|
||||
|
@ -3731,7 +3731,7 @@ public final class Utils implements Constants, TwitterConstants {
|
||||
showWarnMessage(context, context.getText(resId), long_message);
|
||||
}
|
||||
|
||||
public static void startProfilingServiceIfNeeded(final Context context) {
|
||||
public static void startUsageStatisticsServiceIfNeeded(final Context context) {
|
||||
final SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
|
||||
final Intent profilingServiceIntent = new Intent(context, UCDService.class);
|
||||
//spice
|
||||
|
@ -738,6 +738,6 @@
|
||||
<string name="from_name">From <xliff:g id="name">%1$s</xliff:g></string>
|
||||
<string name="from_name_and_name">From <xliff:g id="name">%1$s</xliff:g> and <xliff:g id="name">%2$s</xliff:g></string>
|
||||
<string name="from_name_and_N_others">From <xliff:g id="name">%1$s</xliff:g> and <xliff:g id="name">%2$d</xliff:g> others</string>
|
||||
<string name="projects_we_participant">Projects we participant</string>
|
||||
<string name="projects_we_took_part">Projects we took part</string>
|
||||
|
||||
</resources>
|
@ -28,7 +28,7 @@
|
||||
android:title="@string/usage_statistics"
|
||||
android:key="usage_statistics"/>
|
||||
<PreferenceCategory
|
||||
android:title="@string/projects_we_participant"
|
||||
android:title="@string/projects_we_took_part"
|
||||
android:order="12">
|
||||
<Preference
|
||||
android:title="@string/research_ucdavis_earlybird"/>
|
||||
|
Loading…
Reference in New Issue
Block a user