Class ApplyFriendViewModel
-
- All Implemented Interfaces:
public class ApplyFriendViewModel extends BaseViewModel
Friend application list page ViewModel
- Since:
5.12.0
-
-
Field Summary
Fields Modifier and Type Field Description protected final MutableLiveData<ErrorEvent<NCError>>errorEventLiveData
-
Constructor Summary
Constructors Constructor Description ApplyFriendViewModel(Bundle bundle)
-
Method Summary
Modifier and Type Method Description intgetTimeLabel(long timestamp)Get time label MutableLiveData<List<UiFriendApplicationInfo>>getFriendApplicationsLiveData()voidloadFriendApplications(int type)voidloadFriendApplications(boolean isLoadMore)voidacceptFriendApplication(String userId, OnDataChangeListener<Boolean> callback)voidrefuseFriendApplication(String userId, OnDataChangeListener<Boolean> callback)voidonCleared()-
Methods inherited from class ai.nexconn.chatui.base.BaseViewModel
getArguments, getErrorEventLiveData, postErrorEvent -
Methods inherited from class androidx.lifecycle.ViewModel
addCloseable -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getTimeLabel
@StringRes() int getTimeLabel(long timestamp)
Get time label
- Parameters:
timestamp- timestamp- Returns:
time label string resource
-
getFriendApplicationsLiveData
MutableLiveData<List<UiFriendApplicationInfo>> getFriendApplicationsLiveData()
-
loadFriendApplications
void loadFriendApplications(int type)
- Parameters:
type- 0=all,1=received,2=sent
-
loadFriendApplications
void loadFriendApplications(boolean isLoadMore)
-
acceptFriendApplication
void acceptFriendApplication(String userId, OnDataChangeListener<Boolean> callback)
-
refuseFriendApplication
void refuseFriendApplication(String userId, OnDataChangeListener<Boolean> callback)
-
onCleared
void onCleared()
-
-
-
-