mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-17 04:00:48 +01:00
disabled custom token dialog
This commit is contained in:
parent
b1fd5c7fdc
commit
24a476aba4
@ -0,0 +1,18 @@
|
||||
package org.mariotaku.twidere.api.statusnet.api;
|
||||
|
||||
import org.mariotaku.restfu.annotation.param.Query;
|
||||
import org.mariotaku.twidere.api.twitter.TwitterException;
|
||||
import org.mariotaku.twidere.api.twitter.model.Paging;
|
||||
import org.mariotaku.twidere.api.twitter.model.ResponseList;
|
||||
import org.mariotaku.twidere.api.twitter.model.Status;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 16/3/4.
|
||||
*/
|
||||
public interface GroupResources {
|
||||
|
||||
ResponseList<Status> getUserListStatuses(@Query("group_id") long groupId, @Query Paging paging) throws TwitterException;
|
||||
|
||||
ResponseList<Status> getGroupStatuses(@Query("id") String name, @Query Paging paging) throws TwitterException;
|
||||
|
||||
}
|
@ -26,6 +26,7 @@ android {
|
||||
multiDexEnabled true
|
||||
|
||||
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")'
|
||||
buildConfigField 'boolean', 'SHOW_CUSTOM_TOKEN_DIALOG', 'Boolean.parseBoolean("false")'
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -62,7 +63,6 @@ android {
|
||||
repositories {
|
||||
maven { url 'https://s3.amazonaws.com/repo.commonsware.com' }
|
||||
maven { url 'https://maven.fabric.io/public' }
|
||||
maven { url 'https://github.com/suckgamony/RapidDecoder/raw/master/repository' }
|
||||
flatDir { dirs "$projectDir/lib" }
|
||||
}
|
||||
|
||||
@ -92,7 +92,6 @@ dependencies {
|
||||
compile 'com.github.mariotaku:MessageBubbleView:1.2'
|
||||
compile 'com.github.mariotaku:DragSortListView:0.6.1'
|
||||
compile 'com.github.uucky:ColorPicker-Android:0.9.7@aar'
|
||||
// compile 'com.github.boxme:asyncmanager:1.0.0'
|
||||
compile 'com.sprylab.android.texturevideoview:texturevideoview:1.1.1'
|
||||
compile 'com.squareup:pollexor:2.0.4'
|
||||
compile 'com.squareup:tape:1.2.3'
|
||||
|
@ -361,8 +361,9 @@ public class SignInActivity extends BaseAppCompatActivity implements OnClickList
|
||||
|
||||
final String consumerKey = mPreferences.getString(KEY_CONSUMER_KEY, null);
|
||||
final String consumerSecret = mPreferences.getString(KEY_CONSUMER_SECRET, null);
|
||||
if (savedInstanceState == null && !mPreferences.getBoolean(KEY_CONSUMER_KEY_SECRET_SET, false)
|
||||
&& !Utils.isCustomConsumerKeySecret(consumerKey, consumerSecret)) {
|
||||
if (BuildConfig.SHOW_CUSTOM_TOKEN_DIALOG && savedInstanceState == null &&
|
||||
!mPreferences.getBoolean(KEY_CONSUMER_KEY_SECRET_SET, false) &&
|
||||
!Utils.isCustomConsumerKeySecret(consumerKey, consumerSecret)) {
|
||||
final SetConsumerKeySecretDialogFragment df = new SetConsumerKeySecretDialogFragment();
|
||||
df.setCancelable(false);
|
||||
df.show(getSupportFragmentManager(), "set_consumer_key_secret");
|
||||
|
@ -50,6 +50,7 @@ public abstract class ThemedAppCompatActivity extends AppCompatActivity implemen
|
||||
|
||||
private ThemedAppCompatDelegateFactory.ThemedAppCompatDelegate mDelegate;
|
||||
private Toolbar mToolbar;
|
||||
private int mCurrentThemeResource;
|
||||
|
||||
@Override
|
||||
public String getCurrentThemeFontFamily() {
|
||||
@ -103,6 +104,9 @@ public abstract class ThemedAppCompatActivity extends AppCompatActivity implemen
|
||||
StrictModeUtils.detectAllVmPolicy();
|
||||
StrictModeUtils.detectAllThreadPolicy();
|
||||
}
|
||||
if (mCurrentThemeResource != 0) {
|
||||
getTheme().applyStyle(mCurrentThemeResource, true);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
ThemeUtils.applyToolbarItemColor(this, getActionBarToolbar(), getCurrentThemeColor());
|
||||
}
|
||||
@ -125,6 +129,7 @@ public abstract class ThemedAppCompatActivity extends AppCompatActivity implemen
|
||||
@Override
|
||||
public void setTheme(int resId) {
|
||||
super.setTheme(resId);
|
||||
mCurrentThemeResource = resId;
|
||||
if (shouldApplyWindowBackground()) {
|
||||
ThemeUtils.applyWindowBackground(this, getWindow(), mCurrentThemeBackgroundOption,
|
||||
mCurrentThemeBackgroundAlpha);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.mariotaku.twidere.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.app.UiModeManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
@ -35,7 +36,7 @@ import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.multidex.MultiDexApplication;
|
||||
import android.support.multidex.MultiDex;
|
||||
import android.support.v7.app.AppCompatDelegate;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@ -50,6 +51,7 @@ import org.mariotaku.twidere.util.DebugModeUtils;
|
||||
import org.mariotaku.twidere.util.ExternalThemeManager;
|
||||
import org.mariotaku.twidere.util.HttpClientFactory;
|
||||
import org.mariotaku.twidere.util.StrictModeUtils;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.TwidereBugReporter;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
import org.mariotaku.twidere.util.content.TwidereSQLiteOpenHelper;
|
||||
@ -59,7 +61,7 @@ import org.mariotaku.twidere.util.net.TwidereDns;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.initAccountColor;
|
||||
|
||||
public class TwidereApplication extends MultiDexApplication implements Constants,
|
||||
public class TwidereApplication extends Application implements Constants,
|
||||
OnSharedPreferenceChangeListener {
|
||||
|
||||
private static final String KEY_UCD_DATA_PROFILING = "ucd_data_profiling";
|
||||
@ -79,6 +81,11 @@ public class TwidereApplication extends MultiDexApplication implements Constants
|
||||
return (TwidereApplication) context.getApplicationContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(this);
|
||||
}
|
||||
|
||||
public Handler getHandler() {
|
||||
return mHandler;
|
||||
@ -256,17 +263,17 @@ public class TwidereApplication extends MultiDexApplication implements Constants
|
||||
}
|
||||
|
||||
private void resetTheme(SharedPreferences preferences) {
|
||||
switch (Utils.getNonEmptyString(preferences, KEY_THEME, VALUE_THEME_NAME_LIGHT)) {
|
||||
case VALUE_THEME_NAME_DARK: {
|
||||
((UiModeManager) getSystemService(UI_MODE_SERVICE)).setNightMode(UiModeManager.MODE_NIGHT_YES);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
break;
|
||||
}
|
||||
case VALUE_THEME_NAME_AUTO: {
|
||||
switch (ThemeUtils.getLocalNightMode(preferences)) {
|
||||
case AppCompatDelegate.MODE_NIGHT_AUTO: {
|
||||
((UiModeManager) getSystemService(UI_MODE_SERVICE)).setNightMode(UiModeManager.MODE_NIGHT_AUTO);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
|
||||
break;
|
||||
}
|
||||
case AppCompatDelegate.MODE_NIGHT_YES: {
|
||||
((UiModeManager) getSystemService(UI_MODE_SERVICE)).setNightMode(UiModeManager.MODE_NIGHT_YES);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
((UiModeManager) getSystemService(UI_MODE_SERVICE)).setNightMode(UiModeManager.MODE_NIGHT_NO);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
|
@ -21,6 +21,7 @@ package org.mariotaku.twidere.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
@ -35,6 +36,7 @@ import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatDelegate;
|
||||
import android.support.v7.app.WindowDecorActionBar;
|
||||
import android.support.v7.app.WindowDecorActionBar.ActionModeImpl;
|
||||
import android.support.v7.view.StandaloneActionMode;
|
||||
@ -567,19 +569,21 @@ public class ThemeUtils implements Constants {
|
||||
}
|
||||
|
||||
public static Drawable getWindowBackgroundFromTheme(final Context context) {
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{android.R.attr.windowBackground});
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.windowNormalBackground,
|
||||
android.R.attr.windowBackground});
|
||||
try {
|
||||
return a.getDrawable(0);
|
||||
if (a.hasValue(0)) {
|
||||
return a.getDrawable(0);
|
||||
} else {
|
||||
return a.getDrawable(1);
|
||||
}
|
||||
} finally {
|
||||
a.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
public static Drawable getWindowBackgroundFromThemeApplyAlpha(final Context context, final int alpha) {
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{android.R.attr.windowBackground});
|
||||
final Drawable d = a.getDrawable(0);
|
||||
a.recycle();
|
||||
final Drawable d = getWindowBackgroundFromTheme(context);
|
||||
if (d == null) return null;
|
||||
d.mutate();
|
||||
d.setAlpha(TwidereMathUtils.clamp(alpha, ThemeBackgroundPreference.MIN_ALPHA,
|
||||
@ -951,6 +955,36 @@ public class ThemeUtils implements Constants {
|
||||
return controlBarHeight;
|
||||
}
|
||||
|
||||
public static int getLocalNightMode(SharedPreferences preferences) {
|
||||
switch (Utils.getNonEmptyString(preferences, KEY_THEME, VALUE_THEME_NAME_LIGHT)) {
|
||||
case VALUE_THEME_NAME_DARK: {
|
||||
return AppCompatDelegate.MODE_NIGHT_YES;
|
||||
}
|
||||
case VALUE_THEME_NAME_AUTO: {
|
||||
return AppCompatDelegate.MODE_NIGHT_AUTO;
|
||||
}
|
||||
}
|
||||
return AppCompatDelegate.MODE_NIGHT_NO;
|
||||
}
|
||||
|
||||
public static void applyDayNight(SharedPreferences preferences, AppCompatDelegate delegate) {
|
||||
switch (getLocalNightMode(preferences)) {
|
||||
case AppCompatDelegate.MODE_NIGHT_AUTO: {
|
||||
delegate.setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
|
||||
break;
|
||||
}
|
||||
case AppCompatDelegate.MODE_NIGHT_YES: {
|
||||
delegate.setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
delegate.setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
delegate.applyDayNight();
|
||||
}
|
||||
|
||||
|
||||
public static final class ActionBarContextThemeWrapper extends android.support.v7.view.ContextThemeWrapper {
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
<attr name="progressWheelStyle" format="reference"/>
|
||||
<attr name="darkTheme" format="boolean"/>
|
||||
<attr name="coloredActionBar" format="boolean"/>
|
||||
<attr name="windowNormalBackground" format="reference"/>
|
||||
</declare-styleable>
|
||||
<declare-styleable name="ColorLabelView">
|
||||
<attr name="ignorePadding" format="boolean"/>
|
||||
|
@ -28,11 +28,6 @@
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.DialogWhenLarge" parent="Theme.AppCompat.DialogWhenLarge">
|
||||
<item name="android:textColorTertiary">@color/tertiary_text_mtrl_dark</item>
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.NoActionBar" parent="Theme.AppCompat.NoActionBar">
|
||||
<!-- Window attributes -->
|
||||
<item name="android:windowBackground">@color/background_color_window_dark</item>
|
||||
@ -47,8 +42,15 @@
|
||||
<item name="android:actionBarSize">?actionBarSize</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.Light" parent="Theme.AppCompat.Light">
|
||||
<style name="Theme.Compat.Base.DialogWhenLarge" parent="Theme.AppCompat.DialogWhenLarge">
|
||||
<!-- Window attributes -->
|
||||
<item name="windowNormalBackground">@color/background_color_window_dark</item>
|
||||
|
||||
<item name="android:textColorTertiary">@color/tertiary_text_mtrl_dark</item>
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.Light" parent="Theme.AppCompat.Light">
|
||||
<!-- Window attributes -->
|
||||
<item name="android:windowBackground">@color/background_color_window_light</item>
|
||||
|
||||
@ -56,11 +58,6 @@
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.Light.DialogWhenLarge" parent="Theme.AppCompat.Light.DialogWhenLarge">
|
||||
<item name="android:textColorTertiary">@color/tertiary_text_mtrl_light</item>
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.Light.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Window attributes -->
|
||||
<item name="android:windowBackground">@color/background_color_window_light</item>
|
||||
@ -74,4 +71,12 @@
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_dark</item>
|
||||
<item name="android:actionBarSize">?actionBarSize</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Compat.Base.Light.DialogWhenLarge" parent="Theme.AppCompat.Light.DialogWhenLarge">
|
||||
<!-- Window attributes -->
|
||||
<item name="windowNormalBackground">@color/background_color_window_light</item>
|
||||
|
||||
<item name="android:textColorTertiary">@color/tertiary_text_mtrl_light</item>
|
||||
<item name="android:textColorTertiaryInverse">@color/tertiary_text_mtrl_dark</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user