use of net.iGap.helper.avatar.ParamWithAvatarType in project iGap-Android by KianIranian-STDG.
the class EditChannelFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
avatarHandler.getAvatar(new ParamWithAvatarType(binding.channelAvatar, viewModel.roomId).avatarType(AvatarHandler.AvatarType.ROOM).showMain());
viewModel.onCreateFragment(this);
HelperToolbar mHelperToolbar = HelperToolbar.create().setContext(getContext()).setLifecycleOwner(getViewLifecycleOwner()).setLogoShown(true).setDefaultTitle(getContext().getResources().getString(R.string.tab_edit)).setLeftIcon(R.string.icon_back).setRightIcons(R.string.icon_sent).setListener(new ToolbarListener() {
@Override
public void onLeftIconClickListener(View view) {
popBackStackFragment();
}
@Override
public void onRightIconClickListener(View view) {
viewModel.setData(binding.channelNameEditText.getEditableText().toString(), binding.groupDescriptionEditText.getEditableText().toString());
hideKeyboard();
}
});
binding.toolbar.addView(mHelperToolbar.getView());
viewModel.goToMembersPage.observe(getViewLifecycleOwner(), b -> {
if (b != null && b) {
showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.ALL.toString());
}
});
viewModel.goToAdministratorPage.observe(getViewLifecycleOwner(), b -> {
if (b != null && b) {
showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.ADMIN.toString());
}
});
viewModel.goToModeratorPage.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null && aBoolean) {
showListForCustomRole(ProtoGroupGetMemberList.GroupGetMemberList.FilterRole.MODERATOR.toString());
}
});
viewModel.closePageImediatly.observe(getViewLifecycleOwner(), isClose -> {
if (isClose == null || !isClose)
return;
popBackStackFragment();
});
viewModel.initEmoji.observe(getViewLifecycleOwner(), aBoolean -> {
// if (aBoolean != null) {
// emojiPopup.toggle();
// }
});
viewModel.showDialogLeaveGroup.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null && aBoolean) {
/*groupLeft();*/
}
});
viewModel.showSelectImageDialog.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null && aBoolean) {
startDialogSelectPicture();
}
});
viewModel.showConvertChannelDialog.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null) {
showPopUp(aBoolean);
}
});
viewModel.showDeleteChannelDialog.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null) {
deleteChannel(aBoolean);
}
});
viewModel.goBack.observe(getViewLifecycleOwner(), aBoolean -> {
if (aBoolean != null && aBoolean) {
popBackStackFragment();
}
});
viewModel.goToChatRoom.observe(getViewLifecycleOwner(), go -> {
if (getActivity() instanceof ActivityMain && go != null && go) {
((ActivityMain) getActivity()).removeAllFragmentFromMain();
/*new HelperFragment(getActivity().getSupportFragmentManager()).popBackStack(3);*/
}
});
viewModel.onSignClickListener.observe(getViewLifecycleOwner(), isClicked -> {
binding.signedMessage.setChecked(!binding.signedMessage.isChecked());
});
viewModel.onReactionMessageClickListener.observe(getViewLifecycleOwner(), isClicked -> {
binding.rateMessage.setChecked(!binding.rateMessage.isChecked());
});
viewModel.getChannelAvatarUpdatedLiveData().observe(getViewLifecycleOwner(), roomId -> {
if (roomId != null && roomId == viewModel.roomId)
avatarHandler.getAvatar(new ParamWithAvatarType(binding.channelAvatar, viewModel.roomId).avatarType(AvatarHandler.AvatarType.ROOM).showMain());
});
viewModel.showChangeUsername.observe(getViewLifecycleOwner(), username -> {
if (username != null) {
setUsername(username);
}
});
// setEmojiColor();
}
use of net.iGap.helper.avatar.ParamWithAvatarType in project iGap-Android by KianIranian-STDG.
the class SearchItamIGap method bindView.
@Override
public void bindView(final ViewHolder holder, List payloads) {
super.bindView(holder, payloads);
holder.txtIcon.setVisibility(View.GONE);
if (item.getType() == ProtoClientSearchUsername.ClientSearchUsernameResponse.Result.Type.USER) {
avatarHandler.getAvatar(new ParamWithAvatarType(holder.avatar, item.getUser().getId()).avatarType(AvatarHandler.AvatarType.USER));
holder.name.setText(item.getUser().getDisplayName());
holder.lastSeen.setText(item.getUser().getUsername());
} else if (item.getType() == ProtoClientSearchUsername.ClientSearchUsernameResponse.Result.Type.ROOM) {
avatarHandler.getAvatar(new ParamWithAvatarType(holder.avatar, item.getRoom().getId()).avatarType(AvatarHandler.AvatarType.ROOM));
holder.name.setText(item.getRoom().getTitle());
if (item.getRoom().getType() == ProtoGlobal.Room.Type.CHANNEL) {
holder.lastSeen.setText(item.getRoom().getChannelRoomExtra().getPublicExtra().getUsername());
} else if (item.getRoom().getType() == ProtoGlobal.Room.Type.GROUP) {
holder.lastSeen.setText(item.getRoom().getGroupRoomExtra().getPublicExtra().getUsername());
}
Typeface typeFaceIcon = ResourcesCompat.getFont(holder.txtIcon.getContext(), R.font.font_icons);
if (item.getRoom().getType() == ProtoGlobal.Room.Type.GROUP) {
holder.txtIcon.setTypeface(typeFaceIcon);
holder.txtIcon.setVisibility(View.VISIBLE);
holder.txtIcon.setText(G.context.getString(R.string.icon_contacts));
} else if (item.getRoom().getType() == ProtoGlobal.Room.Type.CHANNEL) {
holder.txtIcon.setTypeface(typeFaceIcon);
holder.txtIcon.setVisibility(View.VISIBLE);
holder.txtIcon.setText(G.context.getString(R.string.icon_channel));
}
}
holder.txtTime.setText("");
if (HelperCalander.isPersianUnicode) {
holder.name.setText(holder.name.getText().toString());
holder.lastSeen.setText(HelperCalander.convertToUnicodeFarsiNumber(holder.lastSeen.getText().toString()));
holder.txtTime.setText(HelperCalander.convertToUnicodeFarsiNumber(holder.txtTime.getText().toString()));
}
}
use of net.iGap.helper.avatar.ParamWithAvatarType in project iGap-Android by KianIranian-STDG.
the class BeepTunesProfileFragment method onStart.
@Override
public void onStart() {
super.onStart();
avatarHandler.registerChangeFromOtherAvatarHandler();
avatarHandler.getAvatar(new ParamWithAvatarType(profileImage, AccountManager.getInstance().getCurrentUser().getId()).avatarType(AvatarHandler.AvatarType.USER).showMain());
}
Aggregations