mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 13:35:33 +03:00
Add annotation where needed
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
443cf8b227
commit
cb455a7104
1 changed files with 15 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
|||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* @author Andy Scherzinger
|
||||
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -33,6 +35,8 @@ import com.nextcloud.talk.utils.ApiUtils;
|
|||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
import com.otaliastudios.autocomplete.RecyclerViewPresenter;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -106,11 +110,12 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||
.retry(3)
|
||||
.subscribe(new Observer<MentionOverall>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
// no actions atm
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(MentionOverall mentionOverall) {
|
||||
public void onNext(@NotNull MentionOverall mentionOverall) {
|
||||
List<Mention> mentionsList = mentionOverall.getOcs().getData();
|
||||
|
||||
if (mentionsList.size() == 0) {
|
||||
|
@ -119,9 +124,12 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||
List<AbstractFlexibleItem> internalAbstractFlexibleItemList = new ArrayList<>();
|
||||
for (Mention mention : mentionsList) {
|
||||
internalAbstractFlexibleItemList.add(
|
||||
new MentionAutocompleteItem(mention.getId(),
|
||||
mention.getLabel(), mention.getSource(),
|
||||
currentUser, context));
|
||||
new MentionAutocompleteItem(
|
||||
mention.getId(),
|
||||
mention.getLabel(),
|
||||
mention.getSource(),
|
||||
currentUser,
|
||||
context));
|
||||
}
|
||||
|
||||
if (adapter.getItemCount() != 0) {
|
||||
|
@ -133,18 +141,17 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
public void onError(@NotNull Throwable e) {
|
||||
adapter.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
// no actions atm
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemClick(View view, int position) {
|
||||
Mention mention = new Mention();
|
||||
|
|
Loading…
Reference in a new issue