mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Padding on checkboxes is broken on Android < 4.2.
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.logging.Logger;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.briarproject.R;
|
import org.briarproject.R;
|
||||||
|
import org.briarproject.android.util.FixedVerticalSpace;
|
||||||
import org.briarproject.android.util.HorizontalBorder;
|
import org.briarproject.android.util.HorizontalBorder;
|
||||||
import org.briarproject.android.util.LayoutUtils;
|
import org.briarproject.android.util.LayoutUtils;
|
||||||
import org.briarproject.android.util.ListLoadingProgressBar;
|
import org.briarproject.android.util.ListLoadingProgressBar;
|
||||||
@@ -109,33 +110,37 @@ OnClickListener {
|
|||||||
underline.setBackgroundColor(titleUnderline);
|
underline.setBackgroundColor(titleUnderline);
|
||||||
settings.addView(underline);
|
settings.addView(underline);
|
||||||
|
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
|
|
||||||
notifyPrivateMessages = new CheckBox(this);
|
notifyPrivateMessages = new CheckBox(this);
|
||||||
notifyPrivateMessages.setPadding(0, pad, 0, pad);
|
|
||||||
notifyPrivateMessages.setTextSize(18);
|
notifyPrivateMessages.setTextSize(18);
|
||||||
notifyPrivateMessages.setText(R.string.notify_private_messages_setting);
|
notifyPrivateMessages.setText(R.string.notify_private_messages_setting);
|
||||||
notifyPrivateMessages.setChecked(true);
|
notifyPrivateMessages.setChecked(true);
|
||||||
notifyPrivateMessages.setOnClickListener(this);
|
notifyPrivateMessages.setOnClickListener(this);
|
||||||
settings.addView(notifyPrivateMessages);
|
settings.addView(notifyPrivateMessages);
|
||||||
|
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
settings.addView(new HorizontalBorder(this));
|
settings.addView(new HorizontalBorder(this));
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
|
|
||||||
notifyGroupPosts = new CheckBox(this);
|
notifyGroupPosts = new CheckBox(this);
|
||||||
notifyGroupPosts.setPadding(0, pad, 0, pad);
|
|
||||||
notifyGroupPosts.setTextSize(18);
|
notifyGroupPosts.setTextSize(18);
|
||||||
notifyGroupPosts.setText(R.string.notify_group_posts_setting);
|
notifyGroupPosts.setText(R.string.notify_group_posts_setting);
|
||||||
notifyGroupPosts.setChecked(true);
|
notifyGroupPosts.setChecked(true);
|
||||||
notifyGroupPosts.setOnClickListener(this);
|
notifyGroupPosts.setOnClickListener(this);
|
||||||
settings.addView(notifyGroupPosts);
|
settings.addView(notifyGroupPosts);
|
||||||
|
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
settings.addView(new HorizontalBorder(this));
|
settings.addView(new HorizontalBorder(this));
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
|
|
||||||
notifyVibration = new CheckBox(this);
|
notifyVibration = new CheckBox(this);
|
||||||
notifyVibration.setPadding(0, pad, 0, pad);
|
|
||||||
notifyVibration.setTextSize(18);
|
notifyVibration.setTextSize(18);
|
||||||
notifyVibration.setText(R.string.notify_vibration_setting);
|
notifyVibration.setText(R.string.notify_vibration_setting);
|
||||||
notifyVibration.setOnClickListener(this);
|
notifyVibration.setOnClickListener(this);
|
||||||
settings.addView(notifyVibration);
|
settings.addView(notifyVibration);
|
||||||
|
|
||||||
|
settings.addView(new FixedVerticalSpace(this));
|
||||||
settings.addView(new HorizontalBorder(this));
|
settings.addView(new HorizontalBorder(this));
|
||||||
|
|
||||||
notifySound = new TextView(this);
|
notifySound = new TextView(this);
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package org.briarproject.android.util;
|
|
||||||
|
|
||||||
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup.LayoutParams;
|
|
||||||
|
|
||||||
public class FixedHorizontalSpace extends View {
|
|
||||||
|
|
||||||
public FixedHorizontalSpace(Context ctx) {
|
|
||||||
super(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWidth(int width) {
|
|
||||||
setLayoutParams(new LayoutParams(width, WRAP_CONTENT));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.briarproject.android.util;
|
package org.briarproject.android.util;
|
||||||
|
|
||||||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup.LayoutParams;
|
import android.view.ViewGroup.LayoutParams;
|
||||||
@@ -9,7 +9,10 @@ public class FixedVerticalSpace extends View {
|
|||||||
|
|
||||||
public FixedVerticalSpace(Context ctx) {
|
public FixedVerticalSpace(Context ctx) {
|
||||||
super(ctx);
|
super(ctx);
|
||||||
int height = LayoutUtils.getPadding(ctx);
|
setHeight(LayoutUtils.getPadding(ctx));
|
||||||
setLayoutParams(new LayoutParams(MATCH_PARENT, height));
|
}
|
||||||
|
|
||||||
|
public void setHeight(int height) {
|
||||||
|
setLayoutParams(new LayoutParams(WRAP_CONTENT, height));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user