summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortom79 <tschneider.ac@gmail.com>2019-05-07 18:10:49 +0200
committertom79 <tschneider.ac@gmail.com>2019-05-07 18:10:49 +0200
commite1228f15c8b09f4d0353e5dc2a8eb91ed6f1a88e (patch)
tree848bd43480a900727744ffef9159aa61f68d90b8
parentec28de29ec5030d343c3a12c0cacdd2f2780ce8d (diff)
Fix for not cropped media
-rw-r--r--app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java21
-rw-r--r--app/src/main/res/layout/drawer_status.xml8
-rw-r--r--app/src/main/res/layout/drawer_status_compact.xml10
-rw-r--r--app/src/main/res/layout/drawer_status_console.xml10
-rw-r--r--app/src/main/res/layout/drawer_status_focused.xml10
5 files changed, 32 insertions, 27 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java
index b9fd5f11e..a8fac668e 100644
--- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java
@@ -1536,11 +1536,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_content_container.setVisibility(View.VISIBLE);
}
}
- if( fullAttachement) {
- RelativeLayout.LayoutParams rel_btn = new RelativeLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
- holder.status_show_more.setLayoutParams(rel_btn);
- }
if (status.getReblog() == null) {
if (status.getMedia_attachments().size() < 1) {
@@ -2737,7 +2732,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
List<Attachment> attachments = status.getMedia_attachments();
-
+ if( !blur)
+ holder.status_show_more.setVisibility(View.GONE);
+ else
+ holder.status_show_more.setVisibility(View.VISIBLE);
if( attachments != null && attachments.size() > 0){
int i = 0;
holder.horizontal_second_image.setVisibility(View.VISIBLE);
@@ -2935,7 +2933,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
.asBitmap()
.load(url)
.thumbnail(0.1f)
- .apply(new RequestOptions().transforms(new BlurTransformation(80), new RoundedCorners(10)))
+ .apply(new RequestOptions().transforms(new BlurTransformation(50,3), new RoundedCorners(10)))
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
@@ -2967,7 +2965,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Glide.with(imageView.getContext())
.load(url)
.thumbnail(0.1f)
- .apply(new RequestOptions().transforms(new BlurTransformation(80), new RoundedCorners(10)))
+ .apply(new RequestOptions().transforms(new BlurTransformation(50,3), new RoundedCorners(10)))
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
@@ -3004,11 +3002,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
position++;
}
}else{
- holder.status_horizontal_document_container.setVisibility(View.GONE);
- holder.status_document_container.setVisibility(View.GONE);
+ holder.status_horizontal_document_container.setVisibility(View.GONE);
+ holder.status_document_container.setVisibility(View.GONE);
+ holder.status_show_more.setVisibility(View.GONE);
}
- holder.status_show_more.setVisibility(View.GONE);
-
}
diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml
index e8b4ef827..bcab804b9 100644
--- a/app/src/main/res/layout/drawer_status.xml
+++ b/app/src/main/res/layout/drawer_status.xml
@@ -672,12 +672,14 @@
android:visibility="gone"
android:id="@+id/status_show_more"
android:layout_width="match_parent"
- android:layout_height="200dp"
+ android:layout_height="match_parent"
android:layout_centerInParent="true">
<TextView
+ android:textSize="20sp"
+ android:gravity="center"
android:id="@+id/show_more_content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</RelativeLayout>
</RelativeLayout>
diff --git a/app/src/main/res/layout/drawer_status_compact.xml b/app/src/main/res/layout/drawer_status_compact.xml
index 02ef82aba..12e4c262c 100644
--- a/app/src/main/res/layout/drawer_status_compact.xml
+++ b/app/src/main/res/layout/drawer_status_compact.xml
@@ -633,12 +633,14 @@
android:visibility="gone"
android:id="@+id/status_show_more"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center">
+ android:layout_height="match_parent"
+ android:layout_centerInParent="true">
<TextView
+ android:textSize="20sp"
+ android:gravity="center"
android:id="@+id/show_more_content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
diff --git a/app/src/main/res/layout/drawer_status_console.xml b/app/src/main/res/layout/drawer_status_console.xml
index 1fcde7137..2315e8dc6 100644
--- a/app/src/main/res/layout/drawer_status_console.xml
+++ b/app/src/main/res/layout/drawer_status_console.xml
@@ -633,12 +633,14 @@
android:visibility="gone"
android:id="@+id/status_show_more"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center">
+ android:layout_height="match_parent"
+ android:layout_centerInParent="true">
<TextView
+ android:textSize="20sp"
+ android:gravity="center"
android:id="@+id/show_more_content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
diff --git a/app/src/main/res/layout/drawer_status_focused.xml b/app/src/main/res/layout/drawer_status_focused.xml
index 4ec05bbe1..95ffcbc5f 100644
--- a/app/src/main/res/layout/drawer_status_focused.xml
+++ b/app/src/main/res/layout/drawer_status_focused.xml
@@ -557,12 +557,14 @@
android:visibility="gone"
android:id="@+id/status_show_more"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center">
+ android:layout_height="match_parent"
+ android:layout_centerInParent="true">
<TextView
+ android:textSize="20sp"
+ android:gravity="center"
android:id="@+id/show_more_content"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>