add image count prompt to flavor image
This commit is contained in:
parent
4e330671fa
commit
d1cf6a071c
@ -657,6 +657,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
public TextView excerptView;
|
||||
public ImageView flavorImageView;
|
||||
public ImageView flavorVideoPlayView;
|
||||
public TextView flavorImagePrompt;
|
||||
public TextView authorView;
|
||||
public TextView dateView;
|
||||
public CheckBox selectionBoxView;
|
||||
@ -822,6 +823,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.publishedView = (ImageView)v.findViewById(R.id.published);
|
||||
holder.excerptView = (TextView)v.findViewById(R.id.excerpt);
|
||||
holder.flavorImageView = (ImageView) v.findViewById(R.id.flavor_image);
|
||||
holder.flavorImagePrompt = (TextView) v.findViewById(R.id.flavor_image_prompt);
|
||||
holder.flavorVideoPlayView = (ImageView) v.findViewById(R.id.flavor_video_play);
|
||||
holder.authorView = (TextView)v.findViewById(R.id.author);
|
||||
holder.dateView = (TextView) v.findViewById(R.id.date);
|
||||
@ -881,6 +883,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
|
||||
if (article.flavorImage == null)
|
||||
article.flavorImage = imgs.first();
|
||||
|
||||
article.flavorImageCount = imgs.size();
|
||||
}
|
||||
|
||||
if (holder.textImage != null) {
|
||||
@ -1027,6 +1031,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.flavorImageView.setVisibility(View.VISIBLE);
|
||||
holder.flavorImageLoadingBar.setVisibility(View.VISIBLE);
|
||||
holder.flavorVideoPlayView.setVisibility(View.GONE);
|
||||
holder.flavorImagePrompt.setVisibility(View.GONE);
|
||||
|
||||
boolean videoFound = false;
|
||||
|
||||
@ -1137,6 +1142,11 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
if (imgSrc.indexOf("//") == 0)
|
||||
imgSrc = "http:" + imgSrc;
|
||||
|
||||
if (article.flavorImageCount > 1) {
|
||||
holder.flavorImagePrompt.setText(getResources().getQuantityString(R.plurals.flavor_image_prompt, article.flavorImageCount-1, article.flavorImageCount-1));
|
||||
holder.flavorImagePrompt.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
ViewCompat.setTransitionName(holder.flavorImageView, "TRANSITION:ARTICLE_IMAGES_PAGER");
|
||||
|
||||
holder.flavorImageView.setOnClickListener(new OnClickListener() {
|
||||
|
@ -458,7 +458,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
public ImageView menuButtonView;
|
||||
public ViewGroup flavorImageHolder;
|
||||
public ProgressBar flavorImageLoadingBar;
|
||||
public View flavorImageArrow;
|
||||
public View headlineFooter;
|
||||
public ImageView textImage;
|
||||
public ImageView textChecked;
|
||||
@ -577,7 +576,6 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
holder.menuButtonView = (ImageView) v.findViewById(R.id.article_menu_button);
|
||||
holder.flavorImageHolder = (ViewGroup) v.findViewById(R.id.flavorImageHolder);
|
||||
holder.flavorImageLoadingBar = (ProgressBar) v.findViewById(R.id.flavorImageLoadingBar);
|
||||
holder.flavorImageArrow = v.findViewById(R.id.flavorImageArrow);
|
||||
holder.headlineFooter = v.findViewById(R.id.headline_footer);
|
||||
holder.textImage = (ImageView) v.findViewById(R.id.text_image);
|
||||
holder.textChecked = (ImageView) v.findViewById(R.id.text_checked);
|
||||
|
@ -37,6 +37,7 @@ public class Article implements Parcelable {
|
||||
/* not serialized */
|
||||
public Document articleDoc;
|
||||
public Element flavorImage;
|
||||
public int flavorImageCount;
|
||||
public boolean noValidFlavorImage;
|
||||
|
||||
public Article(Parcel in) {
|
||||
|
@ -100,6 +100,18 @@
|
||||
android:src="@drawable/flavor_video_play"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:text="5 more images"
|
||||
android:background="#90000000"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/flavor_image_prompt" />
|
||||
|
||||
</FrameLayout>
|
||||
</TableRow>
|
||||
|
||||
|
@ -101,6 +101,18 @@
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/flavor_video_play"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/primary_text_dark"
|
||||
android:text="5 more images"
|
||||
android:background="#90000000"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/flavor_image_prompt" />
|
||||
</FrameLayout>
|
||||
</TableRow>
|
||||
|
||||
|
@ -230,4 +230,10 @@
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="video_player_share">Share video</string>
|
||||
<string name="video_player_open">Open video</string>
|
||||
|
||||
<plurals name="flavor_image_prompt">
|
||||
<item quantity="zero"></item>
|
||||
<item quantity="one">(one more image)</item>
|
||||
<item quantity="other">(%1$d more images)</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user