Settings - Changes users password + Photo
This commit is contained in:
commit
c1e05033d5
46 changed files with 835 additions and 533 deletions
|
@ -2,6 +2,7 @@
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="AndroidLintButtonStyle" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="AndroidLintUseCompoundDrawables" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
||||||
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
||||||
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="animated-vector-drawable-23.4.0">
|
<library name="animated-vector-drawable-23.4.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.4.0/animated-vector-drawable-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.4.0/animated-vector-drawable-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.4.0/animated-vector-drawable-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/annotations.zip!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/annotations.zip!/" />
|
||||||
</ANNOTATIONS>
|
</ANNOTATIONS>
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/annotations.zip!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/annotations.zip!/" />
|
||||||
</ANNOTATIONS>
|
</ANNOTATIONS>
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.4.0/design-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/design/23.4.0/design-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/design/23.4.0/design-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-analytics-impl-9.2.0">
|
<library name="firebase-analytics-impl-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics-impl/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-analytics-impl/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-auth-9.2.0">
|
<library name="firebase-auth-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-auth-common-9.2.0">
|
<library name="firebase-auth-common-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-common/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-common/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-auth-module-9.2.0">
|
<library name="firebase-auth-module-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-module/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-auth-module/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-config-9.2.0">
|
<library name="firebase-config-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-config/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-config/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-crash-9.2.0">
|
<library name="firebase-crash-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-crash/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-crash/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-database-9.2.0">
|
<library name="firebase-database-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-database/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-messaging-9.2.0">
|
<library name="firebase-messaging-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-messaging/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-messaging/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-storage-9.2.0">
|
<library name="firebase-storage-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="firebase-storage-common-9.2.0">
|
<library name="firebase-storage-common-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage-common/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.firebase/firebase-storage-common/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -5,11 +5,12 @@
|
||||||
</ANNOTATIONS>
|
</ANNOTATIONS>
|
||||||
<CLASSES>
|
<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/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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/23.0.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/mediarouter-v7/23.0.0/mediarouter-v7-23.0.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/mediarouter-v7/23.0.0/mediarouter-v7-23.0.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/mediarouter-v7/23.0.0/mediarouter-v7-23.0.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-9.2.0">
|
<library name="play-services-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-appindexing-9.2.0">
|
<library name="play-services-appindexing-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-auth-base-9.2.0">
|
<library name="play-services-auth-base-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth-base/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-basement-9.2.0">
|
<library name="play-services-basement-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-cast-9.2.0">
|
<library name="play-services-cast-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-contextmanager-9.2.0">
|
<library name="play-services-contextmanager-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-contextmanager/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-contextmanager/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-location-9.2.0">
|
<library name="play-services-location-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-plus-9.2.0">
|
<library name="play-services-plus-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-tagmanager-api-9.2.0">
|
<library name="play-services-tagmanager-api-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager-api/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tagmanager-api/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-tasks-9.2.0">
|
<library name="play-services-tasks-9.2.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-tasks/9.2.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="play-services-vision-9.2.0">
|
<library name="play-services-vision-9.2.0">
|
||||||
<CLASSES>
|
<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" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/9.2.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/9.2.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/annotations.zip!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/annotations.zip!/" />
|
||||||
</ANNOTATIONS>
|
</ANNOTATIONS>
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="support-annotations-23.4.0">
|
<library name="support-annotations-23.4.0">
|
||||||
<CLASSES>
|
<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!/" />
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -5,11 +5,12 @@
|
||||||
</ANNOTATIONS>
|
</ANNOTATIONS>
|
||||||
<CLASSES>
|
<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="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!/" />
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/classes.jar!/" />
|
||||||
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/res" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/Library/Android/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.4.0/support-vector-drawable-23.4.0-sources.jar!/" />
|
||||||
<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!/" />
|
<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!/" />
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.4.0/support-vector-drawable-23.4.0-sources.jar!/" />
|
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.4.0/support-vector-drawable-23.4.0-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="volley-1.0.0">
|
<library name="volley-1.0.0">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/jars/classes.jar!/" />
|
|
||||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/res" />
|
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/res" />
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.volley/volley/1.0.0/jars/classes.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class GPSUtils extends Service implements LocationListener {
|
public class GPSUtils extends Service implements LocationListener {
|
||||||
|
|
||||||
private static final String TAG ="GPSUtils" ;
|
private static final String TAG = "GPSUtils";
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
// flag for GPS status
|
// flag for GPS status
|
||||||
|
@ -53,7 +53,7 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
getLocation();
|
getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public Location getLocation() {
|
// public Location getLocation() {
|
||||||
// LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
|
// LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
|
||||||
// if (locationManager != null) {
|
// if (locationManager != null) {
|
||||||
// Location lastKnownLocationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
// Location lastKnownLocationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
||||||
|
@ -69,14 +69,14 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
public Location getLocation() {
|
public Location getLocation() {
|
||||||
try {
|
try {
|
||||||
Log.d("TAG","in get location");
|
Log.d("TAG", "in get location");
|
||||||
locationManager =
|
locationManager =
|
||||||
(LocationManager) mContext
|
(LocationManager) mContext
|
||||||
.getSystemService(LOCATION_SERVICE);
|
.getSystemService(LOCATION_SERVICE);
|
||||||
|
|
||||||
// getting GPS status
|
// getting GPS status
|
||||||
isGPSEnabled = locationManager
|
isGPSEnabled = locationManager
|
||||||
.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||||
|
|
||||||
// getting network status
|
// getting network status
|
||||||
|
@ -91,10 +91,10 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
if (isNetworkEnabled) {
|
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) {
|
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");
|
Log.e("TAG", "No Permissions");
|
||||||
((MainActivity)mContext).setLocationPermission(false);
|
Utils.setLocationPermission(false);
|
||||||
return null;
|
return null;
|
||||||
}else{
|
} else {
|
||||||
((MainActivity)mContext).setLocationPermission(true);
|
Utils.setLocationPermission(true);
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Network");
|
Log.d(TAG, "Network");
|
||||||
if (locationManager != null) {
|
if (locationManager != null) {
|
||||||
|
@ -120,9 +120,8 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
location = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
|
||||||
location = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +132,7 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSettingsAlert(){
|
public void showSettingsAlert() {
|
||||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
|
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
|
||||||
|
|
||||||
// Setting Dialog Title
|
// Setting Dialog Title
|
||||||
|
@ -144,7 +143,7 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
|
|
||||||
// On pressing Settings button
|
// On pressing Settings button
|
||||||
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
|
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog,int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
@ -188,13 +187,13 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Address> getFromLocation(double latitude, double longitude, int maxResults){
|
public List<Address> getFromLocation(double latitude, double longitude, int maxResults) {
|
||||||
try {
|
try {
|
||||||
List<Address> addresses;
|
List<Address> addresses;
|
||||||
|
|
||||||
geocoder = new Geocoder(mContext);
|
geocoder = new Geocoder(mContext);
|
||||||
if (latitude != 0 || longitude != 0) {
|
if (latitude != 0 || longitude != 0) {
|
||||||
addresses = geocoder.getFromLocation(latitude ,
|
addresses = geocoder.getFromLocation(latitude,
|
||||||
longitude, maxResults);
|
longitude, maxResults);
|
||||||
return addresses;
|
return addresses;
|
||||||
|
|
||||||
|
@ -212,11 +211,11 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get latitude
|
* Function to get latitude
|
||||||
* */
|
*/
|
||||||
public double getLatitude(){
|
public double getLatitude() {
|
||||||
if(location != null){
|
if (location != null) {
|
||||||
latitude = location.getLatitude();
|
latitude = location.getLatitude();
|
||||||
}else{
|
} else {
|
||||||
Log.d("Tag", "Got NULL");
|
Log.d("Tag", "Got NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,9 +225,9 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get longitude
|
* Function to get longitude
|
||||||
* */
|
*/
|
||||||
public double getLongitude(){
|
public double getLongitude() {
|
||||||
if(location != null){
|
if (location != null) {
|
||||||
longitude = location.getLongitude();
|
longitude = location.getLongitude();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,21 +235,20 @@ public class GPSUtils extends Service implements LocationListener {
|
||||||
return longitude;
|
return longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getLastKnownLocation(){
|
public Location getLastKnownLocation() {
|
||||||
if (location == null)
|
if (location == null)
|
||||||
return getLocation();
|
return getLocation();
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
String address="";
|
String address = "";
|
||||||
|
|
||||||
|
|
||||||
|
List<Address> listAddress = getFromLocation(getLatitude(), getLongitude(), 1);
|
||||||
List<Address> listAddress = getFromLocation(getLatitude(),getLongitude(),1);
|
|
||||||
for (int i = 0; i <= listAddress.get(0).getMaxAddressLineIndex(); i++) {
|
for (int i = 0; i <= listAddress.get(0).getMaxAddressLineIndex(); i++) {
|
||||||
listAddress.get(0).getAddressLine(i);
|
listAddress.get(0).getAddressLine(i);
|
||||||
address += listAddress.get(0).getAddressLine(i)+" ";
|
address += listAddress.get(0).getAddressLine(i) + " ";
|
||||||
}
|
}
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -176,14 +177,15 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback {
|
||||||
|
|
||||||
final Note note = eventMarkerMap.get(marker);
|
final Note note = eventMarkerMap.get(marker);
|
||||||
final Dialog noteViewDialog = new Dialog(getActivity());
|
final Dialog noteViewDialog = new Dialog(getActivity());
|
||||||
|
|
||||||
|
noteViewDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
noteViewDialog.setContentView(R.layout.note_display_full);
|
noteViewDialog.setContentView(R.layout.note_display_full);
|
||||||
|
|
||||||
boolean isOwner = note.getOwnerId().equals(mainActivity.getUserId());
|
boolean isOwner = note.getOwnerId().equals(mainActivity.getUserId());
|
||||||
if (isOwner)
|
// if (isOwner)
|
||||||
noteViewDialog.setTitle("You wrote...");
|
// noteViewDialog.setTitle("You wrote...");
|
||||||
else
|
// else
|
||||||
noteViewDialog.setTitle("Someone wrote...");
|
// noteViewDialog.setTitle("Someone wrote...");
|
||||||
|
|
||||||
noteViewDialog.show();
|
noteViewDialog.show();
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,24 +193,29 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback {
|
||||||
final TextView title = (TextView) noteViewDialog.findViewById(R.id.ndf_title_textview);
|
final TextView title = (TextView) noteViewDialog.findViewById(R.id.ndf_title_textview);
|
||||||
final TextView body = (TextView) noteViewDialog.findViewById(R.id.ndf_body_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 time = (TextView) noteViewDialog.findViewById(R.id.ndf_time_textview);
|
||||||
|
final TextView date = (TextView) noteViewDialog.findViewById(R.id.ndf_date_textview);
|
||||||
final TextView location = (TextView) noteViewDialog.findViewById(R.id.ndf_address_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 likes = (TextView) noteViewDialog.findViewById(R.id.ndf_likes_textview);
|
||||||
final TextView tags = (TextView) noteViewDialog.findViewById(R.id.ndf_tags_textview);
|
// final TextView tags = (TextView) noteViewDialog.findViewById(R.id.ndf_tags_textview);
|
||||||
final TextView permission = (TextView) noteViewDialog.findViewById(R.id.ndf_permission_textview);
|
final TextView permission = (TextView) noteViewDialog.findViewById(R.id.ndf_permission_textview);
|
||||||
final ImageView avatar = (ImageView) noteViewDialog.findViewById(R.id.note_user_avatar);
|
final ImageView avatar = (ImageView) noteViewDialog.findViewById(R.id.note_user_avatar);
|
||||||
|
final ImageView permissionImg = (ImageView) noteViewDialog.findViewById(R.id.permission_image);
|
||||||
final ImageButton deleteBtn = (ImageButton) noteViewDialog.findViewById(R.id.ndf_delete_imagebutton);
|
final ImageButton deleteBtn = (ImageButton) noteViewDialog.findViewById(R.id.ndf_delete_imagebutton);
|
||||||
|
|
||||||
|
|
||||||
title.setText(note.getTitle());
|
title.setText(note.getTitle());
|
||||||
body.setText(note.getBody());
|
body.setText(note.getBody());
|
||||||
time.setText(note.getTimestamp());
|
time.setText(note.getTime());
|
||||||
location.setText("Address: " + note.getAddress());
|
date.setText(note.getDate());
|
||||||
likes.setText("Likes: " + note.getLikes());
|
|
||||||
tags.setText("Tags: " + note.getTags().toString());
|
location.setText("" + note.getAddress());
|
||||||
|
likes.setText("" + note.getLikes());
|
||||||
|
// tags.setText("Tags: " + note.getTags().toString());
|
||||||
Utils.URLtoImageView(avatar, note.getAvatar());
|
Utils.URLtoImageView(avatar, note.getAvatar());
|
||||||
if (isOwner) {
|
if (isOwner) {
|
||||||
permission.setText("Permission: " + (note.isPublic() ? "Public" : "Private"));
|
permission.setText("" + (note.isPublic() ? "Public" : "Private"));
|
||||||
} else {
|
} else {
|
||||||
|
permissionImg.setVisibility(View.INVISIBLE);
|
||||||
permission.setText("");
|
permission.setText("");
|
||||||
deleteBtn.setBackgroundResource(R.drawable.like_icon);
|
deleteBtn.setBackgroundResource(R.drawable.like_icon);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.android_app.matan.ara.sagi.thesocialnotework;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
@ -40,6 +42,8 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
||||||
private final String LOGIN_PATH = "/login";
|
private final String LOGIN_PATH = "/login";
|
||||||
private LoginActivity self; //this
|
private LoginActivity self; //this
|
||||||
protected LinearLayout layout;
|
protected LinearLayout layout;
|
||||||
|
private boolean permissionsReturend = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -59,6 +63,9 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
||||||
this.mLoginButton.setOnClickListener(this);
|
this.mLoginButton.setOnClickListener(this);
|
||||||
this.mLoginButton.setEnabled(false);
|
this.mLoginButton.setEnabled(false);
|
||||||
|
|
||||||
|
//check for permission
|
||||||
|
// while(!permissionsReturend);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeFocuse() {
|
private void removeFocuse() {
|
||||||
|
@ -220,5 +227,42 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
|
||||||
public void afterTextChanged(Editable editable) {
|
public void afterTextChanged(Editable editable) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// @Override
|
||||||
|
// public void onRequestPermissionsResult(int requestCode,
|
||||||
|
// String permissions[], int[] grantResults) {
|
||||||
|
// permissionsReturend = true;
|
||||||
|
// Log.d(TAG, "onRequestPermissionsResult: in func");
|
||||||
|
// switch (requestCode) {
|
||||||
|
// case FINE_PERM: {
|
||||||
|
// // If request is cancelled, the result arrays are empty.
|
||||||
|
// if (grantResults.length > 0
|
||||||
|
// && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// Log.d(TAG, "onRequestPermissionsResult: got permission for location");
|
||||||
|
// Utils.setLocationPermission(true);
|
||||||
|
// ActivityCompat.requestPermissions(LoginActivity.this, new String[]{android.Manifest.permission.CAMERA}, CAMERA_PERM);
|
||||||
|
// } else {
|
||||||
|
// Log.d(TAG, "onRequestPermissionsResult:DIDNT get permission for location");
|
||||||
|
//
|
||||||
|
// Toast.makeText(LoginActivity.this,"No Location Permissions granted.\n\"An App is nothing without its permissions\"",Toast.LENGTH_LONG);
|
||||||
|
//// System.exit(0);
|
||||||
|
// }
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// case CAMERA_PERM: {
|
||||||
|
// if (grantResults.length > 0
|
||||||
|
// && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// Log.d(TAG, "onRequestPermissionsResult: got permission for camera");
|
||||||
|
// Utils.setCameraPermission(true);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// Log.d(TAG, "onRequestPermissionsResult: DIDNT get permission for camera");
|
||||||
|
// Toast.makeText(LoginActivity.this,"No Camera Permissions granted.\n\"An App is nothing without its permissions\"",Toast.LENGTH_LONG);
|
||||||
|
// }
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.android_app.matan.ara.sagi.thesocialnotework;
|
package com.android_app.matan.ara.sagi.thesocialnotework;
|
||||||
|
|
||||||
|
import android.*;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
@ -11,6 +13,7 @@ import android.os.Bundle;
|
||||||
import android.os.StrictMode;
|
import android.os.StrictMode;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -40,177 +43,207 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
implements NavigationView.OnNavigationItemSelectedListener {
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
public static final String LOCAL_DATA_TSN = "TSN_DATA_STORE";
|
public static final String LOCAL_DATA_TSN = "TSN_DATA_STORE";
|
||||||
protected final String TAG = "[TSN / MainActivity]";
|
protected final String TAG = "[TSN / MainActivity]";
|
||||||
protected User user;
|
protected User user;
|
||||||
private GPSUtils gpsUtils;
|
private GPSUtils gpsUtils;
|
||||||
private boolean locationPermission;
|
private boolean locationPermission;
|
||||||
private GmapFragment gmapFragment;
|
private GmapFragment gmapFragment;
|
||||||
private PersonalFragment personalFragment;
|
private PersonalFragment personalFragment;
|
||||||
private SettingsFragment settingsFragment;
|
private SettingsFragment settingsFragment;
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
public static final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
|
public static final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
|
||||||
private ImageView menu_avatar;
|
private ImageView menu_avatar;
|
||||||
private MainActivity self;
|
private MainActivity self;
|
||||||
private NavigationView nav_view;
|
private NavigationView nav_view;
|
||||||
|
private final int FINE_PERM = 0, CAMERA_PERM = 1;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
this.self = this;
|
this.self = this;
|
||||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
toolbar.setTitle("Personal Notes");
|
toolbar.setTitle("Personal Notes");
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
gmapFragment = new GmapFragment();
|
gmapFragment = new GmapFragment();
|
||||||
personalFragment = new PersonalFragment();
|
personalFragment = new PersonalFragment();
|
||||||
settingsFragment = new SettingsFragment();
|
settingsFragment = new SettingsFragment();
|
||||||
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||||
StrictMode.setThreadPolicy(policy);
|
StrictMode.setThreadPolicy(policy);
|
||||||
|
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
drawer.setDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
|
||||||
|
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
|
||||||
|
|
||||||
|
//get Bundle data (UserString)
|
||||||
|
Bundle b = getIntent().getExtras();
|
||||||
|
this.user = new User(b.getString("UserData"));
|
||||||
|
|
||||||
|
//Get The Nav_View Avatar View
|
||||||
|
nav_view = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
View header_v = nav_view.getHeaderView(0);
|
||||||
|
menu_avatar = (ImageView) header_v.findViewById(R.id.nav_user_avatar);
|
||||||
|
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
//Change Layout
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
Log.d(TAG, "Changing Fragment to Personal Activity");
|
||||||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
|
||||||
drawer.setDrawerListener(toggle);
|
|
||||||
toggle.syncState();
|
|
||||||
|
|
||||||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
|
||||||
|
|
||||||
|
|
||||||
//get Bundle data (UserString)
|
|
||||||
Bundle b = getIntent().getExtras();
|
|
||||||
this.user = new User(b.getString("UserData"));
|
|
||||||
|
|
||||||
//Get The Nav_View Avatar View
|
|
||||||
nav_view = (NavigationView) findViewById(R.id.nav_view);
|
|
||||||
View header_v = nav_view.getHeaderView(0);
|
|
||||||
menu_avatar = (ImageView)header_v.findViewById(R.id.nav_user_avatar);
|
|
||||||
|
|
||||||
|
|
||||||
//Change Layout
|
|
||||||
Log.d(TAG, "Changing Fragment to Personal Activity");
|
|
||||||
// PersonalFragment personalFragment = new PersonalFragment();
|
// PersonalFragment personalFragment = new PersonalFragment();
|
||||||
personalFragment.setArguments(b);
|
personalFragment.setArguments(b);
|
||||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
ft.replace(R.id.fragment_container, personalFragment);
|
ft.replace(R.id.fragment_container, personalFragment);
|
||||||
ft.commit();
|
ft.commit();
|
||||||
Log.d(TAG, "Changed");
|
Log.d(TAG, "Changed");
|
||||||
gpsUtils = new GPSUtils(this);
|
gpsUtils = new GPSUtils(this);
|
||||||
gpsUtils.getLocation();
|
gpsUtils.getLocation();
|
||||||
|
|
||||||
//Change The Avatar
|
//Change The Avatar
|
||||||
Utils.URLtoImageView(menu_avatar, user.getAvatar());
|
Utils.URLtoImageView(menu_avatar, user.getAvatar());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
} else {
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.main, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
return super.onOptionsItemSelected(item);
|
||||||
public void onBackPressed() {
|
}
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
@SuppressWarnings("StatementWithEmptyBody")
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
@Override
|
||||||
} else {
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
super.onBackPressed();
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
}
|
Bundle b = new Bundle();
|
||||||
|
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == R.id.nav_explore) {
|
||||||
|
toolbar.setTitle("Explore");
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
} else if (id == R.id.nav_map) {
|
||||||
|
|
||||||
|
Log.d(TAG, "Before going to map");
|
||||||
|
toolbar.setTitle("Map");
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
ft.replace(R.id.fragment_container, gmapFragment);
|
||||||
|
ft.commit();
|
||||||
|
} else if (id == R.id.nav_personal) {
|
||||||
|
|
||||||
|
Log.d(TAG, "Before going to personal");
|
||||||
|
ft.replace(R.id.fragment_container, personalFragment);
|
||||||
|
ft.commit();
|
||||||
|
} else if (id == R.id.nav_settings) {
|
||||||
|
toolbar.setTitle("Settings");
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
ft.replace(R.id.fragment_container, settingsFragment);
|
||||||
|
ft.commit();
|
||||||
|
} else if (id == R.id.nav_logout) {
|
||||||
|
|
||||||
|
SharedPreferences sharedPref = this.getSharedPreferences(MainActivity.LOCAL_DATA_TSN, Context.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sharedPref.edit();
|
||||||
|
editor.remove("UserData");
|
||||||
|
editor.commit();
|
||||||
|
Intent loginActivity = new Intent(MainActivity.this, LoginActivity.class);
|
||||||
|
startActivity(loginActivity);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
return true;
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public GPSUtils getGPSUtils() {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
return this.gpsUtils;
|
||||||
// Handle action bar item clicks here. The action bar will
|
}
|
||||||
// automatically handle clicks on the Home/Up button, so long
|
|
||||||
// as you specify a parent activity in AndroidManifest.xml.
|
|
||||||
int id = item.getItemId();
|
|
||||||
|
|
||||||
//noinspection SimplifiableIfStatement
|
|
||||||
if (id == R.id.action_settings) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("StatementWithEmptyBody")
|
|
||||||
@Override
|
|
||||||
public boolean onNavigationItemSelected(MenuItem item) {
|
|
||||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
|
|
||||||
int id = item.getItemId();
|
|
||||||
|
|
||||||
if (id == R.id.nav_explore) {
|
|
||||||
toolbar.setTitle("Explore");
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
} else if (id == R.id.nav_map) {
|
|
||||||
|
|
||||||
Log.d(TAG,"Before going to map");
|
|
||||||
toolbar.setTitle("Map");
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
ft.replace(R.id.fragment_container, gmapFragment);
|
|
||||||
ft.commit();
|
|
||||||
} else if (id == R.id.nav_personal) {
|
|
||||||
|
|
||||||
Log.d(TAG,"Before going to personal");
|
|
||||||
ft.replace(R.id.fragment_container, personalFragment);
|
|
||||||
ft.commit();
|
|
||||||
} else if (id == R.id.nav_settings) {
|
|
||||||
toolbar.setTitle("Settings");
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
ft.replace(R.id.fragment_container, settingsFragment);
|
|
||||||
ft.commit();
|
|
||||||
} else if (id == R.id.nav_logout) {
|
|
||||||
|
|
||||||
SharedPreferences sharedPref = this.getSharedPreferences(MainActivity.LOCAL_DATA_TSN, Context.MODE_PRIVATE);
|
|
||||||
SharedPreferences.Editor editor = sharedPref.edit();
|
|
||||||
editor.remove("UserData");
|
|
||||||
editor.commit();
|
|
||||||
Intent loginActivity = new Intent(MainActivity.this, LoginActivity.class);
|
|
||||||
startActivity(loginActivity);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public User getUser(){
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserId(){return user.getId();}
|
public String getUserId() {
|
||||||
|
return user.getId();
|
||||||
|
}
|
||||||
|
|
||||||
public void updateNavAvatar(){
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode,
|
||||||
|
String permissions[], int[] grantResults) {
|
||||||
|
Log.d(TAG, "onRequestPermissionsResult: in func");
|
||||||
|
switch (requestCode) {
|
||||||
|
case FINE_PERM: {
|
||||||
|
// If request is cancelled, the result arrays are empty.
|
||||||
|
if (grantResults.length > 2) {
|
||||||
|
if (!(grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
Log.d(TAG, "onRequestPermissionsResult: Did Not get permission for location");
|
||||||
|
Toast.makeText(MainActivity.this, "No Location Permissions granted.\n\"An App is nothing without its permissions\"", Toast.LENGTH_LONG).show();
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(grantResults[1] == PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
Log.d(TAG, "onRequestPermissionsResult:DIDNT get permission for camera");
|
||||||
|
Toast.makeText(MainActivity.this, "No Camera Permissions granted.\nyou will not be able to change avatar", Toast.LENGTH_LONG).show();
|
||||||
|
Utils.setCameraPermission(false);
|
||||||
|
} else {
|
||||||
|
Utils.setCameraPermission(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grantResults[2] != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
Log.d(TAG, "onRequestPermissionsResult:DIDNT get READ\\WRITE External storage permission");
|
||||||
|
Toast.makeText(MainActivity.this, "No READ\\WRITE External storage Permissions granted.\nyou will not be able to change avatar", Toast.LENGTH_LONG).show();
|
||||||
|
Utils.setCameraPermission(false);
|
||||||
|
} else {
|
||||||
|
Utils.setCameraPermission(true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateNavAvatar() {
|
||||||
//Change The Avatar
|
//Change The Avatar
|
||||||
|
Log.d(TAG, "updateNavAvatar: PINPINPINPIN");
|
||||||
Utils.URLtoImageView(menu_avatar, user.getAvatar());
|
Utils.URLtoImageView(menu_avatar, user.getAvatar());
|
||||||
Toast.makeText(this, "Profile Updated!", Toast.LENGTH_LONG).show();
|
Toast.makeText(this, "Profile Updated!", Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class Note implements Parcelable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDate() {
|
public String getDate() {
|
||||||
Date d = new Date();
|
Date d = new Date(timestamp);
|
||||||
DateFormat format = new SimpleDateFormat("dd MMM yyy");
|
DateFormat format = new SimpleDateFormat("dd MMM yyy");
|
||||||
return format.format(d);
|
return format.format(d);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.Window;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
@ -50,173 +51,187 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class PersonalFragment extends Fragment {
|
public class PersonalFragment extends Fragment {
|
||||||
|
|
||||||
protected ListView noteList;
|
protected ListView noteList;
|
||||||
private final int FINE_PERM = 0;
|
private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
|
||||||
private final String BASE_URL = "http://thesocialnotework-api.appspot.com/api";
|
private GPSUtils gpsUtils;
|
||||||
private GPSUtils gpsUtils;
|
private List<Note> listOfNotes;
|
||||||
private List<Note> listOfNotes;
|
private ListAdapter noteListAdapter;
|
||||||
private ListAdapter noteListAdapter;
|
private String userId;
|
||||||
private String userId;
|
private final String TAG = "[TSN/PersonalFragment]";
|
||||||
private final String TAG = "[TSN/PersonalFragment]";
|
private MainActivity activity;
|
||||||
private MainActivity activity;
|
private final int FINE_PERM = 0, CAMERA_PERM = 1;
|
||||||
|
|
||||||
public PersonalFragment() {
|
|
||||||
// Required empty public constructor
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
public PersonalFragment() {
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
// Required empty public constructor
|
||||||
Bundle savedInstanceState) {
|
}
|
||||||
View view = inflater.inflate(R.layout.fragment_personal, container, false);
|
|
||||||
// Inflate the layout for this fragment
|
|
||||||
activity = (MainActivity) getActivity();
|
|
||||||
Bundle bundle = getArguments();
|
|
||||||
this.userId = activity.getUserId();
|
|
||||||
Log.d(TAG, "onCreateView: userID: " + userId);
|
|
||||||
//check for permission
|
|
||||||
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, FINE_PERM);
|
|
||||||
|
|
||||||
|
|
||||||
this.noteList = (ListView) view.findViewById(R.id.ps_list_listview);
|
@Override
|
||||||
gpsUtils = activity.getGPSUtils();
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
gpsUtils.getLocation();
|
Bundle savedInstanceState) {
|
||||||
listOfNotes = new ArrayList<>();
|
View view = inflater.inflate(R.layout.fragment_personal, container, false);
|
||||||
noteListAdapter = new ListAdapter(getContext(), listOfNotes);
|
// Inflate the layout for this fragment
|
||||||
noteList.setAdapter(noteListAdapter);
|
activity = (MainActivity) getActivity();
|
||||||
noteList.setOnItemClickListener(new ItemClickedListener());
|
Bundle bundle = getArguments();
|
||||||
Utils.showLoadingDialog(getActivity(), "Fetching..", "getting your notes");
|
this.userId = activity.getUserId();
|
||||||
getAllNotes();
|
Log.d(TAG, "onCreateView: userID: " + userId);
|
||||||
|
|
||||||
|
ActivityCompat.requestPermissions(activity, new String[]{
|
||||||
|
android.Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
android.Manifest.permission.CAMERA,
|
||||||
|
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||||
|
},
|
||||||
|
FINE_PERM
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ActivityCompat.requestPermissions(activity, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, FINE_PERM);
|
||||||
|
|
||||||
|
// if (!Utils.arePermissionsGranted()) {
|
||||||
|
// Toast.makeText(getContext(), "Missing some Permissions...\nPlease go to app info and enable them", Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
this.noteList = (ListView) view.findViewById(R.id.ps_list_listview);
|
||||||
|
gpsUtils = activity.getGPSUtils();
|
||||||
|
gpsUtils.getLocation();
|
||||||
|
listOfNotes = new ArrayList<>();
|
||||||
|
noteListAdapter = new ListAdapter(getContext(), listOfNotes);
|
||||||
|
noteList.setAdapter(noteListAdapter);
|
||||||
|
noteList.setOnItemClickListener(new ItemClickedListener());
|
||||||
|
Utils.showLoadingDialog(getActivity(), "Fetching..", "getting your notes");
|
||||||
|
getAllNotes();
|
||||||
|
|
||||||
//https://thesocialnotework-api.appspot.com/api/note/all?uid=<USER_ID>
|
//https://thesocialnotework-api.appspot.com/api/note/all?uid=<USER_ID>
|
||||||
// The New "Add Button"
|
// The New "Add Button"
|
||||||
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
|
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
|
||||||
fab.setOnClickListener(addNewNoteDialog);
|
fab.setOnClickListener(addNewNoteDialog);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
Utils.dismissLoadingDialog();
|
Utils.dismissLoadingDialog();
|
||||||
Log.d(TAG, "onAttach");
|
Log.d(TAG, "onAttach");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDetach() {
|
public void onDetach() {
|
||||||
super.onDetach();
|
super.onDetach();
|
||||||
Utils.dismissLoadingDialog();
|
Utils.dismissLoadingDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAllNotes() {
|
public void getAllNotes() {
|
||||||
Log.d(TAG, "url: " + BASE_URL + "/note/all?uid=" + userId);
|
Log.d(TAG, "url: " + BASE_URL + "/note/all?uid=" + userId);
|
||||||
VolleyUtilSingleton.getInstance(getActivity()).get(BASE_URL + "/note/all?uid=" + userId, getNotesSuccessListener, Utils.genericErrorListener);
|
VolleyUtilSingleton.getInstance(getActivity()).get(BASE_URL + "/note/all?uid=" + userId, getNotesSuccessListener, Utils.genericErrorListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private View.OnClickListener addNewNoteDialog = new View.OnClickListener() {
|
private View.OnClickListener addNewNoteDialog = new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
//create and configure dialog
|
||||||
|
final Dialog dialog = new Dialog(getActivity());
|
||||||
|
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) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
//create and configure dialog
|
//title too short
|
||||||
final Dialog dialog = new Dialog(getActivity());
|
if (newTitle.getText().length() == 0) {
|
||||||
dialog.setContentView(R.layout.note_view_full);
|
Toast toast = Toast.makeText(getActivity(), "Title too short.", Toast.LENGTH_LONG);
|
||||||
dialog.setTitle("New Note");
|
toast.show();
|
||||||
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
|
return;
|
||||||
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);
|
|
||||||
|
|
||||||
|
//title too long
|
||||||
|
if (newTitle.getText().length() > 20) {
|
||||||
|
Toast toast = Toast.makeText(getActivity(), "Title too long.\n Use up to 20 notes.", Toast.LENGTH_LONG);
|
||||||
|
toast.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//volley post
|
||||||
|
final JSONObject noteJson = new JSONObject();
|
||||||
|
try {
|
||||||
|
|
||||||
//get note_view_full layout elements
|
//TODO need to get owner id from login screen
|
||||||
final Switch permissionSwitch = (Switch) dialog.findViewById(R.id.nvf_note_permission);
|
noteJson.put("owner_id", userId);
|
||||||
final EditText newTitle = (EditText) dialog.findViewById(R.id.nvf_note_title);
|
noteJson.put("title", newTitle.getText());
|
||||||
final EditText newBody = (EditText) dialog.findViewById(R.id.nvf_note_content);
|
noteJson.put("lat", gpsUtils.getLatitude());
|
||||||
Button saveBtn = (Button) dialog.findViewById(R.id.nvf_note_submit_btn);
|
noteJson.put("lng", gpsUtils.getLongitude());
|
||||||
Button cancelBtn = (Button) dialog.findViewById(R.id.nvf_note_cancel_btn);
|
noteJson.put("address", gpsUtils.getAddress());
|
||||||
|
noteJson.put("body", newBody.getText());
|
||||||
cancelBtn.setOnClickListener(new View.OnClickListener() {
|
noteJson.put("is_public", permissionSwitch.isChecked());
|
||||||
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(getActivity(), "Title too short.", Toast.LENGTH_LONG);
|
|
||||||
toast.show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//title too long
|
|
||||||
if (newTitle.getText().length() > 20) {
|
|
||||||
Toast toast = Toast.makeText(getActivity(), "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",);
|
// noteJson.put("tags",);
|
||||||
Log.d(TAG, "Json: " + noteJson.toString());
|
Log.d(TAG, "Json: " + noteJson.toString());
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, "saveBtn: " + e.toString());
|
Log.d(TAG, "saveBtn: " + e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
//send request and close dialog
|
|
||||||
VolleyUtilSingleton.getInstance(getActivity()).post(BASE_URL + "/note/upsert", noteJson, newNoteSuccessListener, Utils.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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
//send request and close dialog
|
||||||
|
VolleyUtilSingleton.getInstance(getActivity()).post(BASE_URL + "/note/upsert", noteJson, newNoteSuccessListener, Utils.genericErrorListener);
|
||||||
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
//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);
|
|
||||||
noteList.setAdapter(noteListAdapter);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//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);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//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);
|
||||||
|
noteList.setAdapter(noteListAdapter);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// //response Error listener for adding new note
|
// //response Error listener for adding new note
|
||||||
|
@ -228,29 +243,30 @@ public class PersonalFragment extends Fragment {
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
//response listener for getting all user notes
|
//response listener for getting all user notes
|
||||||
Response.Listener<JSONObject> getNotesSuccessListener = new Response.Listener<JSONObject>() {
|
Response.Listener<JSONObject> getNotesSuccessListener = new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
Log.d(TAG, "getNotesSuccessListener: " + response.toString());
|
Log.d(TAG, "getNotesSuccessListener: " + response.toString());
|
||||||
Utils.dismissLoadingDialog();
|
Utils.dismissLoadingDialog();
|
||||||
try {
|
try {
|
||||||
//need to get all notes and add to listOfNotes
|
//need to get all notes and add to listOfNotes
|
||||||
JSONArray noteObjectsArray = response.getJSONArray("notes");
|
JSONArray noteObjectsArray = response.getJSONArray("notes");
|
||||||
Date time = new Date();
|
activity.getUser().setNumber_of_notes(noteObjectsArray.length());
|
||||||
for (int i = 0; i < noteObjectsArray.length(); i++) {
|
Date time = new Date();
|
||||||
JSONObject noteObject = noteObjectsArray.getJSONObject(i);
|
for (int i = 0; i < noteObjectsArray.length(); i++) {
|
||||||
time.setTime(noteObject.getLong("created_at"));
|
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
addNoteFromJsonObj(noteObject, time);
|
||||||
}
|
}
|
||||||
};
|
noteList.setAdapter(noteListAdapter);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "newNoteSuccess:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// //response ErrorListener for getting all user notes
|
// //response ErrorListener for getting all user notes
|
||||||
|
@ -273,125 +289,126 @@ public class PersonalFragment extends Fragment {
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
private ArrayList<String> jsonArrayToStringArray(JSONArray jArray) {
|
private ArrayList<String> jsonArrayToStringArray(JSONArray jArray) {
|
||||||
ArrayList<String> stringArray = new ArrayList<String>();
|
ArrayList<String> stringArray = new ArrayList<String>();
|
||||||
for (int i = 0, count = jArray.length(); i < count; i++) {
|
for (int i = 0, count = jArray.length(); i < count; i++) {
|
||||||
try {
|
try {
|
||||||
JSONObject jsonObject = jArray.getJSONObject(i);
|
JSONObject jsonObject = jArray.getJSONObject(i);
|
||||||
stringArray.add(jsonObject.toString());
|
stringArray.add(jsonObject.toString());
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return stringArray;
|
|
||||||
}
|
}
|
||||||
|
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"),
|
||||||
|
noteObject.getString("avatar"),
|
||||||
|
noteObject.getString("owner_id"),
|
||||||
|
jsonArrayToStringArray(noteObject.getJSONArray("tags"))
|
||||||
|
);
|
||||||
|
listOfNotes.add(addNote);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// click on listView item
|
||||||
|
class ItemClickedListener implements 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(getActivity());
|
||||||
|
noteViewDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
noteViewDialog.setContentView(R.layout.note_display_full);
|
||||||
|
// noteViewDialog.setTitle("You wrote...");
|
||||||
|
|
||||||
private void addNoteFromJsonObj(JSONObject noteObject, Date time) throws JSONException {
|
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
|
||||||
Note addNote = new Note(
|
lp.copyFrom(noteViewDialog.getWindow().getAttributes());
|
||||||
noteObject.getString("id"),
|
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
Float.parseFloat(noteObject.getJSONObject("location").getString("lat")),
|
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
Float.parseFloat(noteObject.getJSONObject("location").getString("lng")),
|
noteViewDialog.show();
|
||||||
noteObject.getJSONObject("location").getString("address"),
|
|
||||||
noteObject.getString("title"),
|
|
||||||
noteObject.getString("body"),
|
|
||||||
time.toString(),
|
|
||||||
noteObject.getBoolean("is_public"),
|
|
||||||
noteObject.getInt("likes"),
|
|
||||||
noteObject.getString("avatar"),
|
|
||||||
noteObject.getString("owner_id"),
|
|
||||||
jsonArrayToStringArray(noteObject.getJSONArray("tags"))
|
|
||||||
);
|
|
||||||
listOfNotes.add(addNote);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// click on listView item
|
|
||||||
class ItemClickedListener implements 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(getActivity());
|
|
||||||
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);
|
// dialog.getWindow().setAttributes(lp);
|
||||||
|
|
||||||
|
|
||||||
//get note_view_full layout elements
|
//get note_view_full layout elements
|
||||||
final TextView title = (TextView) noteViewDialog.findViewById(R.id.ndf_title_textview);
|
final TextView title = (TextView) noteViewDialog.findViewById(R.id.ndf_title_textview);
|
||||||
final TextView body = (TextView) noteViewDialog.findViewById(R.id.ndf_body_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 time = (TextView) noteViewDialog.findViewById(R.id.ndf_time_textview);
|
||||||
final TextView location = (TextView) noteViewDialog.findViewById(R.id.ndf_address_textview);
|
final TextView date = (TextView) noteViewDialog.findViewById(R.id.ndf_date_textview);
|
||||||
final TextView likes = (TextView) noteViewDialog.findViewById(R.id.ndf_likes_textview);
|
final TextView location = (TextView) noteViewDialog.findViewById(R.id.ndf_address_textview);
|
||||||
final TextView tags = (TextView) noteViewDialog.findViewById(R.id.ndf_tags_textview);
|
final TextView likes = (TextView) noteViewDialog.findViewById(R.id.ndf_likes_textview);
|
||||||
final TextView permission = (TextView) noteViewDialog.findViewById(R.id.ndf_permission_textview);
|
// final TextView tags = (TextView) noteViewDialog.findViewById(R.id.ndf_tags_textview);
|
||||||
final ImageButton deleteBtn = (ImageButton) noteViewDialog.findViewById(R.id.ndf_delete_imagebutton);
|
final TextView permission = (TextView) noteViewDialog.findViewById(R.id.ndf_permission_textview);
|
||||||
final ImageView avatar = (ImageView) noteViewDialog.findViewById(R.id.note_user_avatar);
|
final ImageButton deleteBtn = (ImageButton) noteViewDialog.findViewById(R.id.ndf_delete_imagebutton);
|
||||||
|
final ImageView avatar = (RoundAvatarImageView) noteViewDialog.findViewById(R.id.note_user_avatar);
|
||||||
|
|
||||||
|
|
||||||
title.setText(note.getTitle());
|
title.setText(note.getTitle());
|
||||||
body.setText(note.getBody());
|
body.setText(note.getBody());
|
||||||
time.setText(note.getTimestamp());
|
date.setText(note.getDate());
|
||||||
location.setText("Address: " + note.getAddress());
|
time.setText(note.getTime());
|
||||||
likes.setText("Likes: " + note.getLikes());
|
location.setText(note.getAddress());
|
||||||
tags.setText("Tags: "+ note.getTags().toString());
|
if (likes != null) likes.setText("" + note.getLikes());
|
||||||
permission.setText("Permission: " + (note.isPublic() ? "Public" : "Private"));
|
// tags.setText("Tags: "+ note.getTags().toString());
|
||||||
Utils.URLtoImageView(avatar, note.getAvatar());
|
permission.setText("" + (note.isPublic() ? "Public" : "Private"));
|
||||||
|
Utils.URLtoImageView(avatar, note.getAvatar());
|
||||||
|
|
||||||
deleteBtn.setOnClickListener(new View.OnClickListener() {
|
deleteBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//Put up the Yes/No message box
|
//Put up the Yes/No message box
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
builder
|
builder
|
||||||
.setTitle("Delete Note")
|
.setTitle("Delete Note")
|
||||||
.setMessage("Are you sure you want to delete the note?")
|
.setMessage("Are you sure you want to delete the note?")
|
||||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
//Yes button clicked, do something
|
//Yes button clicked, do something
|
||||||
Toast.makeText(getActivity(), "Item Deleted!",
|
Toast.makeText(getActivity(), "Item Deleted!",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
//TODO send delete
|
//TODO send delete
|
||||||
JSONObject delNote = new JSONObject();
|
JSONObject delNote = new JSONObject();
|
||||||
try {
|
try {
|
||||||
delNote.put("uid", userId);
|
delNote.put("uid", userId);
|
||||||
delNote.put("nid", note.getId());
|
delNote.put("nid", note.getId());
|
||||||
VolleyUtilSingleton.getInstance(getActivity()).post(BASE_URL + "/note/delete", delNote, Utils.deleteNoteSuccessListener, Utils.genericErrorListener);
|
VolleyUtilSingleton.getInstance(getActivity()).post(BASE_URL + "/note/delete", delNote, Utils.deleteNoteSuccessListener, Utils.genericErrorListener);
|
||||||
listOfNotes.remove(position);
|
activity.getUser().setNumber_of_notes(activity.getUser().getNumber_of_notes()-1);
|
||||||
|
listOfNotes.remove(position);
|
||||||
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Toast.makeText(getActivity(), "Something went wrong.\n Failed to delete note...", Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), "Something went wrong.\n Failed to delete note...", Toast.LENGTH_LONG).show();
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
|
||||||
noteList.setAdapter(noteListAdapter);
|
|
||||||
noteViewDialog.dismiss();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
//Yes button clicked, do something
|
|
||||||
Toast.makeText(getActivity(), "Canceled",
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
noteViewDialog.dismiss();
|
|
||||||
}
|
|
||||||
}) //Do nothing on no
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
});
|
noteList.setAdapter(noteListAdapter);
|
||||||
|
noteViewDialog.dismiss();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
//Yes button clicked, do something
|
||||||
|
Toast.makeText(getActivity(), "Canceled",
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
noteViewDialog.dismiss();
|
||||||
|
}
|
||||||
|
}) //Do nothing on no
|
||||||
|
.show();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.android_app.matan.ara.sagi.thesocialnotework;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Path;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by matanbaryosef on 08/07/2016.
|
||||||
|
*/
|
||||||
|
public class RoundAvatarImageView extends ImageView {
|
||||||
|
|
||||||
|
public static float radius = 110.0f;
|
||||||
|
|
||||||
|
public RoundAvatarImageView(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoundAvatarImageView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoundAvatarImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
//float radius = 36.0f;
|
||||||
|
Path clipPath = new Path();
|
||||||
|
RectF rect = new RectF(0, 0, this.getWidth(), this.getHeight());
|
||||||
|
clipPath.addRoundRect(rect, radius, radius, Path.Direction.CW);
|
||||||
|
canvas.clipPath(clipPath);
|
||||||
|
super.onDraw(canvas);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -18,6 +19,7 @@ import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
@ -41,6 +43,7 @@ public class SettingsFragment extends Fragment implements View.OnClickListener,
|
||||||
private Uri currentImgUri;
|
private Uri currentImgUri;
|
||||||
private TextView lbl_num_of_notes, lbl_num_of_liked;
|
private TextView lbl_num_of_notes, lbl_num_of_liked;
|
||||||
private User user;
|
private User user;
|
||||||
|
private Button btn_save;
|
||||||
|
|
||||||
|
|
||||||
public SettingsFragment() {
|
public SettingsFragment() {
|
||||||
|
@ -62,6 +65,7 @@ public class SettingsFragment extends Fragment implements View.OnClickListener,
|
||||||
this.parent = (MainActivity)getActivity();
|
this.parent = (MainActivity)getActivity();
|
||||||
Utils.showLoadingDialog(parent, "Just a sec...", "");
|
Utils.showLoadingDialog(parent, "Just a sec...", "");
|
||||||
this.user = parent.getUser();
|
this.user = parent.getUser();
|
||||||
|
Log.d(TAG, "onCreateView: "+user.toString());
|
||||||
this.cameraBtn = (ImageButton) view.findViewById(R.id.btn_camera);
|
this.cameraBtn = (ImageButton) view.findViewById(R.id.btn_camera);
|
||||||
this.cameraBtn.setOnClickListener(this);
|
this.cameraBtn.setOnClickListener(this);
|
||||||
this.avatarImage = (ImageView) view.findViewById(R.id.settings_userAvater_iamgeView);
|
this.avatarImage = (ImageView) view.findViewById(R.id.settings_userAvater_iamgeView);
|
||||||
|
@ -72,6 +76,8 @@ public class SettingsFragment extends Fragment implements View.OnClickListener,
|
||||||
this.txt_username = (EditText)view.findViewById(R.id.txt_username);
|
this.txt_username = (EditText)view.findViewById(R.id.txt_username);
|
||||||
this.lbl_num_of_notes = (TextView)view.findViewById(R.id.lbl_num_of_notes);
|
this.lbl_num_of_notes = (TextView)view.findViewById(R.id.lbl_num_of_notes);
|
||||||
this.lbl_num_of_liked = (TextView)view.findViewById(R.id.lbl_num_of_liked);
|
this.lbl_num_of_liked = (TextView)view.findViewById(R.id.lbl_num_of_liked);
|
||||||
|
this.btn_save = (Button)view.findViewById(R.id.btn_save);
|
||||||
|
this.btn_save.setOnClickListener(this);
|
||||||
|
|
||||||
this.txt_username.setEnabled(false);
|
this.txt_username.setEnabled(false);
|
||||||
|
|
||||||
|
@ -81,8 +87,8 @@ public class SettingsFragment extends Fragment implements View.OnClickListener,
|
||||||
this.txt_password.setText(user.getPassword());
|
this.txt_password.setText(user.getPassword());
|
||||||
this.txt_email.setText(user.getEmail());
|
this.txt_email.setText(user.getEmail());
|
||||||
|
|
||||||
// this.lbl_num_of_notes.setText(user.getNumber_of_notes()); //TODO
|
this.lbl_num_of_notes.setText(""+user.getNumber_of_notes()); //TODO
|
||||||
// this.lbl_num_of_notes.setText(user.getLiked_notes().size());
|
this.lbl_num_of_notes.setText(""+user.getLiked_notes().size());
|
||||||
|
|
||||||
|
|
||||||
Utils.dismissLoadingDialog();
|
Utils.dismissLoadingDialog();
|
||||||
|
@ -106,8 +112,18 @@ public class SettingsFragment extends Fragment implements View.OnClickListener,
|
||||||
switch(view.getId()){
|
switch(view.getId()){
|
||||||
case R.id.btn_camera:
|
case R.id.btn_camera:
|
||||||
//check for permission
|
//check for permission
|
||||||
ActivityCompat.requestPermissions(parent, new String[]{Manifest.permission.CAMERA}, 1);
|
// ActivityCompat.requestPermissions(parent, new String[]{Manifest.permission.CAMERA}, 1);
|
||||||
openCamera(view);
|
if ((ActivityCompat.checkSelfPermission((MainActivity) getActivity(), android.Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED)
|
||||||
|
&&(ActivityCompat.checkSelfPermission((MainActivity) getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) {
|
||||||
|
openCamera(view);
|
||||||
|
}else{
|
||||||
|
Toast.makeText(getActivity(), "No Camera or Storage Permissions granted.\n\"An App is nothing without its permissions\"", Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case R.id.btn_save:
|
||||||
|
user.updateUser(parent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,11 +151,13 @@ public class User {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateUser(final MainActivity activity){
|
public void updateUser(final MainActivity activity){
|
||||||
|
Log.d(TAG, "updateUser: ================================");
|
||||||
VolleyUtilSingleton.getInstance(activity).post(Utils.BASE_URL + "/user/upsert", this.toJSON(), new Response.Listener<JSONObject>() {
|
VolleyUtilSingleton.getInstance(activity).post(Utils.BASE_URL + "/user/upsert", this.toJSON(), new Response.Listener<JSONObject>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(JSONObject response) {
|
public void onResponse(JSONObject response) {
|
||||||
try {
|
try {
|
||||||
if(response.get("status") == "OK"){
|
if(response.get("status").equals("OK")){
|
||||||
|
Log.d(TAG, "onResponse: In OKOKOKOK");
|
||||||
activity.updateNavAvatar();
|
activity.updateNavAvatar();
|
||||||
SharedPreferences sharedPref = activity.getSharedPreferences(MainActivity.LOCAL_DATA_TSN, Context.MODE_PRIVATE);
|
SharedPreferences sharedPref = activity.getSharedPreferences(MainActivity.LOCAL_DATA_TSN, Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = sharedPref.edit();
|
SharedPreferences.Editor editor = sharedPref.edit();
|
||||||
|
|
|
@ -4,6 +4,12 @@ import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -37,6 +43,8 @@ public class Utils {
|
||||||
private static HashMap<String, Bitmap> bitmapHash = new HashMap<>();
|
private static HashMap<String, Bitmap> bitmapHash = new HashMap<>();
|
||||||
public static final String PHOTOS_DIR_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/TheSocialNotework/";
|
public static final String PHOTOS_DIR_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/TheSocialNotework/";
|
||||||
|
|
||||||
|
private static boolean mLocationPermission = false;
|
||||||
|
private static boolean mCameraPermission = false;
|
||||||
|
|
||||||
|
|
||||||
public static Bitmap getBitmapFromURL(String url) {
|
public static Bitmap getBitmapFromURL(String url) {
|
||||||
|
@ -69,6 +77,7 @@ public class Utils {
|
||||||
public void onErrorResponse(VolleyError error) {
|
public void onErrorResponse(VolleyError error) {
|
||||||
Log.d(TAG, "genericErrorListener");
|
Log.d(TAG, "genericErrorListener");
|
||||||
error.printStackTrace();
|
error.printStackTrace();
|
||||||
|
Utils.dismissLoadingDialog();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -137,7 +146,8 @@ public class Utils {
|
||||||
private static class setUserAvatar extends AsyncTask<Void, Void, Bitmap> {
|
private static class setUserAvatar extends AsyncTask<Void, Void, Bitmap> {
|
||||||
private ImageView iv;
|
private ImageView iv;
|
||||||
private String url;
|
private String url;
|
||||||
public setUserAvatar(ImageView imageView, String url){
|
|
||||||
|
public setUserAvatar(ImageView imageView, String url) {
|
||||||
this.iv = imageView;
|
this.iv = imageView;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
@ -146,16 +156,58 @@ public class Utils {
|
||||||
protected Bitmap doInBackground(Void... v) {
|
protected Bitmap doInBackground(Void... v) {
|
||||||
// Bitmap b;
|
// Bitmap b;
|
||||||
|
|
||||||
return Utils.getBitmapFromURL(url);
|
return Utils.getBitmapFromURL(url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Bitmap b){
|
protected void onPostExecute(Bitmap b) {
|
||||||
iv.setImageBitmap(b);
|
iv.setImageBitmap(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) {
|
||||||
|
Log.d(TAG, "rounded bitmap");
|
||||||
|
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap
|
||||||
|
.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(output);
|
||||||
|
|
||||||
|
final int color = 0xff424242;
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
final RectF rectF = new RectF(rect);
|
||||||
|
final float roundPx = pixels;
|
||||||
|
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
|
||||||
|
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void setLocationPermission(boolean locationPermission) {
|
||||||
|
mLocationPermission = locationPermission;
|
||||||
|
}
|
||||||
|
public static void setCameraPermission(boolean cameraPermission) {
|
||||||
|
mCameraPermission = cameraPermission;
|
||||||
|
}
|
||||||
|
public static boolean arePermissionsGranted() {
|
||||||
|
return (mLocationPermission && mCameraPermission);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isCameraPermissionGranted(){
|
||||||
|
return mCameraPermission;
|
||||||
|
}
|
||||||
|
public static boolean isLocationPermissionGranted(){
|
||||||
|
return mLocationPermission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
11
app/src/main/res/drawable/frame.xml
Normal file
11
app/src/main/res/drawable/frame.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
<padding
|
||||||
|
android:top="6dp"
|
||||||
|
|
||||||
|
android:bottom="6dp"/>
|
||||||
|
|
||||||
|
<corners android:radius="35dp" />
|
||||||
|
<stroke android:width="1dp" android:color="@android:color/transparent" />
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/permission_icon.png
Normal file
BIN
app/src/main/res/drawable/permission_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 308 B |
|
@ -44,10 +44,10 @@
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="textEmailAddress"
|
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:id="@+id/txt_email"
|
android:id="@+id/txt_email"
|
||||||
android:hint="Email" />
|
android:hint="Email"
|
||||||
|
android:inputType="none|text" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView 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_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/cast_ic_notification_1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
|
@ -15,10 +15,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="70dp"
|
<com.android_app.matan.ara.sagi.thesocialnotework.RoundAvatarImageView
|
||||||
android:layout_height="70dp"
|
android:layout_width="70dp"
|
||||||
android:id="@+id/note_user_avatar" />
|
android:layout_height="70dp"
|
||||||
|
android:id="@+id/note_user_avatar"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -30,49 +33,120 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Title"
|
android:text="Title"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ndf_body_textview"
|
android:id="@+id/ndf_body_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Body"
|
android:text="Body"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_gravity="center" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/ndf_time_textview"
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="New Text" />
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/ndf_address_textview"
|
android:layout_width="20dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="20dp"
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/imageView6"
|
||||||
android:text="New Text" />
|
android:src="@drawable/date_icon"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ndf_tags_textview"
|
android:id="@+id/ndf_date_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="New Text"
|
android:text="New Text"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
android:layout_marginLeft="10dp" />
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/ndf_permission_textview"
|
android:layout_width="13dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="13dp"
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/imageView7"
|
||||||
android:text="New Text" />
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/time_icon"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ndf_likes_textview"
|
android:id="@+id/ndf_time_textview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="New Text" />
|
android:text="New Text"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageButton
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:id="@+id/imageView8"
|
||||||
|
android:src="@drawable/location_icon"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ndf_address_textview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New Text"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:id="@+id/permission_image"
|
||||||
|
android:src="@drawable/permission_icon"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ndf_permission_textview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New Text"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:id="@+id/imageView9"
|
||||||
|
android:src="@drawable/like_icon"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/ndf_likes_textview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="New Text"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
android:id="@+id/ndf_delete_imagebutton"
|
android:id="@+id/ndf_delete_imagebutton"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
<color name="colorPrimary">#246068</color>
|
<color name="colorPrimary">#246068</color>
|
||||||
<color name="colorPrimaryDark">#012e34</color>
|
<color name="colorPrimaryDark">#012e34</color>
|
||||||
<color name="colorAccent">#ffb073</color>
|
<color name="colorAccent">#ffb073</color>
|
||||||
|
<color name="darkGrayNote">#d1d4d7</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue