integrated new note dialog
This commit is contained in:
parent
687f177680
commit
41b4b47a36
13 changed files with 179 additions and 33 deletions
|
@ -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$" />
|
||||
|
|
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>
|
|
@ -1,13 +1,13 @@
|
|||
<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://$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>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<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://$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>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<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://$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>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
</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://$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,12 @@
|
|||
<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://$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$/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://$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>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
</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://$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,8 @@
|
|||
</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://$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>
|
||||
|
|
12
.idea/libraries/volley_1_0_0.xml
Normal file
12
.idea/libraries/volley_1_0_0.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<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" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.android.volley/volley/1.0.0/c79696d64f9520675054e27b77f490c17d8b4b9e/volley-1.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -24,4 +24,5 @@ dependencies {
|
|||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:23.3.0'
|
||||
compile 'com.android.support:design:23.3.0'
|
||||
compile 'com.android.volley:volley:1.0.0'
|
||||
}
|
||||
|
|
|
@ -3,11 +3,23 @@ package com.android_app.matan.ara.sagi.thesocialnotework;
|
|||
import android.app.Dialog;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Switch;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.toolbox.JsonArrayRequest;
|
||||
import com.android.volley.toolbox.JsonObjectRequest;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -16,6 +28,9 @@ public class PersonalSpaceActivity extends AppCompatActivity {
|
|||
|
||||
protected ListView noteList;
|
||||
protected Button addBtn;
|
||||
private final String TAG = "Personal Space Activity";
|
||||
protected String url = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -53,9 +68,68 @@ public class PersonalSpaceActivity extends AppCompatActivity {
|
|||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
dialog.getWindow().setAttributes(lp);
|
||||
|
||||
|
||||
final Switch permissionSwitch = (Switch) dialog.findViewById(R.id.nvf_note_permission);
|
||||
EditText newTitle = (EditText) dialog.findViewById(R.id.nvf_note_title);
|
||||
EditText newBody = (EditText) dialog.findViewById(R.id.nvf_note_content);
|
||||
Button saveBtn = (Button) dialog.findViewById(R.id.nvf_note_submit_btn);
|
||||
Button cancleBtn = (Button) dialog.findViewById(R.id.nvf_note_cancel_btn);
|
||||
|
||||
cancleBtn.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
saveBtn.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
permissionSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked)
|
||||
permissionSwitch.setText(R.string.nvf_public_label);
|
||||
else
|
||||
permissionSwitch.setText(R.string.nvf_private_label);
|
||||
|
||||
// do something, the isChecked will be
|
||||
// true if the switch is in the On position
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void newNote(String show) {
|
||||
JsonArrayRequest request =
|
||||
new JsonArrayRequest(
|
||||
Request.Method.POST,
|
||||
url,
|
||||
null,
|
||||
new Response.Listener<JSONArray>() {
|
||||
@Override
|
||||
public void onResponse(JSONArray response) {
|
||||
Log.d(TAG, "success: response - " + response.toString());
|
||||
// loadData(response, true);
|
||||
}
|
||||
},
|
||||
new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
Log.d(TAG, "error: msg: " + error.getMessage());
|
||||
}
|
||||
}
|
||||
);
|
||||
VolleyUtilSingleton.getInstance(this).addToRequestQueue(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.android_app.matan.ara.sagi.thesocialnotework;
|
||||
import android.content.Context;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.ImageLoader;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
|
||||
/**
|
||||
* Created by aranz on 7/1/2016.
|
||||
*/
|
||||
public class VolleyUtilSingleton {
|
||||
|
||||
private static VolleyUtilSingleton mInstance;
|
||||
private RequestQueue mRequestQueue;
|
||||
// private ImageLoader mImageLoader;
|
||||
private static Context mCtx;
|
||||
|
||||
|
||||
private VolleyUtilSingleton(Context context) {
|
||||
mCtx = context;
|
||||
mRequestQueue = getRequestQueue();
|
||||
|
||||
// mImageLoader = new ImageLoader(this.mRequestQueue,new LruBitmapCache());
|
||||
}
|
||||
|
||||
public static synchronized VolleyUtilSingleton getInstance(Context context) {
|
||||
if (mInstance == null) {
|
||||
mInstance = new VolleyUtilSingleton(context);
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
public RequestQueue getRequestQueue() {
|
||||
if (mRequestQueue == null) {
|
||||
// getApplicationContext() is key, it keeps you from leaking the
|
||||
// Activity or BroadcastReceiver if someone passes one in.
|
||||
mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
|
||||
}
|
||||
return mRequestQueue;
|
||||
}
|
||||
|
||||
public <T> void addToRequestQueue(Request<T> req) {
|
||||
getRequestQueue().add(req);
|
||||
}
|
||||
|
||||
// public ImageLoader getImageLoader() {
|
||||
// return mImageLoader;
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in a new issue