diff --git a/briar-android/res/layout/activity_create_forum.xml b/briar-android/res/layout/activity_create_forum.xml
new file mode 100644
index 000000000..19c61317d
--- /dev/null
+++ b/briar-android/res/layout/activity_create_forum.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/briar-android/res/layout/splash.xml b/briar-android/res/layout/splash.xml
new file mode 100644
index 000000000..c7b171adb
--- /dev/null
+++ b/briar-android/res/layout/splash.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/briar-android/res/values/dimens.xml b/briar-android/res/values/dimens.xml
index b1985532c..c3085212c 100644
--- a/briar-android/res/values/dimens.xml
+++ b/briar-android/res/values/dimens.xml
@@ -10,6 +10,7 @@
8dp
16dp
32dp
+ 64dp
12sp
diff --git a/briar-android/src/org/briarproject/android/SplashScreenActivity.java b/briar-android/src/org/briarproject/android/SplashScreenActivity.java
index 5e34e5a4d..20a6d59fa 100644
--- a/briar-android/src/org/briarproject/android/SplashScreenActivity.java
+++ b/briar-android/src/org/briarproject/android/SplashScreenActivity.java
@@ -45,21 +45,9 @@ public class SplashScreenActivity extends BaseActivity {
public void onCreate(Bundle state) {
super.onCreate(state);
- LinearLayout layout = new LinearLayout(this);
- layout.setLayoutParams(MATCH_MATCH);
- layout.setGravity(CENTER);
- layout.setBackgroundColor(Color.WHITE);
-
- int pad = LayoutUtils.getLargeItemPadding(this);
-
- ImageView logo = new ImageView(this);
- logo.setPadding(pad, pad, pad, pad);
- logo.setImageResource(R.drawable.briar_logo_large);
- layout.addView(logo);
-
setPreferencesDefaults();
- setContentView(layout);
+ setContentView(R.layout.splash);
new Handler().postDelayed(new Runnable() {
@Override
diff --git a/briar-android/src/org/briarproject/android/forum/CreateForumActivity.java b/briar-android/src/org/briarproject/android/forum/CreateForumActivity.java
index ac5d79068..2a9d54cdf 100644
--- a/briar-android/src/org/briarproject/android/forum/CreateForumActivity.java
+++ b/briar-android/src/org/briarproject/android/forum/CreateForumActivity.java
@@ -26,6 +26,9 @@ import java.util.logging.Logger;
import javax.inject.Inject;
+import android.text.TextWatcher;
+import android.text.Editable;
+
import static android.text.InputType.TYPE_CLASS_TEXT;
import static android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
import static android.view.Gravity.CENTER;
@@ -58,50 +61,34 @@ implements OnEditorActionListener, OnClickListener {
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
- LinearLayout layout = new LinearLayout(this);
- layout.setLayoutParams(MATCH_MATCH);
- layout.setOrientation(VERTICAL);
- layout.setGravity(CENTER_HORIZONTAL);
- int pad = LayoutUtils.getPadding(this);
- layout.setPadding(pad, pad, pad, pad);
- TextView chooseName = new TextView(this);
- chooseName.setGravity(CENTER);
- chooseName.setTextSize(18);
- chooseName.setText(R.string.choose_forum_name);
- layout.addView(chooseName);
+ setContentView(R.layout.activity_create_forum);
+
+ nameEntry = (EditText) findViewById(R.id.createForumNameEntry);
+ TextWatcher nameEntryWatcher = new TextWatcher() {
- nameEntry = new EditText(this) {
@Override
- protected void onTextChanged(CharSequence text, int start,
+ public void afterTextChanged(Editable s) {}
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
+
+ @Override
+ public void onTextChanged(CharSequence text, int start,
int lengthBefore, int lengthAfter) {
enableOrDisableCreateButton();
}
};
- nameEntry.setId(1);
- nameEntry.setMaxLines(1);
- nameEntry.setInputType(TYPE_CLASS_TEXT | TYPE_TEXT_FLAG_CAP_SENTENCES);
nameEntry.setOnEditorActionListener(this);
- layout.addView(nameEntry);
+ nameEntry.addTextChangedListener(nameEntryWatcher);
- feedback = new TextView(this);
- feedback.setGravity(CENTER);
- feedback.setPadding(0, pad, 0, pad);
- layout.addView(feedback);
+ feedback = (TextView) findViewById(R.id.createForumFeedback);
- createForumButton = new Button(this);
- createForumButton.setLayoutParams(WRAP_WRAP);
- createForumButton.setText(R.string.create_forum_button);
+ createForumButton = (Button) findViewById(R.id.createForumButton);
createForumButton.setOnClickListener(this);
- layout.addView(createForumButton);
- progress = new ProgressBar(this);
- progress.setLayoutParams(WRAP_WRAP);
- progress.setIndeterminate(true);
- progress.setVisibility(GONE);
- layout.addView(progress);
+ progress = (ProgressBar) findViewById(R.id.createForumProgressBar);
- setContentView(layout);
}
@Override