aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-10-28 15:18:01 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-10-28 15:18:01 +0000
commit6e5a0e7ef37ab148123a2fed2e50f84978e1f45a (patch)
treef7f65bb2ecf8e0ec7520d8846b003faaa5fa02ef /app/src/main/res/layout
parent66402e661be86823cb11bc544cd0af482c3ec8ad (diff)
downloadinfinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar.gz
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar.bz2
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar.lz
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar.xz
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.tar.zst
infinity-for-reddit-6e5a0e7ef37ab148123a2fed2e50f84978e1f45a.zip
Use AspectRatiotImageView instead of ImageView to fully display the preview images of posts and prevent scrolling jump in PostFragment and ViewPostDetailActivity.
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/activity_view_post_detail.xml6
-rw-r--r--app/src/main/res/layout/item_post.xml9
2 files changed, 9 insertions, 6 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 b9c13bcb..6f6bac2a 100644
--- a/app/src/main/res/layout/activity_view_post_detail.xml
+++ b/app/src/main/res/layout/activity_view_post_detail.xml
@@ -100,6 +100,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_centerVertical="true"
+ android:textSize="12sp"
android:background="@drawable/rounded_corner"
android:textColor="@android:color/white" />
@@ -156,7 +157,7 @@
android:layout_marginTop="16dp"
android:visibility="gone">
- <ImageView
+ <com.santalu.aspectratioimageview.AspectRatioImageView
android:id="@+id/image_view_view_post_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -166,7 +167,8 @@
<RelativeLayout
android:id="@+id/load_wrapper_view_post_detail"
android:layout_width="match_parent"
- android:layout_height="100dp">
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true">
<ProgressBar
android:id="@+id/progress_bar_view_post_detail"
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index 5ed9444c..cd200590 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -83,6 +83,7 @@
android:background="@drawable/rounded_corner"
android:layout_marginEnd="8dp"
android:layout_centerVertical="true"
+ android:textSize="12sp"
android:textColor="@android:color/white"/>
<ImageView
@@ -136,7 +137,7 @@
<RelativeLayout
android:id="@+id/image_view_wrapper_item_best_post"
android:layout_width="match_parent"
- android:layout_height="350dp"
+ android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone">
@@ -146,11 +147,11 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
- <ImageView
+ <com.santalu.aspectratioimageview.AspectRatioImageView
android:id="@+id/image_view_best_post_item"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop" />
+ android:layout_height="wrap_content"
+ android:scaleType="fitStart" />
<LinearLayout
android:id="@+id/load_image_error_linear_layout_best_post_item"