add login activity
This commit is contained in:
parent
89d4b09ec3
commit
4183fccce1
5 changed files with 118 additions and 143 deletions
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
|
@ -25,7 +25,7 @@
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
package="com.example.hochi.nextcompanion">
|
package="com.example.hochi.nextcompanion">
|
||||||
|
|
||||||
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
<!-- To auto-complete the email text field in the login form with the user's emails -->
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.example.hochi.nextcompanion;
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
|
|
@ -19,6 +20,7 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
|
@ -29,6 +31,16 @@ import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -39,26 +51,14 @@ import static android.Manifest.permission.READ_CONTACTS;
|
||||||
*/
|
*/
|
||||||
public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<Cursor> {
|
public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
/**
|
|
||||||
* Id to identity READ_CONTACTS permission request.
|
|
||||||
*/
|
|
||||||
private static final int REQUEST_READ_CONTACTS = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A dummy authentication store containing known user names and passwords.
|
|
||||||
* TODO: remove after connecting to a real authentication system.
|
|
||||||
*/
|
|
||||||
private static final String[] DUMMY_CREDENTIALS = new String[]{
|
|
||||||
"foo@example.com:hello", "bar@example.com:world"
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* Keep track of the login task to ensure we can cancel it if requested.
|
* Keep track of the login task to ensure we can cancel it if requested.
|
||||||
*/
|
*/
|
||||||
private UserLoginTask mAuthTask = null;
|
private UserLoginTask mAuthTask = null;
|
||||||
|
|
||||||
// UI references.
|
// UI references.
|
||||||
private AutoCompleteTextView mEmailView;
|
private TextView mPhoneView;
|
||||||
private EditText mPasswordView;
|
private EditText mPinView;
|
||||||
private View mProgressView;
|
private View mProgressView;
|
||||||
private View mLoginFormView;
|
private View mLoginFormView;
|
||||||
|
|
||||||
|
|
@ -67,11 +67,10 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_login);
|
setContentView(R.layout.activity_login);
|
||||||
// Set up the login form.
|
// Set up the login form.
|
||||||
mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
|
mPhoneView = findViewById(R.id.phone);
|
||||||
populateAutoComplete();
|
|
||||||
|
|
||||||
mPasswordView = (EditText) findViewById(R.id.password);
|
mPinView = findViewById(R.id.pin);
|
||||||
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
mPinView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
||||||
if (id == EditorInfo.IME_ACTION_DONE || id == EditorInfo.IME_NULL) {
|
if (id == EditorInfo.IME_ACTION_DONE || id == EditorInfo.IME_NULL) {
|
||||||
|
|
@ -82,7 +81,7 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
|
Button mEmailSignInButton = findViewById(R.id.phone_sign_in_button);
|
||||||
mEmailSignInButton.setOnClickListener(new OnClickListener() {
|
mEmailSignInButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
@ -94,50 +93,6 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
mProgressView = findViewById(R.id.login_progress);
|
mProgressView = findViewById(R.id.login_progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateAutoComplete() {
|
|
||||||
if (!mayRequestContacts()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
getLoaderManager().initLoader(0, null, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean mayRequestContacts() {
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (shouldShowRequestPermissionRationale(READ_CONTACTS)) {
|
|
||||||
Snackbar.make(mEmailView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE)
|
|
||||||
.setAction(android.R.string.ok, new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
@TargetApi(Build.VERSION_CODES.M)
|
|
||||||
public void onClick(View v) {
|
|
||||||
requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback received when a permissions request has been completed.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
|
||||||
@NonNull int[] grantResults) {
|
|
||||||
if (requestCode == REQUEST_READ_CONTACTS) {
|
|
||||||
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
populateAutoComplete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to sign in or register the account specified by the login form.
|
* Attempts to sign in or register the account specified by the login form.
|
||||||
* If there are form errors (invalid email, missing fields, etc.), the
|
* If there are form errors (invalid email, missing fields, etc.), the
|
||||||
|
|
@ -149,31 +104,27 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset errors.
|
// Reset errors.
|
||||||
mEmailView.setError(null);
|
mPhoneView.setError(null);
|
||||||
mPasswordView.setError(null);
|
mPinView.setError(null);
|
||||||
|
|
||||||
// Store values at the time of the login attempt.
|
// Store values at the time of the login attempt.
|
||||||
String email = mEmailView.getText().toString();
|
String email = mPhoneView.getText().toString();
|
||||||
String password = mPasswordView.getText().toString();
|
String password = mPinView.getText().toString();
|
||||||
|
|
||||||
boolean cancel = false;
|
boolean cancel = false;
|
||||||
View focusView = null;
|
View focusView = null;
|
||||||
|
|
||||||
// Check for a valid password, if the user entered one.
|
// Check for a valid password, if the user entered one.
|
||||||
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
|
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
|
||||||
mPasswordView.setError(getString(R.string.error_invalid_password));
|
mPinView.setError(getString(R.string.error_invalid_pin));
|
||||||
focusView = mPasswordView;
|
focusView = mPinView;
|
||||||
cancel = true;
|
cancel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for a valid email address.
|
// Check for a valid email address.
|
||||||
if (TextUtils.isEmpty(email)) {
|
if (TextUtils.isEmpty(email)) {
|
||||||
mEmailView.setError(getString(R.string.error_field_required));
|
mPhoneView.setError(getString(R.string.error_field_required));
|
||||||
focusView = mEmailView;
|
focusView = mPhoneView;
|
||||||
cancel = true;
|
|
||||||
} else if (!isEmailValid(email)) {
|
|
||||||
mEmailView.setError(getString(R.string.error_invalid_email));
|
|
||||||
focusView = mEmailView;
|
|
||||||
cancel = true;
|
cancel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,14 +141,9 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEmailValid(String email) {
|
|
||||||
//TODO: Replace this with your own logic
|
|
||||||
return email.contains("@");
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isPasswordValid(String password) {
|
private boolean isPasswordValid(String password) {
|
||||||
//TODO: Replace this with your own logic
|
//TODO: Replace this with your own logic
|
||||||
return password.length() > 4;
|
return password.length() == 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -254,15 +200,8 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
|
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
|
||||||
List<String> emails = new ArrayList<>();
|
|
||||||
cursor.moveToFirst();
|
|
||||||
while (!cursor.isAfterLast()) {
|
|
||||||
emails.add(cursor.getString(ProfileQuery.ADDRESS));
|
|
||||||
cursor.moveToNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
addEmailsToAutoComplete(emails);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -270,16 +209,6 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addEmailsToAutoComplete(List<String> emailAddressCollection) {
|
|
||||||
//Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
|
|
||||||
ArrayAdapter<String> adapter =
|
|
||||||
new ArrayAdapter<>(LoginActivity.this,
|
|
||||||
android.R.layout.simple_dropdown_item_1line, emailAddressCollection);
|
|
||||||
|
|
||||||
mEmailView.setAdapter(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private interface ProfileQuery {
|
private interface ProfileQuery {
|
||||||
String[] PROJECTION = {
|
String[] PROJECTION = {
|
||||||
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
||||||
|
|
@ -296,34 +225,79 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
*/
|
*/
|
||||||
public class UserLoginTask extends AsyncTask<Void, Void, Boolean> {
|
public class UserLoginTask extends AsyncTask<Void, Void, Boolean> {
|
||||||
|
|
||||||
private final String mEmail;
|
private final String mPhone;
|
||||||
private final String mPassword;
|
private final String mPin;
|
||||||
|
|
||||||
UserLoginTask(String email, String password) {
|
UserLoginTask(String phone, String pin) {
|
||||||
mEmail = email;
|
mPhone = URLEncoder.encode(phone);
|
||||||
mPassword = password;
|
mPin = pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(Void... params) {
|
protected Boolean doInBackground(Void... params) {
|
||||||
// TODO: attempt authentication against a network service.
|
Boolean success = false;
|
||||||
|
String urlParameters = "apikey=rXXqTgQZUPZ89lzB&mobile=" + mPhone + "&pin=" + mPin;
|
||||||
|
|
||||||
|
HttpURLConnection connection = null;
|
||||||
try {
|
try {
|
||||||
// Simulate network access.
|
//Create connection
|
||||||
Thread.sleep(2000);
|
URL url = new URL("https://api.nextbike.net/api/login.json");
|
||||||
} catch (InterruptedException e) {
|
connection = (HttpURLConnection) url.openConnection();
|
||||||
return false;
|
connection.setRequestMethod("POST");
|
||||||
|
connection.setRequestProperty("Content-Type",
|
||||||
|
"application/x-www-form-urlencoded");
|
||||||
|
|
||||||
|
connection.setRequestProperty("Content-Length", "" +
|
||||||
|
Integer.toString(urlParameters.getBytes().length));
|
||||||
|
connection.setRequestProperty("Content-Language", "en-US");
|
||||||
|
|
||||||
|
connection.setUseCaches (false);
|
||||||
|
connection.setDoInput(true);
|
||||||
|
connection.setDoOutput(true);
|
||||||
|
|
||||||
|
//Send request
|
||||||
|
DataOutputStream wr = new DataOutputStream (
|
||||||
|
connection.getOutputStream ());
|
||||||
|
wr.writeBytes (urlParameters);
|
||||||
|
wr.flush ();
|
||||||
|
wr.close ();
|
||||||
|
|
||||||
|
//Get Response
|
||||||
|
InputStream is = connection.getInputStream();
|
||||||
|
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
|
||||||
|
String line;
|
||||||
|
StringBuilder response = new StringBuilder();
|
||||||
|
while((line = rd.readLine()) != null) {
|
||||||
|
response.append(line);
|
||||||
|
response.append('\r');
|
||||||
|
}
|
||||||
|
rd.close();
|
||||||
|
try {
|
||||||
|
JSONObject jObject = new JSONObject(response.toString());
|
||||||
|
JSONObject userObject = jObject.getJSONObject("user");
|
||||||
|
String loginkey = userObject.getString("loginkey");
|
||||||
|
Log.d("DEBUG", loginkey);
|
||||||
|
success=true;
|
||||||
|
SharedPreferences sharedPref = getSharedPreferences("persistence", MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sharedPref.edit();
|
||||||
|
editor.putString("loginKey", loginkey);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
success=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String credential : DUMMY_CREDENTIALS) {
|
} catch (Exception e) {
|
||||||
String[] pieces = credential.split(":");
|
|
||||||
if (pieces[0].equals(mEmail)) {
|
|
||||||
// Account exists, return true if the password matches.
|
|
||||||
return pieces[1].equals(mPassword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: register the new account here.
|
e.printStackTrace();
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
if(connection != null) {
|
||||||
|
connection.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -335,8 +309,8 @@ public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<
|
||||||
if (success) {
|
if (success) {
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
mPasswordView.setError(getString(R.string.error_incorrect_password));
|
mPinView.setError(getString(R.string.error_incorrect_pin));
|
||||||
mPasswordView.requestFocus();
|
mPinView.requestFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,17 +16,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
//pre-condition: Is there a login key?
|
|
||||||
Context context = this;
|
|
||||||
SharedPreferences persistence = context.getSharedPreferences(
|
|
||||||
"loginKey", Context.MODE_PRIVATE);
|
|
||||||
String defaultValue = "nokey";
|
|
||||||
String loginKey = persistence.getString("loginKey", defaultValue);
|
|
||||||
if (loginKey.equals("nokey")) {
|
|
||||||
Intent intent = new Intent(this, LoginActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
//now this "every android activity" stuff
|
//now this "every android activity" stuff
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
@ -36,6 +25,20 @@ public class MainActivity extends AppCompatActivity {
|
||||||
FloatingButton();
|
FloatingButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
//pre-condition: Is there a login key?
|
||||||
|
Context context = this;
|
||||||
|
SharedPreferences sharedPref = getSharedPreferences("persistence", MODE_PRIVATE);
|
||||||
|
String defaultValue = "nokey";
|
||||||
|
String loginKey = sharedPref.getString("loginKey", defaultValue);
|
||||||
|
if (loginKey.equals("nokey")) {
|
||||||
|
Intent intent = new Intent(this, LoginActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/email_login_form"
|
android:id="@+id/phone_login_form"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
@ -35,12 +35,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<EditText
|
||||||
android:id="@+id/email"
|
android:id="@+id/phone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/prompt_email"
|
android:hint="@string/prompt_phone"
|
||||||
android:inputType="textEmailAddress"
|
android:inputType="phone"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
|
@ -51,21 +51,21 @@
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password"
|
android:id="@+id/pin"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/prompt_password"
|
android:hint="@string/prompt_pin"
|
||||||
android:imeActionId="6"
|
android:imeActionId="6"
|
||||||
android:imeActionLabel="@string/action_sign_in_short"
|
android:imeActionLabel="@string/action_sign_in_short"
|
||||||
android:imeOptions="actionUnspecified"
|
android:imeOptions="actionUnspecified"
|
||||||
android:inputType="textPassword"
|
android:inputType="numberPassword"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/email_sign_in_button"
|
android:id="@+id/phone_sign_in_button"
|
||||||
style="?android:textAppearanceSmall"
|
style="?android:textAppearanceSmall"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue