New Login Look
This commit is contained in:
parent
a3525d06d0
commit
77970845cb
13 changed files with 82 additions and 136 deletions
|
@ -6,8 +6,6 @@
|
|||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.3.0/animated-vector-drawable-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/design/23.3.0/design-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.3.0/design-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/design/23.3.0/design-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/jars/classes.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/res" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/jars/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.3.0/recyclerview-v7-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.3.0/recyclerview-v7-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.3.0/recyclerview-v7-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-23.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.3.0/res" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.3.0/jars/classes.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.3.0/jars/libs/internal_impl-23.3.0.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.3.0/jars/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.3.0/support-v4-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.3.0/support-v4-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/23.3.0/support-v4-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.3.0/support-vector-drawable-23.3.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.3.0/support-vector-drawable-23.3.0-sources.jar!/" />
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.3.0/support-vector-drawable-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<component name="libraryTable">
|
||||
<library name="volley-1.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/res" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/jars/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.widget.AutoCompleteTextView;
|
|||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
|
@ -75,19 +76,14 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
|
|||
|
||||
private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
|
||||
private final String LOGIN_PATH = "/login";
|
||||
private final String REG_PATH = "/register";
|
||||
|
||||
private LoginActivity self;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
|
||||
// Set up the login form.
|
||||
// mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
|
||||
// populateAutoComplete();
|
||||
// mUsernameView = (AutoCompleteTextView) findViewById(R.id.username);
|
||||
// populateAutoComplete();
|
||||
this.self = this;
|
||||
|
||||
mUsernameView = (EditText) findViewById(R.id.al_username);
|
||||
mPasswordView = (EditText) findViewById(R.id.al_password);
|
||||
|
@ -101,14 +97,14 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
|
|||
return false;
|
||||
}
|
||||
});
|
||||
Button mRegisterButton = (Button) findViewById(R.id.al_register_button);
|
||||
mRegisterButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Log.d(TAG, "Register....... this section under construction");
|
||||
//attemptRegister(); // TODO : implement
|
||||
}
|
||||
});
|
||||
// Button mRegisterButton = (Button) findViewById(R.id.al_register_button);
|
||||
// mRegisterButton.setOnClickListener(new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Log.d(TAG, "Register....... this section under construction");
|
||||
// //attemptRegister(); // TODO : implement
|
||||
// }
|
||||
// });
|
||||
|
||||
Button mEmailSignInButton = (Button) findViewById(R.id.al_login_button);
|
||||
mEmailSignInButton.setOnClickListener(new OnClickListener() {
|
||||
|
@ -188,25 +184,14 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
|
|||
return;
|
||||
}
|
||||
showProgress(true);
|
||||
|
||||
// Reset errors.
|
||||
// mEmailView.setError(null);
|
||||
// mUsernameView.setError(null);
|
||||
mPasswordView.setError(null);
|
||||
|
||||
// Store values at the time of the login attempt.
|
||||
|
||||
// String email = mEmailView.getText().toString();
|
||||
|
||||
if (isParamsValid(mUsernameView.getText().toString(), mPasswordView.getText().toString())) {
|
||||
|
||||
String username = mUsernameView.getText().toString();
|
||||
String password = mPasswordView.getText().toString();
|
||||
|
||||
boolean cancel = false;
|
||||
View focusView = null;
|
||||
// mAuthTask = new UserLoginTask(username, password); // TODO: RETRIEVE ?
|
||||
// mAuthTask.execute((Void) null); // TODO: RETRIEVE ?
|
||||
|
||||
// http request register
|
||||
JSONObject tempJson = new JSONObject();
|
||||
|
@ -218,37 +203,11 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
|
|||
}
|
||||
|
||||
VolleyUtilSingleton.getInstance(LoginActivity.this).post(BASE_URL + LOGIN_PATH, tempJson, onLoginSuccess, onLoginError);
|
||||
|
||||
// Check for a valid password, if the user entered one.
|
||||
// if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
|
||||
// mPasswordView.setError(getString(R.string.error_invalid_password));
|
||||
// focusView = mPasswordView;
|
||||
// cancel = true;
|
||||
// }
|
||||
// if (cancel) {
|
||||
// // There was an error; don't attempt login and focus the first
|
||||
// // form field with an error.
|
||||
// focusView.requestFocus();
|
||||
// } else {
|
||||
// // Show a progress spinner, and kick off a background task to
|
||||
// // perform the user login attempt.
|
||||
//
|
||||
// }
|
||||
} else {
|
||||
showProgress(false);
|
||||
Log.d(TAG, "Invalid params - make sure username exist & password is 4 characters or more");
|
||||
}
|
||||
|
||||
// Check for a valid username
|
||||
// if (TextUtils.isEmpty(username)) {
|
||||
// mUsernameView.setError(getString(R.string.error_field_required));
|
||||
// focusView = mUsernameView;
|
||||
// cancel = true;
|
||||
// } else if (!isEmailValid(username)) {
|
||||
// mUsernameView.setError(getString(R.string.error_invalid_email));
|
||||
// focusView = mUsernameView;
|
||||
// cancel = true;
|
||||
// }
|
||||
}
|
||||
|
||||
Response.Listener<JSONObject> onLoginSuccess = new Response.Listener<JSONObject>() {
|
||||
|
@ -277,6 +236,7 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
|
|||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
showProgress(false);
|
||||
Toast.makeText(self , "Username Or Password Incorrect", Toast.LENGTH_LONG).show();
|
||||
Log.d(TAG, "onLoginError: msg: " + error.getMessage());
|
||||
}
|
||||
};
|
||||
|
|
BIN
app/src/main/res/drawable/logo.png
Normal file
BIN
app/src/main/res/drawable/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -1,79 +1,79 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="com.android_app.matan.ara.sagi.thesocialnotework.LoginActivity">
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Login progress -->
|
||||
<ProgressBar
|
||||
android:id="@+id/login_progress"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone" />
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/login_form">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/login_form"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/email_login_form"
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:paddingTop="56dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/al_username"
|
||||
android:inputType="textPersonName"
|
||||
android:hint="@string/prompt_username" />
|
||||
<!-- Login progress -->
|
||||
<ProgressBar
|
||||
android:id="@+id/login_progress"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/al_password"
|
||||
<ImageView android:src="@drawable/logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<!-- Email Label -->
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/prompt_password"
|
||||
android:imeActionId="@+id/login"
|
||||
android:imeActionLabel="@string/action_sign_in_short"
|
||||
android:imeOptions="actionUnspecified"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
<EditText android:id="@+id/al_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal">
|
||||
android:inputType="textEmailAddress"
|
||||
android:hint="Usename" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/al_login_button"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
<!-- Password Label -->
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
<EditText android:id="@+id/al_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/action_login"
|
||||
android:textStyle="bold" />
|
||||
android:inputType="textPassword"
|
||||
android:imeActionId="@+id/login"
|
||||
android:hint="Password"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<Button
|
||||
style="?android:textAppearanceSmall"
|
||||
android:id="@+id/al_register_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/action_register"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/al_login_button"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:padding="12dp"
|
||||
android:text="Login"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
<TextView android:id="@+id/link_signup"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="No account yet? Create one for FREE"
|
||||
android:gravity="center"
|
||||
android:textSize="16dip"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<resources>
|
||||
<string name="app_name">TheSocialNotework</string>
|
||||
<string name="app_name">TSN</string>
|
||||
|
||||
<!-- Strings related to login -->
|
||||
<string name="prompt_email">Email</string>
|
||||
|
|
Loading…
Reference in a new issue