Permalink
Browse files

added "show more" button

  • Loading branch information...
frogermcs committed Dec 18, 2014
1 parent 861cc0a commit 9eb019a75d58a14a9cee1654dd18279ed2db2a31
@@ -65,6 +65,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
holder.btnComments.setOnClickListener(this);
holder.btnComments.setTag(position);
holder.btnMore.setOnClickListener(this);
holder.btnMore.setTag(position);
}
@Override
@@ -74,10 +76,15 @@ public int getItemCount() {
@Override
public void onClick(View v) {
if (v.getId() == R.id.btnComments) {
final int viewId = v.getId();
if (viewId == R.id.btnComments) {
if (onFeedItemClickListener != null) {
onFeedItemClickListener.onCommentsClick(v, (Integer) v.getTag());
}
} else if (viewId == R.id.btnMore) {
if (onFeedItemClickListener != null) {
onFeedItemClickListener.onMoreClick(v, (Integer) v.getTag());
}
}
}
@@ -100,6 +107,8 @@ public void setOnFeedItemClickListener(OnFeedItemClickListener onFeedItemClickLi
ImageButton btnComments;
@InjectView(R.id.btnLike)
ImageButton btnLike;
@InjectView(R.id.btnMore)
ImageButton btnMore;
public CellFeedViewHolder(View view) {
super(view);
@@ -109,5 +118,6 @@ public CellFeedViewHolder(View view) {
public interface OnFeedItemClickListener {
public void onCommentsClick(View v, int position);
public void onMoreClick(View v, int position);
}
}
@@ -132,4 +132,9 @@ public void onCommentsClick(View v, int position) {
startActivity(intent);
overridePendingTransition(0, 0);
}
@Override
public void onMoreClick(View v, int itemPosition) {
}
}
Binary file not shown.
@@ -48,6 +48,13 @@
android:layout_height="48dp"
android:background="@drawable/btn_feed_action"
android:src="@drawable/ic_comment_outline_grey" />
<ImageButton
android:id="@+id/btnMore"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/btn_feed_action"
android:src="@drawable/ic_more_grey" />
</LinearLayout>
</LinearLayout>

0 comments on commit 9eb019a

Please sign in to comment.