use of net.iGap.adapter.items.cells.RoomListCell in project iGap-Android by KianIranian-STDG.
the class RoomListAdapter method onCreateViewHolder.
@NotNull
@Override
public ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
RoomListCell roomListCell = new RoomListCell(parent.getContext());
roomListCell.setLayoutParams(LayoutCreator.createFrame(LayoutCreator.MATCH_PARENT, 72));
return new ViewHolder(roomListCell);
}
use of net.iGap.adapter.items.cells.RoomListCell in project iGap-Android by KianIranian-STDG.
the class MainFragment method onViewCreated.
@Override
public void onViewCreated(@NotNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
HelperTracker.sendTracker(HelperTracker.TRACKER_ROOM_PAGE);
getEventManager().addObserver(EventManager.CALL_STATE_CHANGED, this);
getEventManager().addObserver(EventManager.EMOJI_LOADED, this);
getEventManager().addObserver(EventManager.ROOM_LIST_CHANGED, this);
getEventManager().addObserver(EventManager.CONNECTION_STATE_CHANGED, this);
roomListAdapter.setCallBack(new RoomListAdapter.OnMainFragmentCallBack() {
@Override
public void onClick(RoomListCell roomListCell, RealmRoom realmRoom, int adapterPosition) {
onItemClick(roomListCell, realmRoom, adapterPosition);
}
@Override
public boolean onLongClick(RoomListCell roomListCell, RealmRoom realmRoom, int position) {
if (!inMultiSelectMode && FragmentChat.mForwardMessages == null && !HelperGetDataFromOtherApp.hasSharedData) {
enableMultiSelect();
updateSelectedRoom(realmRoom, position);
createActionMode();
multiSelectCounter.setNumber(selectedRoom.size(), selectedRoom.size() != 1);
toolbar.showActionToolbar();
BackDrawable backDrawable = new BackDrawable(true);
backDrawable.setRotation(1, true);
backDrawable.setRotatedColor(Theme.getInstance().getPrimaryTextColor(getContext()));
toolbar.setBackIcon(backDrawable);
AnimatorSet animatorSet = new AnimatorSet();
ArrayList<Animator> animators = new ArrayList<>();
for (int a = 0; a < actionModeViews.size(); a++) {
View view = actionModeViews.get(a);
view.setPivotY(Toolbar.getCurrentActionBarHeight() / 2);
animators.add(ObjectAnimator.ofFloat(view, View.SCALE_Y, 0.1f, 1.0f));
}
animatorSet.playTogether(animators);
animatorSet.setDuration(180);
animatorSet.start();
}
return true;
}
@Override
public void needShowLoadProgress(boolean show) {
loadingProgress.setVisibility(show ? View.VISIBLE : View.GONE);
}
@Override
public void needShowEmptyView(boolean show) {
emptyView.setVisibility(show ? View.VISIBLE : View.GONE);
}
@Override
public void needCheckMultiSelect() {
disableMultiSelect();
}
});
G.onNotifyTime = () -> G.handler.post(() -> {
if (recyclerView != null) {
if (recyclerView.getAdapter() != null) {
recyclerView.getAdapter().notifyDataSetChanged();
}
}
});
setForwardMessage(true);
checkHasSharedData(true);
checkMultiSelectState();
}
Aggregations