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);
}
}
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;
}
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;
}
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;
}
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);
}
Aggregations