parent
815eb7a83c
commit
f789020ff9
|
@ -1,151 +0,0 @@
|
|||
/*
|
||||
* 版本:1.0
|
||||
* 日期:2014-10-16
|
||||
* Copyright (C) 2010 中国广东省珠海市魅族科技有限公司版权所有
|
||||
* 修改历史记录:
|
||||
* 2014-10-16 初始版本创建
|
||||
*/
|
||||
package com.meizu.flyme.reflect;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.TypedValue;
|
||||
|
||||
|
||||
/**
|
||||
* <p>用以调用Flyme定制的API</p>
|
||||
*
|
||||
* @author MEIZU.SDK Team
|
||||
*
|
||||
*/
|
||||
public class ActionBarProxy extends Proxy{
|
||||
|
||||
private static Class<?> sClass = ActionBar.class;
|
||||
private static Method sSetBackButtonDrawableMethod;
|
||||
private static Method sSetActionModeHeaderHiddenMethod;
|
||||
private static Method sSetActionBarViewCollapsableMethod;
|
||||
private static Method sSetOverFlowButtonDrawableMethod;
|
||||
private static Method sSetTabsShowAtBottom;
|
||||
|
||||
|
||||
/**
|
||||
* 判断设备是否支持smart bar
|
||||
* @return boolean true支持,false不支持
|
||||
*/
|
||||
public static boolean hasSmartBar() {
|
||||
try {
|
||||
Method method = Class.forName("android.os.Build").getMethod(
|
||||
"hasSmartBar");
|
||||
return ((Boolean) method.invoke(null)).booleanValue();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置返回按钮图标
|
||||
* @param actionbar 相应的ActionBar参数
|
||||
* @param backIcon 返回按键的Icon
|
||||
* @return boolean 执行结果
|
||||
*/
|
||||
public static boolean SetBackButtonDrawable(android.app.ActionBar actionbar,
|
||||
Drawable backIcon) {
|
||||
sSetBackButtonDrawableMethod = getMethod(sSetBackButtonDrawableMethod, sClass, "setBackButtonDrawable", new Class[] { Drawable.class });
|
||||
return invoke(sSetBackButtonDrawableMethod, actionbar, backIcon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置more按钮图标
|
||||
* @return boolean 执行结果
|
||||
*/
|
||||
public static boolean SetOverFlowButtonDrawable(android.app.ActionBar actionbar,
|
||||
Drawable drawable) {
|
||||
sSetOverFlowButtonDrawableMethod = getMethod(sSetOverFlowButtonDrawableMethod, sClass, "setOverFlowButtonDrawable", new Class[] { Drawable.class });
|
||||
return invoke(sSetOverFlowButtonDrawableMethod, actionbar, drawable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置ActionMode顶栏是否隐藏。
|
||||
* @param bar 对应的ActionBar
|
||||
* @param hide为true表示隐藏
|
||||
* @return boolean 执行结果
|
||||
*/
|
||||
public static boolean setActionModeHeaderHidden(ActionBar bar, boolean hide) {
|
||||
sSetActionModeHeaderHiddenMethod = getMethod(sSetActionModeHeaderHiddenMethod, sClass, "setActionModeHeaderHidden", boolean.class);
|
||||
return invoke(sSetActionModeHeaderHiddenMethod, bar, hide);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置ActionBar顶栏无显示内容时是否隐藏。
|
||||
* @param bar
|
||||
* @param collapsable
|
||||
* @return boolen执行结果
|
||||
*/
|
||||
public static boolean setActionBarViewCollapsable(ActionBar bar, boolean collapsable) {
|
||||
sSetActionBarViewCollapsableMethod = getMethod(sSetActionBarViewCollapsableMethod, sClass, "setActionBarViewCollapsable", boolean.class);
|
||||
return invoke(sSetActionBarViewCollapsableMethod, bar, collapsable);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 设置ActionBar Tabs显示在底栏,不过需要配合
|
||||
* android:uiOptions="splitActionBarWhenNarrow"
|
||||
* <p>
|
||||
* @param actionbar
|
||||
* @param showAtBottom
|
||||
* @return boolen 执行结果
|
||||
*/
|
||||
public static boolean setActionBarTabsShowAtBottom(
|
||||
android.app.ActionBar actionbar, boolean showAtBottom) {
|
||||
sSetTabsShowAtBottom = getMethod(sSetTabsShowAtBottom, sClass, "setTabsShowAtBottom", boolean.class);
|
||||
return invoke(sSetTabsShowAtBottom, actionbar, showAtBottom);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取actionbar高度
|
||||
* @param context 上下文
|
||||
* @param actionbar 对应的ActionBar
|
||||
* @return int ActionBar的高度值
|
||||
*/
|
||||
public static int getActionBarHeight(Context context, ActionBar actionbar) {
|
||||
if(actionbar != null){
|
||||
TypedValue tv = new TypedValue();
|
||||
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize,
|
||||
tv, true)) {
|
||||
return TypedValue.complexToDimensionPixelSize(tv.data, context
|
||||
.getResources().getDisplayMetrics());
|
||||
}
|
||||
return actionbar.getHeight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取smartbar高度
|
||||
* @param context
|
||||
* @param actionbar
|
||||
* @return int SmartBar的高度值
|
||||
*/
|
||||
public static int getSmartBarHeight(Context context,ActionBar actionbar) {
|
||||
if(actionbar != null){
|
||||
try {
|
||||
Class<?> c = Class.forName("com.android.internal.R$dimen");
|
||||
Object obj = c.newInstance();
|
||||
Field field = c.getField("mz_action_button_min_height");
|
||||
int height = Integer.parseInt(field.get(obj).toString());
|
||||
return context.getResources().getDimensionPixelSize(height);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
actionbar.getHeight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.meizu.flyme.reflect;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
/**
|
||||
* @author MEIZU.SDK Team
|
||||
*
|
||||
*/
|
||||
public class InputMethodProxy extends Proxy {
|
||||
|
||||
private final static String TAG = "InputMethod";
|
||||
private static Class<?> sClass = InputMethodManager.class;
|
||||
private static Method sSetMzInputThemeLight;
|
||||
|
||||
|
||||
/**
|
||||
* 设置导航栏和输入法背景颜色,在App启动第一个Actiity onCreate方法中调用该方法,执行成功后,App中使用系统输入法都是白色样式
|
||||
* @param context 上下文
|
||||
* @param light 是否把导航栏和输入法背景设置为白色
|
||||
* @return boolean 执行结果,成功执行返回true
|
||||
*/
|
||||
public static boolean setInputThemeLight(Context context, boolean light) {
|
||||
sSetMzInputThemeLight = getMethod(sSetMzInputThemeLight, sClass,
|
||||
"setMzInputThemeLight", boolean.class);
|
||||
InputMethodManager imm = (InputMethodManager) context
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm != null) {
|
||||
return invoke(sSetMzInputThemeLight, imm, light);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
* 版本:1.0
|
||||
* 日期:2014-10-16
|
||||
* Copyright (C) 2010 中国广东省珠海市魅族科技有限公司版权所有
|
||||
* 修改历史记录:
|
||||
* 2014-10-16 初始版本创建
|
||||
*/
|
||||
package com.meizu.flyme.reflect;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import android.app.Notification;
|
||||
import android.app.Notification.Builder;
|
||||
|
||||
|
||||
/**
|
||||
* <p>用以调用Flyme定制的API</p>
|
||||
*
|
||||
* @author MEIZU.SDK Team
|
||||
*
|
||||
*/
|
||||
public class NotificationProxy extends Proxy {
|
||||
|
||||
private static Class<?> sClass = Notification.Builder.class;
|
||||
private static Field sField = null;
|
||||
private static Object sObject = null;
|
||||
private static Method sSetProgressBarStype = null;
|
||||
private static Method sSetCircleProgressBarColor = null;
|
||||
private static Method ssetCircleProgressRimColor = null;
|
||||
|
||||
/**
|
||||
* 设置ProgressBar的类型
|
||||
* @param builder 为Notification.Builder类
|
||||
* @param isCircle true为圆环形,false为普通直线形
|
||||
*/
|
||||
public static void setProgressBarStype(Builder builder, boolean isCircle){
|
||||
try{
|
||||
sField = sClass.getField("mFlymeNotificationBuilder");
|
||||
sObject = sField.get(builder);
|
||||
sSetProgressBarStype = sField.getType().getDeclaredMethod("setCircleProgressBar", boolean.class);
|
||||
|
||||
if(sObject != null){
|
||||
invoke(sSetProgressBarStype, sObject, isCircle);
|
||||
}
|
||||
}catch(Exception ignore){
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置圆环形ProgressBar活动进度条的颜色
|
||||
* @param color 为颜色值
|
||||
*/
|
||||
public static void setCircleProgressBarColor(int color) {
|
||||
try{
|
||||
if(sField != null && sObject != null){
|
||||
sSetCircleProgressBarColor = sField.getType().getDeclaredMethod("setCircleProgressBarColor", int.class);
|
||||
invoke(sSetCircleProgressBarColor, sObject, color);
|
||||
}
|
||||
}catch(Exception ignore){
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置圆环形ProgressBar外边环的颜色
|
||||
* @param color 为颜色值
|
||||
*/
|
||||
public static void setCircleProgressRimColor(int color) {
|
||||
try{
|
||||
if(sField != null && sObject != null){
|
||||
ssetCircleProgressRimColor = sField.getType().getDeclaredMethod("ssetCircleProgressRimColor", int.class);
|
||||
invoke(ssetCircleProgressRimColor, sObject, color);
|
||||
}
|
||||
}catch(Exception ignore){
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package com.meizu.flyme.reflect;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Proxy {
|
||||
|
||||
/**
|
||||
* 获取方法
|
||||
* @param method
|
||||
* @param clazz
|
||||
* @param name
|
||||
* @param parameterTypes
|
||||
* @return method
|
||||
*/
|
||||
protected static Method getMethod (Method method, Class<?> clazz, String name, Class<?>... parameterTypes) {
|
||||
if (method == null) {
|
||||
try {
|
||||
method = clazz.getMethod(name, parameterTypes);
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return method;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行方法
|
||||
* @param method 方法
|
||||
* @param obj 对像
|
||||
* @param args 参数
|
||||
* @return boolean 执行结果
|
||||
*/
|
||||
protected static boolean invoke (Method method, Object obj, Object... args) {
|
||||
if (method != null) {
|
||||
try {
|
||||
method.invoke(obj, args);
|
||||
return true;
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,6 @@ import java.lang.reflect.Field;
|
|||
public class StatusBarProxy {
|
||||
private final static String TAG = "StatusBar";
|
||||
|
||||
|
||||
/**
|
||||
* 设置状态栏图标为深色和魅族特定的文字风格
|
||||
* @param window 需要设置的窗口
|
||||
|
@ -40,67 +39,10 @@ public class StatusBarProxy {
|
|||
meizuFlags.setInt(lp, value);
|
||||
window.setAttributes(lp);
|
||||
result = true;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setStatusBarDarkIcon: failed");
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置沉浸式窗口,设置成功后,状态栏则透明显示
|
||||
* @param window 需要设置的窗口
|
||||
* @param immersive 是否把窗口设置为沉浸
|
||||
* @return boolean 成功执行返回true
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
public static boolean setImmersedWindow(Window window, boolean immersive) {
|
||||
boolean result = false;
|
||||
if (window != null) {
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
int trans_status = 0;
|
||||
Field flags;
|
||||
if (android.os.Build.VERSION.SDK_INT < 19) {
|
||||
try {
|
||||
trans_status = 1 << 6;
|
||||
flags = lp.getClass().getDeclaredField("meizuFlags");
|
||||
flags.setAccessible(true);
|
||||
int value = flags.getInt(lp);
|
||||
if (immersive) {
|
||||
value = value | trans_status;
|
||||
} else {
|
||||
value = value & ~trans_status;
|
||||
}
|
||||
flags.setInt(lp, value);
|
||||
result = true;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setImmersedWindow: failed");
|
||||
}
|
||||
} else {
|
||||
lp.flags |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
|
||||
window.setAttributes(lp);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态栏高度
|
||||
* @param context 上下文
|
||||
* @return int 状态栏高度
|
||||
*/
|
||||
public static int getStatusBarHeight(Context context) {
|
||||
try {
|
||||
Class<?> c = Class.forName("com.android.internal.R$dimen");
|
||||
Object obj = c.newInstance();
|
||||
Field field = c.getField("status_bar_height");
|
||||
int height = Integer.parseInt(field.get(obj).toString());
|
||||
return context.getResources().getDimensionPixelSize(height);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 75;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
package com.meizu.flyme.reflect;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
|
||||
public class WallpaperManagerProxy extends Proxy {
|
||||
private final static String TAG = "WallpaperManagerProxy";
|
||||
private static Class<?> sClass = WallpaperManager.class;
|
||||
private static Method sSetLockWallpaper;
|
||||
|
||||
/**
|
||||
* 从参数所提供的路径,读取图片并设置为锁屏界面
|
||||
* @param context 上下文
|
||||
* @param path 图片的路径
|
||||
* @return boolean 成功执行返回true
|
||||
*/
|
||||
public static boolean setLockWallpaper(Context context, String path) {
|
||||
boolean result = false;
|
||||
WallpaperManager wm = WallpaperManager.getInstance(context);
|
||||
try {
|
||||
InputStream is = new FileInputStream(path);
|
||||
sSetLockWallpaper = getMethod(sSetLockWallpaper, sClass,
|
||||
"setStreamToLockWallpaper", InputStream.class);
|
||||
if (wm != null) {
|
||||
result = invoke(sSetLockWallpaper, wm, is);
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从参数所提供的路径,读取图片并设置为Home界面
|
||||
* @param context 上下文
|
||||
* @param path 图片的路径
|
||||
* @return boolean 成功执行返回true
|
||||
*/
|
||||
public static boolean setHomeWallpaper(Context context, String path) {
|
||||
boolean result = false;
|
||||
WallpaperManager wm = WallpaperManager.getInstance(context);
|
||||
try {
|
||||
InputStream is = new FileInputStream(path);
|
||||
wm.setStream(is);
|
||||
result = true;
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -104,6 +104,7 @@ import org.mariotaku.twidere.util.message.UnreadCountUpdatedEvent;
|
|||
import org.mariotaku.twidere.util.support.ActivitySupport;
|
||||
import org.mariotaku.twidere.util.support.ActivitySupport.TaskDescriptionCompat;
|
||||
import org.mariotaku.twidere.util.support.ViewSupport;
|
||||
import org.mariotaku.twidere.util.support.view.ViewOutlineProviderCompat;
|
||||
import org.mariotaku.twidere.view.ExtendedViewPager;
|
||||
import org.mariotaku.twidere.view.HomeSlidingMenu;
|
||||
import org.mariotaku.twidere.view.LeftDrawerFrameLayout;
|
||||
|
@ -156,8 +157,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
private HomeSlidingMenu mSlidingMenu;
|
||||
private View mEmptyTabHint;
|
||||
private View mActionsButton;
|
||||
private View mTabsContainer;
|
||||
private View mActionBarOverlay;
|
||||
private View mActionBarWithOverlay;
|
||||
private LeftDrawerFrameLayout mLeftDrawerContainer;
|
||||
private RightDrawerFrameLayout mRightDrawerContainer;
|
||||
private TintedStatusFrameLayout mColorStatusFrameLayout;
|
||||
|
@ -303,7 +303,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
|
||||
@Override
|
||||
public void setControlBarOffset(float offset) {
|
||||
mTabsContainer.setTranslationY(mTabColumns > 1 ? 0 : getControlBarHeight() * (offset - 1));
|
||||
mActionBarWithOverlay.setTranslationY(mTabColumns > 1 ? 0 : getControlBarHeight() * (offset - 1));
|
||||
final ViewGroup.LayoutParams lp = mActionsButton.getLayoutParams();
|
||||
if (lp instanceof MarginLayoutParams) {
|
||||
mActionsButton.setTranslationY((((MarginLayoutParams) lp).bottomMargin + mActionsButton.getHeight()) * (1 - offset));
|
||||
|
@ -380,9 +380,13 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
mActionsButton.setOnLongClickListener(this);
|
||||
mEmptyTabHint.setOnClickListener(this);
|
||||
|
||||
ViewCompat.setElevation(mActionBar, ThemeUtils.getSupportActionBarElevation(this));
|
||||
ThemeUtils.setCompatToolbarOverlay(this, new EmptyDrawable());
|
||||
ThemeUtils.setCompatContentViewOverlay(this, new EmptyDrawable());
|
||||
final View actionBarContainer = findViewById(R.id.twidere_action_bar_container);
|
||||
ViewCompat.setElevation(actionBarContainer, ThemeUtils.getSupportActionBarElevation(this));
|
||||
ViewSupport.setOutlineProvider(actionBarContainer, ViewOutlineProviderCompat.BACKGROUND);
|
||||
final View windowOverlay = findViewById(R.id.window_overlay);
|
||||
ViewSupport.setBackground(windowOverlay, ThemeUtils.getNormalWindowContentOverlay(this, getCurrentThemeResourceId()));
|
||||
|
||||
setupSlidingMenu();
|
||||
setupBars();
|
||||
showDataProfilingRequest();
|
||||
|
@ -505,7 +509,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
@Override
|
||||
public void onClick(final View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.action_buttons: {
|
||||
case R.id.actions_button: {
|
||||
triggerActionsClick();
|
||||
break;
|
||||
}
|
||||
|
@ -527,7 +531,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
@Override
|
||||
public boolean onLongClick(final View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.action_buttons: {
|
||||
case R.id.actions_button: {
|
||||
showMenuItemToast(v, v.getContentDescription(), true);
|
||||
return true;
|
||||
}
|
||||
|
@ -645,21 +649,20 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
return 1 - mActionsButton.getTranslationY() / total;
|
||||
}
|
||||
final float totalHeight = getControlBarHeight();
|
||||
return 1 + mTabsContainer.getTranslationY() / totalHeight;
|
||||
return 1 + mActionBarWithOverlay.getTranslationY() / totalHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContentChanged() {
|
||||
super.onContentChanged();
|
||||
mActionBar = (Toolbar) findViewById(R.id.actionbar);
|
||||
mActionBar = (Toolbar) findViewById(R.id.action_bar);
|
||||
mTabIndicator = (TabPagerIndicator) findViewById(R.id.main_tabs);
|
||||
mSlidingMenu = (HomeSlidingMenu) findViewById(R.id.home_menu);
|
||||
mViewPager = (ExtendedViewPager) findViewById(R.id.main_pager);
|
||||
mEmptyTabHint = findViewById(R.id.empty_tab_hint);
|
||||
mActionsButton = findViewById(R.id.action_buttons);
|
||||
mTabsContainer = findViewById(R.id.tabs_container);
|
||||
mActionsButton = findViewById(R.id.actions_button);
|
||||
mActionBarWithOverlay = findViewById(R.id.twidere_action_bar_with_overlay);
|
||||
mTabIndicator = (TabPagerIndicator) findViewById(R.id.main_tabs);
|
||||
mActionBarOverlay = findViewById(R.id.actionbar_overlay);
|
||||
mColorStatusFrameLayout = (TintedStatusFrameLayout) findViewById(R.id.home_content);
|
||||
}
|
||||
|
||||
|
@ -794,7 +797,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
final boolean isTransparent = ThemeUtils.isTransparentBackground(backgroundOption);
|
||||
final int actionBarAlpha = isTransparent ? ThemeUtils.getUserThemeBackgroundAlpha(this) : 0xFF;
|
||||
final IHomeActionButton homeActionButton = (IHomeActionButton) mActionsButton;
|
||||
mTabIndicator.setItemContext(ThemeUtils.getActionBarContext(this));
|
||||
mTabIndicator.setItemContext(ThemeUtils.getActionBarThemedContext(this, themeResId, themeColor));
|
||||
ViewSupport.setBackground(mActionBar, ThemeUtils.getActionBarBackground(this, themeResId, themeColor,
|
||||
backgroundOption, true));
|
||||
final int statusBarColor;
|
||||
|
@ -830,7 +833,6 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
|
|||
mColorStatusFrameLayout.setFactor(1);
|
||||
mTabIndicator.setAlpha(actionBarAlpha / 255f);
|
||||
mActionsButton.setAlpha(actionBarAlpha / 255f);
|
||||
ViewSupport.setBackground(mActionBarOverlay, ThemeUtils.getWindowContentOverlay(this));
|
||||
}
|
||||
|
||||
private void setupHomeTabs() {
|
||||
|
|
|
@ -96,7 +96,6 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
|
|||
private ActionBarContainer mActionBarContainer;
|
||||
|
||||
private boolean mFinishOnly;
|
||||
private int mActionBarItemsColor;
|
||||
private int mActionBarHeight;
|
||||
|
||||
|
||||
|
@ -280,7 +279,7 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
|
|||
public void onContentChanged() {
|
||||
super.onContentChanged();
|
||||
mMainContent = (TintedStatusFrameLayout) findViewById(R.id.main_content);
|
||||
mActionBarOverlay = findViewById(R.id.twidere_action_bar_overlay);
|
||||
mActionBarOverlay = findViewById(R.id.twidere_action_bar_with_overlay);
|
||||
mActionBarContainer = (ActionBarContainer) findViewById(R.id.twidere_action_bar_container);
|
||||
}
|
||||
|
||||
|
@ -363,7 +362,6 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
|
|||
ThemeUtils.setActionBarColor(getWindow(), getSupportActionBar(), titleColor, actionBarItemsColor);
|
||||
}
|
||||
}
|
||||
mActionBarItemsColor = actionBarItemsColor;
|
||||
}
|
||||
|
||||
private void setStatusBarColor(int linkId, Uri uri) {
|
||||
|
|
|
@ -100,7 +100,7 @@ public class ThemePreviewPreference extends Preference implements Constants, OnS
|
|||
final View windowBackgroundView = view.findViewById(R.id.theme_preview_window_background);
|
||||
final View windowContentOverlayView = view.findViewById(R.id.theme_preview_window_content_overlay);
|
||||
final View actionBarOverlay = view.findViewById(R.id.actionbar_overlay);
|
||||
final Toolbar actionBarView = (Toolbar) view.findViewById(R.id.actionbar);
|
||||
final Toolbar actionBarView = (Toolbar) view.findViewById(R.id.action_bar);
|
||||
final ActionMenuView menuBar = (ActionMenuView) view.findViewById(R.id.menu_bar);
|
||||
final View statusContentView = view.findViewById(R.id.theme_preview_status_content);
|
||||
final CardView cardView = (CardView) view.findViewById(R.id.card);
|
||||
|
|
|
@ -312,35 +312,6 @@ public class ThemeUtils implements Constants {
|
|||
return ActionBarColorDrawable.create(actionBarColor, outlineEnabled);
|
||||
}
|
||||
|
||||
public static Context getActionBarContext(final Context context) {
|
||||
@SuppressLint("InlinedApi")
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.actionBarTheme,
|
||||
R.attr.actionBarWidgetTheme, android.R.attr.actionBarTheme,
|
||||
android.R.attr.actionBarWidgetTheme});
|
||||
final int resId;
|
||||
if (a.hasValue(0) || a.hasValue(1)) {
|
||||
resId = a.hasValue(0) ? a.getResourceId(0, 0) : a.getResourceId(1, 0);
|
||||
} else {
|
||||
resId = a.hasValue(2) ? a.getResourceId(2, 0) : a.getResourceId(3, 0);
|
||||
}
|
||||
a.recycle();
|
||||
if (resId == 0) return context;
|
||||
return new ContextThemeWrapper(context, resId);
|
||||
}
|
||||
|
||||
public static float getActionBarElevation(final Context context) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return 0;
|
||||
@SuppressLint("InlinedApi")
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
final TypedArray a = context.obtainStyledAttributes(null, new int[]{android.R.attr.elevation},
|
||||
android.R.attr.actionBarStyle, 0);
|
||||
try {
|
||||
return a.getDimension(0, 0);
|
||||
} finally {
|
||||
a.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
public static Drawable getActionBarHomeAsUpIndicator(android.support.v7.app.ActionBar actionBar) {
|
||||
final Context context = actionBar.getThemedContext();
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
|
@ -353,9 +324,7 @@ public class ThemeUtils implements Constants {
|
|||
}
|
||||
|
||||
public static int getActionBarPopupThemeRes(final Context context) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return 0;
|
||||
@SuppressLint("InlinedApi")
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{android.R.attr.actionBarPopupTheme});
|
||||
final TypedArray a = context.obtainStyledAttributes(new int[]{R.attr.actionBarPopupTheme});
|
||||
try {
|
||||
return a.getResourceId(0, 0);
|
||||
} finally {
|
||||
|
@ -1316,4 +1285,22 @@ public class ThemeUtils implements Constants {
|
|||
return base;
|
||||
}
|
||||
}
|
||||
|
||||
public static Context getActionBarThemedContext(Context base, int themeId, int accentColor) {
|
||||
if (isDarkTheme(themeId)) return base;
|
||||
final int actionBarThemeId;
|
||||
if (TwidereColorUtils.getYIQLuminance(accentColor) > ACCENT_COLOR_THRESHOLD) {
|
||||
actionBarThemeId = R.style.Theme_Twidere_Light;
|
||||
} else {
|
||||
actionBarThemeId = R.style.Theme_Twidere_Dark;
|
||||
}
|
||||
final Resources.Theme baseTheme = base.getTheme();
|
||||
final Resources.Theme actionBarTheme = base.getResources().newTheme();
|
||||
actionBarTheme.setTo(baseTheme);
|
||||
actionBarTheme.applyStyle(actionBarThemeId, true);
|
||||
|
||||
final Context actionBarContext = new android.support.v7.internal.view.ContextThemeWrapper(base, 0);
|
||||
actionBarContext.getTheme().setTo(actionBarTheme);
|
||||
return actionBarContext;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ public class ThemedLayoutInflaterFactory implements LayoutInflaterFactory {
|
|||
}
|
||||
} else if (view instanceof TintableBackgroundView) {
|
||||
final TintableBackgroundView tintable = (TintableBackgroundView) view;
|
||||
if (isAccentOptimal) {
|
||||
if (isAccentOptimal || !isColorTint) {
|
||||
applyTintableBackgroundViewTint(tintable, accentColor, noTintColor, backgroundTintColor, isColorTint);
|
||||
}
|
||||
} else if (view instanceof TwidereToolbar) {
|
||||
|
@ -186,7 +186,7 @@ public class ThemedLayoutInflaterFactory implements LayoutInflaterFactory {
|
|||
themeResourceId, actionBarColor);
|
||||
((TwidereToolbar) view).setItemColor(itemColor);
|
||||
} else if (view instanceof EditText) {
|
||||
if (isAccentOptimal) {
|
||||
if (isAccentOptimal || !isColorTint) {
|
||||
ViewCompat.setBackgroundTintList(view, ColorStateList.valueOf(accentColor));
|
||||
}
|
||||
} else if (view instanceof ProgressBar) {
|
||||
|
|
|
@ -110,11 +110,14 @@ public class TwidereActionModeForChildListener implements NativeActionModeAwareL
|
|||
if (mActionModeView == null) {
|
||||
if (mIsFloating && mUsePopup) {
|
||||
// Use the action bar theme.
|
||||
final TypedValue outValue = new TypedValue();
|
||||
final Resources.Theme baseTheme = mActivity.getTheme();
|
||||
baseTheme.resolveAttribute(android.support.v7.appcompat.R.attr.actionBarTheme, outValue, true);
|
||||
|
||||
final Context actionBarContext = ThemeUtils.getActionBarThemedContext(mActivity);
|
||||
final Context actionBarContext;
|
||||
if (mActivity instanceof IThemedActivity) {
|
||||
actionBarContext = ThemeUtils.getActionBarThemedContext(mActivity,
|
||||
((IThemedActivity) mActivity).getCurrentThemeResourceId(),
|
||||
((IThemedActivity) mActivity).getCurrentThemeColor());
|
||||
} else {
|
||||
actionBarContext = ThemeUtils.getActionBarThemedContext(mActivity);
|
||||
}
|
||||
|
||||
mActionModeView = new ActionBarContextView(actionBarContext);
|
||||
mActionModePopup = new PopupWindow(actionBarContext, null,
|
||||
|
@ -122,6 +125,7 @@ public class TwidereActionModeForChildListener implements NativeActionModeAwareL
|
|||
mActionModePopup.setContentView(mActionModeView);
|
||||
mActionModePopup.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
|
||||
final TypedValue outValue = new TypedValue();
|
||||
actionBarContext.getTheme().resolveAttribute(
|
||||
android.support.v7.appcompat.R.attr.actionBarSize, outValue, true);
|
||||
final int height = TypedValue.complexToDimensionPixelSize(outValue.data,
|
||||
|
|
|
@ -38,6 +38,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ProgressBar;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.activity.iface.IThemedActivity;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.support.ViewSupport;
|
||||
import org.mariotaku.twidere.util.support.graphics.OutlineCompat;
|
||||
|
@ -87,8 +88,14 @@ public class HomeActionButton extends FrameLayout implements IHomeActionButton {
|
|||
mHelper = new EffectViewHelper(this, new PressElevationProperty(elevation), 200);
|
||||
if (isInEditMode()) {
|
||||
inflate(context, R.layout.action_item_home_actions, this);
|
||||
} else if (context instanceof IThemedActivity) {
|
||||
int themeResourceId = ((IThemedActivity) context).getCurrentThemeResourceId();
|
||||
int themeColor = ((IThemedActivity) context).getCurrentThemeColor();
|
||||
inflate(ThemeUtils.getActionBarThemedContext(context, themeResourceId, themeColor),
|
||||
R.layout.action_item_home_actions, this);
|
||||
} else {
|
||||
inflate(ThemeUtils.getActionBarContext(context), R.layout.action_item_home_actions, this);
|
||||
inflate(ThemeUtils.getActionBarThemedContext(context), R.layout.action_item_home_actions,
|
||||
this);
|
||||
}
|
||||
mIconView = (ImageView) findViewById(android.R.id.icon);
|
||||
mProgressBar = (ProgressBar) findViewById(android.R.id.progress);
|
||||
|
|
|
@ -39,6 +39,7 @@ import android.widget.ImageView;
|
|||
import android.widget.ProgressBar;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.activity.iface.IThemedActivity;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.TwidereColorUtils;
|
||||
import org.mariotaku.twidere.util.support.ViewSupport;
|
||||
|
@ -60,7 +61,17 @@ public class HomeActionButtonCompat extends FrameLayout implements IHomeActionBu
|
|||
|
||||
public HomeActionButtonCompat(final Context context, final AttributeSet attrs, final int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
inflate(ThemeUtils.getActionBarContext(context), R.layout.action_item_home_actions_compat, this);
|
||||
if (isInEditMode()) {
|
||||
inflate(context, R.layout.action_item_home_actions_compat, this);
|
||||
} else if (context instanceof IThemedActivity) {
|
||||
int themeResourceId = ((IThemedActivity) context).getCurrentThemeResourceId();
|
||||
int themeColor = ((IThemedActivity) context).getCurrentThemeColor();
|
||||
inflate(ThemeUtils.getActionBarThemedContext(context, themeResourceId, themeColor),
|
||||
R.layout.action_item_home_actions_compat, this);
|
||||
} else {
|
||||
inflate(ThemeUtils.getActionBarThemedContext(context), R.layout.action_item_home_actions_compat,
|
||||
this);
|
||||
}
|
||||
mIconView = (ImageView) findViewById(android.R.id.icon);
|
||||
mProgressBar = (ProgressBar) findViewById(android.R.id.progress);
|
||||
final Resources resources = getResources();
|
||||
|
|
|
@ -1,43 +1,53 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
* 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.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.support.v7.internal.widget.ActionBarContainer;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.activity.iface.IThemedActivity;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 15/4/28.
|
||||
*/
|
||||
public class TwidereActionBarContainer extends ActionBarContainer {
|
||||
public TwidereActionBarContainer(Context context) {
|
||||
super(wrapContext(context));
|
||||
}
|
||||
|
||||
private static final int[] ATTRS = {android.R.attr.layout};
|
||||
|
||||
public TwidereActionBarContainer(Context context, AttributeSet attrs) {
|
||||
super(wrapContext(context), attrs);
|
||||
final TypedArray a = getContext().obtainStyledAttributes(attrs, ATTRS);
|
||||
inflate(getContext(), a.getResourceId(0, R.layout.layout_actionbar_content), this);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
private static Context wrapContext(Context context) {
|
||||
if (context instanceof IThemedActivity) {
|
||||
return ThemeUtils.getActionBarThemedContext(context,
|
||||
((IThemedActivity) context).getCurrentThemeResourceId(),
|
||||
((IThemedActivity) context).getCurrentThemeColor());
|
||||
}
|
||||
return ThemeUtils.getActionBarThemedContext(context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
-->
|
||||
|
||||
<org.mariotaku.twidere.view.HomeActionButton
|
||||
android:id="@+id/action_buttons"
|
||||
android:id="@+id/actions_button"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/float_action_button_size"
|
||||
android:layout_height="@dimen/float_action_button_size"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:layout_height="match_parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/twidere_action_bar_overlay"
|
||||
android:id="@+id/twidere_action_bar_with_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
@ -41,26 +41,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:layout_alignParentTop="true"
|
||||
android:gravity="top"
|
||||
android:touchscreenBlocksFocus="true"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<org.mariotaku.twidere.view.TwidereToolbar
|
||||
android:id="@+id/action_bar"
|
||||
style="?attr/toolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationContentDescription="@string/abc_action_bar_up_description" />
|
||||
|
||||
<android.support.v7.internal.widget.ActionBarContextView
|
||||
android:id="@+id/action_context_bar"
|
||||
style="?attr/actionModeStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
android:visibility="gone" />
|
||||
|
||||
</org.mariotaku.twidere.view.TwidereActionBarContainer>
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<View
|
||||
android:id="@+id/window_overlay"
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
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_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<org.mariotaku.twidere.view.ExtendedViewPager
|
||||
android:id="@+id/main_pager"
|
||||
|
@ -34,37 +35,29 @@
|
|||
|
||||
<include layout="@layout/layout_empty_tab_hint"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tabs_container"
|
||||
<RelativeLayout
|
||||
android:id="@+id/twidere_action_bar_with_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/actionbar"
|
||||
style="?actionBarStyle"
|
||||
<org.mariotaku.twidere.view.TwidereActionBarContainer
|
||||
android:id="@+id/twidere_action_bar_container"
|
||||
style="?attr/actionBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
app:contentInsetEnd="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<org.mariotaku.twidere.view.TabPagerIndicator
|
||||
android:id="@+id/main_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
app:tabExpandEnabled="true"
|
||||
app:tabHorizontalPadding="@dimen/element_spacing_normal"/>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout="@layout/layout_actionbar_home"
|
||||
android:touchscreenBlocksFocus="true"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<View
|
||||
android:id="@+id/actionbar_overlay"
|
||||
android:id="@+id/window_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/twidere_action_bar_container"
|
||||
android:background="?android:windowContentOverlay" />
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/layout_home_actions_button"/>
|
||||
</org.mariotaku.twidere.view.MainFrameLayout>
|
|
@ -24,6 +24,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/element_spacing_normal"
|
||||
android:paddingBottom="@dimen/element_spacing_normal"
|
||||
android:paddingLeft="@dimen/element_spacing_large"
|
||||
android:paddingRight="@dimen/element_spacing_large">
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
@ -29,10 +29,10 @@
|
|||
android:id="@+id/progress_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/status_container"
|
||||
android:layout_alignRight="@+id/status_container"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone"
|
||||
android:padding="@dimen/element_spacing_large">
|
||||
|
||||
<ProgressBar
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<org.mariotaku.twidere.view.TwidereToolbar
|
||||
android:id="@+id/action_bar"
|
||||
style="?attr/toolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationContentDescription="@string/abc_action_bar_up_description" />
|
||||
|
||||
<android.support.v7.internal.widget.ActionBarContextView
|
||||
android:id="@+id/action_context_bar"
|
||||
style="?attr/actionModeStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
android:visibility="gone" />
|
||||
</merge>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<org.mariotaku.twidere.view.TwidereToolbar
|
||||
android:id="@+id/action_bar"
|
||||
style="?attr/toolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationContentDescription="@string/abc_action_bar_up_description"
|
||||
app:contentInsetEnd="0dp"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<org.mariotaku.twidere.view.TabPagerIndicator
|
||||
android:id="@+id/main_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
app:tabExpandEnabled="true"
|
||||
app:tabHorizontalPadding="@dimen/element_spacing_normal" />
|
||||
</org.mariotaku.twidere.view.TwidereToolbar>
|
||||
|
||||
<android.support.v7.internal.widget.ActionBarContextView
|
||||
android:id="@+id/action_context_bar"
|
||||
style="?attr/actionModeStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
android:visibility="gone" />
|
||||
</merge>
|
|
@ -19,7 +19,7 @@
|
|||
-->
|
||||
|
||||
<org.mariotaku.twidere.view.HomeActionButtonCompat
|
||||
android:id="@+id/action_buttons"
|
||||
android:id="@+id/actions_button"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/actionbar"
|
||||
android:id="@+id/action_bar"
|
||||
style="?actionBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
|
|
Loading…
Reference in New Issue