diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-07-16 14:02:06 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-07-16 14:02:06 +0000 |
commit | ca9c90711c6d795d687983430f224fd8deaa5684 (patch) | |
tree | 6389d046dfff06a0c9ef2bf118bac0f54968d1a5 /app/src/main/res | |
parent | 2d002b42d9727d3a6bb185e760b3c3450ca51319 (diff) | |
download | infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar.gz infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar.bz2 infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar.lz infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar.xz infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.tar.zst infinity-for-reddit-ca9c90711c6d795d687983430f224fd8deaa5684.zip |
Support viewing Reddit Gallery in app. Fix gif not autoplayable in CommentAndPostRecyclerViewAdapter.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/res/layout/activity_view_reddit_gallery.xml | 23 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml | 41 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_view_reddit_gallery_video.xml | 15 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post_detail_gallery.xml | 338 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post_detail_no_preview_link.xml | 3 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post_gallery.xml | 337 | ||||
-rw-r--r-- | app/src/main/res/menu/view_imgur_image_fragment.xml (renamed from app/src/main/res/menu/view_imgur_image_fragments.xml) | 6 | ||||
-rw-r--r-- | app/src/main/res/menu/view_imgur_video_fragment.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/menu/view_reddit_gallery_image_or_gif_fragment.xml | 23 | ||||
-rw-r--r-- | app/src/main/res/menu/view_reddit_gallery_video_fragment.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 4 |
11 files changed, 796 insertions, 6 deletions
diff --git a/app/src/main/res/layout/activity_view_reddit_gallery.xml b/app/src/main/res/layout/activity_view_reddit_gallery.xml new file mode 100644 index 00000000..530d4477 --- /dev/null +++ b/app/src/main/res/layout/activity_view_reddit_gallery.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.thefuntasty.hauler.HaulerView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/hauler_view_view_reddit_gallery_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:dragUpEnabled="true" + tools:context=".Activity.ViewRedditGalleryActivity"> + + <androidx.core.widget.NestedScrollView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fillViewport="true"> + + <androidx.viewpager.widget.ViewPager + android:id="@+id/view_pager_view_reddit_gallery_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + + </androidx.core.widget.NestedScrollView> + +</com.thefuntasty.hauler.HaulerView>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml new file mode 100644 index 00000000..a92bce52 --- /dev/null +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/constraintLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Fragment.ViewImgurImageFragment"> + + <ProgressBar + android:id="@+id/progress_bar_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" /> + + <com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView + android:id="@+id/image_view_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:quickScaleEnabled="false" /> + + <LinearLayout + android:id="@+id/load_image_error_linear_layout_view_reddit_gallery_image_or_gif_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_white_24dp" + android:layout_gravity="center" + android:gravity="center" + android:textColor="@android:color/white" + android:text="@string/error_loading_image_tap_to_retry" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </LinearLayout> + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_video.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_video.xml new file mode 100644 index 00000000..92e73d84 --- /dev/null +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_video.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".Fragment.ViewRedditGalleryVideoFragment"> + + <com.google.android.exoplayer2.ui.PlayerView + android:id="@+id/player_view_view_reddit_gallery_video_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:controller_layout_id="@layout/exo_playback_control_view"/> + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_post_detail_gallery.xml b/app/src/main/res/layout/item_post_detail_gallery.xml new file mode 100644 index 00000000..05f013a1 --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -0,0 +1,338 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="?attr/cardViewBackgroundColor"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/constraint_layout_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp"> + + <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView + android:id="@+id/icon_gif_image_view_item_post_detail_gallery" + android:layout_width="24dp" + android:layout_height="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/subreddit_text_view_item_post_detail_gallery" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_gallery" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/user_text_view_item_post_detail_gallery" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_gallery" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_gallery" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_gallery" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_gallery" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:maxLines="2" + android:ellipsize="end" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_gallery" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_gallery" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_gallery" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:layout_constraintHorizontal_bias="1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/guideline" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.6" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <TextView + android:id="@+id/title_text_view_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/title_font_18" + android:fontFamily="?attr/title_font_family" + android:textIsSelectable="true" + android:enabled="true" + android:focusable="true" + android:longClickable="true" /> + + <com.nex3z.flowlayout.FlowLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + app:flChildSpacing="16dp" + app:flChildSpacingForLastRow="align" + app:flRowSpacing="8dp"> + + <com.libRG.CustomTextView + android:id="@+id/type_text_view_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/gallery" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/spoiler_custom_text_view_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:padding="4dp" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/nsfw_text_view_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/flair_custom_text_view_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <ImageView + android:id="@+id/archived_image_view_item_post_detail_gallery" + android:layout_width="20dp" + android:layout_height="20dp" + android:src="@drawable/ic_archive_outline" + android:visibility="gone" /> + + <ImageView + android:id="@+id/locked_image_view_item_post_detail_gallery" + android:layout_width="20dp" + android:layout_height="20dp" + android:src="@drawable/ic_outline_lock_24dp" + android:visibility="gone" /> + + <ImageView + android:id="@+id/crosspost_image_view_item_post_detail_gallery" + android:layout_width="20dp" + android:layout_height="20dp" + android:src="@drawable/crosspost" + android:visibility="gone" /> + + <TextView + android:id="@+id/awards_text_view_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <RelativeLayout + android:id="@+id/image_view_wrapper_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone"> + + <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView + android:id="@+id/image_view_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:scaleType="fitStart" /> + + <RelativeLayout + android:id="@+id/load_wrapper_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:visibility="gone"> + + <ProgressBar + android:id="@+id/progress_bar_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" /> + + <TextView + android:id="@+id/load_image_error_text_view_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_black_24dp" + android:layout_centerInParent="true" + android:gravity="center" + android:text="@string/error_loading_image_tap_to_retry" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:visibility="gone" /> + + </RelativeLayout> + + </RelativeLayout> + + <ImageView + android:id="@+id/image_view_no_preview_link_item_post_detail_gallery" + android:layout_width="match_parent" + android:layout_height="150dp" + android:scaleType="center" + android:src="@drawable/ic_link" + android:visibility="gone" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_gallery"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_arrow_upward_grey_24dp" + android:tint="@android:color/tab_indicator_text" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_detail_gallery" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_gallery" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_arrow_downward_grey_24dp" + android:tint="@android:color/tab_indicator_text" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_gallery" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:gravity="center_vertical" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + android:drawableStart="@drawable/ic_comment_grey_24dp" + android:drawablePadding="12dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_gallery" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:tint="@android:color/tab_indicator_text" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintHorizontal_bias="1" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_gallery" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_gallery" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_share_grey_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_post_detail_no_preview_link.xml b/app/src/main/res/layout/item_post_detail_no_preview_link.xml index f294801a..9eefa30e 100644 --- a/app/src/main/res/layout/item_post_detail_no_preview_link.xml +++ b/app/src/main/res/layout/item_post_detail_no_preview_link.xml @@ -219,8 +219,7 @@ android:layout_width="match_parent" android:layout_height="150dp" android:scaleType="center" - android:src="@drawable/ic_link" - android:tint="@android:color/tab_indicator_text" /> + android:src="@drawable/ic_link" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/item_post_gallery.xml b/app/src/main/res/layout/item_post_gallery.xml new file mode 100644 index 00000000..5b15c117 --- /dev/null +++ b/app/src/main/res/layout/item_post_gallery.xml @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:id="@+id/card_view_item_post_gallery_type" + app:cardBackgroundColor="?attr/cardViewBackgroundColor" + app:cardElevation="2dp" + app:cardCornerRadius="16dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp"> + + <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView + android:id="@+id/icon_gif_image_view_item_post_gallery_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"/> + + <TextView + android:id="@+id/subreddit_name_text_view_item_post_gallery_type" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_gallery_type" + app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_gallery_type" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gallery_type" + app:layout_constraintTop_toTopOf="parent"/> + + <TextView + android:id="@+id/user_text_view_item_post_gallery_type" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_gallery_type" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gallery_type" + app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_gallery_type" + app:layout_constraintHorizontal_bias="0" /> + + <ImageView + android:id="@+id/stickied_post_image_view_item_post_gallery_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_marginEnd="8dp" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_gallery_type" + app:layout_constraintEnd_toStartOf="@+id/guideline2" + app:layout_constraintTop_toTopOf="parent"/> + + <TextView + android:id="@+id/post_time_text_view_item_post_gallery_type" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/guideline2" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.6" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <TextView + android:id="@+id/title_text_view_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textSize="?attr/title_font_18" + android:fontFamily="?attr/title_font_family" /> + + <com.nex3z.flowlayout.FlowLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="16dp" + app:flChildSpacing="16dp" + app:flChildSpacingForLastRow="align" + app:flRowSpacing="8dp"> + + <com.libRG.CustomTextView + android:id="@+id/type_text_view_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/gallery" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/spoiler_custom_text_view_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:padding="4dp" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/nsfw_text_view_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/flair_custom_text_view_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:padding="4dp" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <com.libRG.CustomTextView + android:id="@+id/awards_text_view_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> + + <ImageView + android:id="@+id/archived_image_view_item_post_gallery_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:src="@drawable/ic_archive_outline" + android:visibility="gone" /> + + <ImageView + android:id="@+id/locked_image_view_item_post_gallery_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:src="@drawable/ic_outline_lock_24dp" + android:visibility="gone" /> + + <ImageView + android:id="@+id/crosspost_image_view_item_post_gallery_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:src="@drawable/crosspost" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <RelativeLayout + android:id="@+id/image_wrapper_relative_layout_item_post_gallery" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone"> + + <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView + android:id="@+id/image_view_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:scaleType="fitStart" /> + + <ProgressBar + android:id="@+id/progress_bar_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" /> + + <RelativeLayout + android:id="@+id/load_image_error_relative_layout_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerInParent="true" + android:visibility="gone"> + + <TextView + android:id="@+id/load_image_error_text_view_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_black_24dp" + android:layout_gravity="center" + android:gravity="center" + android:text="@string/error_loading_image_tap_to_retry" + android:textSize="?attr/font_default" + android:fontFamily="?attr/font_family" /> + + </RelativeLayout> + + </RelativeLayout> + + <ImageView + android:id="@+id/image_view_no_preview_gallery_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="150dp" + android:scaleType="center" + android:src="@drawable/ic_link" + android:tint="@android:color/tab_indicator_text" + android:visibility="gone" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/bottom_constraint_layout_item_post_gallery_type" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <ImageView + android:id="@+id/plus_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_arrow_upward_grey_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_gallery_type" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_gallery_type" /> + + <ImageView + android:id="@+id/minus_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_arrow_downward_grey_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_gallery_type" /> + + <TextView + android:id="@+id/comments_count_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:gravity="center_vertical" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + android:drawableStart="@drawable/ic_comment_grey_24dp" + android:drawablePadding="12dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_gallery_type" /> + + <ImageView + android:id="@+id/save_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintHorizontal_bias="1" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_gallery_type" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_gallery_type" /> + + <ImageView + android:id="@+id/share_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="12dp" + android:src="@drawable/ic_share_grey_24dp" + android:background="?actionBarItemBackground" + android:clickable="true" + android:focusable="true" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + </LinearLayout> + +</com.google.android.material.card.MaterialCardView>
\ No newline at end of file diff --git a/app/src/main/res/menu/view_imgur_image_fragments.xml b/app/src/main/res/menu/view_imgur_image_fragment.xml index bba34621..742186d6 100644 --- a/app/src/main/res/menu/view_imgur_image_fragments.xml +++ b/app/src/main/res/menu/view_imgur_image_fragment.xml @@ -2,21 +2,21 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item - android:id="@+id/action_download_view_imgur_image_fragments" + android:id="@+id/action_download_view_imgur_image_fragment" android:orderInCategory="1" android:title="@string/action_download" android:icon="@drawable/ic_file_download_toolbar_white_24dp" app:showAsAction="ifRoom" /> <item - android:id="@+id/action_share_view_imgur_image_fragments" + android:id="@+id/action_share_view_imgur_image_fragment" android:orderInCategory="2" android:title="@string/action_share" android:icon="@drawable/ic_share_toolbar_white_24dp" app:showAsAction="ifRoom" /> <item - android:id="@+id/action_set_wallpaper_view_imgur_image_fragments" + android:id="@+id/action_set_wallpaper_view_imgur_image_fragment" android:orderInCategory="3" android:title="@string/action_set_wallpaper" app:showAsAction="never" /> diff --git a/app/src/main/res/menu/view_imgur_video_fragment.xml b/app/src/main/res/menu/view_imgur_video_fragment.xml index 7b7c4fc8..8a671463 100644 --- a/app/src/main/res/menu/view_imgur_video_fragment.xml +++ b/app/src/main/res/menu/view_imgur_video_fragment.xml @@ -2,7 +2,7 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item - android:id="@+id/action_download_view_imgur_image_fragments" + android:id="@+id/action_download_view_imgur_video_fragment" android:orderInCategory="1" android:title="@string/action_download" android:icon="@drawable/ic_file_download_toolbar_white_24dp" diff --git a/app/src/main/res/menu/view_reddit_gallery_image_or_gif_fragment.xml b/app/src/main/res/menu/view_reddit_gallery_image_or_gif_fragment.xml new file mode 100644 index 00000000..e9356888 --- /dev/null +++ b/app/src/main/res/menu/view_reddit_gallery_image_or_gif_fragment.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_download_view_reddit_gallery_image_or_gif_fragment" + android:orderInCategory="1" + android:title="@string/action_download" + android:icon="@drawable/ic_file_download_toolbar_white_24dp" + app:showAsAction="ifRoom" /> + + <item + android:id="@+id/action_share_view_reddit_gallery_image_or_gif_fragment" + android:orderInCategory="2" + android:title="@string/action_share" + android:icon="@drawable/ic_share_toolbar_white_24dp" + app:showAsAction="ifRoom" /> + + <item + android:id="@+id/action_set_wallpaper_view_reddit_gallery_image_or_gif_fragment" + android:orderInCategory="3" + android:title="@string/action_set_wallpaper" + app:showAsAction="never" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/view_reddit_gallery_video_fragment.xml b/app/src/main/res/menu/view_reddit_gallery_video_fragment.xml new file mode 100644 index 00000000..061ab71e --- /dev/null +++ b/app/src/main/res/menu/view_reddit_gallery_video_fragment.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item + android:id="@+id/action_download_view_reddit_gallery_video_fragment" + android:orderInCategory="1" + android:title="@string/action_download" + android:icon="@drawable/ic_file_download_toolbar_white_24dp" + app:showAsAction="ifRoom" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63f39e2f..f97d3d3a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -29,6 +29,9 @@ <string name="view_imgur_media_activity_image_label">Image %1$d/%2$d</string> <string name="view_imgur_media_activity_video_label">Video %1$d/%2$d</string> <string name="send_private_message_activity_label">Send PM</string> + <string name="view_reddit_gallery_activity_image_label">Image %1$d/%2$d</string> + <string name="view_reddit_gallery_activity_gif_label">Gif %1$d/%2$d</string> + <string name="view_reddit_gallery_activity_video_label">Video %1$d/%2$d</string> <string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string> @@ -263,6 +266,7 @@ <string name="image">IMAGE</string> <string name="video">VIDEO</string> <string name="gif">GIF</string> + <string name="gallery">GALLERY</string> <string name="best">Best</string> <string name="search">Search</string> |