use of net.iGap.fragments.emoji.struct.StructIGStickerGroup in project iGap-Android by KianIranian-STDG.
the class AddStickersFragment method setupViews.
@Override
public void setupViews() {
progressBar = rootView.findViewById(R.id.progress_stricker);
addStickerToolbar = rootView.findViewById(R.id.toolbar2);
customTextViewMedium = rootView.findViewById(R.id.title);
buttonBack = rootView.findViewById(R.id.chl_ripple_back_Button);
if (title == null)
addStickerToolbar.setVisibility(View.GONE);
else
customTextViewMedium.setText(title);
RecyclerView recyclerView = rootView.findViewById(R.id.rcvSettingPage);
recyclerView.setAdapter(adapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
EndlessRecyclerViewScrollListener scrollListener = new EndlessRecyclerViewScrollListener(layoutManager) {
@Override
public void onLoadMore(int iPage, int totalItemsCount, RecyclerView view) {
viewModel.onPageEnded();
}
};
buttonBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popBackStackFragment();
}
});
recyclerView.addOnScrollListener(scrollListener);
adapter.setListener(new AddStickerFragmentAdapter.AddStickerAdapterListener() {
@Override
public void onButtonClick(StructIGStickerGroup stickerGroup, AddStickerFragmentAdapter.ProgressStatus progressStatus) {
viewModel.onItemButtonClicked(stickerGroup, sticker -> {
if (sticker.getGroupId().equals(stickerGroup.getGroupId())) {
progressStatus.setVisibility(sticker.isInUserList());
}
});
}
@Override
public void onCellClick(StructIGStickerGroup stickerGroup) {
viewModel.onItemCellClicked(stickerGroup);
}
@Override
public void onButtonStatusChange(AddStickerFragmentAdapter.ButtonsStatus buttonsStatus) {
viewModel.getButtonStatusChangedLiveData().observe(getViewLifecycleOwner(), buttonsStatus::changed);
}
});
viewModel.getOpenStickerDetailLiveData().observe(getViewLifecycleOwner(), sticker -> openFragmentAddStickerToFavorite(sticker.getGroupId()));
viewModel.getLoadMoreProgressLiveData().observe(getViewLifecycleOwner(), visibility -> progressBar.setVisibility(visibility));
viewModel.getStickerGroupLiveData().observe(getViewLifecycleOwner(), stickerGroup -> adapter.addData(stickerGroup));
}
use of net.iGap.fragments.emoji.struct.StructIGStickerGroup in project iGap-Android by KianIranian-STDG.
the class AddStickersFragment method openFragmentAddStickerToFavorite.
private void openFragmentAddStickerToFavorite(String groupId) {
StructIGStickerGroup stickerGroup = new StructIGStickerGroup(groupId);
StickerDialogFragment dialogFragment = StickerDialogFragment.getInstance(stickerGroup, true);
if (getFragmentManager() != null)
dialogFragment.show(getFragmentManager(), "dialogFragment");
}
use of net.iGap.fragments.emoji.struct.StructIGStickerGroup in project iGap-Android by KianIranian-STDG.
the class StickerDialogFragment method getInstance.
public static StickerDialogFragment getInstance(String groupId) {
StickerDialogFragment dialogAddSticker = new StickerDialogFragment();
dialogAddSticker.stickerGroup = new StructIGStickerGroup(groupId);
return dialogAddSticker;
}
Aggregations