only set header tinting if necessary
This commit is contained in:
parent
9080d7d681
commit
ee63b0d88f
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="358"
|
||||
android:versionName="1.131" >
|
||||
android:versionCode="359"
|
||||
android:versionName="1.132" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="15"
|
||||
|
@ -1077,6 +1077,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.flavorImageLoadingBar.setVisibility(View.GONE);
|
||||
holder.flavorImageView.setVisibility(View.GONE);
|
||||
holder.flavorVideoKindView.setVisibility(View.GONE);
|
||||
holder.headlineHeader.setBackgroundDrawable(null);
|
||||
|
||||
boolean videoFound = false;
|
||||
|
||||
@ -1115,7 +1116,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.flavorImageView.setVisibility(View.VISIBLE);
|
||||
holder.flavorVideoKindView.setVisibility(View.VISIBLE);
|
||||
|
||||
maybeRepositionFlavorImage(view, bitmap);
|
||||
maybeRepositionFlavorImage(view, bitmap, holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1209,7 +1210,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.flavorImageView.setVisibility(View.VISIBLE);
|
||||
holder.flavorVideoKindView.setVisibility(View.VISIBLE);
|
||||
|
||||
maybeRepositionFlavorImage(view, bitmap);
|
||||
maybeRepositionFlavorImage(view, bitmap, holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1314,7 +1315,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.flavorVideoKindView.setImageResource(R.drawable.ic_image_album);
|
||||
}
|
||||
|
||||
maybeRepositionFlavorImage(view, bitmap);
|
||||
maybeRepositionFlavorImage(view, bitmap, holder);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1427,7 +1428,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
return px;
|
||||
}
|
||||
|
||||
private void maybeRepositionFlavorImage(View view, Bitmap bitmap) {
|
||||
private void maybeRepositionFlavorImage(View view, Bitmap bitmap, HeadlineViewHolder holder) {
|
||||
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) view.getLayoutParams();
|
||||
|
||||
int w = bitmap.getWidth();
|
||||
@ -1440,9 +1441,16 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
|
||||
lp.addRule(RelativeLayout.BELOW, R.id.headline_header);
|
||||
|
||||
holder.headlineHeader.setBackgroundDrawable(null);
|
||||
|
||||
} else {
|
||||
lp.addRule(RelativeLayout.BELOW, 0);
|
||||
|
||||
TypedValue tv = new TypedValue();
|
||||
|
||||
if (m_activity.getTheme().resolveAttribute(R.attr.headlineHeaderBackground, tv, true)) {
|
||||
holder.headlineHeader.setBackgroundColor(tv.data);
|
||||
}
|
||||
}
|
||||
|
||||
view.setLayoutParams(lp);
|
||||
|
@ -462,6 +462,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
public ImageView textImage;
|
||||
public ImageView textChecked;
|
||||
public ImageView flavorVideoKindView;
|
||||
public View headlineHeader;
|
||||
}
|
||||
|
||||
private class ArticleListAdapter extends SimpleCursorAdapter {
|
||||
@ -581,6 +582,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
holder.textImage = (ImageView) v.findViewById(R.id.text_image);
|
||||
holder.textChecked = (ImageView) v.findViewById(R.id.text_checked);
|
||||
holder.flavorVideoKindView = (ImageView) v.findViewById(R.id.flavor_video_kind);
|
||||
holder.headlineHeader = v.findViewById(R.id.headline_header);
|
||||
|
||||
v.setTag(holder);
|
||||
|
||||
@ -768,6 +770,8 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
holder.flavorImageLoadingBar.setVisibility(View.GONE);
|
||||
holder.flavorImageView.setVisibility(View.GONE);
|
||||
holder.flavorVideoKindView.setVisibility(View.GONE);
|
||||
|
||||
holder.headlineHeader.setBackgroundDrawable(null);
|
||||
}
|
||||
|
||||
if (holder.menuButtonView != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user