diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/views/MaxWidthFrameLayout.java b/mastodon/src/main/java/org/joinmastodon/android/ui/views/MaxWidthFrameLayout.java index 364f030f1..5625037c1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/views/MaxWidthFrameLayout.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/views/MaxWidthFrameLayout.java @@ -3,12 +3,13 @@ package org.joinmastodon.android.ui.views; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; +import android.view.ViewGroup; import android.widget.FrameLayout; import org.joinmastodon.android.R; public class MaxWidthFrameLayout extends FrameLayout{ - private int maxWidth; + private int maxWidth, defaultWidth; public MaxWidthFrameLayout(Context context){ this(context, null); @@ -22,6 +23,7 @@ public class MaxWidthFrameLayout extends FrameLayout{ super(context, attrs, defStyle); TypedArray ta=context.obtainStyledAttributes(attrs, R.styleable.MaxWidthFrameLayout); maxWidth=ta.getDimensionPixelSize(R.styleable.MaxWidthFrameLayout_android_maxWidth, Integer.MAX_VALUE); + defaultWidth=ta.getDimensionPixelSize(R.styleable.MaxWidthFrameLayout_defaultWidth, -1); ta.recycle(); } @@ -33,10 +35,19 @@ public class MaxWidthFrameLayout extends FrameLayout{ this.maxWidth=maxWidth; } + public int getDefaultWidth() { + return defaultWidth; + } + + public void setDefaultWidth(int defaultWidth) { + this.defaultWidth = defaultWidth; + } + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){ if(MeasureSpec.getSize(widthMeasureSpec)>maxWidth){ - widthMeasureSpec=maxWidth | MeasureSpec.getMode(widthMeasureSpec); + int width = defaultWidth >= 0 ? defaultWidth : maxWidth; + widthMeasureSpec=width | MeasureSpec.getMode(widthMeasureSpec); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } diff --git a/mastodon/src/main/res/layout/display_item_footer.xml b/mastodon/src/main/res/layout/display_item_footer.xml index 99896e58f..23e7edef0 100644 --- a/mastodon/src/main/res/layout/display_item_footer.xml +++ b/mastodon/src/main/res/layout/display_item_footer.xml @@ -1,120 +1,127 @@ - + android:layout_height="wrap_content"> + - - - + android:minWidth="56dp"> + + - + - - - + android:minWidth="56dp"> + + - + - - - + android:minWidth="56dp"> + + - + - - - + android:minWidth="56dp"> + + - + - - - + android:layout_height="match_parent"> + + - \ No newline at end of file + + \ No newline at end of file diff --git a/mastodon/src/main/res/values/attrs.xml b/mastodon/src/main/res/values/attrs.xml index 5755462c2..86ffa2122 100644 --- a/mastodon/src/main/res/values/attrs.xml +++ b/mastodon/src/main/res/values/attrs.xml @@ -73,6 +73,7 @@ +