use of androidx.recyclerview.widget.RecyclerView in project fresco by facebook.
the class DraweeRecyclerViewFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
final RecyclerView recyclerView = view.findViewById(R.id.recycler_view);
recyclerView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
final int imageSize = (right - left) / SPAN_COUNT;
mResizeOptions = new ResizeOptions(imageSize, imageSize);
}
});
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), SPAN_COUNT);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
final SimpleAdapter adapter = new SimpleAdapter(new ArrayList<Uri>());
recyclerView.setAdapter(adapter);
final Spinner imageSource = view.findViewById(R.id.spinner_image_source);
ImageSourceSpinner.INSTANCE.setup(imageSource, sampleUris(), new Function1<List<Uri>, Unit>() {
@Override
public Unit invoke(List<Uri> uris) {
adapter.setData(uris);
return null;
}
});
}
use of androidx.recyclerview.widget.RecyclerView in project Timber by naman14.
the class PlaylistFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_playlist, container, false);
Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
pager = (MultiViewPager) rootView.findViewById(R.id.playlistpager);
recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.ic_menu);
ab.setDisplayHomeAsUpEnabled(true);
ab.setTitle(R.string.playlists);
playlists = PlaylistLoader.getPlaylists(getActivity(), showAuto);
playlistcount = playlists.size();
if (isDefault) {
initPager();
} else {
initRecyclerView();
}
return rootView;
}
use of androidx.recyclerview.widget.RecyclerView in project Timber by naman14.
the class AlbumDetailFragment method onCreateView.
@TargetApi(21)
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_album_detail, container, false);
albumArt = (ImageView) rootView.findViewById(R.id.album_art);
artistArt = (ImageView) rootView.findViewById(R.id.artist_art);
albumTitle = (TextView) rootView.findViewById(R.id.album_title);
albumDetails = (TextView) rootView.findViewById(R.id.album_details);
toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
if (getArguments().getBoolean("transition")) {
albumArt.setTransitionName(getArguments().getString("transition_name"));
}
recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
collapsingToolbarLayout = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar);
appBarLayout = (AppBarLayout) rootView.findViewById(R.id.app_bar);
recyclerView.setEnabled(false);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
album = AlbumLoader.getAlbum(getActivity(), albumID);
setAlbumart();
setUpEverything();
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
AlbumSongsAdapter adapter = (AlbumSongsAdapter) recyclerView.getAdapter();
MusicPlayer.playAll(getActivity(), adapter.getSongIds(), 0, albumID, TimberUtils.IdType.Album, true);
NavigationUtils.navigateToNowplaying(getActivity(), false);
}
}, 150);
}
});
return rootView;
}
use of androidx.recyclerview.widget.RecyclerView in project Timber by naman14.
the class Timber5 method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_timber5, container, false);
setMusicStateListener();
setSongDetails(rootView);
mBlurredArt = (ImageView) rootView.findViewById(R.id.album_art_blurred);
recyclerView = (RecyclerView) rootView.findViewById(R.id.queue_recyclerview_horizontal);
initGestures(mBlurredArt);
setupSlidingQueue();
return rootView;
}
use of androidx.recyclerview.widget.RecyclerView in project Timber by naman14.
the class Timber4 method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_timber4, container, false);
setMusicStateListener();
setSongDetails(rootView);
mBlurredArt = (ImageView) rootView.findViewById(R.id.album_art_blurred);
horizontalRecyclerview = (RecyclerView) rootView.findViewById(R.id.queue_recyclerview_horizontal);
setupHorizontalQueue();
initGestures(mBlurredArt);
return rootView;
}
Aggregations