This commit is contained in:
Aran Zaiger 2016-07-03 15:26:36 +03:00
commit 0817d86fce
22 changed files with 135 additions and 147 deletions

View file

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="android-android-23">
<CLASSES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/platforms/android-23/android.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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">

View file

@ -20,7 +20,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".LoginActivity"
android:name=".SplashActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -28,7 +28,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".PersonalSpaceActivity"></activity>
<activity android:name=".PersonalSpaceActivity" />
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -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());
}
};

View file

@ -0,0 +1,26 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
public class SplashActivity extends AppCompatActivity {
private ImageView appSplashScreen;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
appSplashScreen = (ImageView) findViewById(R.id.sa_splashScreenImage);
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
finish();
}
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_splash);
// }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,14 +1,20 @@
<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"
<?xml version="1.0" encoding="utf-8"?>
<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">
<LinearLayout
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">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="56dp"
android:paddingLeft="24dp"
android:paddingRight="24dp">
<!-- Login progress -->
<ProgressBar
@ -19,61 +25,55 @@
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView android:src="@drawable/logo"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_marginBottom="24dp"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:id="@+id/email_login_form"
<!-- Email Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
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:id="@+id/al_username"
android:inputType="textPersonName"
android:hint="@string/prompt_username" />
android:inputType="textEmailAddress"
android:hint="Usename" />
</android.support.design.widget.TextInputLayout>
<EditText
android:id="@+id/al_password"
<!-- 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: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" />
android:imeActionId="@+id/login"
android:hint="Password"/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<Button
<android.support.v7.widget.AppCompatButton
android:id="@+id/al_login_button"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_login"
android:textStyle="bold" />
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:padding="12dp"
android:text="Login"/>
<Button
style="?android:textAppearanceSmall"
android:id="@+id/al_register_button"
android:layout_width="wrap_content"
<TextView android:id="@+id/link_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_register"
android:textStyle="bold" />
</LinearLayout>
android:layout_marginBottom="24dp"
android:text="No account yet? Create one for FREE"
android:gravity="center"
android:textSize="16dip"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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: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.SplashActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sa_splashScreenImage"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -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>