removed window overlay shadow on home screen

improved user profile - default theme color while user not loaded
This commit is contained in:
Mariotaku Lee 2015-04-25 22:51:55 +08:00
parent 05ef4cf640
commit 4c61a2be38
3 changed files with 22 additions and 22 deletions

View File

@ -392,6 +392,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
mActionsButton.setOnLongClickListener(this);
mEmptyTabHint.setOnClickListener(this);
ThemeUtils.setCompatToolbarOverlay(this, new EmptyDrawable());
setupSlidingMenu();
setupBars();
showDataProfilingRequest();
@ -401,7 +402,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
if (savedInstanceState == null) {
if (refreshOnStart) {
mTwitterWrapper.refreshAll();
mTwitterWrapper.refreshAll(getActivatedAccountIds());
}
if (intent.getBooleanExtra(EXTRA_OPEN_ACCOUNTS_DRAWER, false)) {
openAccountsDrawer();

View File

@ -21,7 +21,6 @@ package org.mariotaku.twidere.activity.support;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
@ -277,10 +276,10 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
final String option = getThemeBackgroundOption();
int actionBarItemsColor = ThemeUtils.getContrastActionBarItemColor(this, themeId, themeColor);
switch (linkId) {
case LINK_ID_USER: {
actionBarItemsColor = Color.WHITE;
break;
}
// case LINK_ID_USER: {
// actionBarItemsColor = Color.WHITE;
// break;
// }
case LINK_ID_SEARCH:
case LINK_ID_USER_LISTS: {
ThemeUtils.applyActionBarBackground(actionBar, this, themeId, themeColor, option, false);
@ -303,9 +302,7 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
switch (linkId) {
case LINK_ID_USER: {
mMainContent.setShadowColor(0xA0000000);
mMainContent.setDrawShadow(false);
mMainContent.setDrawColor(true);
break;
// Fall through
}
default: {
mMainContent.setDrawShadow(false);
@ -325,9 +322,9 @@ public class LinkHandlerActivity extends BaseAppCompatActivity implements System
private void setTaskInfo(int linkId, Uri uri) {
switch (linkId) {
case LINK_ID_USER: {
break;
}
// case LINK_ID_USER: {
// break;
// }
default: {
if (ThemeUtils.isColoredActionBar(getCurrentThemeResourceId())) {
ActivityAccessor.setTaskDescription(this, new TaskDescriptionCompat(null, null,

View File

@ -211,7 +211,7 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
private int mBannerWidth;
private int mCardBackgroundColor;
private int mActionBarShadowColor;
private int mUserUiColor;
private int mUiColor;
private boolean mNameFirst;
@ -534,9 +534,9 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
mProfileImageLoader.displayProfileImage(mProfileImageView, Utils.getOriginalTwitterProfileImage(user.profile_image_url));
if (userColor != 0) {
setUserUiColor(userColor);
setUiColor(userColor);
} else {
setUserUiColor(user.link_color);
setUiColor(user.link_color);
}
final int defWidth = resources.getDisplayMetrics().widthPixels;
final int width = mBannerWidth > 0 ? mBannerWidth : defWidth;
@ -776,14 +776,16 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
mPagerIndicator.setBackgroundColor(mCardBackgroundColor);
mUuckyFooter.setBackgroundColor(mCardBackgroundColor);
getUserInfo(accountId, userId, screenName, false);
final float actionBarElevation = ThemeUtils.getSupportActionBarElevation(activity);
ViewCompat.setElevation(mPagerIndicator, actionBarElevation);
setupBaseActionBar();
setupUserPages();
if (activity instanceof IThemedActivity) {
setUiColor(((IThemedActivity) activity).getCurrentThemeColor());
}
getUserInfo(accountId, userId, screenName, false);
}
@Override
@ -1334,8 +1336,8 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
drawable.setAlpha(Math.round(alpha * 255));
}
private void setUserUiColor(int color) {
mUserUiColor = color;
private void setUiColor(int color) {
mUiColor = color;
if (mActionBarBackground == null) {
setupBaseActionBar();
}
@ -1479,9 +1481,9 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
final int contrastColor = TwidereColorUtils.getContrastYIQ(stackedTabColor, 192);
mPagerIndicator.setIconColor(contrastColor);
mPagerIndicator.setLabelColor(contrastColor);
mPagerIndicator.setStripColor(mUserUiColor);
mPagerIndicator.setStripColor(mUiColor);
} else if (drawable instanceof ColorDrawable) {
stackedTabColor = mUserUiColor;
stackedTabColor = mUiColor;
final int tabColor = (Integer) sArgbEvaluator.evaluate(tabOutlineAlphaFactor, stackedTabColor, mCardBackgroundColor);
((ColorDrawable) drawable).setColor(tabColor);
final int contrastColor = TwidereColorUtils.getContrastYIQ(tabColor, 192);