-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b735292
commit 4f4d0f2
Showing
355 changed files
with
5,558 additions
and
17,148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
{ | ||
"userId": "111111", | ||
"userName": "Olivia", | ||
"avatarUrl": "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar1.png" | ||
}, | ||
{ | ||
"userId": "222222", | ||
"userName": "Sophia", | ||
"avatarUrl": "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar2.png" | ||
}, | ||
{ | ||
"userId": "333333", | ||
"userName": "William", | ||
"avatarUrl": "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar3.png" | ||
}, | ||
{ | ||
"userId": "444444", | ||
"userName": "James", | ||
"avatarUrl": "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar4.png" | ||
}, | ||
{ | ||
"userId": "555555", | ||
"userName": "Charlotte", | ||
"avatarUrl": "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar5.png" | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
...app/src/main/java/com/tencent/liteav/demo/SelectParticipants/MoreParticipantsAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
package com.tencent.liteav.demo.SelectParticipants; | ||
|
||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.FrameLayout; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.constraintlayout.utils.widget.ImageFilterView; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.tencent.liteav.demo.R; | ||
import com.tencent.cloud.tuikit.roomkit.common.utils.ImageLoader; | ||
import com.tencent.cloud.tuikit.roomkit.view.page.widget.ScheduleConference.SelectScheduleParticipant.User; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class MoreParticipantsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||
private List<User> mSelectedParticipants; | ||
private final Context mContext; | ||
private final LayoutInflater mLayoutInflater; | ||
private deleteParticipantCallback mCallback; | ||
|
||
public MoreParticipantsAdapter(Context context, List<User> list) { | ||
this.mContext = context; | ||
this.mLayoutInflater = LayoutInflater.from(mContext); | ||
mSelectedParticipants = new ArrayList<>(list); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
View contentView = mLayoutInflater.inflate(R.layout.app_item_more_participants, parent, false); | ||
return new ViewHolderAttendee(contentView); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { | ||
User user = mSelectedParticipants.get(position); | ||
if (holder instanceof ViewHolderAttendee) { | ||
((ViewHolderAttendee) holder).bind(user); | ||
} | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return mSelectedParticipants.size(); | ||
} | ||
|
||
private class ViewHolderAttendee extends RecyclerView.ViewHolder { | ||
private ImageFilterView mImgAvatar; | ||
private TextView mUserName; | ||
private FrameLayout mFlDeleteParticipant; | ||
|
||
public ViewHolderAttendee(@NonNull View itemView) { | ||
super(itemView); | ||
initView(itemView); | ||
} | ||
|
||
private void initView(View itemView) { | ||
mFlDeleteParticipant = itemView.findViewById(R.id.fl_delete_participant); | ||
mImgAvatar = itemView.findViewById(R.id.img_participant_avatar); | ||
mUserName = itemView.findViewById(R.id.tv_participant_name); | ||
} | ||
|
||
public void bind(User user) { | ||
ImageLoader.loadImage(mContext, mImgAvatar, user.avatarUrl, R.drawable.app_ic_avatar); | ||
mUserName.setText(user.userName); | ||
mFlDeleteParticipant.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
mCallback.onParticipantDeleted(user); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
public void setParticipantDeletedCallback(deleteParticipantCallback callback) { | ||
mCallback = callback; | ||
} | ||
|
||
public interface deleteParticipantCallback { | ||
void onParticipantDeleted(User participant); | ||
} | ||
|
||
public void removeParticipantItem(User participant) { | ||
if (mSelectedParticipants.contains(participant)) { | ||
int index = mSelectedParticipants.indexOf(participant); | ||
mSelectedParticipants.remove(participant); | ||
notifyItemRemoved(index); | ||
} | ||
} | ||
|
||
public int getDeletedParticipantsSize() { | ||
return mSelectedParticipants.size(); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...app/src/main/java/com/tencent/liteav/demo/SelectParticipants/MoreParticipantsPopView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.tencent.liteav.demo.SelectParticipants; | ||
|
||
import android.content.Context; | ||
import android.view.View; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.tencent.liteav.demo.R; | ||
import com.google.android.material.bottomsheet.BottomSheetDialog; | ||
import com.tencent.cloud.tuikit.roomkit.view.page.widget.ScheduleConference.SelectScheduleParticipant.User; | ||
|
||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
public class MoreParticipantsPopView extends BottomSheetDialog { | ||
private Context mContext; | ||
private RecyclerView mRvAttendeesView; | ||
private TextView mTvSelectedAttendeeTitle; | ||
private MoreParticipantsAdapter mAdapter; | ||
private onParticipantDeletedCallback mDeletedParticipantCallback; | ||
private ImageView mImgDismissDialog; | ||
|
||
public MoreParticipantsPopView(@NonNull Context context) { | ||
super(context, R.style.TUIRoomDialogFragmentTheme); | ||
setContentView(R.layout.app_view_more_participants); | ||
mContext = context; | ||
initView(); | ||
} | ||
|
||
public void setAttendees(List<User> participants) { | ||
String text = String.format(Locale.getDefault(), getContext().getString(R.string.app_format_select_participant), mContext.getString(R.string.app_selected_text), participants.size()); | ||
mTvSelectedAttendeeTitle.setText(text); | ||
mAdapter = new MoreParticipantsAdapter(mContext, participants); | ||
mRvAttendeesView.setAdapter(mAdapter); | ||
mAdapter.setParticipantDeletedCallback(new MoreParticipantsAdapter.deleteParticipantCallback() { | ||
@Override | ||
public void onParticipantDeleted(User participant) { | ||
mAdapter.removeParticipantItem(participant); | ||
if (mDeletedParticipantCallback != null) { | ||
mDeletedParticipantCallback.onParticipantDelete(participant); | ||
} | ||
String text = String.format(Locale.getDefault(), getContext().getString(R.string.app_format_select_participant), mContext.getString(R.string.app_selected_text), mAdapter.getDeletedParticipantsSize()); | ||
mTvSelectedAttendeeTitle.setText(text); | ||
} | ||
}); | ||
} | ||
|
||
private void initView() { | ||
mImgDismissDialog = findViewById(R.id.img_arrow_down); | ||
mImgDismissDialog.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
dismiss(); | ||
} | ||
}); | ||
mTvSelectedAttendeeTitle = findViewById(R.id.tv_selected_participant_count_title); | ||
mRvAttendeesView = findViewById(R.id.rv_attendee_list); | ||
mRvAttendeesView.setLayoutManager(new LinearLayoutManager(mContext)); | ||
} | ||
|
||
public void setDeleteParticipantCallback(onParticipantDeletedCallback callback) { | ||
mDeletedParticipantCallback = callback; | ||
} | ||
|
||
public interface onParticipantDeletedCallback { | ||
void onParticipantDelete(User user); | ||
} | ||
} |
Oops, something went wrong.