Search in sources :

Example 1 with MediaRailAdapter

use of org.thoughtcrime.securesms.mediapreview.MediaRailAdapter in project Signal-Android by WhisperSystems.

the class MediaPreviewActivity method initializeViews.

private void initializeViews() {
    mediaPager = findViewById(R.id.media_pager);
    mediaPager.setOffscreenPageLimit(1);
    mediaPager.setPageTransformer(true, new DepthPageTransformer());
    viewPagerListener = new ViewPagerListener();
    mediaPager.addOnPageChangeListener(viewPagerListener);
    albumRail = findViewById(R.id.media_preview_album_rail);
    albumRailAdapter = new MediaRailAdapter(GlideApp.with(this), this, false);
    // Or can crash when set to INVISIBLE while animating by FullscreenHelper https://issuetracker.google.com/issues/148720682
    albumRail.setItemAnimator(null);
    albumRail.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
    albumRail.setAdapter(albumRailAdapter);
    detailsContainer = findViewById(R.id.media_preview_details_container);
    caption = findViewById(R.id.media_preview_caption);
    captionContainer = findViewById(R.id.media_preview_caption_container);
    playbackControlsContainer = findViewById(R.id.media_preview_playback_controls_container);
    View toolbarLayout = findViewById(R.id.toolbar_layout);
    anchorMarginsToBottomInsets(detailsContainer);
    fullscreenHelper.configureToolbarSpacer(findViewById(R.id.toolbar_cutout_spacer));
    fullscreenHelper.showAndHideWithSystemUI(getWindow(), detailsContainer, toolbarLayout);
}
Also used : DepthPageTransformer(org.thoughtcrime.securesms.animation.DepthPageTransformer) MediaRailAdapter(org.thoughtcrime.securesms.mediapreview.MediaRailAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 2 with MediaRailAdapter

use of org.thoughtcrime.securesms.mediapreview.MediaRailAdapter in project Signal-Android by signalapp.

the class MediaPreviewActivity method initializeViews.

private void initializeViews() {
    mediaPager = findViewById(R.id.media_pager);
    mediaPager.setOffscreenPageLimit(1);
    mediaPager.setPageTransformer(true, new DepthPageTransformer());
    viewPagerListener = new ViewPagerListener();
    mediaPager.addOnPageChangeListener(viewPagerListener);
    albumRail = findViewById(R.id.media_preview_album_rail);
    albumRailAdapter = new MediaRailAdapter(GlideApp.with(this), this, false);
    // Or can crash when set to INVISIBLE while animating by FullscreenHelper https://issuetracker.google.com/issues/148720682
    albumRail.setItemAnimator(null);
    albumRail.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
    albumRail.setAdapter(albumRailAdapter);
    detailsContainer = findViewById(R.id.media_preview_details_container);
    caption = findViewById(R.id.media_preview_caption);
    captionContainer = findViewById(R.id.media_preview_caption_container);
    playbackControlsContainer = findViewById(R.id.media_preview_playback_controls_container);
    View toolbarLayout = findViewById(R.id.toolbar_layout);
    anchorMarginsToBottomInsets(detailsContainer);
    fullscreenHelper.configureToolbarSpacer(findViewById(R.id.toolbar_cutout_spacer));
    fullscreenHelper.showAndHideWithSystemUI(getWindow(), detailsContainer, toolbarLayout);
}
Also used : DepthPageTransformer(org.thoughtcrime.securesms.animation.DepthPageTransformer) MediaRailAdapter(org.thoughtcrime.securesms.mediapreview.MediaRailAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

View (android.view.View)2 TextView (android.widget.TextView)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2 DepthPageTransformer (org.thoughtcrime.securesms.animation.DepthPageTransformer)2 MediaRailAdapter (org.thoughtcrime.securesms.mediapreview.MediaRailAdapter)2