Skip to content

Commit

Permalink
videochat-java
Browse files Browse the repository at this point in the history
- fixed google-services.json
- added logic for fill userName in UsersAdapter
- fixed item_opponents_list.xml
  • Loading branch information
kirillTolmachev committed Dec 12, 2023
1 parent 5bb9dac commit c9b5c62
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 37 deletions.
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release notifier

on:
release:
types: [ published ]

jobs:
after-release:
runs-on: ubuntu-latest
steps:
- name: Notify Slack
run: |
curl -X POST \
--data-urlencode "payload={
\"channel\": \"${{ secrets.SLACK_CHANNEL }}\",
\"username\": \"${{ secrets.QB_PROJECT }} release bot\",
\"text\": \"<!here>
The ${{ secrets.QB_PROJECT }} version *${{ github.event.release.name }}* was released.
>*Changelog:*
\`\`\`${{ github.event.release.body }}\`\`\`
>*Link:*
${{ github.event.release.html_url }}\",
\"icon_emoji\": \":rocket:\"}" \
--url ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion sample-videochat-java/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"client_info": {
"mobilesdk_app_id": "Put here your value",
"android_client_info": {
"package_name": "com.quickblox.sample.videochat.kotlin"
"package_name": "com.quickblox.sample.videochat.java"
}
},
"oauth_client": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ public UsersAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
@Override
public void onBindViewHolder(@NonNull UsersAdapter.ViewHolder holder, int position) {
QBUser user = usersList.get(position);
holder.opponentName.setText(user.getFullName());
holder.opponentName.setText(getOpponentNameFrom(user));
if (selectedUsers.contains(user)) {
holder.rootLayout.setBackgroundResource(R.color.background_color_selected_user_item);
holder.opponentIcon.setBackgroundDrawable(
UiUtils.getColoredCircleDrawable(context.getResources().getColor(R.color.icon_background_color_selected_user)));
holder.opponentIcon.setBackgroundDrawable(UiUtils.getColoredCircleDrawable(context.getResources().getColor(R.color.icon_background_color_selected_user)));
holder.opponentIcon.setImageResource(R.drawable.ic_checkmark);
} else {
holder.rootLayout.setBackgroundResource(R.color.background_color_normal_user_item);
Expand All @@ -66,6 +65,20 @@ public void onBindViewHolder(@NonNull UsersAdapter.ViewHolder holder, int positi
});
}

private String getOpponentNameFrom(QBUser user) {
boolean isFullNameAvailable = user.getFullName() != null && !user.getFullName().trim().isEmpty();
if (isFullNameAvailable) {
return user.getFullName();
}

boolean isLoginAvailable = user.getLogin() != null && !user.getLogin().trim().isEmpty();
if (isLoginAvailable) {
return user.getLogin();
}

return user.getId().toString();
}

@Override
public int getItemCount() {
return usersList.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
style="@style/MatchWidth"
android:layout_marginStart="@dimen/padding_start"
android:layout_marginLeft="@dimen/padding_start"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
tools:text="User Name" />
</LinearLayout>

0 comments on commit c9b5c62

Please sign in to comment.