mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-10 00:30:51 +01:00
improved transparent theme
This commit is contained in:
parent
a9a80e4de0
commit
0e4e7887fd
@ -135,6 +135,7 @@ public class AccountsDashboardFragment extends BaseSupportFragment implements Lo
|
|||||||
private TextView mAccountProfileNameView, mAccountProfileScreenNameView;
|
private TextView mAccountProfileNameView, mAccountProfileScreenNameView;
|
||||||
private ActionMenuView mAccountsToggleMenu;
|
private ActionMenuView mAccountsToggleMenu;
|
||||||
private View mAccountProfileContainer;
|
private View mAccountProfileContainer;
|
||||||
|
private View mNoAccountContainer;
|
||||||
|
|
||||||
private Context mThemedContext;
|
private Context mThemedContext;
|
||||||
private MediaLoaderWrapper mImageLoader;
|
private MediaLoaderWrapper mImageLoader;
|
||||||
@ -244,6 +245,13 @@ public class AccountsDashboardFragment extends BaseSupportFragment implements Lo
|
|||||||
final Menu menu = mAccountsToggleMenu.getMenu();
|
final Menu menu = mAccountsToggleMenu.getMenu();
|
||||||
mAccountActionProvider = (AccountToggleProvider) MenuItemCompat.getActionProvider(menu.findItem(MENU_SELECT_ACCOUNT));
|
mAccountActionProvider = (AccountToggleProvider) MenuItemCompat.getActionProvider(menu.findItem(MENU_SELECT_ACCOUNT));
|
||||||
final ParcelableAccount[] accounts = ParcelableAccount.getAccounts(data);
|
final ParcelableAccount[] accounts = ParcelableAccount.getAccounts(data);
|
||||||
|
if (accounts.length > 0) {
|
||||||
|
mNoAccountContainer.setVisibility(View.GONE);
|
||||||
|
mAccountProfileContainer.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mNoAccountContainer.setVisibility(View.VISIBLE);
|
||||||
|
mAccountProfileContainer.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
long defaultId = -1;
|
long defaultId = -1;
|
||||||
for (ParcelableAccount account : accounts) {
|
for (ParcelableAccount account : accounts) {
|
||||||
if (account.is_activated) {
|
if (account.is_activated) {
|
||||||
@ -394,6 +402,7 @@ public class AccountsDashboardFragment extends BaseSupportFragment implements Lo
|
|||||||
mAccountsSelector.setAdapter(mAccountsAdapter);
|
mAccountsSelector.setAdapter(mAccountsAdapter);
|
||||||
mAccountsSelector.setItemAnimator(null);
|
mAccountsSelector.setItemAnimator(null);
|
||||||
mAccountProfileContainer = mAccountSelectorView.findViewById(R.id.profile_container);
|
mAccountProfileContainer = mAccountSelectorView.findViewById(R.id.profile_container);
|
||||||
|
mNoAccountContainer = mAccountSelectorView.findViewById(R.id.no_account_container);
|
||||||
mAccountProfileImageView = (ShapedImageView) mAccountSelectorView.findViewById(R.id.profile_image);
|
mAccountProfileImageView = (ShapedImageView) mAccountSelectorView.findViewById(R.id.profile_image);
|
||||||
mAccountProfileBannerView = (ImageView) mAccountSelectorView.findViewById(R.id.account_profile_banner);
|
mAccountProfileBannerView = (ImageView) mAccountSelectorView.findViewById(R.id.account_profile_banner);
|
||||||
mFloatingProfileImageSnapshotView = (ImageView) mAccountSelectorView.findViewById(R.id.floating_profile_image_snapshot);
|
mFloatingProfileImageSnapshotView = (ImageView) mAccountSelectorView.findViewById(R.id.floating_profile_image_snapshot);
|
||||||
|
@ -642,8 +642,8 @@ public class ThemeUtils implements Constants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getActionBarAlpha(final int alpha) {
|
public static int getActionBarAlpha(final int alpha) {
|
||||||
return MathUtils.clamp(alpha * 2, ThemeBackgroundPreference.MIN_ALPHA,
|
return MathUtils.clamp(ThemeBackgroundPreference.MIN_ALPHA + (ThemeBackgroundPreference.MAX_ALPHA - alpha) / 2,
|
||||||
ThemeBackgroundPreference.MAX_ALPHA);
|
ThemeBackgroundPreference.MIN_ALPHA, ThemeBackgroundPreference.MAX_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Typeface getUserTypeface(final Context context, final Typeface defTypeface) {
|
public static Typeface getUserTypeface(final Context context, final Typeface defTypeface) {
|
||||||
|
@ -146,4 +146,20 @@
|
|||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/no_account_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/profile_container"
|
||||||
|
android:layout_alignTop="@+id/profile_container"
|
||||||
|
android:clickable="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="@string/no_account" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
Loading…
x
Reference in New Issue
Block a user