UI improve in Display Note
This commit is contained in:
parent
90d2438cb1
commit
c27d2aadf9
12 changed files with 116 additions and 59 deletions
9
.idea/libraries/android_android_23.xml
Normal file
9
.idea/libraries/android_android_23.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<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>
|
|
@ -6,6 +6,7 @@
|
|||
</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:///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,6 +9,7 @@
|
|||
</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:///opt/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.3.0/appcompat-v7-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
</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:///opt/android-sdk/extras/android/m2repository/com/android/support/design/23.3.0/design-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<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!/" />
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.3.0/res" />
|
||||
</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:///opt/android-sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.3.0/recyclerview-v7-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-23.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0.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.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:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.3.0/support-annotations-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
</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/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!/" />
|
||||
<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!/" />
|
||||
</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:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/23.3.0/support-v4-23.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
</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:///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="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!/" />
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/res" />
|
||||
</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.7" 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.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -10,11 +10,13 @@ import android.os.Bundle;
|
|||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.volley.Request;
|
||||
|
@ -79,16 +81,57 @@ public class PersonalSpaceActivity extends AppCompatActivity {
|
|||
noteListAdapter = new ListAdapter(this, listOfNotes);
|
||||
|
||||
noteList.setAdapter(noteListAdapter);
|
||||
// new HeavyWorker(this).execute();
|
||||
getAllNotes();
|
||||
new HeavyWorker(this).execute();
|
||||
// getAllNotes();
|
||||
|
||||
//https://thesocialnotework-api.appspot.com/api/note/all?uid=<USER_ID>
|
||||
addBtn.setOnClickListener(addNewNoteDialog);
|
||||
|
||||
// click on listView item
|
||||
noteList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
//create and configure dialog
|
||||
Note note = listOfNotes.get(position);
|
||||
final Dialog dialog = new Dialog(PersonalSpaceActivity.this);
|
||||
dialog.setContentView(R.layout.note_display_full);
|
||||
dialog.setTitle("You wrote...");
|
||||
|
||||
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
|
||||
lp.copyFrom(dialog.getWindow().getAttributes());
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
dialog.show();
|
||||
// dialog.getWindow().setAttributes(lp);
|
||||
|
||||
|
||||
//get note_view_full layout elements
|
||||
final TextView title = (TextView) dialog.findViewById(R.id.ndf_title_textview);
|
||||
final TextView body = (TextView) dialog.findViewById(R.id.ndf_body_textview);
|
||||
final TextView time = (TextView) dialog.findViewById(R.id.ndf_time_textview);
|
||||
final TextView location = (TextView) dialog.findViewById(R.id.ndf_address_textview);
|
||||
final TextView likes = (TextView) dialog.findViewById(R.id.ndf_likes_textview);
|
||||
final TextView tags = (TextView) dialog.findViewById(R.id.ndf_tags_textview);
|
||||
final TextView permission = (TextView) dialog.findViewById(R.id.ndf_permission_textview);
|
||||
|
||||
|
||||
title.setText(note.getTitle());
|
||||
body.setText(note.getBody());
|
||||
time.setText(note.getTimestamp());
|
||||
location.setText("Tags: "+note.getAddress());
|
||||
likes.setText("Likes: "+note.getLikes());
|
||||
tags.setText(note.getTags().toString());
|
||||
permission.setText("Permission: "+ (note.isPublic() ? "Public" : "Private"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getAllNotes(){
|
||||
Log.d(TAG, "url: "+BASE_URL + "/note/all?uid="+userId);
|
||||
VolleyUtilSingleton.getInstance(PersonalSpaceActivity.this).get(BASE_URL + "/note/all?uid="+userId, getNotesSuccessListener, genericErrorListener);
|
||||
|
@ -183,19 +226,6 @@ 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);
|
||||
// }
|
||||
|
||||
|
||||
public void setLocationPermission(boolean locationPermission) {
|
||||
this.locationPermission = locationPermission;
|
||||
}
|
||||
|
|
|
@ -1,49 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<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" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:id="@+id/ndf_time_textview" />
|
||||
<TextView
|
||||
android:id="@+id/ndf_title_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Title"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:id="@+id/ndf_address_textview" />
|
||||
<TextView
|
||||
android:id="@+id/ndf_body_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Body"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:id="@+id/ndf_tags_textview" />
|
||||
<TextView
|
||||
android:id="@+id/ndf_time_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:id="@+id/ndf_permission_textview" />
|
||||
<TextView
|
||||
android:id="@+id/ndf_address_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:id="@+id/ndf_likes_textview" />
|
||||
<TextView
|
||||
android:id="@+id/ndf_tags_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/ndf_permission_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ndf_likes_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="New Text" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
Loading…
Reference in a new issue