Search in sources :

Example 1 with PairItemActionCallback

use of com.onesignal.sdktest.callback.PairItemActionCallback in project OneSignal-Android-SDK by OneSignal.

the class MainActivityViewModel method setupTagRecyclerView.

private void setupTagRecyclerView() {
    recyclerViewBuilder.setupRecyclerView(tagsRecyclerView, 20, false, true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    tagsRecyclerView.setLayoutManager(linearLayoutManager);
    tagPairRecyclerViewAdapter = new PairRecyclerViewAdapter(context, tagArrayList, new PairItemActionCallback() {

        @Override
        public void onLongClick(String key) {
            OneSignal.deleteTag(key);
            tagSet.remove(key);
            refreshTagRecyclerView();
            toaster.makeCustomViewToast("Deleted tag " + key, ToastType.SUCCESS);
        }
    });
    tagsRecyclerView.setAdapter(tagPairRecyclerViewAdapter);
}
Also used : PairItemActionCallback(com.onesignal.sdktest.callback.PairItemActionCallback) PairRecyclerViewAdapter(com.onesignal.sdktest.adapter.PairRecyclerViewAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 PairRecyclerViewAdapter (com.onesignal.sdktest.adapter.PairRecyclerViewAdapter)1 PairItemActionCallback (com.onesignal.sdktest.callback.PairItemActionCallback)1