The Big Merge - Fixed Conflicts - Needs Cleaning

This commit is contained in:
Sagi Dayan 2016-07-06 14:00:51 +03:00
commit d85693d54f
78 changed files with 1644 additions and 460 deletions

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

View file

@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="animated-vector-drawable-23.4.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.4.0/animated-vector-drawable-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="appcompat-v7-23.4.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="design-23.4.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/design/23.4.0/design-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-analytics-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-analytics-impl-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics-impl/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics-impl/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-auth-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-auth-common-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-common/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-common/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-auth-module-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-module/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-module/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-common-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-common/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-common/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-config-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-config/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-config/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-crash-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-crash/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-crash/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-database-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-database-connection-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database-connection/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database-connection/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-iid-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-iid/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-iid/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-messaging-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-messaging/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-messaging/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-storage-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="firebase-storage-common-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage-common/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage-common/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,16 @@
<component name="libraryTable">
<library name="mediarouter-v7-23.0.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/jars/libs/internal_impl-23.0.0.jar!/" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/23.0.0/mediarouter-v7-23.0.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-ads-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-ads-lite-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads-lite/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads-lite/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-analytics-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-analytics-impl-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics-impl/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics-impl/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-appindexing-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-appinvite-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appinvite/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appinvite/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-auth-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-auth-base-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-base-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-basement-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-cast-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-cast-framework-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast-framework/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast-framework/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-clearcut-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-clearcut/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-clearcut/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-contextmanager-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-contextmanager/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-contextmanager/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-drive-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-drive/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-drive/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-fitness-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-fitness/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-fitness/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-games-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-games/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-games/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-gass-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-gass/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-gass/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-gcm-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-identity-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-iid-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-iid/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-iid/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-location-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-maps-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-nearby-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-nearby/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-nearby/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-panorama-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-panorama/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-panorama/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-places-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-places/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-places/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-plus-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-safetynet-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-safetynet/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-safetynet/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-tagmanager-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-tagmanager-api-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager-api/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager-api/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-tasks-9.2.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-vision-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-wallet-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-wallet/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-wallet/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="play-services-wearable-9.2.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="recyclerview-v7-23.4.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.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.4.0/recyclerview-v7-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="support-annotations-23.4.0">
<CLASSES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,16 @@
<component name="libraryTable">
<library name="support-v4-23.4.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/libs/internal_impl-23.4.0.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.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.4.0/support-v4-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="support-vector-drawable-23.4.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.4.0/support-vector-drawable-23.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

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

View file

@ -0,0 +1,21 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=F0:CE:E8:80:13:79:2F:63:B1:4D:F7:24:28:39:A8:0B:94:85:EE:10%3Bcom.android_app.matan.ara.sagi.thesocialnotework
You can also add your credentials to an existing key, using this line:
F0:CE:E8:80:13:79:2F:63:B1:4D:F7:24:28:39:A8:0B:94:85:EE:10;com.android_app.matan.ara.sagi.thesocialnotework
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
AIzaSyAh1zNJoLXlCF_MWXQLQyer4nADBVevIPo
</string>
</resources>

View file

@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android_app.matan.ara.sagi.thesocialnotework">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
@ -35,6 +36,8 @@
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity android:name=".RegisterActivity"
android:noHistory="true"></activity>
</application>
</manifest>

View file

@ -91,10 +91,10 @@ public class GPSUtils extends Service implements LocationListener {
if (isNetworkEnabled) {
if (ContextCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
Log.e("TAG", "No Permissions");
((PersonalSpaceActivity)mContext).setLocationPermission(false);
((MainActivity)mContext).setLocationPermission(false);
return null;
}else{
((PersonalSpaceActivity)mContext).setLocationPermission(true);
((MainActivity)mContext).setLocationPermission(true);
}
Log.d(TAG, "Network");
if (locationManager != null) {

View file

@ -30,8 +30,8 @@ public class HeavyWorker extends AsyncTask< String , Context , Void > {
protected Void doInBackground ( String ... params ) {
// Do Your WORK here
PersonalSpaceActivity ps = (PersonalSpaceActivity)targetCtx;
ps.getAllNotes();
// MainActivity ps = (MainActivity) targetCtx;
// ps.getAllNotes();
return null ;
}

View file

@ -74,6 +74,9 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
private EditText mPasswordView;
private View mProgressView;
private View mLoginFormView;
private TextView mRegisterButton;
private Button mLoginButton;
private final String TAG = "Login Activity";
@ -85,13 +88,19 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_login);
this.self = this;
this.layout = (LinearLayout) findViewById(R.id.layout);
mUsernameView = (EditText) findViewById(R.id.al_username);
mPasswordView = (EditText) findViewById(R.id.al_password);
mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress);
showProgress(false);
// Remove Auto Focus from the Text Fields
layout.setFocusable(true);
layout.setFocusableInTouchMode(true);
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
@ -102,30 +111,29 @@ 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 mEmailSignInButton = (Button) findViewById(R.id.al_login_button);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
mRegisterButton = (TextView) findViewById(R.id.al_register_button);
mRegisterButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "going to Register...page");
Intent registerActivity = new Intent(LoginActivity.this, RegisterActivity.class);
startActivity(registerActivity);
}
});
mLoginButton = (Button) findViewById(R.id.al_login_button);
mLoginButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "Login.......");
showProgress(false);
attemptLogin();
}
});
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() {
@ -201,6 +209,8 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
String username = mUsernameView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
// http request register
JSONObject tempJson = new JSONObject();
@ -223,7 +233,6 @@ public class LoginActivity extends AppCompatActivity{ // implements LoaderCallba
@Override
public void onResponse(JSONObject response) {
try {
// if(response.get("user") != null) {
if(!response.isNull("user")) {
Log.e(TAG, "onLoginSuccess => user exist"); // TODO: REMOVE console
Intent personalSpaceActivity = new Intent(LoginActivity.this, MainActivity.class);

View file

@ -20,6 +20,8 @@ public class MainActivity extends AppCompatActivity
protected final String TAG = "[TSN / MainActivity]";
protected String userId;
private GPSUtils gpsUtils;
private boolean locationPermission;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -59,6 +61,9 @@ public class MainActivity extends AppCompatActivity
ft.replace(R.id.fragment_container, personalFragment);
ft.commit();
Log.d(TAG, "Changed");
gpsUtils = new GPSUtils(this);
gpsUtils.getLocation();
}
@Override
@ -114,7 +119,14 @@ public class MainActivity extends AppCompatActivity
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}public GPSUtils getGPSUtils() {
return this.gpsUtils;
}
public void setLocationPermission(boolean locationPermission) {
this.locationPermission = locationPermission;
}
}

View file

@ -0,0 +1,68 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
//import com.google.android.gms.maps.CameraUpdateFactory;
//import com.google.android.gms.maps.GoogleMap;
//import com.google.android.gms.maps.OnMapReadyCallback;
//import com.google.android.gms.maps.SupportMapFragment;
//import com.google.android.gms.maps.model.LatLng;
//import com.google.android.gms.maps.model.MarkerOptions;
import java.util.ArrayList;
//
//public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
////
//// private GoogleMap mMap;
//// private ArrayList<Note> listOfNotes;
//// private float userLat, userLng;
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_maps);
// // Obtain the SupportMapFragment and get notified when the map is ready to be used.
// SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
// .findFragmentById(R.id.map);
// mapFragment.getMapAsync(this);
//
// Log.d("Tag","in maps create");
// listOfNotes = getIntent().getParcelableArrayListExtra("note_list");
// userLat = getIntent().getFloatExtra("user_lat", -34);
// userLng = getIntent().getFloatExtra("user_lng", 151);
// Toast.makeText(this, listOfNotes.get(1).title, Toast.LENGTH_LONG).show();
// }
//
//
// /**
// * Manipulates the map once available.
// * This callback is triggered when the map is ready to be used.
// * This is where we can add markers or lines, add listeners or move the camera. In this case,
// * we just add a marker near Sydney, Australia.
// * If Google Play services is not installed on the device, the user will be prompted to install
// * it inside the SupportMapFragment. This method will only be triggered once the user has
// * installed Google Play services and returned to the app.
// */
// @Override
// public void onMapReady(GoogleMap googleMap) {
// mMap = googleMap;
//
// LatLng userLocation = new LatLng(userLat,userLng);
// LatLng noteLocation = null;
//
// for (Note note :listOfNotes){
// noteLocation = new LatLng(note.getLat(),note.getLon());
// mMap.addMarker(new MarkerOptions().position(noteLocation).title(note.getTitle()));
// }
// // Add a marker in Sydney and move the camera
//// LatLng sydney = new LatLng(-34, 151);
//// mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
// mMap.addMarker(new MarkerOptions().position(userLocation).title("I Am Here!"));
//
// mMap.moveCamera(CameraUpdateFactory.newLatLng(userLocation));
// }
//}

View file

@ -1,11 +1,14 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
/**
* Created by JERLocal on 7/1/2016.
*/
public class Note {
public class Note implements Parcelable{
protected int likes;
protected ArrayList<String> tags;
@ -15,6 +18,7 @@ public class Note {
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;
@ -29,6 +33,31 @@ public class Note {
this.tags = tags;
}
protected Note(Parcel in) {
likes = in.readInt();
tags = in.createStringArrayList();
lat = in.readFloat();
lon = in.readFloat();
id = in.readString();
address = in.readString();
title = in.readString();
body = in.readString();
timestamp = in.readString();
isPublic = in.readByte() != 0;
}
public static final Creator<Note> CREATOR = new Creator<Note>() {
@Override
public Note createFromParcel(Parcel in) {
return new Note(in);
}
@Override
public Note[] newArray(int size) {
return new Note[size];
}
};
@Override
public String toString() {
return "Note{" +
@ -126,6 +155,26 @@ public class Note {
this.tags = tags;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(likes);
dest.writeList(tags);
dest.writeFloat(lat);
dest.writeFloat(lon);
dest.writeString(id);
dest.writeString(address);
dest.writeString(title);
dest.writeString(body);
dest.writeString(timestamp);
dest.writeByte((byte) (isPublic ? 1 : 0));
}
// public void save(SQLiteOpenHelper dbHelper, Context context){
// SQLiteDatabase db = dbHelper.getWritableDatabase();
// ContentValues values = new ContentValues();

View file

@ -72,7 +72,7 @@ public class PersonalFragment extends Fragment {
this.noteList = (ListView) view.findViewById(R.id.ps_list_listview);
addBtn = (Button) view.findViewById(R.id.ps_new_note_button);
gpsUtils = new GPSUtils(getContext());
gpsUtils = ((MainActivity)getActivity()).getGPSUtils();
gpsUtils.getLocation();

View file

@ -1,263 +1,465 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import android.Manifest;
import android.app.Dialog;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
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.Toast;
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 org.json.JSONException;
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;
import java.util.Map;
import java.util.TimeZone;
//http://thesocialnotework.appspot.com/api/status | http://localhost:8080/api/note/all?uid=<userID>
public class PersonalSpaceActivity extends AppCompatActivity {
protected ListView noteList;
protected Button addBtn;
private final String TAG = "Personal Space Activity";
private final int FINE_PERM = 0;
private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
private boolean locationPermission;
private GPSUtils gpsUtils;
private List<Note> listOfNotes;
private ListAdapter noteListAdapter;
private String userId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_personal_space);
Bundle b = getIntent().getExtras();
userId = b.getString("user_id");
Log.d(TAG,"-------------------------USER ID: "+ userId);
this.locationPermission = true;
//check for permission
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, FINE_PERM);
this.noteList = (ListView) findViewById(R.id.ps_list_listview);
addBtn = (Button) findViewById(R.id.ps_new_note_button);
gpsUtils = new GPSUtils(this);
gpsUtils.getLocation();
listOfNotes = new ArrayList<>();
//TODO - remove -add demo notes to view
// addDemoNotes(listOfNotes);
noteListAdapter = new ListAdapter(this, listOfNotes);
noteList.setAdapter(noteListAdapter);
// new HeavyWorker(this).execute();
getAllNotes();
//https://thesocialnotework-api.appspot.com/api/note/all?uid=<USER_ID>
addBtn.setOnClickListener(addNewNoteDialog);
}
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);
}
private View.OnClickListener addNewNoteDialog = new View.OnClickListener() {
public void onClick(View v) {
//create and configure dialog
final Dialog dialog = new Dialog(PersonalSpaceActivity.this);
dialog.setContentView(R.layout.note_view_full);
dialog.setTitle("New Note");
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(dialog.getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
dialog.setCancelable(false);
dialog.show();
dialog.getWindow().setAttributes(lp);
//get note_view_full layout elements
final Switch permissionSwitch = (Switch) dialog.findViewById(R.id.nvf_note_permission);
final EditText newTitle = (EditText) dialog.findViewById(R.id.nvf_note_title);
final EditText newBody = (EditText) dialog.findViewById(R.id.nvf_note_content);
Button saveBtn = (Button) dialog.findViewById(R.id.nvf_note_submit_btn);
Button cancelBtn = (Button) dialog.findViewById(R.id.nvf_note_cancel_btn);
cancelBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
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 {
//TODO need to get owner id from login screen
noteJson.put("owner_id", userId);
noteJson.put("title", newTitle.getText());
noteJson.put("lat", gpsUtils.getLatitude());
noteJson.put("lng", gpsUtils.getLongitude());
noteJson.put("address", gpsUtils.getAddress());
noteJson.put("body", newBody.getText());
noteJson.put("is_public", permissionSwitch.isChecked());
// noteJson.put("tags",);
Log.d(TAG, "Json: " + noteJson.toString());
} catch (Exception e) {
Log.d(TAG, "saveBtn: "+e.toString());
}
//send request and close dialog
VolleyUtilSingleton.getInstance(PersonalSpaceActivity.this).post(BASE_URL + "/note/upsert", noteJson, newNoteSuccessListener, genericErrorListener);
dialog.dismiss();
}
});
//change text of switch according to state.
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);
}
});
}
};
// //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;
}
//response listener for adding new note
Response.Listener<JSONObject> newNoteSuccessListener = new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.d(TAG, "newNoteSuccess: response - " + response.toString());
try {
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"),
// noteObject.getInt("likes"),
// jsonArrayToStringArray(noteObject.getJSONArray("tags"))
// );
//package com.android_app.matan.ara.sagi.thesocialnotework;
//
// listOfNotes.add(addNote);
noteList.setAdapter(noteListAdapter);
} catch (Exception e) {
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
}
}
};
//response Error listener for adding new note
Response.ErrorListener newNoteErrorListener = new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(TAG, "newNoteError: msg: " + error.getMessage());
}
};
//response listener for getting all user notes
Response.Listener<JSONObject> getNotesSuccessListener = new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.d(TAG,"getNotesSuccessListener: "+response.toString());
try {
//need to get all notes and add to listOfNotes
JSONArray noteObjectsArray = response.getJSONArray("notes");
Date time = new Date();
for (int i = 0; i < noteObjectsArray.length(); i++) {
JSONObject noteObject = noteObjectsArray.getJSONObject(i);
time.setTime(noteObject.getLong("created_at"));
addNoteFromJsonObj(noteObject, time);
//import android.Manifest;
//import android.app.AlertDialog;
//import android.app.Dialog;
//import android.app.FragmentTransaction;
//import android.content.DialogInterface;
//import android.content.Intent;
//import android.content.pm.PackageManager;
//import android.os.Parcelable;
//import android.support.v4.app.ActivityCompat;
//import android.support.v4.content.ContextCompat;
//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.AdapterView;
//import android.widget.Button;
//import android.widget.CompoundButton;
//import android.widget.EditText;
//import android.widget.ImageButton;
//import android.widget.ListView;
//import android.widget.Switch;
//import android.widget.TextView;
//import android.widget.Toast;
//
//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 com.google.android.gms.maps.MapFragment;
//
//import org.json.JSONArray;
//import org.json.JSONException;
//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;
//import java.util.Map;
//import java.util.TimeZone;
//
//
////TODO - change all "setOnClickListener to xml onClick
////TODO -
//
////http://thesocialnotework.appspot.com/api/status | http://localhost:8080/api/note/all?uid=<userID>
//public class PersonalSpaceActivity extends AppCompatActivity {
//
// protected ListView noteList;
// protected Button addBtn, mapButton;
// private final String TAG = "Personal Space Activity";
// private final int FINE_PERM = 0;
// private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
// private boolean locationPermission;
// private GPSUtils gpsUtils;
// private List<Note> listOfNotes;
// private ListAdapter noteListAdapter;
// private String userId;
//// private MapFragment mMapFragment;
//
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_personal_space);
// Bundle b = getIntent().getExtras();
// userId = b.getString("user_id");
// Log.d(TAG, "-------------------------USER ID: " + userId);
//
// this.locationPermission = true;
//
// //check for permission
// ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, FINE_PERM);
//
//
// this.noteList = (ListView) findViewById(R.id.ps_list_listview);
// addBtn = (Button) findViewById(R.id.ps_new_note_button);
// mapButton = (Button) findViewById(R.id.ps_maps_btn);
// gpsUtils = new GPSUtils(this);
// gpsUtils.getLocation();
//
//
// listOfNotes = new ArrayList<>();
// //TODO - remove -add demo notes to view
//// addDemoNotes(listOfNotes);
// noteListAdapter = new ListAdapter(this, listOfNotes);
//
// noteList.setAdapter(noteListAdapter);
// new HeavyWorker(this).execute();
//// getAllNotes();
//
// addBtn.setOnClickListener(addNewNoteDialog);
//
// mapButton.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v) {
// Log.d(TAG, "IN TESTS!!!!!!!!!!!!!!");
////
// Toast.makeText(PersonalSpaceActivity.this, "SUCCESS", Toast.LENGTH_LONG).show();
//
// mMapFragment = MapFragment.newInstance();
// FragmentTransaction fragmentTransaction =
// getFragmentManager().beginTransaction();
// fragmentTransaction.add(R.id.map, mMapFragment);
// fragmentTransaction.commit();
// Intent mapsActivity = new Intent(PersonalSpaceActivity.this, MapsActivity.class);
//// Bundle loginUserBundle = new Bundle();
// mapsActivity.putParcelableArrayListExtra("note_list", (ArrayList<Note>) listOfNotes);
// mapsActivity.putExtra("user_lat", gpsUtils.getLatitude());
// mapsActivity.putExtra("user_lng", gpsUtils.getLongitude());
//// Log.d(TAG, "IN After!!!!!!!!!!!!!!");
////
// startActivity(mapsActivity);
// Log.d(TAG, "FINIsh!!!");
//
// }
// });
//
// // click on listView item
// noteList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
// @Override
// public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {
// //create and configure dialog
// final Note note = listOfNotes.get(position);
// final Dialog noteViewDialog = new Dialog(PersonalSpaceActivity.this);
// noteViewDialog.setContentView(R.layout.note_display_full);
// noteViewDialog.setTitle("You wrote...");
//
// WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
// lp.copyFrom(noteViewDialog.getWindow().getAttributes());
// lp.width = WindowManager.LayoutParams.MATCH_PARENT;
// lp.height = WindowManager.LayoutParams.MATCH_PARENT;
// noteViewDialog.show();
//// dialog.getWindow().setAttributes(lp);
//
//
// //get note_view_full layout elements
// final TextView title = (TextView) noteViewDialog.findViewById(R.id.ndf_title_textview);
// final TextView body = (TextView) noteViewDialog.findViewById(R.id.ndf_body_textview);
// final TextView time = (TextView) noteViewDialog.findViewById(R.id.ndf_time_textview);
// final TextView location = (TextView) noteViewDialog.findViewById(R.id.ndf_address_textview);
// final TextView likes = (TextView) noteViewDialog.findViewById(R.id.ndf_likes_textview);
// final TextView tags = (TextView) noteViewDialog.findViewById(R.id.ndf_tags_textview);
// final TextView permission = (TextView) noteViewDialog.findViewById(R.id.ndf_permission_textview);
// final ImageButton deleteBtn = (ImageButton) noteViewDialog.findViewById(R.id.ndf_delete_imagebutton);
//
//
// 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"));
//
// deleteBtn.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v) {
// //Put up the Yes/No message box
// AlertDialog.Builder builder = new AlertDialog.Builder(PersonalSpaceActivity.this);
// builder
// .setTitle("Delete Note")
// .setMessage("Are you sure you want to delete the note?")
// .setIcon(android.R.drawable.ic_dialog_alert)
// .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// //Yes button clicked, do something
// Toast.makeText(PersonalSpaceActivity.this, "Item Deleted!",
// Toast.LENGTH_SHORT).show();
// //TODO send delete
// JSONObject delNote = new JSONObject();
// try {
// delNote.put("uid", userId);
// delNote.put("nid", note.getId());
// VolleyUtilSingleton.getInstance(PersonalSpaceActivity.this).post(BASE_URL + "/note/delete", delNote, deleteNoteSuccessListener, genericErrorListener);
// listOfNotes.remove(position);
//
// } catch (JSONException e) {
// Toast.makeText(PersonalSpaceActivity.this, "Something went wrong.\n Failed to delete note...", Toast.LENGTH_LONG).show();
// e.printStackTrace();
// }
// noteList.setAdapter(noteListAdapter);
//// dialog.dismiss();
// noteViewDialog.dismiss();
// }
// })
// .setNegativeButton("No", new DialogInterface.OnClickListener() {
// public void onClick(DialogInterface dialog, int which) {
// //Yes button clicked, do something
// Toast.makeText(PersonalSpaceActivity.this, "Note still here!",
// Toast.LENGTH_SHORT).show();
//// dialog.dismiss();
// noteViewDialog.dismiss();
// }
// }) //Do nothing on no
// .show();
// }
// });
//
// }
// });
//
//
// }
//
//
// 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);
// }
//
// private View.OnClickListener addNewNoteDialog = new View.OnClickListener() {
// public void onClick(View v) {
//
// //create and configure dialog
// final Dialog dialog = new Dialog(PersonalSpaceActivity.this);
// dialog.setContentView(R.layout.note_view_full);
// dialog.setTitle("New Note");
// WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
// lp.copyFrom(dialog.getWindow().getAttributes());
// lp.width = WindowManager.LayoutParams.MATCH_PARENT;
// lp.height = WindowManager.LayoutParams.MATCH_PARENT;
// dialog.setCancelable(false);
// dialog.show();
// dialog.getWindow().setAttributes(lp);
//
//
// //get note_view_full layout elements
// final Switch permissionSwitch = (Switch) dialog.findViewById(R.id.nvf_note_permission);
// final EditText newTitle = (EditText) dialog.findViewById(R.id.nvf_note_title);
// final EditText newBody = (EditText) dialog.findViewById(R.id.nvf_note_content);
// Button saveBtn = (Button) dialog.findViewById(R.id.nvf_note_submit_btn);
// Button cancelBtn = (Button) dialog.findViewById(R.id.nvf_note_cancel_btn);
//
// cancelBtn.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v) {
// dialog.dismiss();
// }
// });
//
// saveBtn.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v) {
//
// //title too short
// if (newTitle.getText().length() == 0) {
// Toast.makeText(PersonalSpaceActivity.this, "Title too short.", Toast.LENGTH_LONG).show();
// return;
// }
//
// //title too long
// if (newTitle.getText().length() > 20) {
// Toast.makeText(PersonalSpaceActivity.this, "Title too long.\n Use up to 20 notes.", Toast.LENGTH_LONG).show();
// return;
// }
// //volley post
// final JSONObject noteJson = new JSONObject();
// try {
//
// //TODO need to get owner id from login screen
// noteJson.put("owner_id", userId);
// noteJson.put("title", newTitle.getText());
// noteJson.put("lat", gpsUtils.getLatitude());
// noteJson.put("lng", gpsUtils.getLongitude());
// noteJson.put("address", gpsUtils.getAddress());
// noteJson.put("body", newBody.getText());
// noteJson.put("is_public", permissionSwitch.isChecked());
//// noteJson.put("tags",);
// Log.d(TAG, "Json: " + noteJson.toString());
//
//
// } catch (Exception e) {
// Log.d(TAG, "saveBtn: " + e.toString());
// }
//
// //send request and close dialog
// VolleyUtilSingleton.getInstance(PersonalSpaceActivity.this).post(BASE_URL + "/note/upsert", noteJson, newNoteSuccessListener, genericErrorListener);
// dialog.dismiss();
// }
// });
//
// //change text of switch according to state.
// 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);
// }
// });
//
//
// }
// };
//
//
// public void setLocationPermission(boolean locationPermission) {
// this.locationPermission = locationPermission;
// }
//
//
// //response listener for adding new note
// Response.Listener<JSONObject> newNoteSuccessListener = new Response.Listener<JSONObject>() {
// @Override
// public void onResponse(JSONObject response) {
// Log.d(TAG, "newNoteSuccess: response - " + response.toString());
// try {
// 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"),
//// noteObject.getInt("likes"),
//// jsonArrayToStringArray(noteObject.getJSONArray("tags"))
//// );
////
//// listOfNotes.add(addNote);
// noteList.setAdapter(noteListAdapter);
// } catch (Exception e) {
// Log.e(TAG, "newNoteSuccess:" + e.getMessage());
// }
//
// }
// };
//
//
// //response Error listener for adding new note
// Response.ErrorListener newNoteErrorListener = new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {
// Log.d(TAG, "newNoteError: msg: " + error.getMessage());
// }
// };
//
//
// //response listener for getting all user notes
// Response.Listener<JSONObject> getNotesSuccessListener = new Response.Listener<JSONObject>() {
// @Override
// public void onResponse(JSONObject response) {
// Log.d(TAG, "getNotesSuccessListener: " + response.toString());
// try {
// //need to get all notes and add to listOfNotes
// JSONArray noteObjectsArray = response.getJSONArray("notes");
// Date time = new Date();
// for (int i = 0; i < noteObjectsArray.length(); i++) {
// JSONObject noteObject = noteObjectsArray.getJSONObject(i);
// time.setTime(noteObject.getLong("created_at"));
//
// addNoteFromJsonObj(noteObject, time);
// }
// noteList.setAdapter(noteListAdapter);
// } catch (Exception e) {
// Log.e(TAG, "newNoteSuccess:" + e.getMessage());
// }
// }
// };
//
// //response listener for getting all user notes
// Response.Listener<JSONObject> deleteNoteSuccessListener = new Response.Listener<JSONObject>() {
// @Override
// public void onResponse(JSONObject response) {
// Log.d(TAG, "deleteNoteSuccessListener: " + response.toString());
//
//
// }
// };
//
// //response ErrorListener for getting all user notes
// Response.ErrorListener getNotesErrorListener = new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {
// Log.d(TAG, "getNotesErrorListener: " + error.getMessage());
// }
// };
//
// //Generic response ErrorListener
// Response.ErrorListener genericErrorListener = new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {
// Log.d(TAG, "genericErrorListener");
// error.printStackTrace();
// }
// };
//
//
// public void requestPermissions() {
// // Here, thisActivity is the current activity
// if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
// Manifest.permission.ACCESS_FINE_LOCATION)
// != PackageManager.PERMISSION_GRANTED) {
//
//
// ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
// new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
// FINE_PERM);
//
// // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// // app-defined int constant. The callback method gets the
// // result of the request.
//
// }
//
// if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
// Manifest.permission.ACCESS_FINE_LOCATION)
// != PackageManager.PERMISSION_GRANTED) {
//
//
// ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
// new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
// 1);
//
// // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// // app-defined int constant. The callback method gets the
// // result of the request.
//
// }
//
// if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
// Manifest.permission.ACCESS_COARSE_LOCATION)
// != PackageManager.PERMISSION_GRANTED) {
//
//
// ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
// new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
// FINE_PERM);
//
// // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// // app-defined int constant. The callback method gets the
// // result of the request.
//
// }
//
// }
//
//
// 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")),
@ -271,114 +473,19 @@ public class PersonalSpaceActivity extends AppCompatActivity {
// jsonArrayToStringArray(noteObject.getJSONArray("tags"))
// );
// listOfNotes.add(addNote);
}
noteList.setAdapter(noteListAdapter);
} catch (Exception e) {
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
}
}
};
//response ErrorListener for getting all user notes
Response.ErrorListener getNotesErrorListener = new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(TAG,"getNotesErrorListener: "+error.getMessage());
}
};
//Generic response ErrorListener
Response.ErrorListener genericErrorListener = new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(TAG,"genericErrorListener");
error.printStackTrace();
}
};
public void requestPermissions(){
// Here, thisActivity is the current activity
if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
FINE_PERM);
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
}
if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
1);
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
}
if (ContextCompat.checkSelfPermission(PersonalSpaceActivity.this,
Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(PersonalSpaceActivity.this,
new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
FINE_PERM);
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
}
}
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);
}
}
//
// }
//
//// public void goToMap(View v){
//// Log.d(TAG,"IN TESTS!!!!!!!!!!!!!!");
////
//// Toast.makeText(this,"SUCCESS",Toast.LENGTH_LONG).show();
//// Intent mapsActivity = new Intent(PersonalSpaceActivity.this, MapsActivity.class);
//// Bundle loginUserBundle = new Bundle();
//// mapsActivity.putParcelableArrayListExtra("note_list", (ArrayList<Note>) listOfNotes);
//// mapsActivity.putExtra("user_lat",gpsUtils.getLatitude());
//// mapsActivity.putExtra("user_lng",gpsUtils.getLongitude());
//// startActivity(mapsActivity);
////
//// }
//}

View file

@ -0,0 +1,173 @@
package com.android_app.matan.ara.sagi.thesocialnotework;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import org.json.JSONObject;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener{
private EditText mUsernameView;
private EditText mPasswordView;
private EditText mEmailView;
private Button registerButton;
private Button testBtn;
private RegisterActivity self;
protected RelativeLayout layout;
private final String TAG = "Register Activity";
private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
private final String REG_PATH = "/register";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
mUsernameView = (EditText) findViewById(R.id.ra_username);
mPasswordView = (EditText) findViewById(R.id.ra_password);
mEmailView = (EditText) findViewById(R.id.ra_email);
this.self = this;
this.layout = (RelativeLayout) findViewById(R.id.ra_layout);
// Remove Auto Focus from the Text Fields
layout.setFocusable(true);
layout.setFocusableInTouchMode(true);
testBtn = (Button) findViewById(R.id.btn_cancel);
testBtn.setOnClickListener(this);
registerButton = (Button) findViewById(R.id.ra_register_button);
registerButton.setOnClickListener(this);
}
private boolean isUsernameValid(String username) {
return !TextUtils.isEmpty(username) && username.length() > 0;
}
private boolean isPasswordValid(String password) {
return !TextUtils.isEmpty(password) && password.length() > 3;
}
private boolean isEmailValid(String email) {
if(TextUtils.isEmpty(email))
return false;
// boolean isValid = false;
String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
CharSequence inputStr = email;
Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputStr);
// if (matcher.matches()) {
// isValid = true;
// }
// Log.d(TAG, "isValid: " + isValid);
return matcher.matches();
}
private boolean isParamsValid(String username, String password, String email) {
return (isUsernameValid(username) && isPasswordValid(password) && isEmailValid(email));
}
private void attemptRegister() {
// showProgress(true);
Log.d(TAG, "in attemptRegister: Registering..");
if (isParamsValid(mUsernameView.getText().toString(), mPasswordView.getText().toString(), mEmailView.getText().toString())) {
Log.d(TAG, "params are valid");
String username = mUsernameView.getText().toString();
String password = mPasswordView.getText().toString();
String email = mEmailView.getText().toString();
boolean cancel = false;
View focusView = null;
// http request register
JSONObject tempJson = new JSONObject();
try {
tempJson.put("username", username);
tempJson.put("password", password);
tempJson.put("email", email);
} catch (Exception e) {
Log.d(TAG, e.toString());
}
Log.d(TAG,"JSON: "+tempJson.toString());
VolleyUtilSingleton.getInstance(RegisterActivity.this).post(BASE_URL + REG_PATH, tempJson, onRegisterSuccess, onRegisterError);
} else {
// showProgress(false);
Log.d(TAG, "Invalid params - make sure username exist, password is 4 characters or more & email is valid");
Toast.makeText(this, "Make Sure tou have entered a valid email. password at least 4 chars", Toast.LENGTH_LONG).show();
}
}
Response.Listener<JSONObject> onRegisterSuccess = new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.d(TAG,"reposne: "+ response.toString());
try {
if(response.getString("message").equals("created")) {
Log.d(TAG, "onRegisterSuccess => user created"); // TODO: REMOVE console
Intent loginActivity = new Intent(RegisterActivity.this, LoginActivity.class);
Toast.makeText(self, "You are now a social notework member - You May Login...", Toast.LENGTH_LONG).show();
startActivity(loginActivity);
} else {
// showProgress(false);
Toast.makeText(self , "Username is already taken. maybe: " + mUsernameView.getText().toString()+"_666 ? :)", Toast.LENGTH_LONG).show();
Log.d(TAG, "Cannot create user, " + response.getString("message"));
}
}catch (Exception e) {
Log.e(TAG, "onRegisterSuccess:" + e.getMessage());
}
}
};
Response.ErrorListener onRegisterError = new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// showProgress(false);
Toast.makeText(self , "Username is already taken. maybe: " + mUsernameView.getText().toString()+"_666 ? :)", Toast.LENGTH_LONG).show();
Log.d(TAG, "onRegisterError: msg: " + error.getMessage());
}
};
@Override
public void onClick(View view) {
switch(view.getId()){
case R.id.ra_register_button:
attemptRegister();
break;
case R.id.btn_cancel:
returnToLogin();
break;
}
}
private void returnToLogin(){
Intent i = new Intent(RegisterActivity.this, LoginActivity.class);
startActivity(i);
finish();
}
}

View file

@ -44,7 +44,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="Usename" />
android:hint="Username" />
</android.support.design.widget.TextInputLayout>
<!-- Password Label -->
@ -72,7 +72,7 @@
android:background="@color/colorPrimary"
android:textColor="#ffffff" />
<TextView android:id="@+id/link_signup"
<TextView android:id="@+id/al_register_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"

View file

@ -0,0 +1,9 @@
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.android_app.matan.ara.sagi.thesocialnotework.MapsActivity"
tools:layout="@layout/activity_maps" />

View file

@ -26,16 +26,16 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/temp_btn" />
android:onClick="goToMap"
android:id="@+id/ps_maps_btn"
android:background="@android:drawable/ic_menu_mapmode" />
<Button
android:id="@+id/ps_new_note_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="+"
android:onClick=""
android:layout_weight="0.2"/>
android:layout_weight="0.2"
android:background="@android:drawable/ic_input_add" />
</LinearLayout>
<ListView

View file

@ -0,0 +1,78 @@
<?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.RegisterActivity"
android:id="@+id/ra_layout">
<ImageView
android:src="@drawable/logo"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/logo"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="24dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/ra_username"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:hint="Username"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/ra_password"
android:layout_below="@+id/ra_username"
android:layout_centerHorizontal="true"
android:hint="Password"
android:enabled="true"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/ra_email"
android:layout_below="@+id/ra_password"
android:layout_centerHorizontal="true"
android:hint="Email"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/register"
android:id="@+id/ra_register_button"
android:layout_marginTop="56dp"
android:layout_below="@+id/ra_email"
android:layout_alignParentStart="true"
android:background="@color/colorPrimary"
android:textColor="#ffffff" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel"
android:id="@+id/btn_cancel"
android:layout_below="@+id/ra_register_button"
android:layout_alignParentStart="true" />
</RelativeLayout>

View file

@ -1,49 +1,67 @@
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:orientation="vertical">
<TextView
android:id="@+id/ndf_title_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_title_textview" />
android:text="Title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/ndf_body_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_body_textview" />
android:text="Body"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/ndf_time_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_time_textview" />
android:text="New Text" />
<TextView
android:id="@+id/ndf_address_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_address_textview" />
android:text="New Text" />
<TextView
android:id="@+id/ndf_tags_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_tags_textview" />
android:textAppearance="?android:attr/textAppearanceListItem" />
<TextView
android:id="@+id/ndf_permission_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/ndf_permission_textview" />
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"
android:id="@+id/ndf_likes_textview" />
android:text="New Text" />
</LinearLayout>
<ImageButton
android:id="@+id/ndf_delete_imagebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@android:drawable/ic_menu_delete" />
</LinearLayout>
</ScrollView>

View file

@ -62,7 +62,7 @@
android:layout_margin="15dp"
android:drawableLeft="@android:drawable/ic_menu_send"
android:background="@color/colorPrimary"
android:textColor="@color/abc_background_cache_hint_selector_material_light"
android:textColor="#ffffff"
android:paddingLeft="5dp"
android:paddingRight="5dp" />

View file

@ -7,6 +7,8 @@
<string name="prompt_password">Password</string>
<string name="action_login">Login</string>
<string name="action_register">Register</string>
<string name="register">Register</string>
<string name="create_new_account">No account yet? Create one for FREE</string>
<string name="action_sign_in_short">Sign in</string>
<string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string>
@ -21,8 +23,10 @@
<string name="logo">Logo</string>
<string name="nvf_title">Title</string>
<string name="nvf_content">Content</string>
<string name="throw_me">Throw Me</string>
<string name="note_me">Note Me</string>
<string name="throw_me">Discard</string>
<string name="note_me">Save</string>
<string name="username">Username</string>
<string name="password">Password</string>
<string name="title_activity_main">MainActivity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>

View file

@ -0,0 +1,22 @@
<resources>
<!--
TODO: Before you release your application, you need a Google Maps API key.
To do this, you can either add your release key credentials to your existing
key, or create a new key.
Note that this file specifies the API key for the release build target.
If you have previously set up a key for the debug target with the debug signing certificate,
you will also need to set up a key for your release certificate.
Follow the directions here:
https://developers.google.com/maps/documentation/android/signup
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
YOUR_KEY_HERE
</string>
</resources>