Search in sources :

Example 11 with DividerItemDecoration

use of androidx.recyclerview.widget.DividerItemDecoration in project RespawnIRC-Android by FranckRJ.

the class ManageIgnoreListActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_manageignorelist);
    initToolbar(R.id.toolbar_manageignorelist);
    adapterForIgnoreList = new RemovableItemListAdapter(this);
    RecyclerView ignoreListView = findViewById(R.id.ignore_list_manageignorelist);
    emptyListMessageText = findViewById(R.id.text_emptylist_manageignorelist);
    generateListOfIgnoredPseudos();
    adapterForIgnoreList.setOnItemRemovedListener(listenerForPseudoRemoved);
    ignoreListView.setNestedScrollingEnabled(false);
    ignoreListView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    ignoreListView.setLayoutManager(new LinearLayoutManager(this));
    ignoreListView.setAdapter(adapterForIgnoreList);
    if (adapterForIgnoreList.listIsEmpty()) {
        emptyListMessageText.setVisibility(View.VISIBLE);
    } else {
        emptyListMessageText.setVisibility(View.GONE);
    }
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 12 with DividerItemDecoration

use of androidx.recyclerview.widget.DividerItemDecoration in project mopub-android-mediation by mopub.

the class ImpressionsInfoFragment method onCreateView.

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ArrayList<String> impressionsList = null;
    if (getArguments() != null) {
        impressionsList = getArguments().getStringArrayList(ARG_IMPRESSIONS_LIST);
    }
    // Inflate the layout for this fragment
    fragmentView = inflater.inflate(R.layout.fragment_impressions_info, container, false);
    final RecyclerView recyclerView = fragmentView.findViewById(R.id.impressions_recycler_view);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    adapter = new ImpressionsInfoAdapter(container.getContext(), impressionsList);
    recyclerView.setAdapter(adapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), VERTICAL));
    recyclerView.setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
    if (adapter.stringList.size() > 0) {
        fragmentView.findViewById(R.id.text_no_impressions).setVisibility(View.GONE);
    }
    final Button closeButton = fragmentView.findViewById(R.id.close_btn);
    closeButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final Activity activity = getActivity();
            if (activity != null) {
                activity.onBackPressed();
            }
        }
    });
    return fragmentView;
}
Also used : Button(android.widget.Button) Activity(android.app.Activity) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 13 with DividerItemDecoration

use of androidx.recyclerview.widget.DividerItemDecoration in project mopub-android-mediation by mopub.

the class PrivacyInfoFragment method onCreateView.

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.privacy_info_fragment, container, false);
    final List<PrivacyItem> privacySettings = readPrivacySettings();
    if (privacySettings != null && !privacySettings.isEmpty()) {
        RecyclerView recyclerView = view.findViewById(R.id.privacy_recycler_view);
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recyclerView.setAdapter(new PrivacyAdapter(privacySettings));
        recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), VERTICAL));
    }
    final Button closeButton = view.findViewById(R.id.privacy_close_btn);
    closeButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final Activity activity = getActivity();
            if (activity != null) {
                activity.onBackPressed();
            }
        }
    });
    return view;
}
Also used : Button(android.widget.Button) Activity(android.app.Activity) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 14 with DividerItemDecoration

use of androidx.recyclerview.widget.DividerItemDecoration in project AntennaPod by AntennaPod.

the class ChaptersFragment method onCreateView.

public View onCreateView(@NonNull LayoutInflater inflater) {
    View root = inflater.inflate(R.layout.simple_list_fragment, null, false);
    root.findViewById(R.id.toolbar).setVisibility(View.GONE);
    RecyclerView recyclerView = root.findViewById(R.id.recyclerView);
    progressBar = root.findViewById(R.id.progLoading);
    layoutManager = new LinearLayoutManager(getActivity());
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), layoutManager.getOrientation()));
    adapter = new ChaptersListAdapter(getActivity(), pos -> {
        if (controller.getStatus() != PlayerStatus.PLAYING) {
            controller.playPause();
        }
        Chapter chapter = adapter.getItem(pos);
        controller.seekTo((int) chapter.getStart());
        updateChapterSelection(pos);
    });
    recyclerView.setAdapter(adapter);
    progressBar.setVisibility(View.VISIBLE);
    RelativeLayout.LayoutParams wrapHeight = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    recyclerView.setLayoutParams(wrapHeight);
    return root;
}
Also used : DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) PlaybackController(de.danoeh.antennapod.core.util.playback.PlaybackController) Bundle(android.os.Bundle) AlertDialog(androidx.appcompat.app.AlertDialog) ProgressBar(android.widget.ProgressBar) NonNull(androidx.annotation.NonNull) Maybe(io.reactivex.Maybe) Dialog(android.app.Dialog) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) AppCompatDialogFragment(androidx.appcompat.app.AppCompatDialogFragment) EventBus(org.greenrobot.eventbus.EventBus) PlaybackPositionEvent(de.danoeh.antennapod.event.playback.PlaybackPositionEvent) View(android.view.View) Schedulers(io.reactivex.schedulers.Schedulers) RecyclerView(androidx.recyclerview.widget.RecyclerView) ChaptersListAdapter(de.danoeh.antennapod.adapter.ChaptersListAdapter) Chapter(de.danoeh.antennapod.model.feed.Chapter) Log(android.util.Log) LayoutInflater(android.view.LayoutInflater) R(de.danoeh.antennapod.R) Playable(de.danoeh.antennapod.model.playback.Playable) ThreadMode(org.greenrobot.eventbus.ThreadMode) ViewGroup(android.view.ViewGroup) PlayerStatus(de.danoeh.antennapod.playback.base.PlayerStatus) Disposable(io.reactivex.disposables.Disposable) Nullable(androidx.annotation.Nullable) Subscribe(org.greenrobot.eventbus.Subscribe) ChapterUtils(de.danoeh.antennapod.core.util.ChapterUtils) RelativeLayout(android.widget.RelativeLayout) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) ChaptersListAdapter(de.danoeh.antennapod.adapter.ChaptersListAdapter) Chapter(de.danoeh.antennapod.model.feed.Chapter) RelativeLayout(android.widget.RelativeLayout) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 15 with DividerItemDecoration

use of androidx.recyclerview.widget.DividerItemDecoration in project AntennaPod by AntennaPod.

the class EpisodeItemListRecyclerView method setup.

private void setup() {
    layoutManager = new LinearLayoutManager(getContext());
    layoutManager.setRecycleChildrenOnDetach(true);
    setLayoutManager(layoutManager);
    setHasFixedSize(true);
    addItemDecoration(new DividerItemDecoration(getContext(), layoutManager.getOrientation()));
    setClipToPadding(false);
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DividerItemDecoration(androidx.recyclerview.widget.DividerItemDecoration)

Aggregations

DividerItemDecoration (androidx.recyclerview.widget.DividerItemDecoration)26 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)20 RecyclerView (androidx.recyclerview.widget.RecyclerView)15 View (android.view.View)12 TextView (android.widget.TextView)7 Button (android.widget.Button)6 Context (android.content.Context)5 ArrayList (java.util.ArrayList)5 Activity (android.app.Activity)4 Bundle (android.os.Bundle)4 ProgressBar (android.widget.ProgressBar)4 Nullable (androidx.annotation.Nullable)4 List (java.util.List)4 SuppressLint (android.annotation.SuppressLint)3 Log (android.util.Log)3 LayoutInflater (android.view.LayoutInflater)3 MenuItem (android.view.MenuItem)3 ViewGroup (android.view.ViewGroup)3 RelativeLayout (android.widget.RelativeLayout)3 NonNull (androidx.annotation.NonNull)3