From b97c4e24edfa2f651bcfa67f57a450f23e3b4e12 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Thu, 4 May 2017 18:07:59 +0200 Subject: [PATCH] remove redundant account_header background, fix weird flicker in header when opening AccountActivity --- .../keylesspalace/tusky/AccountActivity.java | 5 +- .../tusky/EditProfileActivity.java | 3 +- .../com/keylesspalace/tusky/MainActivity.java | 2 +- .../res/drawable/account_header_default.png | Bin 1891 -> 0 bytes ...missing.xml => account_header_default.xml} | 0 app/src/main/res/layout/activity_account.xml | 106 +++++++++--------- 6 files changed, 57 insertions(+), 59 deletions(-) delete mode 100644 app/src/main/res/drawable/account_header_default.png rename app/src/main/res/drawable/{account_header_missing.xml => account_header_default.xml} (100%) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index ed12bd2cb..ae09b1502 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -156,9 +156,6 @@ public class AccountActivity extends BaseActivity implements SFragment.OnUserRem // Initialise the default UI states. floatingBtn.hide(); - avatar.setImageResource(R.drawable.avatar_default); - header.setImageResource(R.drawable.account_header_default); - // Obtain information to fill out the profile. obtainAccount(); if (!accountId.equals(loggedInAccountId)) { @@ -266,7 +263,7 @@ public class AccountActivity extends BaseActivity implements SFragment.OnUserRem .into(avatar); Picasso.with(this) .load(account.header) - .placeholder(R.drawable.account_header_missing) + .placeholder(R.drawable.account_header_default) .into(header); NumberFormat nf = NumberFormat.getInstance(); diff --git a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java index ddb538083..f06da406b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java @@ -36,7 +36,6 @@ import android.util.Base64; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; @@ -178,7 +177,7 @@ public class EditProfileActivity extends BaseActivity { .into(avatar); Picasso.with(header.getContext()) .load(me.header) - .placeholder(R.drawable.account_header_missing) + .placeholder(R.drawable.account_header_default) .into(header); } diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index 764d1bddf..ffbfe1136 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -476,7 +476,7 @@ public class MainActivity extends BaseActivity implements SFragment.OnUserRemove Picasso.with(MainActivity.this) .load(me.header) - .placeholder(R.drawable.account_header_missing) + .placeholder(R.drawable.account_header_default) .resize(backgroundWidth, backgroundHeight) .centerCrop() .into(background); diff --git a/app/src/main/res/drawable/account_header_default.png b/app/src/main/res/drawable/account_header_default.png deleted file mode 100644 index c4e44ad25b2e13190a7570edcfbcf761b80f38c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1891 zcmeAS@N?(olHy`uVBq!ia0y~yVA{jL!06Ax1{7HzBAW^17FM=u`STG-vy9r}lT zS7*J0086QmOFBEN;F2Sgmt9b@syJNz{qd7|)2B0YRK^;Oi~auj)n51CavJX#Ze}O^XPEJ< zCgrj8&-WSL@g>^7fx*vN;1OBOz@VoL!i*J5?aP3IVpSm#C5fda8Tmz^_$WT(t?8x9 z&cJ??DJe`$%7cM{wc69gF{I+w+iQ-33KGUbu1p6S zbeNlgp-r5Dfk&T#K_ZTU!2lTV2^EZR`oIS!hK7f%s0y)ZfGLF0SWQN@0Yf1!r+^fK zoP?nP=4KcTb33v^47VdY0h - + android:fitsSystemWindows="true" + android:orientation="vertical"> + android:theme="@style/AppTheme.Account.AppBarLayout"> + android:background="@drawable/account_header_default" + android:contentDescription="@null" + android:fitsSystemWindows="true" + android:scaleType="centerCrop" + app:layout_collapseMode="pin" /> + android:layout_height="wrap_content" + android:background="@drawable/account_header_gradient" + android:orientation="vertical" + android:paddingTop="?attr/actionBarSize" + app:layout_collapseMode="parallax"> + android:paddingTop="16dp"> + android:src="@drawable/avatar_default" + app:shadow="true" /> + android:orientation="vertical"> + android:textSize="18sp" + android:textStyle="normal|bold" /> + + android:maxLines="1" + android:textColor="?android:textColorSecondary" /> + android:contentDescription="@string/description_account_locked" + android:tint="?android:textColorSecondary" + android:visibility="gone" + app:srcCompat="@drawable/reblog_disabled_light" /> + android:paddingTop="10dp" + android:textColor="?android:textColorTertiary" /> @@ -125,9 +127,9 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="@android:color/transparent" - android:layout_gravity="top" android:layout_alignParentTop="true" + android:layout_gravity="top" + android:background="@android:color/transparent" app:layout_collapseMode="pin" app:popupTheme="?attr/account_toolbar_popup_theme" /> @@ -136,16 +138,16 @@ + android:layout_height="wrap_content" + app:tabBackground="?android:colorBackground"> + android:visibility="visible" + app:layout_anchor="@id/tab_layout" + app:layout_anchorGravity="bottom" /> + android:contentDescription="@string/action_follow" + app:srcCompat="@drawable/ic_person_add_24dp" />