Minor layout changes: padding and text size.

This commit is contained in:
akwizgran
2013-03-11 12:33:09 +00:00
parent 19a6178b54
commit aa4f1cdfdd
17 changed files with 76 additions and 45 deletions

View File

@@ -14,7 +14,7 @@
<string name="contact_last_connected">Last connected &lt;br /&gt; %1$s</string>
<string name="search_button">Search</string>
<string name="add_contact_title">Add a Contact</string>
<string name="same_network">Briar can add contacts via Wi-Fi or Bluetooth. For security reasons, you must be face-to-face to add someone as a contact. To use Wi-Fi you must both be connected to the same network.</string>
<string name="same_network">Briar can add contacts via Wi-Fi or Bluetooth. To use Wi-Fi you must both be connected to the same network.</string>
<string name="wifi_not_available">Wi-Fi is not available on this device</string>
<string name="wifi_disabled">Wi-Fi is OFF</string>
<string name="wifi_disconnected">Wi-Fi is DISCONNECTED</string>

View File

@@ -71,7 +71,6 @@ implements OnClickListener, DatabaseListener, ConnectionListener {
layout.addView(new HorizontalBorder(this));
ImageButton addContactButton = new ImageButton(this);
addContactButton.setPadding(10, 10, 10, 10);
addContactButton.setBackgroundResource(0);
addContactButton.setImageResource(R.drawable.social_add_person);
addContactButton.setOnClickListener(this);

View File

@@ -35,6 +35,8 @@ public class BluetoothWidget extends LinearLayout implements OnClickListener {
Context ctx = getContext();
TextView status = new TextView(ctx);
status.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
status.setTextSize(14);
status.setPadding(10, 10, 10, 10);
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if(adapter == null) {
bluetoothStateChanged(false);

View File

@@ -6,6 +6,7 @@ import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_HORIZONTAL;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
import net.sf.briar.R;
import net.sf.briar.android.widgets.CommonLayoutParams;
import android.content.Context;
import android.view.KeyEvent;
import android.view.View;
@@ -35,11 +36,17 @@ OnEditorActionListener, OnClickListener {
Context ctx = getContext();
TextView enterCode = new TextView(ctx);
enterCode.setGravity(CENTER_HORIZONTAL);
enterCode.setPadding(0, 0, 0, 10);
enterCode.setTextSize(14);
enterCode.setPadding(10, 10, 10, 10);
enterCode.setText(prompt);
addView(enterCode);
LinearLayout innerLayout = new LinearLayout(ctx);
innerLayout.setOrientation(HORIZONTAL);
innerLayout.setGravity(CENTER);
final Button continueButton = new Button(ctx);
continueButton.setLayoutParams(CommonLayoutParams.WRAP_WRAP);
continueButton.setText(R.string.continue_button);
continueButton.setEnabled(false);
continueButton.setOnClickListener(this);
@@ -51,15 +58,13 @@ OnEditorActionListener, OnClickListener {
continueButton.setEnabled(text.length() == 6);
}
};
codeEntry.setTextSize(26);
codeEntry.setPadding(10, 0, 10, 10);
codeEntry.setOnEditorActionListener(this);
codeEntry.setMinEms(5);
codeEntry.setMaxEms(5);
codeEntry.setMaxLines(1);
codeEntry.setInputType(TYPE_CLASS_NUMBER);
LinearLayout innerLayout = new LinearLayout(ctx);
innerLayout.setOrientation(HORIZONTAL);
innerLayout.setGravity(CENTER);
innerLayout.addView(codeEntry);
innerLayout.addView(continueButton);
addView(innerLayout);

View File

@@ -1,7 +1,6 @@
package net.sf.briar.android.invitation;
import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_HORIZONTAL;
import net.sf.briar.R;
import net.sf.briar.android.widgets.CommonLayoutParams;
import android.content.Context;
@@ -32,22 +31,23 @@ implements OnClickListener {
innerLayout.addView(icon);
TextView failed = new TextView(ctx);
failed.setTextSize(20);
failed.setTextSize(22);
failed.setPadding(0, 10, 10, 10);
failed.setText(R.string.codes_do_not_match);
innerLayout.addView(failed);
addView(innerLayout);
TextView interfering = new TextView(ctx);
interfering.setGravity(CENTER_HORIZONTAL);
interfering.setPadding(0, 0, 0, 10);
interfering.setTextSize(14);
interfering.setPadding(10, 0, 10, 10);
interfering.setText(R.string.interfering);
addView(interfering);
Button tryAgain = new Button(ctx);
tryAgain.setLayoutParams(CommonLayoutParams.WRAP_WRAP);
tryAgain.setText(R.string.try_again_button);
tryAgain.setOnClickListener(this);
addView(tryAgain);
Button tryAgainButton = new Button(ctx);
tryAgainButton.setLayoutParams(CommonLayoutParams.WRAP_WRAP);
tryAgainButton.setText(R.string.try_again_button);
tryAgainButton.setOnClickListener(this);
addView(tryAgainButton);
}
public void onClick(View view) {

View File

@@ -29,19 +29,23 @@ implements CodeEntryListener {
innerLayout.addView(icon);
TextView connected = new TextView(ctx);
connected.setTextSize(20);
connected.setTextSize(22);
connected.setPadding(0, 10, 10, 10);
connected.setText(R.string.connected_to_contact);
innerLayout.addView(connected);
addView(innerLayout);
TextView yourCode = new TextView(ctx);
yourCode.setGravity(CENTER_HORIZONTAL);
yourCode.setTextSize(14);
yourCode.setPadding(10, 10, 10, 10);
yourCode.setText(R.string.your_confirmation_code);
addView(yourCode);
TextView code = new TextView(ctx);
code.setGravity(CENTER_HORIZONTAL);
code.setTextSize(50);
code.setPadding(10, 0, 10, 10);
int localCode = container.getLocalConfirmationCode();
code.setText(String.format("%06d", localCode));
addView(code);

View File

@@ -1,7 +1,6 @@
package net.sf.briar.android.invitation;
import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_HORIZONTAL;
import net.sf.briar.R;
import net.sf.briar.android.widgets.CommonLayoutParams;
import android.content.Context;
@@ -34,13 +33,15 @@ implements WifiStateListener, BluetoothStateListener, OnClickListener {
innerLayout.addView(icon);
TextView failed = new TextView(ctx);
failed.setTextSize(20);
failed.setTextSize(22);
failed.setPadding(0, 10, 10, 10);
failed.setText(R.string.connection_failed);
innerLayout.addView(failed);
addView(innerLayout);
TextView checkNetwork = new TextView(ctx);
checkNetwork.setGravity(CENTER_HORIZONTAL);
checkNetwork.setTextSize(14);
checkNetwork.setPadding(10, 0, 10, 10);
checkNetwork.setText(R.string.check_same_network);
addView(checkNetwork);

View File

@@ -20,12 +20,15 @@ public class ConnectionView extends AddContactView {
Context ctx = getContext();
TextView yourCode = new TextView(ctx);
yourCode.setGravity(CENTER_HORIZONTAL);
yourCode.setTextSize(14);
yourCode.setPadding(10, 10, 10, 10);
yourCode.setText(R.string.your_invitation_code);
addView(yourCode);
TextView code = new TextView(ctx);
code.setGravity(CENTER_HORIZONTAL);
code.setTextSize(50);
code.setPadding(10, 0, 10, 10);
int localCode = container.getLocalInvitationCode();
code.setText(String.format("%06d", localCode));
addView(code);
@@ -38,7 +41,7 @@ public class ConnectionView extends AddContactView {
ProgressBar progress = new ProgressBar(ctx);
progress.setIndeterminate(true);
progress.setPadding(0, 10, 10, 0);
progress.setPadding(10, 10, 10, 10);
innerLayout.addView(progress);
TextView connecting = new TextView(ctx);
@@ -57,7 +60,7 @@ public class ConnectionView extends AddContactView {
innerLayout.setGravity(CENTER);
ProgressBar progress = new ProgressBar(ctx);
progress.setPadding(0, 10, 10, 0);
progress.setPadding(10, 10, 10, 10);
progress.setIndeterminate(true);
innerLayout.addView(progress);

View File

@@ -1,8 +1,12 @@
package net.sf.briar.android.invitation;
import static android.text.InputType.TYPE_CLASS_TEXT;
import static android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS;
import static android.text.InputType.TYPE_TEXT_VARIATION_PERSON_NAME;
import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_HORIZONTAL;
import net.sf.briar.R;
import net.sf.briar.android.widgets.CommonLayoutParams;
import android.content.Context;
import android.view.KeyEvent;
import android.view.View;
@@ -31,19 +35,20 @@ OnEditorActionListener {
innerLayout.setGravity(CENTER);
ImageView icon = new ImageView(ctx);
icon.setImageResource(R.drawable.navigation_accept);
icon.setPadding(10, 10, 10, 10);
icon.setImageResource(R.drawable.navigation_accept);
innerLayout.addView(icon);
TextView added = new TextView(ctx);
added.setTextSize(22);
added.setPadding(0, 10, 10, 10);
added.setText(R.string.contact_added);
added.setTextSize(20);
innerLayout.addView(added);
addView(innerLayout);
TextView enterNickname = new TextView(ctx);
enterNickname.setGravity(CENTER_HORIZONTAL);
enterNickname.setPadding(0, 0, 0, 10);
enterNickname.setPadding(10, 0, 10, 10);
enterNickname.setText(R.string.enter_nickname);
addView(enterNickname);
@@ -51,24 +56,29 @@ OnEditorActionListener {
innerLayout.setOrientation(HORIZONTAL);
innerLayout.setGravity(CENTER);
final Button done = new Button(ctx);
final Button doneButton = new Button(ctx);
doneButton.setLayoutParams(CommonLayoutParams.WRAP_WRAP);
doneButton.setText(R.string.done_button);
doneButton.setEnabled(false);
doneButton.setOnClickListener(this);
nicknameEntry = new EditText(ctx) {
@Override
protected void onTextChanged(CharSequence text, int start,
int lengthBefore, int lengthAfter) {
done.setEnabled(text.length() > 0);
doneButton.setEnabled(text.length() > 0);
}
};
nicknameEntry.setMinEms(10);
nicknameEntry.setTextSize(26);
nicknameEntry.setPadding(10, 0, 10, 10);
nicknameEntry.setMinEms(5);
nicknameEntry.setMaxEms(20);
nicknameEntry.setMaxLines(1);
nicknameEntry.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_FLAG_CAP_WORDS |
TYPE_TEXT_VARIATION_PERSON_NAME);
nicknameEntry.setOnEditorActionListener(this);
innerLayout.addView(nicknameEntry);
done.setText(R.string.done_button);
done.setEnabled(false);
done.setOnClickListener(this);
innerLayout.addView(done);
innerLayout.addView(doneButton);
addView(innerLayout);
}

View File

@@ -18,12 +18,15 @@ implements CodeEntryListener {
Context ctx = getContext();
TextView yourCode = new TextView(ctx);
yourCode.setGravity(CENTER_HORIZONTAL);
yourCode.setTextSize(14);
yourCode.setPadding(10, 10, 10, 10);
yourCode.setText(R.string.your_invitation_code);
addView(yourCode);
TextView code = new TextView(ctx);
code.setGravity(CENTER_HORIZONTAL);
code.setTextSize(50);
code.setPadding(10, 0, 10, 10);
int localCode = container.getLocalInvitationCode();
code.setText(String.format("%06d", localCode));
addView(code);

View File

@@ -1,6 +1,5 @@
package net.sf.briar.android.invitation;
import static android.view.Gravity.CENTER_HORIZONTAL;
import net.sf.briar.R;
import net.sf.briar.android.widgets.CommonLayoutParams;
import android.content.Context;
@@ -22,7 +21,8 @@ implements WifiStateListener, BluetoothStateListener, OnClickListener {
removeAllViews();
Context ctx = getContext();
TextView sameNetwork = new TextView(ctx);
sameNetwork.setGravity(CENTER_HORIZONTAL);
sameNetwork.setTextSize(14);
sameNetwork.setPadding(10, 10, 10, 10);
sameNetwork.setText(R.string.same_network);
addView(sameNetwork);

View File

@@ -28,19 +28,23 @@ public class WaitForContactView extends AddContactView {
innerLayout.addView(icon);
TextView failed = new TextView(ctx);
failed.setTextSize(20);
failed.setTextSize(22);
failed.setPadding(0, 10, 10, 10);
failed.setText(R.string.connected_to_contact);
innerLayout.addView(failed);
addView(innerLayout);
TextView yourCode = new TextView(ctx);
yourCode.setGravity(CENTER_HORIZONTAL);
yourCode.setTextSize(14);
yourCode.setPadding(10, 0, 10, 10);
yourCode.setText(R.string.your_confirmation_code);
addView(yourCode);
TextView code = new TextView(ctx);
code.setGravity(CENTER_HORIZONTAL);
code.setTextSize(50);
code.setPadding(10, 0, 10, 10);
int localCode = container.getLocalConfirmationCode();
code.setText(String.format("%06d", localCode));
addView(code);
@@ -51,7 +55,7 @@ public class WaitForContactView extends AddContactView {
ProgressBar progress = new ProgressBar(ctx);
progress.setIndeterminate(true);
progress.setPadding(0, 10, 10, 0);
progress.setPadding(10, 10, 10, 10);
innerLayout.addView(progress);
TextView connecting = new TextView(ctx);

View File

@@ -36,6 +36,8 @@ public class WifiWidget extends LinearLayout implements OnClickListener {
removeAllViews();
Context ctx = getContext();
TextView status = new TextView(ctx);
status.setTextSize(14);
status.setPadding(10, 10, 10, 10);
status.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
WifiManager wifi = (WifiManager) ctx.getSystemService(WIFI_SERVICE);
if(wifi == null) {

View File

@@ -83,7 +83,6 @@ implements DatabaseListener, OnClickListener, OnItemClickListener {
layout.addView(new HorizontalBorder(this));
ImageButton composeButton = new ImageButton(this);
composeButton.setPadding(10, 10, 10, 10);
composeButton.setBackgroundResource(0);
composeButton.setImageResource(R.drawable.content_new_email);
composeButton.setOnClickListener(this);

View File

@@ -77,7 +77,7 @@ implements OnClickListener, DatabaseListener {
layout.addView(new HorizontalBorder(this));
ImageButton composeButton = new ImageButton(this);
composeButton.setPadding(10, 10, 10, 10);
// composeButton.setPadding(10, 10, 10, 10);
composeButton.setBackgroundResource(0);
composeButton.setImageResource(R.drawable.content_new_email);
composeButton.setOnClickListener(this);

View File

@@ -163,7 +163,7 @@ implements OnClickListener {
footer.setGravity(CENTER);
readButton = new ImageButton(this);
readButton.setPadding(10, 10, 10, 10);
// readButton.setPadding(10, 10, 10, 10);
readButton.setBackgroundResource(0);
if(read) readButton.setImageResource(R.drawable.content_unread);
else readButton.setImageResource(R.drawable.content_read);
@@ -172,7 +172,7 @@ implements OnClickListener {
footer.addView(new HorizontalSpace(this));
prevButton = new ImageButton(this);
prevButton.setPadding(10, 10, 10, 10);
// prevButton.setPadding(10, 10, 10, 10);
prevButton.setBackgroundResource(0);
prevButton.setImageResource(R.drawable.navigation_previous_item);
prevButton.setOnClickListener(this);
@@ -181,7 +181,7 @@ implements OnClickListener {
footer.addView(new HorizontalSpace(this));
nextButton = new ImageButton(this);
nextButton.setPadding(10, 10, 10, 10);
// nextButton.setPadding(10, 10, 10, 10);
nextButton.setBackgroundResource(0);
nextButton.setImageResource(R.drawable.navigation_next_item);
nextButton.setOnClickListener(this);
@@ -190,7 +190,7 @@ implements OnClickListener {
footer.addView(new HorizontalSpace(this));
replyButton = new ImageButton(this);
replyButton.setPadding(10, 10, 10, 10);
// replyButton.setPadding(10, 10, 10, 10);
replyButton.setBackgroundResource(0);
replyButton.setImageResource(R.drawable.social_reply);
replyButton.setOnClickListener(this);

View File

@@ -80,14 +80,13 @@ implements OnClickListener {
TextView to = new TextView(this);
// Give me all the unused width
to.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
to.setPadding(10, 10, 10, 10);
to.setTextSize(18);
to.setPadding(10, 10, 10, 10);
String format = getResources().getString(R.string.message_to);
to.setText(String.format(format, contactName));
actionBar.addView(to);
ImageButton sendButton = new ImageButton(this);
sendButton.setPadding(10, 10, 10, 10);
sendButton.setBackgroundResource(0);
sendButton.setImageResource(R.drawable.social_send_now);
sendButton.setOnClickListener(this);