Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/libraries/animated_vector_drawable_23_3_0.xml
#	.idea/libraries/appcompat_v7_23_3_0.xml
#	.idea/libraries/design_23_3_0.xml
#	.idea/libraries/recyclerview_v7_23_3_0.xml
#	.idea/libraries/support_annotations_23_3_0.xml
#	.idea/libraries/support_v4_23_3_0.xml
#	.idea/libraries/support_vector_drawable_23_3_0.xml
#	app/src/main/res/values/strings.xml
This commit is contained in:
Matan Bar Yosef 2016-07-03 16:07:27 +03:00
commit aef9568ba6
18 changed files with 330 additions and 200 deletions

View file

@ -5,7 +5,7 @@
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-2.10" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

View file

@ -1,13 +1,11 @@
<component name="libraryTable">
<library name="animated-vector-drawable-23.3.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<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://$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:///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

@ -4,13 +4,11 @@
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.3.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.3.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.3.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.3.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<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://$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:///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

@ -4,13 +4,11 @@
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.3.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.3.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.3.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.3.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<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://$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:///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$/Library/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$/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:///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$/Library/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$/Library/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$/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:///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$/Library/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$/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:///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$/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://$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:///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

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

@ -59,12 +59,18 @@ public class ListAdapter extends BaseAdapter {
TextView title = (TextView) v.findViewById(R.id.nvm_title_textview);
TextView datetime = (TextView) v.findViewById(R.id.nvm_time_textview);
TextView location = (TextView) v.findViewById(R.id.nvm_location_textview);
TextView likes = (TextView) v.findViewById(R.id.nvm_likes_textview);
TextView permission = (TextView) v.findViewById(R.id.nvm_permission_textview);
// NetworkImageView thumbNail = (NetworkImageView) v.findViewById(R.id.infoImageImageView);
// String url = mVideos.get(position).getImgURL();
// thumbNail.setImageUrl(url, VolleyUtilSingleTone.getInstance(mContext).getImageLoader());
title.setText(mNotes.get(position).getTitle());
datetime.setText(Html.fromHtml(mNotes.get(position).getTimestamp()));
location.setText(mNotes.get(position).getAddress());
Note curNote = mNotes.get(position);
title.setText(curNote.getTitle());
datetime.setText(Html.fromHtml(curNote.getTimestamp()));
location.setText(curNote.getAddress());
likes.setText(""+curNote.getLikes());
permission.setText(curNote.isPublic() ? "Public":"Private");
// Animation animation = AnimationUtils.loadAnimation(mContext, (position > lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);
// v.startAnimation(animation);
lastPosition = position;

View file

@ -24,12 +24,16 @@ import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Response;
import com.android.volley.VolleyError;
@ -75,20 +79,17 @@ 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;
protected LinearLayout layout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
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;
this.layout = (LinearLayout) findViewById(R.id.layout);
mUsernameView = (EditText) findViewById(R.id.al_username);
mPasswordView = (EditText) findViewById(R.id.al_password);
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@ -101,14 +102,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() {
@ -121,6 +122,10 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress);
// Remove Auto Focus from the Text Fields
layout.setFocusable(true);
layout.setFocusableInTouchMode(true);
}
private void populateAutoComplete() {
@ -188,25 +193,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 +212,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 +245,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

@ -1,25 +1,32 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import java.util.ArrayList;
/**
* Created by JERLocal on 7/1/2016.
*/
public class Note {
// protected int id;
protected int likes;
protected ArrayList<String> tags;
protected float lat, lon;
protected String id, address, title, body;
protected String timestamp;
protected String id, address, title, body, timestamp;
protected boolean isPublic;
public Note(String id, float lat, float lon, String address, String title, String body, String timestamp, boolean isPublic) {
public Note(String id, float lat, float lon, String address, String title, String body, String timestamp, boolean isPublic, int likes, ArrayList<String> tags) {
this.id = id;
this.lat = lat;
this.lon = lon;
this.address = address;
this.title = title;
this.body = body;
this.timestamp = timestamp;
this.isPublic = isPublic;
this.likes = likes;
this.tags = tags;
}
@Override
@ -103,6 +110,21 @@ public class Note {
public String getLocationAndTime() {
return getTimestamp()+" at "+ getAddress();
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public ArrayList<String> getTags() {
return tags;
}
public void setTags(ArrayList<String> tags) {
this.tags = tags;
}
// public void save(SQLiteOpenHelper dbHelper, Context context){
// SQLiteDatabase db = dbHelper.getWritableDatabase();

View file

@ -15,6 +15,7 @@ import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Switch;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.Response;
@ -29,6 +30,7 @@ import org.json.JSONObject;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -72,8 +74,8 @@ public class PersonalSpaceActivity extends AppCompatActivity {
listOfNotes = new ArrayList<>();
//add demo notes to view
addDemoNotes(listOfNotes);
//TODO - remove -add demo notes to view
// addDemoNotes(listOfNotes);
noteListAdapter = new ListAdapter(this, listOfNotes);
noteList.setAdapter(noteListAdapter);
@ -123,6 +125,22 @@ public class PersonalSpaceActivity extends AppCompatActivity {
saveBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//title too short
if (newTitle.getText().length() == 0)
{
Toast toast = Toast.makeText(PersonalSpaceActivity.this, "Title too short.", Toast.LENGTH_LONG);
toast.show();
return;
}
//title too long
if (newTitle.getText().length() > 20)
{
Toast toast = Toast.makeText(PersonalSpaceActivity.this, "Title too long.\n Use up to 20 notes.", Toast.LENGTH_LONG);
toast.show();
return;
}
//volley post
final JSONObject noteJson = new JSONObject();
try {
@ -165,17 +183,17 @@ public class PersonalSpaceActivity extends AppCompatActivity {
//TODO remove
public void addDemoNotes(List<Note> listOfNotes) {
Note n1 = new Note("1", 100, 100, "location1", "My 1st Title", "ohh i'm so sexy1", ""+System.currentTimeMillis() / 1000, true);
Note n2 = new Note("2", 200, 200, "location2", "My 2st Title", "ohh i'm so sexy2", ""+System.currentTimeMillis() / 1000, true);
Note n3 = new Note("3", 300, 300, "hell", "My 3st Title", "ohh i'm so sexy3", ""+System.currentTimeMillis() / 1000, true);
// Note n4 = new Note("4", 400, 400, "hell2", "My 4st Title", "ohh i'm so sexy4", ""+System.currentTimeMillis() / 1000, true);
listOfNotes.add(n1);
listOfNotes.add(n2);
listOfNotes.add(n3);
// listOfNotes.add(n4);
}
// //TODO remove
// public void addDemoNotes(List<Note> listOfNotes) {
// Note n1 = new Note("1", 100, 100, "location1", "My 1st Title", "ohh i'm so sexy1", ""+System.currentTimeMillis() / 1000, true);
// Note n2 = new Note("2", 200, 200, "location2", "My 2st Title", "ohh i'm so sexy2", ""+System.currentTimeMillis() / 1000, true);
// Note n3 = new Note("3", 300, 300, "hell", "My 3st Title", "ohh i'm so sexy3", ""+System.currentTimeMillis() / 1000, true);
//// Note n4 = new Note("4", 400, 400, "hell2", "My 4st Title", "ohh i'm so sexy4", ""+System.currentTimeMillis() / 1000, true);
// listOfNotes.add(n1);
// listOfNotes.add(n2);
// listOfNotes.add(n3);
//// listOfNotes.add(n4);
// }
public void setLocationPermission(boolean locationPermission) {
@ -192,19 +210,22 @@ public class PersonalSpaceActivity extends AppCompatActivity {
Date time = new Date();
JSONObject noteObject = response.getJSONObject("note");
time.setTime(noteObject.getLong("created_at"));
addNoteFromJsonObj(noteObject, time);
Note addNote = new Note(
noteObject.getString("id"),
Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
noteObject.getJSONObject("location").getString("address"),
noteObject.getString("title"),
noteObject.getString("body"),
time.toString(),
noteObject.getBoolean("is_public")
);
listOfNotes.add(addNote);
// Note addNote = new Note(
// noteObject.getString("id"),
// Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
// Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
// noteObject.getJSONObject("location").getString("address"),
// noteObject.getString("title"),
// noteObject.getString("body"),
// time.toString(),
// noteObject.getBoolean("is_public"),
// noteObject.getInt("likes"),
// jsonArrayToStringArray(noteObject.getJSONArray("tags"))
// );
//
// listOfNotes.add(addNote);
noteList.setAdapter(noteListAdapter);
} catch (Exception e) {
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
@ -236,17 +257,20 @@ public class PersonalSpaceActivity extends AppCompatActivity {
JSONObject noteObject = noteObjectsArray.getJSONObject(i);
time.setTime(noteObject.getLong("created_at"));
Note addNote = new Note(
noteObject.getString("id"),
Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
noteObject.getJSONObject("location").getString("address"),
noteObject.getString("title"),
noteObject.getString("body"),
time.toString(),
noteObject.getBoolean("is_public")
);
listOfNotes.add(addNote);
addNoteFromJsonObj(noteObject, time);
// Note addNote = new Note(
// noteObject.getString("id"),
// Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
// Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
// noteObject.getJSONObject("location").getString("address"),
// noteObject.getString("title"),
// noteObject.getString("body"),
// time.toString(),
// noteObject.getBoolean("is_public"),
// noteObject.getInt("likes"),
// jsonArrayToStringArray(noteObject.getJSONArray("tags"))
// );
// listOfNotes.add(addNote);
}
noteList.setAdapter(noteListAdapter);
} catch (Exception e) {
@ -326,4 +350,35 @@ public class PersonalSpaceActivity extends AppCompatActivity {
private ArrayList<String> jsonArrayToStringArray(JSONArray jArray){
ArrayList<String> stringArray = new ArrayList<String>();
for(int i = 0, count = jArray.length(); i< count; i++)
{
try {
JSONObject jsonObject = jArray.getJSONObject(i);
stringArray.add(jsonObject.toString());
}
catch (JSONException e) {
e.printStackTrace();
}
}
return stringArray;
}
private void addNoteFromJsonObj(JSONObject noteObject, Date time) throws JSONException {
Note addNote = new Note(
noteObject.getString("id"),
Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
noteObject.getJSONObject("location").getString("address"),
noteObject.getString("title"),
noteObject.getString("body"),
time.toString(),
noteObject.getBoolean("is_public"),
noteObject.getInt("likes"),
jsonArrayToStringArray(noteObject.getJSONArray("tags"))
);
listOfNotes.add(addNote);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,14 +1,21 @@
<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"
android:id="@+id/layout">
<!-- Login progress -->
<ProgressBar
@ -19,61 +26,56 @@
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"
android:contentDescription="@string/logo" />
<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,49 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_title_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_body_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_time_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_address_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_tags_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_permission_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_likes_textview" />
</LinearLayout>

View file

@ -1,8 +1,22 @@
<?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:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="0dp"
android:layout_height="70dp"
android:id="@+id/nvm_permission_textview"
android:background="@android:drawable/ic_lock_lock"
android:layout_weight="0.2"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -23,5 +37,31 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="location"
android:id="@+id/nvm_location_textview" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tags #1"
android:id="@+id/nvm_tags1_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tags #2"
android:id="@+id/nvm_tags2_textview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Likes"
android:id="@+id/nvm_likes_textview" />
</LinearLayout>
</LinearLayout>

View file

@ -18,6 +18,7 @@
<string name="title_activity_personal_space">PersonalSpaceActivity</string>
<string name="nvf_private_label">Private</string>
<string name="nvf_public_label">Public</string>
<string name="logo">Logo</string>
<string name="nvf_title">Title</string>
<string name="nvf_content">Content</string>
<string name="throw_me">Throw Me</string>