improved text color
This commit is contained in:
parent
77299e457c
commit
5493ab43f1
|
@ -169,6 +169,7 @@ public class Chameleon {
|
||||||
|
|
||||||
private int colorControlNormal;
|
private int colorControlNormal;
|
||||||
private int colorControlActivated;
|
private int colorControlActivated;
|
||||||
|
private int colorControlHighlight;
|
||||||
|
|
||||||
private int statusBarColor;
|
private int statusBarColor;
|
||||||
private int navigationBarColor;
|
private int navigationBarColor;
|
||||||
|
@ -348,6 +349,14 @@ public class Chameleon {
|
||||||
this.colorControlActivated = color;
|
this.colorControlActivated = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getColorControlHighlight() {
|
||||||
|
return colorControlHighlight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColorControlHighlight(int colorControlHighlight) {
|
||||||
|
this.colorControlHighlight = colorControlHighlight;
|
||||||
|
}
|
||||||
|
|
||||||
public void setLightStatusBarMode(@LightStatusBarMode int mode) {
|
public void setLightStatusBarMode(@LightStatusBarMode int mode) {
|
||||||
this.lightStatusBarMode = mode;
|
this.lightStatusBarMode = mode;
|
||||||
}
|
}
|
||||||
|
@ -379,6 +388,7 @@ public class Chameleon {
|
||||||
|
|
||||||
theme.setColorControlNormal(a.getColor(R.styleable.ChameleonTheme_colorControlNormal, 0));
|
theme.setColorControlNormal(a.getColor(R.styleable.ChameleonTheme_colorControlNormal, 0));
|
||||||
theme.setColorControlActivated(a.getColor(R.styleable.ChameleonTheme_colorControlActivated, 0));
|
theme.setColorControlActivated(a.getColor(R.styleable.ChameleonTheme_colorControlActivated, 0));
|
||||||
|
theme.setColorControlHighlight(a.getColor(R.styleable.ChameleonTheme_colorControlHighlight, 0));
|
||||||
|
|
||||||
theme.setStatusBarColor(a.getColor(R.styleable.ChameleonTheme_android_statusBarColor, 0));
|
theme.setStatusBarColor(a.getColor(R.styleable.ChameleonTheme_android_statusBarColor, 0));
|
||||||
theme.setNavigationBarColor(a.getColor(R.styleable.ChameleonTheme_android_navigationBarColor, Color.BLACK));
|
theme.setNavigationBarColor(a.getColor(R.styleable.ChameleonTheme_android_navigationBarColor, Color.BLACK));
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||||
import android.support.v4.util.ArrayMap;
|
import android.support.v4.util.ArrayMap;
|
||||||
import android.support.v4.view.LayoutInflaterFactory;
|
import android.support.v4.view.LayoutInflaterFactory;
|
||||||
import android.support.v7.app.AppCompatDelegate;
|
import android.support.v7.app.AppCompatDelegate;
|
||||||
|
@ -170,6 +171,10 @@ public class ChameleonInflationFactory implements LayoutInflaterFactory {
|
||||||
R.styleable.ChameleonView, mTheme);
|
R.styleable.ChameleonView, mTheme);
|
||||||
Drawable background = a.getDrawable(R.styleable.ChameleonView_android_background);
|
Drawable background = a.getDrawable(R.styleable.ChameleonView_android_background);
|
||||||
if (background != null) {
|
if (background != null) {
|
||||||
|
int tint = a.getColor(R.styleable.ChameleonView_backgroundTint, 0);
|
||||||
|
if (tint != 0) {
|
||||||
|
DrawableCompat.setTint(background, tint);
|
||||||
|
}
|
||||||
SupportMethods.setBackground(view, background);
|
SupportMethods.setBackground(view, background);
|
||||||
}
|
}
|
||||||
a.recycle();
|
a.recycle();
|
||||||
|
|
|
@ -49,10 +49,6 @@ public class ChameleonTypedArray {
|
||||||
return new ChameleonTypedArray(array, hasAttribute, attributeReferences, theme);
|
return new ChameleonTypedArray(array, hasAttribute, attributeReferences, theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getColor(int index) {
|
|
||||||
return wrapped.getColor(index, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getColor(int index, int defValue) {
|
public int getColor(int index, int defValue) {
|
||||||
final int ref = attributeReferences[index];
|
final int ref = attributeReferences[index];
|
||||||
int color = getCommonColorReference(ref);
|
int color = getCommonColorReference(ref);
|
||||||
|
@ -76,6 +72,12 @@ public class ChameleonTypedArray {
|
||||||
return theme.getColorPrimaryDark();
|
return theme.getColorPrimaryDark();
|
||||||
} else if (ref == android.support.design.R.attr.colorAccent) {
|
} else if (ref == android.support.design.R.attr.colorAccent) {
|
||||||
return theme.getColorAccent();
|
return theme.getColorAccent();
|
||||||
|
} else if (ref == android.support.design.R.attr.colorControlNormal) {
|
||||||
|
return theme.getColorControlNormal();
|
||||||
|
} else if (ref == android.support.design.R.attr.colorControlActivated) {
|
||||||
|
return theme.getColorControlActivated();
|
||||||
|
} else if (ref == android.support.design.R.attr.colorControlHighlight) {
|
||||||
|
return theme.getColorControlHighlight();
|
||||||
} else if (ref == R.attr.colorToolbar) {
|
} else if (ref == R.attr.colorToolbar) {
|
||||||
return theme.getColorToolbar();
|
return theme.getColorToolbar();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ChameleonAutoCompleteTextView extends AppCompatAutoCompleteTextView
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public ChameleonEditText.Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
public ChameleonEditText.Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
||||||
return ChameleonTextView.Appearance.create(context, attributeSet, theme);
|
return ChameleonTextView.Appearance.create(this, context, attributeSet, theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ChameleonEditText extends AppCompatEditText implements ChameleonVie
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
public Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
||||||
return ChameleonTextView.Appearance.create(context, attributeSet, theme);
|
return ChameleonTextView.Appearance.create(this, context, attributeSet, theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ChameleonMultiAutoCompleteTextView extends AppCompatMultiAutoComple
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public ChameleonEditText.Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
public ChameleonEditText.Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
||||||
return ChameleonTextView.Appearance.create(context, attributeSet, theme);
|
return ChameleonTextView.Appearance.create(this, context, attributeSet, theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,37 +45,59 @@ public class ChameleonTextView extends AppCompatTextView implements ChameleonVie
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
public Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
||||||
Appearance appearance = new Appearance();
|
return Appearance.create(this, context, attributeSet, theme);
|
||||||
ChameleonTypedArray a = ChameleonTypedArray.obtain(context, attributeSet,
|
|
||||||
R.styleable.ChameleonTextView, theme);
|
|
||||||
appearance.setLinkTextColor(a.getColor(R.styleable.ChameleonTextView_android_textColorLink, theme.getTextColorLink()));
|
|
||||||
a.recycle();
|
|
||||||
return appearance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyAppearance(@NonNull ChameleonView.Appearance appearance) {
|
public void applyAppearance(@NonNull ChameleonView.Appearance appearance) {
|
||||||
final Appearance a = (Appearance) appearance;
|
Appearance.apply(this, (Appearance) appearance);
|
||||||
setLinkTextColor(a.getLinkTextColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Appearance implements ChameleonView.Appearance {
|
public static class Appearance implements ChameleonView.Appearance {
|
||||||
|
private int textColor;
|
||||||
private int linkTextColor;
|
private int linkTextColor;
|
||||||
private int backgroundColor;
|
private int backgroundColor;
|
||||||
|
|
||||||
public static void apply(TextView view, ChameleonTextView.Appearance appearance) {
|
|
||||||
|
public int getLinkTextColor() {
|
||||||
|
return linkTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLinkTextColor(int linkTextColor) {
|
||||||
|
this.linkTextColor = linkTextColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBackgroundColor() {
|
||||||
|
return backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundColor(int backgroundColor) {
|
||||||
|
this.backgroundColor = backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTextColor() {
|
||||||
|
return textColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextColor(int textColor) {
|
||||||
|
this.textColor = textColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void apply(TextView view, Appearance appearance) {
|
||||||
view.setLinkTextColor(appearance.getLinkTextColor());
|
view.setLinkTextColor(appearance.getLinkTextColor());
|
||||||
|
view.setTextColor(appearance.getTextColor());
|
||||||
ViewCompat.setBackgroundTintList(view, ColorStateList.valueOf(appearance.getBackgroundColor()));
|
ViewCompat.setBackgroundTintList(view, ColorStateList.valueOf(appearance.getBackgroundColor()));
|
||||||
setCursorTint(view, appearance.getBackgroundColor());
|
setCursorTint(view, appearance.getBackgroundColor());
|
||||||
setHandlerTint(view, appearance.getBackgroundColor());
|
setHandlerTint(view, appearance.getBackgroundColor());
|
||||||
view.setHighlightColor(ChameleonUtils.adjustAlpha(appearance.getBackgroundColor(), 0.4f));
|
view.setHighlightColor(ChameleonUtils.adjustAlpha(appearance.getBackgroundColor(), 0.4f));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChameleonEditText.Appearance create(Context context, AttributeSet attributeSet, Chameleon.Theme theme) {
|
public static Appearance create(TextView view, Context context, AttributeSet attributeSet, Chameleon.Theme theme) {
|
||||||
ChameleonTextView.Appearance appearance = new ChameleonTextView.Appearance();
|
Appearance appearance = new Appearance();
|
||||||
ChameleonTypedArray a = ChameleonTypedArray.obtain(context, attributeSet,
|
ChameleonTypedArray a = ChameleonTypedArray.obtain(context, attributeSet,
|
||||||
R.styleable.ChameleonEditText, theme);
|
R.styleable.ChameleonEditText, theme);
|
||||||
|
appearance.setTextColor(a.getColor(R.styleable.ChameleonEditText_android_textColor, view.getCurrentTextColor()));
|
||||||
appearance.setLinkTextColor(a.getColor(R.styleable.ChameleonEditText_android_textColorLink, theme.getTextColorLink()));
|
appearance.setLinkTextColor(a.getColor(R.styleable.ChameleonEditText_android_textColorLink, theme.getTextColorLink()));
|
||||||
appearance.setBackgroundColor(a.getColor(R.styleable.ChameleonEditText_backgroundTint, theme.getColorAccent()));
|
appearance.setBackgroundColor(a.getColor(R.styleable.ChameleonEditText_backgroundTint, theme.getColorAccent()));
|
||||||
a.recycle();
|
a.recycle();
|
||||||
|
@ -132,21 +154,5 @@ public class ChameleonTextView extends AppCompatTextView implements ChameleonVie
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
field.set(object, value);
|
field.set(object, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLinkTextColor() {
|
|
||||||
return linkTextColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLinkTextColor(int linkTextColor) {
|
|
||||||
this.linkTextColor = linkTextColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBackgroundColor() {
|
|
||||||
return backgroundColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBackgroundColor(int backgroundColor) {
|
|
||||||
this.backgroundColor = backgroundColor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,14 @@
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
<declare-styleable name="ChameleonView">
|
<declare-styleable name="ChameleonView">
|
||||||
<attr name="android:background"/>
|
<attr name="android:background"/>
|
||||||
|
<attr name="backgroundTint"/>
|
||||||
|
<attr name="backgroundTintMode"/>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
<declare-styleable name="ChameleonTextView">
|
<declare-styleable name="ChameleonTextView">
|
||||||
<attr name="android:textColorLink"/>
|
<attr name="android:textColorLink"/>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
<declare-styleable name="ChameleonEditText">
|
<declare-styleable name="ChameleonEditText">
|
||||||
|
<attr name="android:textColor"/>
|
||||||
<attr name="android:textColorLink"/>
|
<attr name="android:textColorLink"/>
|
||||||
<attr name="backgroundTint"/>
|
<attr name="backgroundTint"/>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package org.mariotaku.twidere.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
import org.mariotaku.chameleon.Chameleon;
|
||||||
|
import org.mariotaku.chameleon.ChameleonUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mariotaku on 2016/12/23.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PreferencesItemIconView extends IconActionView {
|
||||||
|
public PreferencesItemIconView(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PreferencesItemIconView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PreferencesItemIconView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Appearance createAppearance(@NonNull Context context, @NonNull AttributeSet attributeSet, @NonNull Chameleon.Theme theme) {
|
||||||
|
Appearance appearance = new Appearance();
|
||||||
|
appearance.setActivatedColor(ChameleonUtils.getColorDependent(theme.getColorControlActivated()));
|
||||||
|
appearance.setDefaultColor(theme.getColorForeground());
|
||||||
|
return appearance;
|
||||||
|
}
|
||||||
|
}
|
|
@ -314,9 +314,9 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
signInIntent.setClass(this, SignInActivity::class.java)
|
signInIntent.setClass(this, SignInActivity::class.java)
|
||||||
startActivity(signInIntent)
|
startActivity(signInIntent)
|
||||||
finish()
|
finish()
|
||||||
if (defaultAutoRefreshKeyAsked !in kPreferences) {
|
if (defaultAutoRefreshAskedKey !in kPreferences) {
|
||||||
// Assume first install
|
// Assume first install
|
||||||
kPreferences[defaultAutoRefreshKeyAsked] = false
|
kPreferences[defaultAutoRefreshAskedKey] = false
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
@ -347,16 +347,16 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
}
|
}
|
||||||
mainTabs.setTabDisplayOption(tabDisplayOptionInt)
|
mainTabs.setTabDisplayOption(tabDisplayOptionInt)
|
||||||
mainTabs.setTabExpandEnabled(tabDisplayOptionInt and TabPagerIndicator.DisplayOption.LABEL == 0)
|
mainTabs.setTabExpandEnabled(tabDisplayOptionInt and TabPagerIndicator.DisplayOption.LABEL == 0)
|
||||||
mainTabs.setDisplayBadge(preferences.getBoolean(SharedPreferenceConstants.KEY_UNREAD_COUNT, true))
|
mainTabs.setDisplayBadge(preferences[unreadCountKey])
|
||||||
mainTabs.updateAppearance()
|
mainTabs.updateAppearance()
|
||||||
|
|
||||||
if (preferences.getBoolean(SharedPreferenceConstants.KEY_DRAWER_TOGGLE)) {
|
if (preferences[drawerToggleKey]) {
|
||||||
drawerToggleButton.visibility = View.VISIBLE
|
drawerToggleButton.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
drawerToggleButton.visibility = View.GONE
|
drawerToggleButton.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preferences.getBoolean(SharedPreferenceConstants.KEY_FAB_VISIBLE)) {
|
if (preferences[fabVisibleKey]) {
|
||||||
actionsButton.visibility = View.VISIBLE
|
actionsButton.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
actionsButton.visibility = View.GONE
|
actionsButton.visibility = View.GONE
|
||||||
|
@ -400,7 +400,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
startService(Intent(this, StreamingService::class.java))
|
startService(Intent(this, StreamingService::class.java))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showDrawerTutorial() && !kPreferences[defaultAutoRefreshKeyAsked]) {
|
if (!showDrawerTutorial() && !kPreferences[defaultAutoRefreshAskedKey]) {
|
||||||
showAutoRefreshConfirm()
|
showAutoRefreshConfirm()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -947,7 +947,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDismiss(dialog: DialogInterface?) {
|
override fun onDismiss(dialog: DialogInterface?) {
|
||||||
kPreferences[defaultAutoRefreshKeyAsked] = true
|
kPreferences[defaultAutoRefreshAskedKey] = true
|
||||||
super.onDismiss(dialog)
|
super.onDismiss(dialog)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,10 @@ val bugReportsKey = KBooleanKey(KEY_BUG_REPORTS, BuildConfig.DEBUG)
|
||||||
val readFromBottomKey = KBooleanKey(KEY_READ_FROM_BOTTOM, false)
|
val readFromBottomKey = KBooleanKey(KEY_READ_FROM_BOTTOM, false)
|
||||||
val randomizeAccountNameKey = KBooleanKey(KEY_RANDOMIZE_ACCOUNT_NAME, false)
|
val randomizeAccountNameKey = KBooleanKey(KEY_RANDOMIZE_ACCOUNT_NAME, false)
|
||||||
val defaultAutoRefreshKey = KBooleanKey(KEY_DEFAULT_AUTO_REFRESH, false)
|
val defaultAutoRefreshKey = KBooleanKey(KEY_DEFAULT_AUTO_REFRESH, false)
|
||||||
val defaultAutoRefreshKeyAsked = KBooleanKey("default_auto_refresh_asked", true)
|
val defaultAutoRefreshAskedKey = KBooleanKey("default_auto_refresh_asked", true)
|
||||||
|
val unreadCountKey = KBooleanKey(KEY_UNREAD_COUNT, true)
|
||||||
|
val drawerToggleKey = KBooleanKey(KEY_DRAWER_TOGGLE, false)
|
||||||
|
val fabVisibleKey = KBooleanKey(KEY_FAB_VISIBLE, true)
|
||||||
|
|
||||||
object refreshIntervalKey : KSimpleKey<Long>(KEY_REFRESH_INTERVAL, 15) {
|
object refreshIntervalKey : KSimpleKey<Long>(KEY_REFRESH_INTERVAL, 15) {
|
||||||
override fun read(preferences: SharedPreferences): Long {
|
override fun read(preferences: SharedPreferences): Long {
|
||||||
|
|
|
@ -68,6 +68,7 @@ import org.mariotaku.twidere.util.CustomTabUtils
|
||||||
import org.mariotaku.twidere.util.DataStoreUtils
|
import org.mariotaku.twidere.util.DataStoreUtils
|
||||||
import org.mariotaku.twidere.util.ThemeUtils
|
import org.mariotaku.twidere.util.ThemeUtils
|
||||||
import org.mariotaku.twidere.view.holder.TwoLineWithIconViewHolder
|
import org.mariotaku.twidere.view.holder.TwoLineWithIconViewHolder
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, MultiChoiceModeListener {
|
class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, MultiChoiceModeListener {
|
||||||
|
|
||||||
|
@ -149,7 +150,12 @@ class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, Mult
|
||||||
val icon = conf.icon.createDrawable(context)
|
val icon = conf.icon.createDrawable(context)
|
||||||
icon.mutate().setColorFilter(theme.textColorPrimary, Mode.SRC_ATOP)
|
icon.mutate().setColorFilter(theme.textColorPrimary, Mode.SRC_ATOP)
|
||||||
subItem.icon = icon
|
subItem.icon = icon
|
||||||
|
val weakFragment = WeakReference(this)
|
||||||
subItem.setOnMenuItemClickListener { item ->
|
subItem.setOnMenuItemClickListener { item ->
|
||||||
|
val fragment = weakFragment.get() ?: return@setOnMenuItemClickListener false
|
||||||
|
val adapter = fragment.adapter
|
||||||
|
val fm = fragment.childFragmentManager
|
||||||
|
|
||||||
val df = TabEditorDialogFragment()
|
val df = TabEditorDialogFragment()
|
||||||
df.arguments = Bundle {
|
df.arguments = Bundle {
|
||||||
this[EXTRA_TAB_TYPE] = type
|
this[EXTRA_TAB_TYPE] = type
|
||||||
|
@ -157,7 +163,7 @@ class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, Mult
|
||||||
this[EXTRA_TAB_POSITION] = adapter.getTab(adapter.count - 1).position + 1
|
this[EXTRA_TAB_POSITION] = adapter.getTab(adapter.count - 1).position + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
df.show(fragmentManager, TabEditorDialogFragment.TAG_ADD_TAB)
|
df.show(fm, TabEditorDialogFragment.TAG_ADD_TAB)
|
||||||
return@setOnMenuItemClickListener true
|
return@setOnMenuItemClickListener true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,11 @@ import org.mariotaku.twidere.model.UserKey
|
||||||
/**
|
/**
|
||||||
* Created by mariotaku on 15/1/23.
|
* Created by mariotaku on 15/1/23.
|
||||||
*/
|
*/
|
||||||
open class StatusLinkClickHandler(context: Context, manager: MultiSelectManager, preferences: SharedPreferencesWrapper) : OnLinkClickHandler(context, manager, preferences), Constants {
|
open class StatusLinkClickHandler(
|
||||||
|
context: Context,
|
||||||
|
manager: MultiSelectManager,
|
||||||
|
preferences: SharedPreferencesWrapper
|
||||||
|
) : OnLinkClickHandler(context, manager, preferences), Constants {
|
||||||
|
|
||||||
var status: ParcelableStatus? = null
|
var status: ParcelableStatus? = null
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
@ -27,7 +28,8 @@
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:tag="tint_background|accent_color">
|
android:tag="tint_background|accent_color"
|
||||||
|
app:backgroundTint="?colorControlActivated">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/drag_handle"
|
android:id="@+id/drag_handle"
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="@dimen/element_spacing_normal"
|
android:padding="@dimen/element_spacing_normal"
|
||||||
android:tag="tint_background|accent_color"
|
android:tag="tint_background|accent_color"
|
||||||
|
app:backgroundTint="?colorControlActivated"
|
||||||
app:ignorePadding="true"
|
app:ignorePadding="true"
|
||||||
tools:context=".adapter.DraftsAdapter">
|
tools:context=".adapter.DraftsAdapter">
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,5 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:tag="text_color|accent_color"
|
android:maxLines="1"
|
||||||
android:textColor="?colorAccent"
|
android:textColor="?colorAccent"/>
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:minHeight="?listPreferredItemHeightSmall"
|
android:minHeight="?listPreferredItemHeightSmall"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:tag="tint_background|accent_color">
|
app:backgroundTint="?colorControlActivated">
|
||||||
|
|
||||||
<org.mariotaku.twidere.view.IconActionView
|
<org.mariotaku.twidere.view.PreferencesItemIconView
|
||||||
android:id="@android:id/icon"
|
android:id="@android:id/icon"
|
||||||
android:layout_width="@dimen/header_icon_width"
|
android:layout_width="@dimen/header_icon_width"
|
||||||
android:layout_height="@dimen/header_icon_width"
|
android:layout_height="@dimen/header_icon_width"
|
||||||
|
|
|
@ -17,14 +17,16 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@android:id/text1"
|
android:id="@android:id/text1"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/activatedBackgroundIndicator"
|
android:background="?android:activatedBackgroundIndicator"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
android:minHeight="?android:listPreferredItemHeightSmall"
|
||||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||||
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
|
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
||||||
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
|
android:paddingRight="?android:listPreferredItemPaddingRight"
|
||||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||||
android:tag="tint_background|accent_color"
|
android:tag="tint_background|accent_color"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"/>
|
android:textAppearance="?android:textAppearanceListItemSmall"
|
||||||
|
app:backgroundTint="?colorControlActivated"/>
|
||||||
|
|
|
@ -16,23 +16,25 @@
|
||||||
|
|
||||||
<TwoLineListItem
|
<TwoLineListItem
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/activatedBackgroundIndicator"
|
android:background="?android:activatedBackgroundIndicator"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
android:minHeight="?android:listPreferredItemHeight"
|
||||||
android:mode="twoLine"
|
android:mode="twoLine"
|
||||||
android:paddingBottom="2dip"
|
android:paddingBottom="2dip"
|
||||||
android:paddingTop="2dip"
|
android:paddingTop="2dip"
|
||||||
android:tag="tint_background|accent_color">
|
android:tag="tint_background|accent_color"
|
||||||
|
app:backgroundTint="?colorControlActivated">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@android:id/text1"
|
android:id="@android:id/text1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft"
|
android:layout_marginLeft="?android:listPreferredItemPaddingLeft"
|
||||||
android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
|
android:layout_marginStart="?android:listPreferredItemPaddingStart"
|
||||||
android:layout_marginTop="6dip"
|
android:layout_marginTop="6dip"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItem"/>
|
android:textAppearance="?android:textAppearanceListItem"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@android:id/text2"
|
android:id="@android:id/text2"
|
||||||
|
@ -41,7 +43,7 @@
|
||||||
android:layout_alignLeft="@android:id/text1"
|
android:layout_alignLeft="@android:id/text1"
|
||||||
android:layout_alignStart="@android:id/text1"
|
android:layout_alignStart="@android:id/text1"
|
||||||
android:layout_below="@android:id/text1"
|
android:layout_below="@android:id/text1"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:textAppearanceSmall"
|
||||||
android:textColor="?android:textColorSecondary"/>
|
android:textColor="?android:textColorSecondary"/>
|
||||||
|
|
||||||
</TwoLineListItem>
|
</TwoLineListItem>
|
||||||
|
|
Loading…
Reference in New Issue