diff options
author | TacoTheDank <SkytkRSfan3895@gmail.com> | 2020-05-19 20:39:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 20:39:37 +0000 |
commit | 6126df39a5e1fc0a935327cfdedb4d15beba62be (patch) | |
tree | 4713b6ce43ab25b0c4427150065dc1fa896c1d84 /app/src/main/res | |
parent | fc284a3dc01a99234785a0633630931f5abad648 (diff) | |
parent | 07710908ba44f3ada4d95c1fffd3cb708029a633 (diff) | |
download | infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar.gz infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar.bz2 infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar.lz infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar.xz infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.tar.zst infinity-for-reddit-6126df39a5e1fc0a935327cfdedb4d15beba62be.zip |
Merge branch 'master' into master
Diffstat (limited to 'app/src/main/res')
20 files changed, 1817 insertions, 560 deletions
diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index 3b0dd281..d867c596 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -37,7 +37,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - <androidx.recyclerview.widget.RecyclerView + <ml.docilealligator.infinityforreddit.CustomView.CustomToroContainer android:id="@+id/recycler_view_view_post_detail" android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml deleted file mode 100644 index 9de730bf..00000000 --- a/app/src/main/res/layout/item_post.xml +++ /dev/null @@ -1,361 +0,0 @@ -<?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" - 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" - 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" - 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" - app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post" - app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post" - app:layout_constraintTop_toTopOf="parent"/> - - <TextView - android:id="@+id/user_text_view_item_post" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="16dp" - android:layout_marginEnd="8dp" - android:textSize="?attr/font_default" - android:maxLines="2" - android:ellipsize="end" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post" - app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post" - app:layout_constraintHorizontal_bias="0" /> - - <ImageView - android:id="@+id/stickied_post_image_view_item_post" - 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" - app:layout_constraintEnd_toStartOf="@+id/guideline2" - app:layout_constraintTop_toTopOf="parent"/> - - <TextView - android:id="@+id/post_time_text_view_best_item_post" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:gravity="end" - android:textSize="?attr/font_default" - 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_best_item_post" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:textSize="?attr/title_font_18" /> - - <TextView - android:id="@+id/content_text_view_item_post" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:maxLines="4" - android:visibility="gone" - android:textSize="?attr/content_font_default" - android:ellipsize="end" /> - - <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" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="4dp" - android:textSize="?attr/font_12" - app:lib_setRadius="3dp" - app:lib_setRoundedView="true" - app:lib_setShape="rectangle" /> - - <com.libRG.CustomTextView - android:id="@+id/spoiler_custom_text_view_item_post" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:text="@string/spoiler" - android:textSize="?attr/font_12" - 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" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="4dp" - android:text="@string/nsfw" - android:textSize="?attr/font_12" - 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" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:textSize="?attr/font_12" - 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" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="4dp" - android:textSize="?attr/font_12" - android:visibility="gone" - app:lib_setRadius="3dp" - app:lib_setRoundedView="true" - app:lib_setShape="rectangle" /> - - <ImageView - android:id="@+id/archived_image_view_item_post" - 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" - 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" - android:layout_width="24dp" - android:layout_height="24dp" - android:src="@drawable/crosspost" - android:visibility="gone" /> - - </com.nex3z.flowlayout.FlowLayout> - - <TextView - android:id="@+id/link_text_view_item_post" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="16dp" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:textSize="?attr/font_12" - android:visibility="gone" /> - - <RelativeLayout - android:id="@+id/image_view_wrapper_item_post" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone"> - - <FrameLayout - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/image_view_best_post_item" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:adjustViewBounds="true" - android:scaleType="fitStart" /> - - <ImageView - android:id="@+id/play_button_image_view_item_post" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:layout_gravity="start" - android:background="@drawable/play_button_round_background" - android:src="@drawable/ic_play_circle_36dp" - android:visibility="gone" /> - - </FrameLayout> - - <ProgressBar - android:id="@+id/progress_bar_item_post" - 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" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerInParent="true" - android:visibility="gone"> - - <TextView - 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" /> - - </RelativeLayout> - - </RelativeLayout> - - <ImageView - android:id="@+id/image_view_no_preview_link_item_post" - 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" - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <ImageView - android:id="@+id/plus_button_item_post" - 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" - android:layout_width="64dp" - android:layout_height="wrap_content" - android:gravity="center" - android:textSize="?attr/font_12" - android:textStyle="bold" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_item_post" /> - - <ImageView - android:id="@+id/minus_button_item_post" - 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" /> - - <TextView - android:id="@+id/comments_count_item_post" - 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: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" /> - - <ImageView - android:id="@+id/save_button_item_post" - 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" - app:layout_constraintEnd_toStartOf="@id/share_button_item_post" /> - - <ImageView - android:id="@+id/share_button_item_post" - 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/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml index 8b65f934..d81a2bdc 100644 --- a/app/src/main/res/layout/item_post_compact.xml +++ b/app/src/main/res/layout/item_post_compact.xml @@ -54,7 +54,7 @@ app:layout_constraintTop_toTopOf="parent" /> <TextView - android:id="@+id/post_time_text_view_best_item_post_compact" + android:id="@+id/post_time_text_view_item_post_compact" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -78,7 +78,7 @@ android:layout_height="wrap_content"> <TextView - android:id="@+id/title_text_view_best_item_post_compact" + android:id="@+id/title_text_view_item_post_compact" android:layout_width="0dp" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -98,7 +98,7 @@ android:paddingBottom="8dp" android:paddingStart="16dp" android:paddingEnd="16dp" - app:layout_constraintTop_toBottomOf="@id/title_text_view_best_item_post_compact" + app:layout_constraintTop_toBottomOf="@id/title_text_view_item_post_compact" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toStartOf="@id/barrier2" app:layout_constraintBottom_toTopOf="@id/link_text_view_item_post_compact" @@ -220,7 +220,7 @@ android:layout_height="match_parent"> <ImageView - android:id="@+id/image_view_best_post_item" + android:id="@+id/image_view_item_post_compact" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="center" /> diff --git a/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml b/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml new file mode 100644 index 00000000..3667d7b5 --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml @@ -0,0 +1,317 @@ +<?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_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_image_and_gif_autoplay" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_image_and_gif_autoplay" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_image_and_gif_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + 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_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_image_and_gif_autoplay" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_image_and_gif_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + 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_image_and_gif_autoplay" + 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: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_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <RelativeLayout + android:id="@+id/image_view_wrapper_item_post_detail_image_and_gif_autoplay" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <com.santalu.aspectratioimageview.AspectRatioImageView + android:id="@+id/image_view_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_centerInParent="true"> + + <ProgressBar + android:id="@+id/progress_bar_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + 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:visibility="gone" /> + + </RelativeLayout> + + </RelativeLayout> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_image_and_gif_autoplay"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_image_and_gif_autoplay" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_image_and_gif_autoplay" + 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: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_image_and_gif_autoplay" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_image_and_gif_autoplay" + 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_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_image_and_gif_autoplay" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_image_and_gif_autoplay" + 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_link.xml b/app/src/main/res/layout/item_post_detail_link.xml new file mode 100644 index 00000000..1b8570da --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_link.xml @@ -0,0 +1,327 @@ +<?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_link" + 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_link" + 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_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_link" + 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_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_link" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_link" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_link" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + 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_link" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_link" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + 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_link" + 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: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_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/link" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_link" + 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_link" + 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_link" + 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_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <TextView + android:id="@+id/link_text_view_item_post_detail_link" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textSize="?attr/font_12" /> + + <RelativeLayout + android:id="@+id/image_view_wrapper_item_post_detail_link" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <com.santalu.aspectratioimageview.AspectRatioImageView + android:id="@+id/image_view_item_post_detail_link" + 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_link" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_centerInParent="true"> + + <ProgressBar + android:id="@+id/progress_bar_item_post_detail_link" + 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_link" + 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:visibility="gone" /> + + </RelativeLayout> + + </RelativeLayout> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_link"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_link" + 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_link" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_link" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_link" + 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_link" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_link" + 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: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_link" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_link" + 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_link" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_link" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_link" + 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 new file mode 100644 index 00000000..01e887fb --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_no_preview_link.xml @@ -0,0 +1,305 @@ +<?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_no_preview_link" + 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_no_preview_link" + 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_no_preview_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_no_preview_link" + 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_no_preview_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_no_preview_link" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_no_preview_link" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_no_preview_link" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_no_preview_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + 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_no_preview_link" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_no_preview_link" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_no_preview_link" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + 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_no_preview_link" + 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:textIsSelectable="true" + android:enabled="true" + android:focusable="true" + android:longClickable="true" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/content_markdown_view_item_post_detail_no_preview_link" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="16dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:visibility="gone" /> + + <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_no_preview_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/link" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_no_preview_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_no_preview_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_no_preview_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_no_preview_link" + 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_no_preview_link" + 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_no_preview_link" + 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_no_preview_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <TextView + android:id="@+id/link_text_view_item_post_detail_no_preview_link" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textSize="?attr/font_12" /> + + <ImageView + android:id="@+id/image_view_no_preview_link_item_post_detail_no_preview_link" + android:layout_width="match_parent" + android:layout_height="150dp" + android:scaleType="center" + android:src="@drawable/ic_link" + android:tint="@android:color/tab_indicator_text" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_no_preview_link"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_no_preview_link" + 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_no_preview_link" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_no_preview_link" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_no_preview_link" + 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_no_preview_link" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_no_preview_link" + 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: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_no_preview_link" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_no_preview_link" + 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_no_preview_link" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_no_preview_link" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_no_preview_link" + 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_text.xml b/app/src/main/res/layout/item_post_detail_text.xml new file mode 100644 index 00000000..00b81547 --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_text.xml @@ -0,0 +1,288 @@ +<?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_text" + 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_text" + 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_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_text" + 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_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_text" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_text" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_text" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + 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_text" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_text" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + 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_text" + 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:textIsSelectable="true" + android:enabled="true" + android:focusable="true" + android:longClickable="true" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/content_markdown_view_item_post_detail_text" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="16dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:visibility="gone" /> + + <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_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/text" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_text" + 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_text" + 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_text" + 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_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_text"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_text" + 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_text" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_text" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_text" + 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_text" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_text" + 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: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_text" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_text" + 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_text" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_text" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_text" + 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.xml b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml index ce515feb..5de14a3e 100644 --- a/app/src/main/res/layout/item_post_detail.xml +++ b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml @@ -7,13 +7,13 @@ android:background="?attr/cardViewBackgroundColor"> <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/constraint_layout_item_post_detail" + android:id="@+id/constraint_layout_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview" android:layout_width="24dp" android:layout_height="24dp" app:layout_constraintBottom_toBottomOf="parent" @@ -21,7 +21,7 @@ app:layout_constraintTop_toTopOf="parent" /> <TextView - android:id="@+id/subreddit_text_view_item_post_detail" + android:id="@+id/subreddit_text_view_item_post_detail_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -29,13 +29,13 @@ android:textSize="?attr/font_default" android:maxLines="2" android:ellipsize="end" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/user_text_view_item_post_detail_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -43,14 +43,14 @@ android:textSize="?attr/font_default" android:maxLines="2" android:ellipsize="end" - app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_video_and_gif_preview" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview" app:layout_constraintEnd_toStartOf="@id/guideline" - app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_video_and_gif_preview" app:layout_constraintHorizontal_bias="0" /> <TextView - android:id="@+id/author_flair_text_view_item_post_detail" + android:id="@+id/author_flair_text_view_item_post_detail_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -60,13 +60,13 @@ android:ellipsize="end" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_and_gif_preview" app:layout_constraintEnd_toStartOf="@id/guideline" - app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_video_and_gif_preview" app:layout_constraintHorizontal_bias="0" /> <TextView - android:id="@+id/post_time_text_view_item_post_detail" + android:id="@+id/post_time_text_view_item_post_detail_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -87,7 +87,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_item_post_detail" + android:id="@+id/title_text_view_item_post_detail_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -99,15 +99,6 @@ android:focusable="true" android:longClickable="true" /> - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/content_markdown_view_item_post_detail" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="16dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp" - android:visibility="gone" /> - <com.nex3z.flowlayout.FlowLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -117,7 +108,7 @@ app:flRowSpacing="8dp"> <com.libRG.CustomTextView - android:id="@+id/type_text_view_item_post_detail" + android:id="@+id/type_text_view_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -128,7 +119,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/spoiler_custom_text_view_item_post_detail" + android:id="@+id/spoiler_custom_text_view_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -142,7 +133,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/nsfw_text_view_item_post_detail" + android:id="@+id/nsfw_text_view_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -155,7 +146,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/flair_custom_text_view_item_post_detail" + android:id="@+id/flair_custom_text_view_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -168,87 +159,73 @@ app:lib_setShape="rectangle" /> <ImageView - android:id="@+id/archived_image_view_item_post_detail" + android:id="@+id/archived_image_view_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/locked_image_view_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/crosspost_image_view_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/awards_text_view_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" /> </com.nex3z.flowlayout.FlowLayout> - <TextView - android:id="@+id/link_text_view_item_post_detail" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="16dp" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:textSize="?attr/font_12" - android:visibility="gone"/> - <RelativeLayout - android:id="@+id/image_view_wrapper_item_post_detail" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="gone"> + android:layout_height="wrap_content"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.santalu.aspectratioimageview.AspectRatioImageView - android:id="@+id/image_view_item_post_detail" + android:id="@+id/image_view_item_post_detail_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitStart"/> <ImageView - android:id="@+id/play_button_image_view_item_post_detail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" android:layout_gravity="start" android:background="@drawable/play_button_round_background" - android:src="@drawable/ic_play_circle_36dp" - android:visibility="gone" /> + android:src="@drawable/ic_play_circle_36dp" /> </FrameLayout> <RelativeLayout - android:id="@+id/load_wrapper_item_post_detail" + android:id="@+id/load_wrapper_item_post_detail_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true"> <ProgressBar - android:id="@+id/progress_bar_item_post_detail" + android:id="@+id/progress_bar_item_post_detail_video_and_gif_preview" 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" + android:id="@+id/load_image_error_text_view_item_post_detail_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_error_outline_black_24dp" @@ -262,22 +239,13 @@ </RelativeLayout> - <ImageView - android:id="@+id/image_view_no_preview_link_item_post_detail" - 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:layout_width="match_parent" android:layout_height="wrap_content" - android:id="@+id/bottom_constraint_layout_item_post_detail"> + android:id="@+id/bottom_constraint_layout_item_post_detail_video_and_gif_preview"> <ImageView - android:id="@+id/plus_button_item_post_detail" + android:id="@+id/plus_button_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -291,7 +259,7 @@ app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/score_text_view_item_post_detail" + android:id="@+id/score_text_view_item_post_detail_video_and_gif_preview" android:layout_width="64dp" android:layout_height="wrap_content" android:gravity="center" @@ -299,10 +267,10 @@ android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail" /> + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_video_and_gif_preview" /> <ImageView - android:id="@+id/minus_button_item_post_detail" + android:id="@+id/minus_button_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -313,10 +281,10 @@ android:focusable="true" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_and_gif_preview" /> <TextView - android:id="@+id/comments_count_item_post_detail" + android:id="@+id/comments_count_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -327,10 +295,10 @@ android:drawablePadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail" /> + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_video_and_gif_preview" /> <ImageView - android:id="@+id/save_button_item_post_detail" + android:id="@+id/save_button_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -341,11 +309,11 @@ 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" - app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail" /> + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_detail_video_and_gif_preview" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_video_and_gif_preview" /> <ImageView - android:id="@+id/share_button_item_post_detail" + android:id="@+id/share_button_item_post_detail_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml new file mode 100644 index 00000000..b73fae27 --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml @@ -0,0 +1,294 @@ +<?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_video_autoplay" + 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_video_autoplay" + 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_video_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_autoplay" + 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_video_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_default" + android:maxLines="2" + android:ellipsize="end" + app:layout_constraintBottom_toTopOf="@+id/author_flair_text_view_item_post_detail_video_autoplay" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_video_autoplay" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_video_autoplay" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/author_flair_text_view_item_post_detail_video_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" + android:textSize="?attr/font_12" + 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_video_autoplay" + app:layout_constraintEnd_toStartOf="@id/guideline" + app:layout_constraintTop_toBottomOf="@+id/user_text_view_item_post_detail_video_autoplay" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/post_time_text_view_item_post_detail_video_autoplay" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:textSize="?attr/font_default" + 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_video_autoplay" + 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: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_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/video" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:text="@string/spoiler" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="4dp" + android:text="@string/nsfw" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="4dp" + android:textSize="?attr/font_12" + android:textColor="@android:color/white" + 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_video_autoplay" + 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_video_autoplay" + 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_video_autoplay" + 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_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="gone" /> + + </com.nex3z.flowlayout.FlowLayout> + + <com.google.android.exoplayer2.ui.AspectRatioFrameLayout + android:id="@+id/aspect_ratio_frame_layout_item_post_detail_video_autoplay" + android:layout_width="match_parent" + android:layout_height="0dp" + android:background="#000000" + app:resize_mode="fixed_width"> + + <com.google.android.exoplayer2.ui.PlayerView + android:id="@+id/player_view_item_post_detail_video_autoplay" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:controller_layout_id="@layout/exo_autoplay_playback_control_view"/> + + </com.google.android.exoplayer2.ui.AspectRatioFrameLayout> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/bottom_constraint_layout_item_post_detail_video_autoplay"> + + <ImageView + android:id="@+id/plus_button_item_post_detail_video_autoplay" + 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_video_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_video_autoplay" /> + + <ImageView + android:id="@+id/minus_button_item_post_detail_video_autoplay" + 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_video_autoplay" /> + + <TextView + android:id="@+id/comments_count_item_post_detail_video_autoplay" + 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: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_video_autoplay" /> + + <ImageView + android:id="@+id/save_button_item_post_detail_video_autoplay" + 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_video_autoplay" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_detail_video_autoplay" /> + + <ImageView + android:id="@+id/share_button_item_post_detail_video_autoplay" + 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_image_and_gif_autoplay_type.xml b/app/src/main/res/layout/item_post_image_and_gif_autoplay.xml index b2fdf016..e29f4287 100644 --- a/app/src/main/res/layout/item_post_image_and_gif_autoplay_type.xml +++ b/app/src/main/res/layout/item_post_image_and_gif_autoplay.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" - android:id="@+id/card_view_item_post_image_type" + android:id="@+id/card_view_item_post_image_and_gif_autoplay" app:cardBackgroundColor="?attr/cardViewBackgroundColor" app:cardElevation="2dp" app:cardCornerRadius="16dp"> @@ -21,7 +21,7 @@ android:padding="16dp"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/icon_gif_image_view_item_post_image_type" + android:id="@+id/icon_gif_image_view_item_post_image_and_gif_autoplay" android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center" @@ -30,20 +30,20 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/subreddit_name_text_view_item_post_image_type" + android:id="@+id/subreddit_name_text_view_item_post_image_and_gif_autoplay" 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" - app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_image_type" - app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_image_type" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_type" + app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_image_and_gif_autoplay" + app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_and_gif_autoplay" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/user_text_view_item_post_image_type" + android:id="@+id/user_text_view_item_post_image_and_gif_autoplay" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -52,24 +52,24 @@ android:maxLines="2" android:ellipsize="end" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_image_type" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_type" - app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_image_type" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_image_and_gif_autoplay" + app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_image_and_gif_autoplay" app:layout_constraintHorizontal_bias="0" /> <ImageView - android:id="@+id/stickied_post_image_view_item_post_image_type" + android:id="@+id/stickied_post_image_view_item_post_image_and_gif_autoplay" 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_image_type" + app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_image_and_gif_autoplay" app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_image_type" + android:id="@+id/post_time_text_view_item_post_image_and_gif_autoplay" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_image_type" + android:id="@+id/title_text_view_item_post_image_and_gif_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -105,7 +105,7 @@ app:flRowSpacing="8dp"> <com.libRG.CustomTextView - android:id="@+id/type_text_view_item_post_image_type" + android:id="@+id/type_text_view_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -115,7 +115,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/spoiler_custom_text_view_item_post_image_type" + android:id="@+id/spoiler_custom_text_view_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -128,7 +128,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/nsfw_text_view_item_post_image_type" + android:id="@+id/nsfw_text_view_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -140,7 +140,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/flair_custom_text_view_item_post_image_type" + android:id="@+id/flair_custom_text_view_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -152,7 +152,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/awards_text_view_item_post_image_type" + android:id="@+id/awards_text_view_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -163,21 +163,21 @@ app:lib_setShape="rectangle" /> <ImageView - android:id="@+id/archived_image_view_item_post_image_type" + android:id="@+id/archived_image_view_item_post_image_and_gif_autoplay" 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_image_type" + android:id="@+id/locked_image_view_item_post_image_and_gif_autoplay" 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_image_type" + android:id="@+id/crosspost_image_view_item_post_image_and_gif_autoplay" android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/crosspost" @@ -186,31 +186,31 @@ </com.nex3z.flowlayout.FlowLayout> <RelativeLayout - android:id="@+id/image_view_wrapper_item_post_image_type" android:layout_width="match_parent" android:layout_height="wrap_content"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/image_view_best_post_item" + android:id="@+id/image_view_item_post_image_and_gif_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitStart" /> <ProgressBar - android:id="@+id/progress_bar_item_post_image_type" + android:id="@+id/progress_bar_item_post_image_and_gif_autoplay" 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_image_type" + android:id="@+id/load_image_error_relative_layout_item_post_image_and_gif_autoplay" 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_image_and_gif_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_error_outline_black_24dp" @@ -224,12 +224,12 @@ </RelativeLayout> <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/bottom_constraint_layout_item_post_image_type" + android:id="@+id/bottom_constraint_layout_item_post_image_and_gif_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView - android:id="@+id/plus_button_item_post_image_type" + android:id="@+id/plus_button_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -242,7 +242,7 @@ app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/score_text_view_item_post_image_type" + android:id="@+id/score_text_view_item_post_image_and_gif_autoplay" android:layout_width="64dp" android:layout_height="wrap_content" android:gravity="center" @@ -250,10 +250,10 @@ android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_item_post_image_type" /> + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_image_and_gif_autoplay" /> <ImageView - android:id="@+id/minus_button_item_post_image_type" + android:id="@+id/minus_button_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -263,10 +263,10 @@ android:focusable="true" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_image_type" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_image_and_gif_autoplay" /> <TextView - android:id="@+id/comments_count_item_post_image_type" + android:id="@+id/comments_count_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -277,10 +277,10 @@ android:drawablePadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/minus_button_item_post_image_type" /> + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_image_and_gif_autoplay" /> <ImageView - android:id="@+id/save_button_item_post_image_type" + android:id="@+id/save_button_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -290,11 +290,11 @@ app:layout_constraintHorizontal_bias="1" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/comments_count_item_post_image_type" - app:layout_constraintEnd_toStartOf="@id/share_button_item_post_image_type" /> + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_image_and_gif_autoplay" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_image_and_gif_autoplay" /> <ImageView - android:id="@+id/share_button_item_post_image_type" + android:id="@+id/share_button_item_post_image_and_gif_autoplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" diff --git a/app/src/main/res/layout/item_post_link_type.xml b/app/src/main/res/layout/item_post_link.xml index 43f51b10..66c55908 100644 --- a/app/src/main/res/layout/item_post_link_type.xml +++ b/app/src/main/res/layout/item_post_link.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" - android:id="@+id/card_view_item_post_link_type" + android:id="@+id/card_view_item_post_link" app:cardBackgroundColor="?attr/cardViewBackgroundColor" app:cardElevation="2dp" app:cardCornerRadius="16dp"> @@ -21,7 +21,7 @@ android:padding="16dp"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/icon_gif_image_view_item_post_link_type" + android:id="@+id/icon_gif_image_view_item_post_link" android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center" @@ -30,20 +30,20 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/subreddit_name_text_view_item_post_link_type" + android:id="@+id/subreddit_name_text_view_item_post_link" 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" - app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_link_type" - app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_link_type" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link_type" + app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_link" + app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_link" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/user_text_view_item_post_link_type" + android:id="@+id/user_text_view_item_post_link" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -52,24 +52,24 @@ android:maxLines="2" android:ellipsize="end" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_link_type" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link_type" - app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_link_type" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_link" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_link" + app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_link" app:layout_constraintHorizontal_bias="0" /> <ImageView - android:id="@+id/stickied_post_image_view_item_post_link_type" + android:id="@+id/stickied_post_image_view_item_post_link" 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_link_type" + app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_link" app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_link_type" + android:id="@+id/post_time_text_view_item_post_link" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_link_type" + android:id="@+id/title_text_view_item_post_link" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -105,7 +105,7 @@ app:flRowSpacing="8dp"> <com.libRG.CustomTextView - android:id="@+id/type_text_view_item_post_link_type" + android:id="@+id/type_text_view_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -116,7 +116,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/spoiler_custom_text_view_item_post_link_type" + android:id="@+id/spoiler_custom_text_view_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -129,7 +129,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/nsfw_text_view_item_post_link_type" + android:id="@+id/nsfw_text_view_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -141,7 +141,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/flair_custom_text_view_item_post_link_type" + android:id="@+id/flair_custom_text_view_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -153,7 +153,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/awards_text_view_item_post_link_type" + android:id="@+id/awards_text_view_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -164,21 +164,21 @@ app:lib_setShape="rectangle" /> <ImageView - android:id="@+id/archived_image_view_item_post_link_type" + android:id="@+id/archived_image_view_item_post_link" 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_link_type" + android:id="@+id/locked_image_view_item_post_link" 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_link_type" + android:id="@+id/crosspost_image_view_item_post_link" android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/crosspost" @@ -187,7 +187,7 @@ </com.nex3z.flowlayout.FlowLayout> <TextView - android:id="@+id/link_text_view_item_post_link_type" + android:id="@+id/link_text_view_item_post_link" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" @@ -197,31 +197,31 @@ android:visibility="gone" /> <RelativeLayout - android:id="@+id/image_view_wrapper_item_post_link_type" android:layout_width="match_parent" android:layout_height="wrap_content"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/image_view_best_post_item" + android:id="@+id/image_view_item_post_link" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitStart" /> <ProgressBar - android:id="@+id/progress_bar_item_post_link_type" + android:id="@+id/progress_bar_item_post_link" 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_link_type" + android:id="@+id/load_image_error_relative_layout_item_post_link" 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_link" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_error_outline_black_24dp" @@ -235,12 +235,12 @@ </RelativeLayout> <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/bottom_constraint_layout_item_post_link_type" + android:id="@+id/bottom_constraint_layout_item_post_link" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView - android:id="@+id/plus_button_item_post_link_type" + android:id="@+id/plus_button_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -253,7 +253,7 @@ app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/score_text_view_item_post_link_type" + android:id="@+id/score_text_view_item_post_link" android:layout_width="64dp" android:layout_height="wrap_content" android:gravity="center" @@ -261,10 +261,10 @@ android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_item_post_link_type" /> + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_link" /> <ImageView - android:id="@+id/minus_button_item_post_link_type" + android:id="@+id/minus_button_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -274,10 +274,10 @@ android:focusable="true" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_link_type" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_link" /> <TextView - android:id="@+id/comments_count_item_post_link_type" + android:id="@+id/comments_count_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -288,10 +288,10 @@ android:drawablePadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/minus_button_item_post_link_type" /> + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_link" /> <ImageView - android:id="@+id/save_button_item_post_link_type" + android:id="@+id/save_button_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -301,11 +301,11 @@ app:layout_constraintHorizontal_bias="1" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/comments_count_item_post_link_type" - app:layout_constraintEnd_toStartOf="@id/share_button_item_post_link_type" /> + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_link" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_link" /> <ImageView - android:id="@+id/share_button_item_post_link_type" + android:id="@+id/share_button_item_post_link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" diff --git a/app/src/main/res/layout/item_post_no_preview_link_type.xml b/app/src/main/res/layout/item_post_no_preview_link.xml index a6ef9eeb..bf1ba331 100644 --- a/app/src/main/res/layout/item_post_no_preview_link_type.xml +++ b/app/src/main/res/layout/item_post_no_preview_link.xml @@ -69,7 +69,7 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_no_preview_link_type" + android:id="@+id/post_time_text_view_item_post_no_preview_link_type" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_no_preview_link_type" + android:id="@+id/title_text_view_item_post_no_preview_link_type" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" diff --git a/app/src/main/res/layout/item_post_text_type.xml b/app/src/main/res/layout/item_post_text.xml index cc7a3bb9..39ea56f4 100644 --- a/app/src/main/res/layout/item_post_text_type.xml +++ b/app/src/main/res/layout/item_post_text.xml @@ -69,7 +69,7 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_text_type" + android:id="@+id/post_time_text_view_item_post_text_type" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_text_type" + android:id="@+id/title_text_view_item_post_text_type" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" diff --git a/app/src/main/res/layout/item_post_video_and_gif_preview_type.xml b/app/src/main/res/layout/item_post_video_and_gif_preview.xml index c3549df4..ad2e3b9d 100644 --- a/app/src/main/res/layout/item_post_video_and_gif_preview_type.xml +++ b/app/src/main/res/layout/item_post_video_and_gif_preview.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" - android:id="@+id/card_view_item_post_gif_type_autoplay" + android:id="@+id/card_view_item_post_video_and_gif_preview" app:cardBackgroundColor="?attr/cardViewBackgroundColor" app:cardElevation="2dp" app:cardCornerRadius="16dp"> @@ -21,7 +21,7 @@ android:padding="16dp"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/icon_gif_image_view_item_post_gif_type_autoplay" + android:id="@+id/icon_gif_image_view_item_post_video_and_gif_preview" android:layout_width="24dp" android:layout_height="24dp" android:layout_gravity="center" @@ -30,20 +30,20 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/subreddit_name_text_view_item_post_gif_type_autoplay" + android:id="@+id/subreddit_name_text_view_item_post_video_and_gif_preview" 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" - app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_gif_type_autoplay" - app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_gif_type_autoplay" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gif_type_autoplay" + app:layout_constraintBottom_toTopOf="@id/user_text_view_item_post_video_and_gif_preview" + app:layout_constraintStart_toEndOf="@id/icon_gif_image_view_item_post_video_and_gif_preview" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_video_and_gif_preview" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/user_text_view_item_post_gif_type_autoplay" + android:id="@+id/user_text_view_item_post_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" @@ -52,24 +52,24 @@ android:maxLines="2" android:ellipsize="end" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_gif_type_autoplay" - app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_gif_type_autoplay" - app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_gif_type_autoplay" + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_video_and_gif_preview" + app:layout_constraintEnd_toStartOf="@id/stickied_post_image_view_item_post_video_and_gif_preview" + app:layout_constraintTop_toBottomOf="@+id/subreddit_name_text_view_item_post_video_and_gif_preview" app:layout_constraintHorizontal_bias="0" /> <ImageView - android:id="@+id/stickied_post_image_view_item_post_gif_type_autoplay" + android:id="@+id/stickied_post_image_view_item_post_video_and_gif_preview" 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_gif_type_autoplay" + app:layout_constraintStart_toEndOf="@id/subreddit_name_text_view_item_post_video_and_gif_preview" app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_gif_type_autoplay" + android:id="@+id/post_time_text_view_item_post_video_and_gif_preview" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_gif_type_autoplay" + android:id="@+id/title_text_view_item_post_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -105,7 +105,7 @@ app:flRowSpacing="8dp"> <com.libRG.CustomTextView - android:id="@+id/type_text_view_item_post_gif_type_autoplay" + android:id="@+id/type_text_view_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -116,7 +116,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/spoiler_custom_text_view_item_post_gif_type_autoplay" + android:id="@+id/spoiler_custom_text_view_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -129,7 +129,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/nsfw_text_view_item_post_gif_type_autoplay" + android:id="@+id/nsfw_text_view_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -141,7 +141,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/flair_custom_text_view_item_post_gif_type_autoplay" + android:id="@+id/flair_custom_text_view_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" @@ -153,7 +153,7 @@ app:lib_setShape="rectangle" /> <com.libRG.CustomTextView - android:id="@+id/awards_text_view_item_post_gif_type_autoplay" + android:id="@+id/awards_text_view_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="4dp" @@ -164,21 +164,21 @@ app:lib_setShape="rectangle" /> <ImageView - android:id="@+id/archived_image_view_item_post_gif_type_autoplay" + android:id="@+id/archived_image_view_item_post_video_and_gif_preview" 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_gif_type_autoplay" + android:id="@+id/locked_image_view_item_post_video_and_gif_preview" 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_gif_type_autoplay" + android:id="@+id/crosspost_image_view_item_post_video_and_gif_preview" android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/crosspost" @@ -187,7 +187,6 @@ </com.nex3z.flowlayout.FlowLayout> <RelativeLayout - android:id="@+id/image_view_wrapper_item_post_gif_type_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content"> @@ -196,7 +195,7 @@ android:layout_height="wrap_content"> <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView - android:id="@+id/image_view_item_post_gif_type_autoplay" + android:id="@+id/image_view_item_post_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" @@ -213,19 +212,20 @@ </FrameLayout> <ProgressBar - android:id="@+id/progress_bar_item_post_gif_type_autoplay" + android:id="@+id/progress_bar_item_post_video_and_gif_preview" 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_gif_type_autoplay" + android:id="@+id/load_image_error_relative_layout_item_post_video_and_gif_preview" 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_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableTop="@drawable/ic_error_outline_black_24dp" @@ -239,12 +239,12 @@ </RelativeLayout> <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/bottom_constraint_layout_item_post_gif_type_autoplay" + android:id="@+id/bottom_constraint_layout_item_post_video_and_gif_preview" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView - android:id="@+id/plus_button_item_post_gif_type_autoplay" + android:id="@+id/plus_button_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -257,7 +257,7 @@ app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/score_text_view_item_post_gif_type_autoplay" + android:id="@+id/score_text_view_item_post_video_and_gif_preview" android:layout_width="64dp" android:layout_height="wrap_content" android:gravity="center" @@ -265,10 +265,10 @@ android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_item_post_gif_type_autoplay" /> + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_video_and_gif_preview" /> <ImageView - android:id="@+id/minus_button_item_post_gif_type_autoplay" + android:id="@+id/minus_button_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -278,10 +278,10 @@ android:focusable="true" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_gif_type_autoplay" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_and_gif_preview" /> <TextView - android:id="@+id/comments_count_item_post_gif_type_autoplay" + android:id="@+id/comments_count_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -292,10 +292,10 @@ android:drawablePadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/minus_button_item_post_gif_type_autoplay" /> + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_video_and_gif_preview" /> <ImageView - android:id="@+id/save_button_item_post_gif_type_autoplay" + android:id="@+id/save_button_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" @@ -305,11 +305,11 @@ app:layout_constraintHorizontal_bias="1" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/comments_count_item_post_gif_type_autoplay" - app:layout_constraintEnd_toStartOf="@id/share_button_item_post_gif_type_autoplay" /> + app:layout_constraintStart_toEndOf="@id/comments_count_item_post_video_and_gif_preview" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_video_and_gif_preview" /> <ImageView - android:id="@+id/share_button_item_post_gif_type_autoplay" + android:id="@+id/share_button_item_post_video_and_gif_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="12dp" diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml index 138090d8..bfbc7456 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml @@ -69,7 +69,7 @@ app:layout_constraintTop_toTopOf="parent"/> <TextView - android:id="@+id/post_time_text_view_best_item_post_video_type_autoplay" + android:id="@+id/post_time_text_view_item_post_video_type_autoplay" android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="end" @@ -89,7 +89,7 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/title_text_view_best_item_post_video_type_autoplay" + android:id="@+id/title_text_view_item_post_video_type_autoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" @@ -187,7 +187,7 @@ </com.nex3z.flowlayout.FlowLayout> <com.google.android.exoplayer2.ui.AspectRatioFrameLayout - android:id="@+id/aspect" + android:id="@+id/aspect_ratio_frame_layout_item_post_video_type_autoplay" android:layout_width="match_parent" android:layout_height="0dp" android:background="#000000" diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index b415b0f5..5fce9e21 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -122,4 +122,22 @@ <item>XLarge</item> <item>XXLarge</item> </string-array> + + <string-array name="settings_tab_post_type"> + <item>Home</item> + <item>Popular</item> + <item>All</item> + <item>Subreddit</item> + <item>MultiReddit</item> + <item>User</item> + </string-array> + + <string-array name="settings_tab_post_type_values"> + <item>0</item> + <item>1</item> + <item>2</item> + <item>3</item> + <item>4</item> + <item>5</item> + </string-array> </resources>
\ 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 c12d7105..b44a5157 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -321,6 +321,8 @@ <string name="settings_immersive_interface_title">Immersive Interface</string> <string name="settings_immersive_interface_ignore_nav_bar_title">Ignore Navigation Bar in Immersive Interface</string> <string name="settings_immersive_interface_ignore_nav_bar_summary">Prevent the Bottom Navigation Bar Having Extra Padding</string> + <string name="settings_customize_tabs_in_main_page_title">Customize Tabs in Main Page</string> + <string name="settings_customize_tabs_in_main_page_summary">Only for Logged-in User</string> <string name="settings_enable_bottom_app_bar_title">Enable Bottom Navigation</string> <string name="settings_enable_bottom_app_bar_summary">Has No Effect in Anonymous Mode</string> <string name="settings_vote_buttons_on_the_right_title">Vote Buttons on the Right</string> @@ -336,6 +338,7 @@ <string name="settings_show_elapsed_time">Show Elapsed Time in Posts and Comments</string> <string name="settings_default_post_layout">Default Post Layout</string> <string name="settings_show_divider_in_compact_layout">Show Divider in Compact Layout</string> + <string name="settings_swap_tap_and_long_title">Swap Tap and Long Press in Comments</string> <string name="settings_swipe_to_go_back_from_post_detail_title">Swipe Right to Go Back From Comments</string> <string name="settings_lock_jump_to_next_top_level_comment_button_title">Lock Jump to Next Top-level Comment Button</string> <string name="settings_lock_bottom_app_bar_title">Lock Bottom Navigation Bar</string> @@ -392,6 +395,15 @@ <string name="settings_delete_all_themes_in_database_title">Delete All Themes in Database</string> <string name="settings_reset_all_settings_title">Reset All Settings</string> <string name="settings_advanced_settings_summary">Clean the database and shared preferences</string> + <string name="settings_tab_info">Restart the app to see the changes</string> + <string name="settings_tab_1_summary">Tab 1</string> + <string name="settings_tab_2_summary">Tab 2</string> + <string name="settings_tab_3_summary">Tab 3</string> + <string name="settings_tab_title">Title</string> + <string name="settings_tab_post_type">Type</string> + <string name="settings_tab_subreddit_name">Subreddit Name (Without r/ prefix)</string> + <string name="settings_tab_multi_reddit_name">MultiReddit Name (/user/yourusername/m/yourmultiredditname)</string> + <string name="settings_tab_username">Username (Without u/ prefix)</string> <string name="no_link_available">Cannot get the link</string> @@ -710,10 +722,13 @@ <string name="report_successful">Reported</string> <string name="report_failed">Report failed</string> <string name="report_reason_not_selected">You haven\'t selected a reason</string> - + <string name="report_reason_general_spam">It Is Spam</string> <string name="report_reason_general_copyright_issue">It Contains Copyright Issue</string> <string name="report_reason_general_child_pornography">It Contains Child Pornography</string> <string name="report_reason_general_abusive_content">It Contains Abusive Content</string> + <string name="home">Home</string> + <string name="popular">Popular</string> + </resources> diff --git a/app/src/main/res/xml/customize_main_page_tabs_preferences.xml b/app/src/main/res/xml/customize_main_page_tabs_preferences.xml new file mode 100644 index 00000000..37e17d0c --- /dev/null +++ b/app/src/main/res/xml/customize_main_page_tabs_preferences.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <Preference + android:icon="@drawable/ic_info_preference_24dp" + app:summary="@string/settings_tab_info" + app:enabled="false" /> + + <PreferenceCategory + app:title="@string/settings_tab_1_summary" /> + + <EditTextPreference + app:defaultValue="@string/home" + app:key="main_page_tab_1_title" + app:title="@string/settings_tab_title" + app:useSimpleSummaryProvider="true" /> + + <ListPreference + app:defaultValue="0" + android:entries="@array/settings_tab_post_type" + app:entryValues="@array/settings_tab_post_type_values" + app:key="main_page_tab_1_post_type" + app:title="@string/settings_tab_post_type" + app:useSimpleSummaryProvider="true" /> + + <EditTextPreference + app:key="main_page_tab_1_name" + app:isPreferenceVisible="false" + app:useSimpleSummaryProvider="true" /> + + <PreferenceCategory + app:title="@string/settings_tab_2_summary" /> + + <EditTextPreference + app:defaultValue="@string/popular" + app:key="main_page_tab_2_title" + app:title="@string/settings_tab_title" + app:useSimpleSummaryProvider="true" /> + + <ListPreference + app:defaultValue="1" + android:entries="@array/settings_tab_post_type" + app:entryValues="@array/settings_tab_post_type_values" + app:key="main_page_tab_2_post_type" + app:title="@string/settings_tab_post_type" + app:useSimpleSummaryProvider="true" /> + + <EditTextPreference + app:key="main_page_tab_2_name" + app:isPreferenceVisible="false" + app:useSimpleSummaryProvider="true" /> + + <PreferenceCategory + app:title="@string/settings_tab_3_summary" /> + + <EditTextPreference + app:defaultValue="@string/all" + app:key="main_page_tab_3_title" + app:title="@string/settings_tab_title" + app:useSimpleSummaryProvider="true" /> + + <ListPreference + app:defaultValue="2" + android:entries="@array/settings_tab_post_type" + app:entryValues="@array/settings_tab_post_type_values" + app:key="main_page_tab_3_post_type" + app:title="@string/settings_tab_post_type" + app:useSimpleSummaryProvider="true" /> + + <EditTextPreference + app:key="main_page_tab_3_name" + app:isPreferenceVisible="false" + app:useSimpleSummaryProvider="true" /> + +</PreferenceScreen>
\ No newline at end of file diff --git a/app/src/main/res/xml/gestures_and_buttons_preference.xml b/app/src/main/res/xml/gestures_and_buttons_preference.xml index 4d111187..8cd307e0 100644 --- a/app/src/main/res/xml/gestures_and_buttons_preference.xml +++ b/app/src/main/res/xml/gestures_and_buttons_preference.xml @@ -33,4 +33,9 @@ app:key="volume_keys_navigate_posts" app:title="@string/settings_volume_keys_navigate_posts_title" /> + <SwitchPreference + app:defaultValue="false" + app:key="swap_tap_and_long_in_comments" + app:title="@string/settings_swap_tap_and_long_title" /> + </PreferenceScreen>
\ No newline at end of file diff --git a/app/src/main/res/xml/interface_preference.xml b/app/src/main/res/xml/interface_preference.xml index 8b67a3bc..58de9ef4 100644 --- a/app/src/main/res/xml/interface_preference.xml +++ b/app/src/main/res/xml/interface_preference.xml @@ -20,6 +20,11 @@ app:summary="@string/settings_immersive_interface_ignore_nav_bar_summary" app:isPreferenceVisible="false" /> + <Preference + app:title="@string/settings_customize_tabs_in_main_page_title" + app:summary="@string/settings_customize_tabs_in_main_page_summary" + app:fragment="ml.docilealligator.infinityforreddit.Settings.CustomizeMainPageTabsFragment" /> + <SwitchPreference app:defaultValue="false" app:key="bottom_app_bar" |