mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 22:09:30 +00:00
Adde More button on friends
This commit is contained in:
parent
6dda9c3753
commit
0f8274dd28
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.communiquons.android.comunic.client.R;
|
import org.communiquons.android.comunic.client.R;
|
||||||
@ -155,12 +156,17 @@ public class FriendsAdapter extends BaseRecyclerViewAdapter {
|
|||||||
/**
|
/**
|
||||||
* Accepted friend holder
|
* 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) {
|
AcceptedFriendHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
|
mMoreBtn = itemView.findViewById(R.id.more_btn);
|
||||||
|
|
||||||
itemView.setOnLongClickListener(this);
|
itemView.setOnLongClickListener(this);
|
||||||
|
mMoreBtn.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -172,6 +178,12 @@ public class FriendsAdapter extends BaseRecyclerViewAdapter {
|
|||||||
mListener.onOpenContextMenuForFriend(itemView, getLayoutPosition());
|
mListener.onOpenContextMenuForFriend(itemView, getLayoutPosition());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(v.equals(mMoreBtn))
|
||||||
|
mListener.onOpenContextMenuForFriend(v, getLayoutPosition());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,5 +52,22 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</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>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
@ -240,4 +240,5 @@
|
|||||||
<string name="action_about">A propos</string>
|
<string name="action_about">A propos</string>
|
||||||
<string name="action_reject_friend_request">Rejeter</string>
|
<string name="action_reject_friend_request">Rejeter</string>
|
||||||
<string name="notice_request">Demande</string>
|
<string name="notice_request">Demande</string>
|
||||||
|
<string name="action_more_description">Plus d\'options</string>
|
||||||
</resources>
|
</resources>
|
@ -242,4 +242,5 @@
|
|||||||
<string name="btn_open_source_licences">Open Source Licences</string>
|
<string name="btn_open_source_licences">Open Source Licences</string>
|
||||||
<string name="action_reject_friend_request">Reject</string>
|
<string name="action_reject_friend_request">Reject</string>
|
||||||
<string name="notice_request">Requested</string>
|
<string name="notice_request">Requested</string>
|
||||||
|
<string name="action_more_description">Get more options</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user