refactor(PreviewlessMedia): move margin value to layout file

This commit is contained in:
LucasGGamerM 2023-09-17 09:26:33 -03:00
parent f69ae5e816
commit 5cda112129
2 changed files with 3 additions and 4 deletions

View File

@ -73,10 +73,9 @@ public class PreviewlessMediaGridStatusDisplayItem extends StatusDisplayItem{
super(new FrameLayoutThatOnlyMeasuresFirstChild(activity)); super(new FrameLayoutThatOnlyMeasuresFirstChild(activity));
wrapper=(FrameLayout)itemView; wrapper=(FrameLayout)itemView;
layout= new LinearLayout(activity); layout= new LinearLayout(activity);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.setMargins(V.dp(16), 0, V.dp(16), 0);
layout.setLayoutParams(params);
layout.setOrientation(LinearLayout.VERTICAL); layout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layout.setLayoutParams(params);
wrapper.addView(layout); wrapper.addView(layout);
wrapper.setClipToPadding(false); wrapper.setClipToPadding(false);

View File

@ -3,12 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginHorizontal="16dp"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<org.joinmastodon.android.ui.views.MaxWidthFrameLayout <org.joinmastodon.android.ui.views.MaxWidthFrameLayout
android:id="@+id/inner" android:id="@+id/inner"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:layout_marginHorizontal="16dp"
android:background="@drawable/bg_search_field" android:background="@drawable/bg_search_field"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"