Search in sources :

Example 1 with StickersAdapter

use of com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.adapter.StickersAdapter in project android-java-chat-push-notification-app by cometchat-pro.

the class StickerFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_stickers_view, container, false);
    rvStickers = view.findViewById(R.id.rvStickers);
    rvStickers.setLayoutManager(new GridLayoutManager(getContext(), 4));
    Id = this.getArguments().getString("Id");
    type = this.getArguments().getString("type");
    List<Sticker> list = this.getArguments().getParcelableArrayList("stickerList");
    stickers = list;
    Log.e("onStickerView: ", stickers.get(0).getSetName());
    adapter = new StickersAdapter(getContext(), stickers);
    rvStickers.setAdapter(adapter);
    rvStickers.addOnItemTouchListener(new RecyclerTouchListener(getContext(), rvStickers, new ClickListener() {

        @Override
        public void onClick(View var1, int var2) {
            Sticker sticker = (Sticker) var1.getTag(R.string.sticker);
            stickerClickListener.onClickListener(sticker);
        }
    }));
    return view;
}
Also used : Sticker(com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.model.Sticker) StickersAdapter(com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.adapter.StickersAdapter) RecyclerTouchListener(com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.RecyclerTouchListener) GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) ClickListener(com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.ClickListener) StickerClickListener(com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.listener.StickerClickListener) Nullable(androidx.annotation.Nullable)

Aggregations

View (android.view.View)1 Nullable (androidx.annotation.Nullable)1 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 StickersAdapter (com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.adapter.StickersAdapter)1 StickerClickListener (com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.listener.StickerClickListener)1 Sticker (com.cometchat.pro.uikit.ui_components.shared.cometchatStickers.model.Sticker)1 ClickListener (com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.ClickListener)1 RecyclerTouchListener (com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.RecyclerTouchListener)1