Brion VIBBER has submitted this change and it was merged. Change subject: Add stub Create Account activity ......................................................................
Add stub Create Account activity Change-Id: I54f3efad4e48ec3b7220c301ed2b0c81a8e3f90c --- M wikipedia/AndroidManifest.xml A wikipedia/res/layout/activity_create_account.xml M wikipedia/res/layout/activity_login.xml A wikipedia/res/menu/menu_create_account.xml M wikipedia/res/values/strings.xml A wikipedia/src/main/java/org/wikipedia/login/CreateAccountActivity.java M wikipedia/src/main/java/org/wikipedia/login/LoginActivity.java 7 files changed, 96 insertions(+), 1 deletion(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/AndroidManifest.xml b/wikipedia/AndroidManifest.xml index dd218cc..9be25e6 100644 --- a/wikipedia/AndroidManifest.xml +++ b/wikipedia/AndroidManifest.xml @@ -60,8 +60,9 @@ /> <activity android:name=".login.LoginActivity" android:label="@string/login_activity_title" - android:windowSoftInputMode="stateVisible" + android:windowSoftInputMode="stateVisible|adjustResize" /> + <activity android:name=".login.CreateAccountActivity" android:label="@string/create_account_activity_title"/> <provider android:authorities="org.wikipedia.history" diff --git a/wikipedia/res/layout/activity_create_account.xml b/wikipedia/res/layout/activity_create_account.xml new file mode 100644 index 0000000..331053b --- /dev/null +++ b/wikipedia/res/layout/activity_create_account.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="16dp" + > + <org.wikipedia.styledviews.StylizedEditText + android:id="@+id/create_account_username" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/create_account_username_hint" + android:singleLine="true" + /> + + <org.wikipedia.styledviews.StylizedEditText + android:id="@+id/create_account_password" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/create_account_password_hint" + android:singleLine="true" + /> +</LinearLayout> \ No newline at end of file diff --git a/wikipedia/res/layout/activity_login.xml b/wikipedia/res/layout/activity_login.xml index a5ed462..1722ac8 100644 --- a/wikipedia/res/layout/activity_login.xml +++ b/wikipedia/res/layout/activity_login.xml @@ -33,5 +33,18 @@ style="?android:textAppearanceMedium" /> + <!-- Padding to push the create account to the bottom --> + <View android:layout_width="match_parent" android:layout_height="0dp" + android:layout_weight="1" /> + + <org.wikipedia.styledviews.StyledTextView + android:id="@+id/login_create_account_link" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|center_horizontal" + android:padding="8dp" + android:text="@string/login_create_account_link" + style="?android:textAppearanceMedium" + /> </LinearLayout> \ No newline at end of file diff --git a/wikipedia/res/menu/menu_create_account.xml b/wikipedia/res/menu/menu_create_account.xml new file mode 100644 index 0000000..87ba092 --- /dev/null +++ b/wikipedia/res/menu/menu_create_account.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> + +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item android:id="@+id/menu_create_account" + android:icon="@android:drawable/ic_menu_send" + android:enabled="false" + app:showAsAction="always" /> +</menu> \ No newline at end of file diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml index 3b43133..8661a62 100644 --- a/wikipedia/res/values/strings.xml +++ b/wikipedia/res/values/strings.xml @@ -81,4 +81,8 @@ <string name="logging_out_progress">Logging out...</string> <string name="saved_pages_empty_message">No saved pages.</string> <string name="history_empty_message">Your history is empty.</string> + <string name="create_account_username_hint">Username</string> + <string name="create_account_password_hint">Password</string> + <string name="login_create_account_link">Create account</string> + <string name="create_account_activity_title">Create an account</string> </resources> diff --git a/wikipedia/src/main/java/org/wikipedia/login/CreateAccountActivity.java b/wikipedia/src/main/java/org/wikipedia/login/CreateAccountActivity.java new file mode 100644 index 0000000..5f6f07a --- /dev/null +++ b/wikipedia/src/main/java/org/wikipedia/login/CreateAccountActivity.java @@ -0,0 +1,32 @@ +package org.wikipedia.login; + +import android.app.Activity; +import android.os.Bundle; +import android.support.v7.app.*; +import android.view.*; +import org.wikipedia.*; + +public class CreateAccountActivity extends ActionBarActivity { + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_create_account); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu_create_account, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } +} \ No newline at end of file diff --git a/wikipedia/src/main/java/org/wikipedia/login/LoginActivity.java b/wikipedia/src/main/java/org/wikipedia/login/LoginActivity.java index e384c1e..bae3610 100644 --- a/wikipedia/src/main/java/org/wikipedia/login/LoginActivity.java +++ b/wikipedia/src/main/java/org/wikipedia/login/LoginActivity.java @@ -1,6 +1,7 @@ package org.wikipedia.login; import android.app.*; +import android.content.*; import android.os.*; import android.support.v7.app.*; import android.text.*; @@ -17,6 +18,7 @@ private EditText usernameText; private EditText passwordText; private CheckBox showPassword; + private View createAccountLink; private WikipediaApp app; @@ -31,6 +33,7 @@ usernameText = (EditText) findViewById(R.id.login_username_text); passwordText = (EditText) findViewById(R.id.login_password_text); showPassword = (CheckBox) findViewById(R.id.login_show_password); + createAccountLink = findViewById(R.id.login_create_account_link); TextWatcher enableActionWhenNonEmptyWatcher = new TextWatcher() { @Override @@ -71,6 +74,15 @@ passwordText.setSelection(curPos); } }); + + createAccountLink.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(LoginActivity.this, CreateAccountActivity.class); + startActivity(intent); + finish(); + } + }); } @Override -- To view, visit https://gerrit.wikimedia.org/r/114141 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54f3efad4e48ec3b7220c301ed2b0c81a8e3f90c Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com> Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits