mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-21 20:45:29 +03:00
fix(spotbugs): Improve spotbugs scoring
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
cabd248e13
commit
3ac1b18d3d
3 changed files with 29 additions and 24 deletions
|
@ -86,8 +86,8 @@ public class CallParticipantList {
|
||||||
callParticipants.remove(callParticipant.getSessionId());
|
callParticipants.remove(callParticipant.getSessionId());
|
||||||
// No need to copy it, as it will be no longer used.
|
// No need to copy it, as it will be no longer used.
|
||||||
callParticipant.setInCall(Participant.InCallFlags.DISCONNECTED);
|
callParticipant.setInCall(Participant.InCallFlags.DISCONNECTED);
|
||||||
left.add(callParticipant);
|
|
||||||
}
|
}
|
||||||
|
left.addAll(knownCallParticipantsNotFound);
|
||||||
|
|
||||||
if (!joined.isEmpty() || !updated.isEmpty() || !left.isEmpty()) {
|
if (!joined.isEmpty() || !updated.isEmpty() || !left.isEmpty()) {
|
||||||
callParticipantListNotifier.notifyChanged(joined, updated, left, unchanged);
|
callParticipantListNotifier.notifyChanged(joined, updated, left, unchanged);
|
||||||
|
|
|
@ -126,9 +126,12 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull MentionOverall mentionOverall) {
|
public void onNext(@NonNull MentionOverall mentionOverall) {
|
||||||
|
if (mentionOverall.getOcs() != null) {
|
||||||
List<Mention> mentionsList = mentionOverall.getOcs().getData();
|
List<Mention> mentionsList = mentionOverall.getOcs().getData();
|
||||||
|
|
||||||
if (mentionsList.size() == 0) {
|
if (mentionsList != null) {
|
||||||
|
|
||||||
|
if (mentionsList.isEmpty()) {
|
||||||
adapter.clear();
|
adapter.clear();
|
||||||
} else {
|
} else {
|
||||||
List<AbstractFlexibleItem> internalAbstractFlexibleItemList =
|
List<AbstractFlexibleItem> internalAbstractFlexibleItemList =
|
||||||
|
@ -150,6 +153,8 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
||||||
adapter.updateDataSet(internalAbstractFlexibleItemList);
|
adapter.updateDataSet(internalAbstractFlexibleItemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("LongLogTag")
|
@SuppressLint("LongLogTag")
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
themeViews();
|
themeViews();
|
||||||
setupCurrentUser(user);
|
setupCurrentUser(user);
|
||||||
setupListeners(user);
|
setupListeners();
|
||||||
setupAdapter();
|
setupAdapter();
|
||||||
prepareViews();
|
prepareViews();
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||||
adapter.updateDataSet(userItems, false);
|
adapter.updateDataSet(userItems, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupListeners(User user) {
|
private void setupListeners() {
|
||||||
// Creating listeners for quick-actions
|
// Creating listeners for quick-actions
|
||||||
binding.currentAccount.getRoot().setOnClickListener(v -> dismiss());
|
binding.currentAccount.getRoot().setOnClickListener(v -> dismiss());
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
|
||||||
binding.setStatus.setOnClickListener(v -> {
|
binding.setStatus.setOnClickListener(v -> {
|
||||||
dismiss();
|
dismiss();
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null && getActivity() != null) {
|
||||||
SetStatusDialogFragment setStatusDialog = SetStatusDialogFragment.newInstance(status);
|
SetStatusDialogFragment setStatusDialog = SetStatusDialogFragment.newInstance(status);
|
||||||
setStatusDialog.show(getActivity().getSupportFragmentManager(), "fragment_set_status");
|
setStatusDialog.show(getActivity().getSupportFragmentManager(), "fragment_set_status");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue