mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 14:18:26 +00:00
parent
39ac2b5042
commit
b1f336c874
@ -11,11 +11,21 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/color_grid"
|
android:layout_width="match_parent"
|
||||||
android:padding="16dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center">
|
||||||
app:orientation="horizontal"
|
|
||||||
app:columnCount="5"/>
|
<android.support.v7.widget.GridLayout
|
||||||
|
android:id="@+id/color_grid"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
app:orientation="horizontal"
|
||||||
|
app:columnCount="5"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
@ -223,31 +223,31 @@ public class ColorPreference extends Preference {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sizeDialog() {
|
private void sizeDialog() {
|
||||||
if (mPreference == null || mColorGrid == null) {
|
// if (mPreference == null || mColorGrid == null) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Dialog dialog = getDialog();
|
// Dialog dialog = getDialog();
|
||||||
if (dialog == null) {
|
// if (dialog == null) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
final Resources res = mColorGrid.getContext().getResources();
|
// final Resources res = mColorGrid.getContext().getResources();
|
||||||
DisplayMetrics dm = res.getDisplayMetrics();
|
// DisplayMetrics dm = res.getDisplayMetrics();
|
||||||
|
//
|
||||||
// Can't use Integer.MAX_VALUE here (weird issue observed otherwise on 4.2)
|
// // Can't use Integer.MAX_VALUE here (weird issue observed otherwise on 4.2)
|
||||||
mColorGrid.measure(
|
// mColorGrid.measure(
|
||||||
View.MeasureSpec.makeMeasureSpec(dm.widthPixels, View.MeasureSpec.AT_MOST),
|
// View.MeasureSpec.makeMeasureSpec(dm.widthPixels, View.MeasureSpec.AT_MOST),
|
||||||
View.MeasureSpec.makeMeasureSpec(dm.heightPixels, View.MeasureSpec.AT_MOST));
|
// View.MeasureSpec.makeMeasureSpec(dm.heightPixels, View.MeasureSpec.AT_MOST));
|
||||||
int width = mColorGrid.getMeasuredWidth();
|
// int width = mColorGrid.getMeasuredWidth();
|
||||||
int height = mColorGrid.getMeasuredHeight();
|
// int height = mColorGrid.getMeasuredHeight();
|
||||||
|
//
|
||||||
int extraPadding = res.getDimensionPixelSize(R.dimen.color_grid_extra_padding);
|
// int extraPadding = res.getDimensionPixelSize(R.dimen.color_grid_extra_padding);
|
||||||
|
//
|
||||||
width += extraPadding;
|
// width += extraPadding;
|
||||||
height += extraPadding;
|
// height += extraPadding;
|
||||||
|
//
|
||||||
dialog.getWindow().setLayout(width, height);
|
// dialog.getWindow().setLayout(width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user