Fixes an issue in light mode & header profile picture

This commit is contained in:
stom79 2018-01-26 18:33:42 +01:00
parent 612b97a43b
commit f866da4cc4
2 changed files with 14 additions and 17 deletions

View File

@ -1195,6 +1195,12 @@ public class Helper {
if( urlHeader.startsWith("/") ){
urlHeader = Helper.getLiveInstanceWithProtocol(activity) + account.getHeader();
}
LinearLayout main_header_container = headerLayout.findViewById(R.id.main_header_container);
final SharedPreferences sharedpreferences = activity.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
main_header_container.setBackgroundDrawable( activity.getResources().getDrawable(R.drawable.side_nav_bar_dark));
}
if (!urlHeader.contains("missing.png")) {
Glide.with(activity.getApplicationContext())
.asBitmap()
@ -1211,15 +1217,6 @@ public class Helper {
}
}
});
}else {
LinearLayout main_header_container = headerLayout.findViewById(R.id.main_header_container);
final SharedPreferences sharedpreferences = activity.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
main_header_container.setBackgroundDrawable( activity.getResources().getDrawable(R.drawable.side_nav_bar_dark));
}else {
main_header_container.setBackgroundDrawable( activity.getResources().getDrawable(R.drawable.side_nav_bar));
}
}
}
profilePicture.setOnClickListener(null);

View File

@ -22,13 +22,7 @@
android:id="@+id/container"
android:layout_height="@dimen/nav_header_height"
>
<ImageView
android:id="@+id/back_ground_image"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_alignParentTop="true"
android:layout_width="match_parent"
@ -103,5 +97,11 @@
android:layout_height="20dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<ImageView
android:id="@+id/back_ground_image"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
</RelativeLayout>