Adde More button on friends

This commit is contained in:
Pierre HUBERT 2018-08-23 14:02:10 +02:00
parent 6dda9c3753
commit 0f8274dd28
4 changed files with 32 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import org.communiquons.android.comunic.client.R;
@ -155,12 +156,17 @@ public class FriendsAdapter extends BaseRecyclerViewAdapter {
/**
* Accepted friend holder
*/
private class AcceptedFriendHolder extends BaseFriendHolder implements View.OnLongClickListener {
private class AcceptedFriendHolder extends BaseFriendHolder implements View.OnLongClickListener, View.OnClickListener {
private ImageView mMoreBtn;
AcceptedFriendHolder(@NonNull View itemView) {
super(itemView);
mMoreBtn = itemView.findViewById(R.id.more_btn);
itemView.setOnLongClickListener(this);
mMoreBtn.setOnClickListener(this);
}
@Override
@ -172,6 +178,12 @@ public class FriendsAdapter extends BaseRecyclerViewAdapter {
mListener.onOpenContextMenuForFriend(itemView, getLayoutPosition());
return true;
}
@Override
public void onClick(View v) {
if(v.equals(mMoreBtn))
mListener.onOpenContextMenuForFriend(v, getLayoutPosition());
}
}

View File

@ -52,5 +52,22 @@
</LinearLayout>
<ImageView
android:id="@+id/more_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:background="?selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:tint="@android:color/darker_gray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more"
android:contentDescription="@string/action_more_description"/>
</android.support.constraint.ConstraintLayout>

View File

@ -240,4 +240,5 @@
<string name="action_about">A propos</string>
<string name="action_reject_friend_request">Rejeter</string>
<string name="notice_request">Demande</string>
<string name="action_more_description">Plus d\'options</string>
</resources>

View File

@ -242,4 +242,5 @@
<string name="btn_open_source_licences">Open Source Licences</string>
<string name="action_reject_friend_request">Reject</string>
<string name="notice_request">Requested</string>
<string name="action_more_description">Get more options</string>
</resources>