├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── chat.png
│ │ │ │ ├── post.png
│ │ │ │ ├── doodle.png
│ │ │ │ ├── icon01.jpg
│ │ │ │ ├── splash.png
│ │ │ │ ├── about_us.png
│ │ │ │ ├── chat_list.png
│ │ │ │ ├── setting.png
│ │ │ │ ├── wallpaper.png
│ │ │ │ ├── home_screen.png
│ │ │ │ ├── cure_profile.png
│ │ │ │ ├── github_profile.jpg
│ │ │ │ ├── post_fragment.png
│ │ │ │ ├── welcome_screen.png
│ │ │ │ ├── your_profile.png
│ │ │ │ ├── post_bottom_sheet.png
│ │ │ │ ├── ic_outline_send_24.xml
│ │ │ │ ├── ic_down.xml
│ │ │ │ ├── button.xml
│ │ │ │ ├── ic_baseline_message_24.xml
│ │ │ │ ├── ic_round_add_24.xml
│ │ │ │ ├── ic_baseline_edit_12.xml
│ │ │ │ ├── ic_baseline_edit_24.xml
│ │ │ │ ├── ic_outline_add_circle_outline.xml
│ │ │ │ ├── ic_up.xml
│ │ │ │ ├── ic_more_dots.xml
│ │ │ │ ├── ic_round_favorite_24.xml
│ │ │ │ ├── ic_outline_thumb_up_alt_24.xml
│ │ │ │ ├── ic_round_perm_identity_125.xml
│ │ │ │ ├── ic_camera.xml
│ │ │ │ ├── ic_baseline_thumb_up_alt_24.xml
│ │ │ │ ├── ic_call.xml
│ │ │ │ ├── ic_round_star_24.xml
│ │ │ │ ├── ic_baseline_call_.xml
│ │ │ │ ├── ic_linkedin.xml
│ │ │ │ ├── ic_twitter.xml
│ │ │ │ ├── ic_male.xml
│ │ │ │ ├── ic_female.xml
│ │ │ │ ├── ic_github.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── app_icon.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── app_icon_round.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── app_icon_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── app_icon.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── app_icon_round.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── app_icon_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── app_icon.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── app_icon_round.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── app_icon_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── app_icon.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── app_icon_round.png
│ │ │ │ ├── app_icon_foreground.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── app_icon.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── app_icon_round.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── app_icon_foreground.png
│ │ │ ├── values
│ │ │ │ ├── app_icon_background.xml
│ │ │ │ ├── preloaded_fonts.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── styles.xml
│ │ │ │ ├── font_certs.xml
│ │ │ │ └── strings.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── app_icon.xml
│ │ │ │ ├── app_icon_round.xml
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── font
│ │ │ │ └── amaranth_bold_italic.xml
│ │ │ ├── layout
│ │ │ │ ├── dialog_image_layout.xml
│ │ │ │ ├── activity_cure_profile.xml
│ │ │ │ ├── activity_profile.xml
│ │ │ │ ├── fragment_cure.xml
│ │ │ │ ├── activity_track_your.xml
│ │ │ │ ├── activity_splash.xml
│ │ │ │ ├── fragment_chat.xml
│ │ │ │ ├── activity_block.xml
│ │ │ │ ├── fragment_post.xml
│ │ │ │ ├── item_block.xml
│ │ │ │ ├── item_track.xml
│ │ │ │ ├── message_list_you_image.xml
│ │ │ │ ├── message_list_other_image.xml
│ │ │ │ ├── activity_main_screen.xml
│ │ │ │ ├── bottom_sheet.xml
│ │ │ │ ├── chat_list.xml
│ │ │ │ ├── cure_list.xml
│ │ │ │ ├── activity_add_post.xml
│ │ │ │ ├── post_item.xml
│ │ │ │ ├── activity_chat.xml
│ │ │ │ ├── message_list_other.xml
│ │ │ │ ├── message_list.xml
│ │ │ │ ├── activity_login_screen.xml
│ │ │ │ ├── activity_setting.xml
│ │ │ │ ├── dilaog_layout.xml
│ │ │ │ ├── post_list.xml
│ │ │ │ ├── post_list_like.xml
│ │ │ │ ├── activity_editprofile.xml
│ │ │ │ └── activity_about_us.xml
│ │ │ ├── menu
│ │ │ │ ├── main_menu.xml
│ │ │ │ └── chat_menu.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── app_icon-playstore.png
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── vatsal
│ │ │ │ └── kesarwani
│ │ │ │ └── therapy
│ │ │ │ ├── Model
│ │ │ │ ├── ChatModel.java
│ │ │ │ ├── TrackModel.java
│ │ │ │ ├── CureModel.java
│ │ │ │ ├── AppConfig.java
│ │ │ │ ├── MessageModel.java
│ │ │ │ └── PostModel.java
│ │ │ │ ├── Adapter
│ │ │ │ ├── MyAdapter.java
│ │ │ │ ├── TrackAdapter.java
│ │ │ │ ├── CureAdapter.java
│ │ │ │ └── MessageAdapter.java
│ │ │ │ ├── Utility
│ │ │ │ ├── Util.java
│ │ │ │ ├── App.java
│ │ │ │ └── AppVisibilityDetector.java
│ │ │ │ ├── Activity
│ │ │ │ ├── AboutUs.java
│ │ │ │ ├── TrackYourActivity.java
│ │ │ │ ├── Splash.java
│ │ │ │ ├── MainScreen.java
│ │ │ │ └── BlockActivity.java
│ │ │ │ └── Fragment
│ │ │ │ └── ChatFragment.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── vatsal
│ │ │ └── kesarwani
│ │ │ └── therapy
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── vatsal
│ │ └── kesarwani
│ │ └── therapy
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
├── google-services.json
└── build.gradle
├── settings.gradle
├── AppImages
├── clone.png
├── fork.png
├── star.png
└── Change_branch.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── vcs.xml
├── render.experimental.xml
├── runConfigurations.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
└── codeStyles
│ └── Project.xml
├── .gitignore
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Therapy"
--------------------------------------------------------------------------------
/AppImages/clone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/AppImages/clone.png
--------------------------------------------------------------------------------
/AppImages/fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/AppImages/fork.png
--------------------------------------------------------------------------------
/AppImages/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/AppImages/star.png
--------------------------------------------------------------------------------
/AppImages/Change_branch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/AppImages/Change_branch.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/chat.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/post.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/post.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/app_icon-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/app_icon-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/doodle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/doodle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/icon01.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/splash.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/about_us.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/about_us.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chat_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/chat_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/setting.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/wallpaper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/wallpaper.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/home_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/home_screen.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-hdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-mdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cure_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/cure_profile.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/github_profile.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/github_profile.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/post_fragment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/post_fragment.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/welcome_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/welcome_screen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/your_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/your_profile.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xhdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxhdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxxhdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/post_bottom_sheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/drawable/post_bottom_sheet.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/app_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-hdpi/app_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/app_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-mdpi/app_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/app_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xhdpi/app_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/app_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxhdpi/app_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/app_icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxxhdpi/app_icon_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/app_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-hdpi/app_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/app_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-mdpi/app_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/app_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xhdpi/app_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/app_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxhdpi/app_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/app_icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vatsalkesarwani12/Heal-O-Chat/HEAD/app/src/main/res/mipmap-xxxhdpi/app_icon_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/app_icon_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/render.experimental.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/amaranth_bold_italic
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #129A7F
4 | #129077
5 | #03DAC5
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jul 16 16:43:54 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/app_icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/app_icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/ChatModel.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class ChatModel {
4 | private String mail;
5 |
6 | public ChatModel(String mail) {
7 | this.mail = mail;
8 | }
9 |
10 | public String getMail() {
11 | return mail;
12 | }
13 |
14 | public void setMail(String mail) {
15 | this.mail = mail;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_send_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_down.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/font/amaranth_bold_italic.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
10 |
13 |
14 |
15 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_message_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_add_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_edit_12.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_edit_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_add_circle_outline.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/test/java/com/vatsal/kesarwani/therapy/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_image_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_up.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_more_dots.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_favorite_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_outline_thumb_up_alt_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_perm_identity_125.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_camera.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_thumb_up_alt_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_star_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_call_.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_cure_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
17 |
18 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/vatsal/kesarwani/therapy/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.vatsal.kesarwani.therapy", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/TrackModel.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class TrackModel {
4 | private String time;
5 | private String trackName;
6 |
7 | public TrackModel() {
8 | }
9 |
10 | public TrackModel(String time, String trackName) {
11 | this.time = time;
12 | this.trackName = trackName;
13 | }
14 |
15 | public String getTime() {
16 | return time;
17 | }
18 |
19 | public void setTime(String time) {
20 | this.time = time;
21 | }
22 |
23 | public String getTrackName() {
24 | return trackName;
25 | }
26 |
27 | public void setTrackName(String trackName) {
28 | this.trackName = trackName;
29 | }
30 |
31 | @Override
32 | public String toString() {
33 | return "TrackModel{" +
34 | "time='" + time + '\'' +
35 | ", trackName='" + trackName + '\'' +
36 | '}';
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/chat_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
18 |
19 |
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_cure.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
17 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_track_your.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "851800524185",
4 | "firebase_url": "https://therapy-204b7.firebaseio.com",
5 | "project_id": "therapy-204b7",
6 | "storage_bucket": "therapy-204b7.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:851800524185:android:4dd2bcadcc8daf51003f08",
12 | "android_client_info": {
13 | "package_name": "com.vatsal.kesarwani.therapy"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "851800524185-c49oes2n6e1a4lcdd1ap0dcl7arsr6v3.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyDIZ8WCXGgbYz1Dngo2QqZuhTPcglCTOkM"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "851800524185-c49oes2n6e1a4lcdd1ap0dcl7arsr6v3.apps.googleusercontent.com",
32 | "client_type": 3
33 | }
34 | ]
35 | }
36 | }
37 | }
38 | ],
39 | "configuration_version": "1"
40 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_chat.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
27 |
28 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Adapter/MyAdapter.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Adapter;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.fragment.app.Fragment;
7 | import androidx.fragment.app.FragmentManager;
8 | import androidx.fragment.app.FragmentPagerAdapter;
9 |
10 | import com.vatsal.kesarwani.therapy.Fragment.CureFragment;
11 | import com.vatsal.kesarwani.therapy.Fragment.PostFragment;
12 | import com.vatsal.kesarwani.therapy.Fragment.ChatFragment;
13 |
14 | public class MyAdapter extends FragmentPagerAdapter {
15 |
16 | private Context myContext;
17 | int totalTabs;
18 |
19 | public MyAdapter(@NonNull FragmentManager fm, Context myContext, int totalTabs) {
20 | super(fm);
21 | this.myContext = myContext;
22 | this.totalTabs = totalTabs;
23 | }
24 |
25 | @NonNull
26 | @Override
27 | public Fragment getItem(int position) {
28 | switch (position){
29 | case 0:
30 | return new PostFragment();
31 | case 1:
32 | return new CureFragment();
33 | case 2:
34 | return new ChatFragment();
35 | default:
36 | return null;
37 | }
38 | }
39 |
40 | @Override
41 | public int getCount() {
42 | return totalTabs;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_block.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_post.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_linkedin.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_twitter.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_block.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
24 |
25 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/CureModel.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class CureModel {
4 | private String name;
5 | private String desc;
6 | private String sex;
7 | private String mail;
8 | private String uri;
9 | private String UID;
10 |
11 | public CureModel(String name, String desc, String sex, String mail, String uri, String UID) {
12 | this.name = name;
13 | this.desc = desc;
14 | this.sex = sex;
15 | this.mail = mail;
16 | this.uri = uri;
17 | this.UID = UID;
18 | }
19 |
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | public void setName(String name) {
25 | this.name = name;
26 | }
27 |
28 | public String getDesc() {
29 | return desc;
30 | }
31 |
32 | public void setDesc(String desc) {
33 | this.desc = desc;
34 | }
35 |
36 | public String getSex() {
37 | return sex;
38 | }
39 |
40 | public void setSex(String sex) {
41 | this.sex = sex;
42 | }
43 |
44 | public String getMail() {
45 | return mail;
46 | }
47 |
48 | public void setMail(String mail) {
49 | this.mail = mail;
50 | }
51 |
52 | public String getUri() {
53 | return uri;
54 | }
55 |
56 | public void setUri(String uri) {
57 | this.uri = uri;
58 | }
59 |
60 | public String getUID() {
61 | return UID;
62 | }
63 |
64 | public void setUID(String UID) {
65 | this.UID = UID;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
19 |
20 |
29 |
30 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Utility/Util.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Utility;
2 |
3 | import com.google.firebase.auth.FirebaseAuth;
4 | import com.google.firebase.database.DatabaseReference;
5 | import com.google.firebase.database.FirebaseDatabase;
6 | import com.google.firebase.firestore.FirebaseFirestore;
7 | import com.vatsal.kesarwani.therapy.Model.AppConfig;
8 |
9 | import java.util.HashMap;
10 | import java.util.Map;
11 | import java.util.Objects;
12 |
13 | public class Util {
14 | private DatabaseReference dr;
15 | private FirebaseAuth mAuth;
16 |
17 | public void setOffline(){
18 | Map m=new HashMap<>();
19 | m.put(AppConfig.STATUS,false);
20 |
21 | FirebaseFirestore.getInstance().collection("User")
22 | .document(Objects.requireNonNull(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getEmail()))
23 | .update(m);
24 | }
25 |
26 | public void setOnline(){
27 | Map m=new HashMap<>();
28 | m.put(AppConfig.STATUS,true);
29 |
30 | FirebaseFirestore.getInstance().collection("User")
31 | .document(Objects.requireNonNull(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getEmail()))
32 | .update(m);
33 | }
34 |
35 | public void track(Map map){
36 | dr= FirebaseDatabase.getInstance().getReference();
37 | mAuth=FirebaseAuth.getInstance();
38 |
39 | dr.child("Track")
40 | .child(Objects.requireNonNull(Objects.requireNonNull(mAuth.getCurrentUser()).getUid()))
41 | .push()
42 | .setValue(map);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/AppConfig.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class AppConfig {
4 |
5 | final public static String SHARED_PREF="com.vatsal.kesarwani.theraphy.SHARED_PREF";
6 | final public static String PROFILE_VISIBILITY="com.vatsal.kesarwani.theraphy.PROFILE_VISIBILITY";
7 | final public static String PROFILE_STATE="com.vatsal.kesarwani.theraphy.PROFILE_STATE";
8 | final public static String CALL_STATE="com.vatsal.kesarwani.theraphy.CALL_STATE";
9 | final public static String PROFILE_DP="com.vatsal.kesarwani.theraphy.PROFILE_DP";
10 | final public static String USERNAME="com.vatsal.kesarwani.theraphy.USERNAME";
11 | final public static String SPLASH=0+"";
12 | final public static String UID="UID";
13 | final public static String NAME="NAME";
14 | final public static String AGE="AGE";
15 | final public static String SEX="SEX";
16 | final public static String NUMBER="NUMBER";
17 | final public static String ABOUT="ABOUT";
18 | final public static String DESCRIPTION="DESCRIPTION";
19 | final public static String CAN_CALL="CAN_CALL";
20 | final public static String VISIBLE="VISIBLE";
21 | final public static String POST_DESCRIPTION = "POST_DESCRIPTION";
22 | final public static String POST_IMAGE="POST_IMAGE";
23 | final public static String POST_BY="POST_BY";
24 | final public static String PROFILE_DISPLAY="PROFILE_DISPLAY";
25 | final public static String LIKES="LIKES";
26 | final public static String STATUS="STATUS";
27 | final public static String REPORT="REPORT";
28 | final public static String TIME="time";
29 | final public static String TRACKNAME="trackName";
30 |
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Utility/App.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Utility;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.util.Log;
7 |
8 | import com.google.firebase.auth.FirebaseAuth;
9 | import com.vatsal.kesarwani.therapy.Model.AppConfig;
10 |
11 | public class App extends Application {
12 | private FirebaseAuth mAuth;
13 | private SharedPreferences sharedPreferences;
14 |
15 | private static final String TAG = "App123";
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 | mAuth= FirebaseAuth.getInstance();
20 | sharedPreferences= getSharedPreferences(AppConfig.SHARED_PREF, Context.MODE_PRIVATE);
21 |
22 | if (mAuth.getCurrentUser() != null && sharedPreferences.getString(AppConfig.PROFILE_STATE, "com.vatsal.kesarwani.theraphy.PROFILE_STATE").equals("com.vatsal.kesarwani.theraphy.PROFILE_STATE")) {
23 | Log.d(TAG, "onAppGotoForeground: ");
24 | } else if (mAuth.getCurrentUser() != null) {
25 | Log.d(TAG, "onCreate: ");
26 | AppVisibilityDetector.init(App.this, new AppVisibilityDetector.AppVisibilityCallback() {
27 | @Override
28 | public void onAppGotoForeground() {
29 | //app is from background to foreground
30 | new Util().setOnline();
31 | }
32 | @Override
33 | public void onAppGotoBackground() {
34 | //app is from foreground to background
35 | new Util().setOffline();
36 | }
37 | });
38 | }
39 | }
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/MessageModel.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class MessageModel {
4 | private String user;
5 | private String mssg;
6 | private String img;
7 | private String time;
8 | private String date;
9 |
10 | public MessageModel() {
11 | }
12 |
13 | public MessageModel(String mssg, String user, String img, String time, String date) {
14 | this.user = user;
15 | this.mssg = mssg;
16 | this.img = img;
17 | this.time = time;
18 | this.date = date;
19 | }
20 |
21 | public String getUser() {
22 | return user;
23 | }
24 |
25 | public void setUser(String user) {
26 | this.user = user;
27 | }
28 |
29 | public String getMssg() {
30 | return mssg;
31 | }
32 |
33 | public void setMssg(String mssg) {
34 | this.mssg = mssg;
35 | }
36 |
37 | public String getImg() {
38 | return img;
39 | }
40 |
41 | public void setImg(String img) {
42 | this.img = img;
43 | }
44 |
45 | public String getTime() {
46 | return time;
47 | }
48 |
49 | public void setTime(String time) {
50 | this.time = time;
51 | }
52 |
53 | public String getDate() {
54 | return date;
55 | }
56 |
57 | public void setDate(String date) {
58 | this.date = date;
59 | }
60 |
61 | @Override
62 | public String toString() {
63 | return "MessageModel{" +
64 | "user='" + user + '\'' +
65 | ", mssg='" + mssg + '\'' +
66 | ", img='" + img + '\'' +
67 | ", time='" + time + '\'' +
68 | ", date='" + date + '\'' +
69 | '}';
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Adapter/TrackAdapter.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.recyclerview.widget.RecyclerView;
11 |
12 | import com.vatsal.kesarwani.therapy.Model.TrackModel;
13 | import com.vatsal.kesarwani.therapy.R;
14 |
15 | import java.util.List;
16 |
17 | public class TrackAdapter extends RecyclerView.Adapter {
18 |
19 | private Context context;
20 | private List list;
21 |
22 | public TrackAdapter(Context context, List list) {
23 | this.context = context;
24 | this.list = list;
25 | }
26 |
27 | @NonNull
28 | @Override
29 | public TrackAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
30 | View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.item_track,parent,false);
31 | return new ViewHolder(v);
32 | }
33 |
34 | @Override
35 | public void onBindViewHolder(@NonNull TrackAdapter.ViewHolder holder, int position) {
36 | holder.time.setText(list.get(position).getTime());
37 | holder.track.setText(list.get(position).getTrackName());
38 | }
39 |
40 | @Override
41 | public int getItemCount() {
42 | return list.size();
43 | }
44 |
45 | public static class ViewHolder extends RecyclerView.ViewHolder {
46 | private TextView time,track;
47 | public ViewHolder(@NonNull View itemView) {
48 | super(itemView);
49 | time=itemView.findViewById(R.id.time);
50 | track=itemView.findViewById(R.id.task_name);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/message_list_you_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
19 |
20 |
29 |
30 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/message_list_other_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
19 |
20 |
29 |
30 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
26 |
27 |
35 |
36 |
37 |
38 |
39 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_sheet.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
25 |
26 |
30 |
31 |
38 |
39 |
40 |
41 |
42 |
43 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/chat_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
19 |
28 |
29 |
35 |
36 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/cure_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
16 |
25 |
26 |
36 |
37 |
44 |
45 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_male.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_female.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'com.google.gms.google-services'
3 | apply plugin: 'com.google.firebase.crashlytics'
4 |
5 | android {
6 | compileSdkVersion 29
7 | buildToolsVersion "30.0.0"
8 |
9 | defaultConfig {
10 | applicationId "com.vatsal.kesarwani.therapy"
11 | minSdkVersion 21
12 | targetSdkVersion 29
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | }
26 |
27 | dependencies {
28 | implementation fileTree(dir: "libs", include: ["*.jar"])
29 | implementation 'androidx.appcompat:appcompat:1.2.0'
30 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
31 | implementation 'com.google.firebase:firebase-analytics:17.5.0'
32 | implementation 'com.google.firebase:firebase-auth:19.3.2'
33 | implementation 'com.google.android.gms:play-services-auth:18.1.0'
34 | implementation 'androidx.viewpager2:viewpager2:1.0.0'
35 | implementation 'com.google.android.material:material:1.2.0'
36 | //noinspection GradleCompatible
37 | implementation 'com.android.support:design:28.0.0'
38 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
39 | implementation 'com.google.firebase:firebase-firestore:21.6.0'
40 | implementation 'com.google.firebase:firebase-storage:19.2.0'
41 | implementation 'com.google.firebase:firebase-database:19.4.0'
42 | implementation 'com.google.firebase:firebase-messaging:20.2.4'
43 | implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
44 | testImplementation 'junit:junit:4.13'
45 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
46 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
47 |
48 | //alerter
49 | implementation 'com.tapadoo.android:alerter:1.0.6'
50 |
51 | //Toasty
52 | implementation 'com.github.GrenderG:Toasty:1.4.2'
53 |
54 | //circular image
55 | implementation 'de.hdodenhof:circleimageview:3.1.0'
56 |
57 | //glide
58 | implementation 'com.github.bumptech.glide:glide:4.11.0'
59 | annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
60 |
61 | //image-picker
62 | implementation 'com.github.dhaval2404:imagepicker:1.7.5'
63 |
64 | //swipe refresh layout
65 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_add_post.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
23 |
24 |
30 |
31 |
36 |
37 |
38 |
39 |
40 |
41 |
53 |
54 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Model/PostModel.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Model;
2 |
3 | public class PostModel {
4 | private String uri;
5 | private int likes;
6 | private String message;
7 | private String by;
8 | private String id;
9 | private boolean clicked;
10 | private String name;
11 | private String profile_display;
12 | private String uid;
13 | private int report;
14 |
15 | public PostModel(String uri, int likes, String message, String by,String id,boolean clicked, String name, String profile_display, String uid, int report) {
16 | this.uri = uri;
17 | this.likes = likes;
18 | this.message = message;
19 | this.by = by;
20 | this.id=id;
21 | this.clicked=clicked;
22 | this.name= name;
23 | this.profile_display= profile_display;
24 | this.uid= uid;
25 | this.report= report;
26 | }
27 |
28 | public String getUri() {
29 | return uri;
30 | }
31 |
32 | public void setUri(String uri) {
33 | this.uri = uri;
34 | }
35 |
36 | public int getLikes() {
37 | return likes;
38 | }
39 |
40 | public void setLikes(int likes) {
41 | this.likes = likes;
42 | }
43 |
44 | public String getMessage() {
45 | return message;
46 | }
47 |
48 | public void setMessage(String message) {
49 | this.message = message;
50 | }
51 |
52 | public String getBy() {
53 | return by;
54 | }
55 |
56 | public void setBy(String by) {
57 | this.by = by;
58 | }
59 |
60 | public String getId() {
61 | return id;
62 | }
63 |
64 | public void setId(String id) {
65 | this.id = id;
66 | }
67 |
68 | public boolean isClicked() {
69 | return clicked;
70 | }
71 |
72 | public void setClicked(boolean clicked) {
73 | this.clicked = clicked;
74 | }
75 |
76 | public String getName() {
77 | return name;
78 | }
79 |
80 | public void setName(String name) {
81 | this.name = name;
82 | }
83 |
84 | public String getProfile_display() {
85 | return profile_display;
86 | }
87 |
88 | public void setProfile_display(String profile_display) {
89 | this.profile_display = profile_display;
90 | }
91 |
92 | public String getUid() {
93 | return uid;
94 | }
95 |
96 | public void setUid(String uid) {
97 | this.uid = uid;
98 | }
99 |
100 | public int getReport() {
101 | return report;
102 | }
103 |
104 | public void setReport(int report) {
105 | this.report = report;
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_github.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/post_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
20 |
21 |
28 |
29 |
37 |
38 |
42 |
43 |
48 |
49 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_chat.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
29 |
30 |
31 |
35 |
36 |
49 |
50 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
17 |
20 |
24 |
28 |
31 |
32 |
36 |
40 |
44 |
47 |
50 |
53 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/message_list_other.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
21 |
22 |
45 |
46 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/message_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
21 |
22 |
46 |
47 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Activity/AboutUs.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Activity;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.appcompat.app.AppCompatDelegate;
5 |
6 | import android.content.Intent;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import android.view.View;
10 | import android.widget.ImageButton;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import com.vatsal.kesarwani.therapy.R;
15 |
16 | public class AboutUs extends AppCompatActivity {
17 | private ImageButton linkedin,github,twitter;
18 | private String llinkedin,lgit,ltweet,lrepo;
19 | private ImageView star;
20 | private TextView tv_star;
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_about_us);
27 | init();
28 | llinkedin="https://www.linkedin.com/in/vatsal-kesarwani-4a3858171/";
29 | lgit="https://github.com/plazzy99";
30 | ltweet="https://twitter.com/KesarwaniVatsal";
31 | lrepo="https://github.com/plazzy99/Therapy";
32 |
33 | linkedin.setOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View v) {
36 | Intent i = new Intent(Intent.ACTION_VIEW);
37 | i.setData(Uri.parse(llinkedin));
38 | startActivity(i);
39 | }
40 | });
41 |
42 | github.setOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 | Intent i = new Intent(Intent.ACTION_VIEW);
46 | i.setData(Uri.parse(lgit));
47 | startActivity(i);
48 | }
49 | });
50 |
51 | twitter.setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View v) {
54 | Intent i = new Intent(Intent.ACTION_VIEW);
55 | i.setData(Uri.parse(ltweet));
56 | startActivity(i);
57 | }
58 | });
59 |
60 | star.setOnClickListener(new View.OnClickListener() {
61 | @Override
62 | public void onClick(View v) {
63 | starRepo();
64 | }
65 | });
66 |
67 | tv_star.setOnClickListener(new View.OnClickListener() {
68 | @Override
69 | public void onClick(View v) {
70 | starRepo();
71 | }
72 | });
73 |
74 | }
75 |
76 | private void starRepo() {
77 | Intent i = new Intent(Intent.ACTION_VIEW);
78 | i.setData(Uri.parse(lrepo));
79 | startActivity(i);
80 | }
81 |
82 | private void init(){
83 | linkedin=findViewById(R.id.linkedin);
84 | github=findViewById(R.id.github);
85 | twitter=findViewById(R.id.twitter);
86 | star=findViewById(R.id.starImage);
87 | tv_star=findViewById(R.id.star);
88 | }
89 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
25 |
26 |
38 |
39 |
52 |
53 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Activity/TrackYourActivity.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Activity;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.recyclerview.widget.RecyclerView;
8 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
9 |
10 | import com.google.firebase.auth.FirebaseAuth;
11 | import com.google.firebase.database.DataSnapshot;
12 | import com.google.firebase.database.DatabaseError;
13 | import com.google.firebase.database.DatabaseReference;
14 | import com.google.firebase.database.FirebaseDatabase;
15 | import com.google.firebase.database.ValueEventListener;
16 | import com.vatsal.kesarwani.therapy.Adapter.TrackAdapter;
17 | import com.vatsal.kesarwani.therapy.Model.TrackModel;
18 | import com.vatsal.kesarwani.therapy.R;
19 |
20 | import java.util.ArrayList;
21 | import java.util.List;
22 | import java.util.Objects;
23 |
24 | public class TrackYourActivity extends AppCompatActivity {
25 |
26 | private RecyclerView trackRecycle;
27 | private TrackAdapter adapter;
28 | private List list;
29 | private DatabaseReference dr;
30 | private FirebaseAuth mAuth;
31 | private ValueEventListener valueEventListener;
32 | private SwipeRefreshLayout swipeRefreshLayout;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_track_your);
38 |
39 | init();
40 |
41 | refreshData();
42 |
43 | swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
44 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
45 | @Override
46 | public void onRefresh() {
47 | refreshData();
48 | }
49 | });
50 |
51 | }
52 |
53 | private void refreshData(){
54 | valueEventListener=new ValueEventListener() {
55 | @Override
56 | public void onDataChange(@NonNull DataSnapshot snapshot) {
57 | list.clear();
58 | for (DataSnapshot snapshott : snapshot.getChildren()){
59 | TrackModel model=snapshott.getValue(TrackModel.class);
60 | list.add(model);
61 | }
62 | trackRecycle.scrollToPosition(list.size() -1);
63 | swipeRefreshLayout.setRefreshing(false);
64 | adapter.notifyDataSetChanged();
65 | }
66 |
67 | @Override
68 | public void onCancelled(@NonNull DatabaseError error) {
69 |
70 | }
71 | };
72 | dr.child("Track").child(Objects.requireNonNull(Objects.requireNonNull(mAuth.getCurrentUser()).getUid())).addValueEventListener(valueEventListener);
73 | }
74 |
75 | private void init(){
76 | trackRecycle=findViewById(R.id.trackRecycle);
77 | list=new ArrayList<>();
78 | adapter=new TrackAdapter(this,list);
79 | trackRecycle.setAdapter(adapter);
80 | dr= FirebaseDatabase.getInstance().getReference();
81 | mAuth=FirebaseAuth.getInstance();
82 | swipeRefreshLayout=findViewById(R.id.refreshTrack);
83 | }
84 | }
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Activity/Splash.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Activity;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.os.Handler;
8 | import android.os.SystemClock;
9 | import android.widget.TextView;
10 |
11 | import androidx.appcompat.app.AppCompatActivity;
12 | import androidx.appcompat.app.AppCompatDelegate;
13 |
14 | import com.google.firebase.auth.FirebaseAuth;
15 | import com.vatsal.kesarwani.therapy.Model.AppConfig;
16 | import com.vatsal.kesarwani.therapy.R;
17 |
18 | public class Splash extends AppCompatActivity {
19 |
20 | private FirebaseAuth mAuth;
21 | private SharedPreferences sharedPreferences;
22 | private String[] a ={
23 | "You matter\nYou are important!\nYour presence on this earth makes a difference!",
24 | "Storms Don't Last Forever",
25 | "Be Kinder To Yourself.\nAnd then let your kindness flood the world",
26 | "Hope make a good breakfast eat plenty of it",
27 | "Adopt the pace of nature,\nHer secret is Patience",
28 | "When you focus on the good,\nThe good gets better",
29 | "The best view comes after the hardest climb",
30 | "Everyone is struggling mentally daily,\nYou are not alone.\nBetter things lie ahead.\nTake Care and be Kind",
31 | "The pain you feel today will be the strength you feel tomorrow",
32 | "You are more precious to the world than you'll ever know",
33 | "It is often in the darkest skies we see the brightest stars",
34 | "The calm of your mind is strong enough to handle noise of the world",
35 | "Tomorrow is another chance",
36 | "No darkness last forever. and even there, there are stars",
37 | "Silence teaches us lesson that words never will!!"
38 | };
39 |
40 | @Override
41 | protected void onCreate(Bundle savedInstanceState) {
42 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_splash);
45 |
46 | SystemClock.sleep(500);
47 |
48 | mAuth=FirebaseAuth.getInstance();
49 | TextView quote = findViewById(R.id.quote);
50 | sharedPreferences=getSharedPreferences(AppConfig.SHARED_PREF, Context.MODE_PRIVATE);
51 | int z=Integer.parseInt(sharedPreferences.getString(AppConfig.SPLASH,0+""));
52 | quote.setText(a[z]);
53 | z=z+1;
54 | if(z>=a.length){
55 | z=0;
56 | }
57 | sharedPreferences.edit()
58 | .putString(AppConfig.SPLASH,z+"")
59 | .apply();
60 |
61 | Handler handler = new Handler();
62 | handler.postDelayed(new Runnable() {
63 | @Override
64 | public void run() {
65 | if(mAuth.getCurrentUser()==null)
66 | startActivity(new Intent(getApplicationContext(), LoginScreen.class));
67 | else {
68 | if (mAuth.getCurrentUser() != null && sharedPreferences.getString(AppConfig.PROFILE_STATE, "com.vatsal.kesarwani.theraphy.PROFILE_STATE").equals("com.vatsal.kesarwani.theraphy.PROFILE_STATE")) {
69 | startActivity(new Intent(getApplicationContext(), Editprofile.class));
70 | } else if (mAuth.getCurrentUser() != null) {
71 | startActivity(new Intent(getApplicationContext(), MainScreen.class));
72 | }
73 | }
74 | }
75 | },2000);
76 | }
77 |
78 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Heal-O-Chat
3 | Hello blank fragment
4 | Full Name
5 | Age
6 | Contact Number
7 | About Me
8 | Describe Your Mental Situation
9 | Save changes
10 | Delete Account
11 | Delete Profile
12 | Allow Call From Others
13 | Profile Visibility
14 | Post Description
15 | Post
16 | Post Image
17 | Post Message
18 | Post By
19 | 00 Likes
20 | send
21 | you
22 | other
23 | Enter Message
24 | sex
25 | About
26 | contact
27 | Call
28 | message
29 | name
30 | Vatsal Kesarwani
31 | plazzy99
32 | Mentor @HakinCodes\'20 | Android Developer | Programmer | Android Developer at @DSC-JSS-NOIDA
33 | Contact Me
34 | linkedin
35 | github
36 | twitter
37 | profile cover
38 | Personal Info
39 | Edit Your Profile
40 | How do you feel
41 | Mental State
42 | Namaste 🙏
43 | \"Joy shared is doubled, Sorrow shared is halved.\"\n\nHeal-O-Chat is a Social Media Application for people who have been feeling less motivated in life or are losing hope. This platform allows users to chat with people and share their thoughts and feelings with each other and thereby let go of stress, anxiety and depression that they\'ve been feeling for long.
44 | So don\'t feel low anymore and hit the button to get started
45 | Report Post
46 | Block User
47 | Blocked User
48 | Block
49 | Unblock
50 | send mssg button
51 | xx:xx am
52 | Image
53 | View Profile
54 | Deactivate Profile
55 | Posts
56 | Add Some Friends to your chat list from the cure profiles
57 | No User Blocked From Your Side
58 | Your Activity
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
30 |
31 |
42 |
43 |
50 |
51 |
60 |
61 |
68 |
69 |
78 |
79 |
86 |
87 |
96 |
97 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Adapter/CureAdapter.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Adapter;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.TextView;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.bumptech.glide.Glide;
16 | import com.google.android.gms.tasks.OnSuccessListener;
17 | import com.google.firebase.storage.FirebaseStorage;
18 | import com.google.firebase.storage.StorageReference;
19 | import com.vatsal.kesarwani.therapy.Activity.CureProfile;
20 | import com.vatsal.kesarwani.therapy.Model.CureModel;
21 | import com.vatsal.kesarwani.therapy.R;
22 |
23 | import java.util.ArrayList;
24 | import java.util.Objects;
25 |
26 | import de.hdodenhof.circleimageview.CircleImageView;
27 |
28 | public class CureAdapter extends RecyclerView.Adapter {
29 | Context context;
30 | ArrayList list;
31 |
32 | public CureAdapter(Context context, ArrayList list) {
33 | this.context = context;
34 | this.list = list;
35 | }
36 |
37 | @NonNull
38 | @Override
39 | public CureAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
40 | View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.cure_list,parent,false);
41 | return new ViewHolder(v);
42 | }
43 |
44 | @Override
45 | public void onBindViewHolder(@NonNull final CureAdapter.ViewHolder holder, final int position) {
46 | holder.name.setText(list.get(position).getName());
47 | holder.desc.setText(list.get(position).getDesc());
48 | if (list.get(position).getUri().length()<5) {
49 | if (Objects.equals(list.get(position).getSex(), "Male")) {
50 | Glide.with(context.getApplicationContext())
51 | .load(R.drawable.ic_male)
52 | .into(holder.dp);
53 | } else {
54 | Glide.with(context.getApplicationContext())
55 | .load(R.drawable.ic_female)
56 | .into(holder.dp);
57 | }
58 | }
59 | else{
60 | StorageReference sr= FirebaseStorage.getInstance().getReference();
61 | try {
62 | sr.child(list.get(position).getUri())
63 | .getDownloadUrl()
64 | .addOnSuccessListener(new OnSuccessListener() {
65 | @Override
66 | public void onSuccess(Uri uri) {
67 | Glide.with(context.getApplicationContext())
68 | .load(uri)
69 | .into(holder.dp);
70 | }
71 | });
72 | }
73 | catch (Exception e){
74 | e.printStackTrace();
75 | }
76 | }
77 |
78 | holder.itemView.setOnClickListener(new View.OnClickListener() {
79 | @Override
80 | public void onClick(View v) {
81 | Intent intent =new Intent(context, CureProfile.class);
82 | intent.putExtra("mail",list.get(position).getMail());
83 | intent.putExtra("name",list.get(position).getName());
84 | intent.putExtra("uid",list.get(position).getUID());
85 | Log.d("ID: ",list.get(position).getMail());
86 | context.startActivity(intent);
87 | }
88 | });
89 | }
90 |
91 | @Override
92 | public int getItemCount() {
93 | return list.size();
94 | }
95 |
96 | public static class ViewHolder extends RecyclerView.ViewHolder {
97 | private TextView name,desc;
98 | private CircleImageView dp;
99 | public ViewHolder(@NonNull View itemView) {
100 | super(itemView);
101 | name=itemView.findViewById(R.id.name);
102 | desc=itemView.findViewById(R.id.description);
103 | dp=itemView.findViewById(R.id.dp);
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Activity/MainScreen.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.Menu;
6 | import android.view.MenuInflater;
7 | import android.view.MenuItem;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.appcompat.app.AppCompatActivity;
11 | import androidx.appcompat.app.AppCompatDelegate;
12 | import androidx.appcompat.widget.Toolbar;
13 | import androidx.viewpager.widget.ViewPager;
14 |
15 | import com.google.android.material.tabs.TabLayout;
16 | import com.google.firebase.auth.FirebaseAuth;
17 | import com.vatsal.kesarwani.therapy.Adapter.MyAdapter;
18 | import com.vatsal.kesarwani.therapy.R;
19 | import com.vatsal.kesarwani.therapy.Utility.Util;
20 |
21 | public class MainScreen extends AppCompatActivity {
22 |
23 | private FirebaseAuth mAuth;
24 | private TabLayout tabLayout;
25 | private ViewPager viewPager;
26 | private MyAdapter adapter;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_main_screen);
33 | Toolbar toolbar = findViewById(R.id.toolbar);
34 | setSupportActionBar(toolbar);
35 |
36 | init();
37 |
38 | tabLayout.addTab(tabLayout.newTab().setText("Post"));
39 | tabLayout.addTab(tabLayout.newTab().setText("Cure"));
40 | tabLayout.addTab(tabLayout.newTab().setText("Chat"));
41 | adapter = new MyAdapter(getSupportFragmentManager(), this, tabLayout.getTabCount());
42 | viewPager.setAdapter(adapter);
43 |
44 |
45 | viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
46 |
47 | tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
48 | @Override
49 | public void onTabSelected(TabLayout.Tab tab) {
50 | switch (tab.getPosition()) {
51 | case 0:
52 | viewPager.setCurrentItem(0);
53 | break;
54 |
55 | case 1:
56 | viewPager.setCurrentItem(1);
57 | break;
58 |
59 | case 2:
60 | viewPager.setCurrentItem(2);
61 | break;
62 | }
63 | }
64 |
65 | @Override
66 | public void onTabUnselected(TabLayout.Tab tab) {
67 |
68 | }
69 |
70 | @Override
71 | public void onTabReselected(TabLayout.Tab tab) {
72 |
73 | }
74 | });
75 |
76 | }
77 |
78 | private void init() {
79 | mAuth = FirebaseAuth.getInstance();
80 | tabLayout = findViewById(R.id.tablayout);
81 | viewPager = findViewById(R.id.viewpager);
82 | }
83 |
84 | @Override
85 | public boolean onCreateOptionsMenu(Menu menu) {
86 | MenuInflater inflater = getMenuInflater();
87 | inflater.inflate(R.menu.main_menu, menu);
88 | return true;
89 | }
90 |
91 | @Override
92 | public boolean onOptionsItemSelected(@NonNull MenuItem item) {
93 | switch (item.getItemId()) {
94 | case R.id.signout:
95 | new Util().setOffline();
96 | mAuth.signOut();
97 | startActivity(new Intent(getApplicationContext(), LoginScreen.class));
98 | return true;
99 |
100 | case R.id.profile:
101 | startActivity(new Intent(getApplicationContext(), Profile.class));
102 | return true;
103 |
104 | case R.id.setting:
105 | startActivity(new Intent(getApplicationContext(), Setting.class));
106 | return true;
107 |
108 | case R.id.aboutus:
109 | startActivity(new Intent(getApplicationContext(), AboutUs.class));
110 | return true;
111 | }
112 | return super.onOptionsItemSelected(item);
113 | }
114 |
115 |
116 | @Override
117 | public void onBackPressed() {
118 | super.onBackPressed();
119 | finishAffinity();
120 | finish();
121 | }
122 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Activity/BlockActivity.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Activity;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.TextView;
6 | import android.widget.Toast;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.recyclerview.widget.RecyclerView;
11 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
12 |
13 | import com.google.android.gms.tasks.OnCompleteListener;
14 | import com.google.android.gms.tasks.Task;
15 | import com.google.firebase.auth.FirebaseAuth;
16 | import com.google.firebase.firestore.FirebaseFirestore;
17 | import com.google.firebase.firestore.QueryDocumentSnapshot;
18 | import com.google.firebase.firestore.QuerySnapshot;
19 | import com.vatsal.kesarwani.therapy.Adapter.BlockAdapter;
20 | import com.vatsal.kesarwani.therapy.R;
21 |
22 | import java.util.ArrayList;
23 | import java.util.HashMap;
24 | import java.util.Map;
25 | import java.util.Objects;
26 |
27 | import es.dmoral.toasty.Toasty;
28 |
29 | public class BlockActivity extends AppCompatActivity {
30 |
31 | private FirebaseFirestore db;
32 | private ArrayList list;
33 | private BlockAdapter adapter;
34 | private RecyclerView recyclerView;
35 | private FirebaseAuth mAuth;
36 | private Map map;
37 | private SwipeRefreshLayout swipeRefreshLayout;
38 | private TextView warn;
39 |
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_block);
45 |
46 | init();
47 | //fetchData();
48 |
49 | swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent);
50 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
51 | @Override
52 | public void onRefresh() {
53 | fetchData();
54 | }
55 | });
56 |
57 | }
58 |
59 | @Override
60 | protected void onResume() {
61 | super.onResume();
62 | fetchData();
63 | }
64 |
65 | private void fetchData() {
66 | list.clear();
67 | db.collection("User")
68 | .document(Objects.requireNonNull(Objects.requireNonNull(mAuth.getCurrentUser()).getEmail()))
69 | .collection("Chat")
70 | .get()
71 | .addOnCompleteListener(new OnCompleteListener() {
72 | @Override
73 | public void onComplete(@NonNull Task task) {
74 | if (task.isSuccessful()){
75 |
76 | for (QueryDocumentSnapshot document : Objects.requireNonNull(task.getResult())){
77 | map=document.getData();
78 | if ((boolean)map.get("Block")){
79 | list.add(document.getId());
80 | }
81 | }
82 | swipeRefreshLayout.setRefreshing(false);
83 | if(list.size() > 0){
84 | warn.setVisibility(View.GONE);
85 | }else{
86 | warn.setVisibility(View.VISIBLE);
87 | }
88 | adapter.notifyDataSetChanged();
89 | }
90 | else{
91 | Toasty.error(BlockActivity.this,"Error Fetching Data", Toast.LENGTH_SHORT).show();
92 | }
93 | }
94 | });
95 | }
96 |
97 | private void init(){
98 | recyclerView= findViewById(R.id.blockedRecycle);
99 | list= new ArrayList<>();
100 | db= FirebaseFirestore.getInstance();
101 | adapter= new BlockAdapter(this, list);
102 | recyclerView.setAdapter(adapter);
103 | mAuth= FirebaseAuth.getInstance();
104 | map= new HashMap<>();
105 | swipeRefreshLayout=findViewById(R.id.refreshBlock);
106 | warn=findViewById(R.id.warn_block);
107 | if (list.size() == 0){
108 | warn.setVisibility(View.VISIBLE);
109 | }
110 | }
111 | }
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | xmlns:android
32 |
33 | ^$
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | xmlns:.*
43 |
44 | ^$
45 |
46 |
47 | BY_NAME
48 |
49 |
50 |
51 |
52 |
53 |
54 | .*:id
55 |
56 | http://schemas.android.com/apk/res/android
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | .*:name
66 |
67 | http://schemas.android.com/apk/res/android
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | name
77 |
78 | ^$
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | style
88 |
89 | ^$
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | .*
99 |
100 | ^$
101 |
102 |
103 | BY_NAME
104 |
105 |
106 |
107 |
108 |
109 |
110 | .*
111 |
112 | http://schemas.android.com/apk/res/android
113 |
114 |
115 | ANDROID_ATTRIBUTE_ORDER
116 |
117 |
118 |
119 |
120 |
121 |
122 | .*
123 |
124 | .*
125 |
126 |
127 | BY_NAME
128 |
129 |
130 |
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dilaog_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
27 |
28 |
33 |
34 |
48 |
49 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
72 |
73 |
80 |
81 |
88 |
89 |
96 |
97 |
103 |
104 |
105 |
106 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/post_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
27 |
28 |
33 |
34 |
48 |
49 |
57 |
58 |
59 |
60 |
61 |
62 |
71 |
72 |
79 |
80 |
87 |
88 |
95 |
96 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/post_list_like.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
27 |
28 |
33 |
34 |
48 |
49 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
72 |
73 |
80 |
81 |
88 |
89 |
96 |
97 |
103 |
104 |
105 |
106 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_editprofile.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
23 |
24 |
32 |
33 |
43 |
44 |
51 |
52 |
61 |
62 |
65 |
66 |
71 |
72 |
73 |
74 |
85 |
86 |
96 |
97 |
107 |
108 |
117 |
118 |
121 |
122 |
123 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about_us.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
32 |
33 |
42 |
43 |
56 |
57 |
66 |
67 |
76 |
77 |
85 |
86 |
94 |
95 |
103 |
104 |
105 |
106 |
115 |
116 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Adapter/MessageAdapter.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Adapter;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.graphics.drawable.ColorDrawable;
7 | import android.net.Uri;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import androidx.annotation.NonNull;
15 | import androidx.cardview.widget.CardView;
16 | import androidx.recyclerview.widget.RecyclerView;
17 |
18 | import com.bumptech.glide.Glide;
19 | import com.google.android.gms.tasks.OnSuccessListener;
20 | import com.google.firebase.auth.FirebaseAuth;
21 | import com.google.firebase.storage.FirebaseStorage;
22 | import com.google.firebase.storage.StorageReference;
23 | import com.vatsal.kesarwani.therapy.Model.MessageModel;
24 | import com.vatsal.kesarwani.therapy.R;
25 |
26 | import java.util.ArrayList;
27 | import java.util.Objects;
28 |
29 | public class MessageAdapter extends RecyclerView.Adapter {
30 | Context context;
31 | ArrayList list;
32 | final int YOU=1;
33 | final int OTHER =2;
34 | final int YOU_IMAGE=11;
35 | final int OTHER_IMAGE= 22;
36 | private View v;
37 |
38 | public MessageAdapter(Context context, ArrayList list) {
39 | this.context = context;
40 | this.list = list;
41 | }
42 |
43 | @NonNull
44 | @Override
45 | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
46 | switch (viewType){
47 | case OTHER :
48 | v = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_list_other, parent, false);
49 | return new TextViewHolder(v);
50 |
51 | case YOU_IMAGE:
52 | v= LayoutInflater.from(parent.getContext()).inflate(R.layout.message_list_you_image,parent,false);
53 | return new ImageViewHolder(v);
54 |
55 | case OTHER_IMAGE:
56 | v= LayoutInflater.from(parent.getContext()).inflate(R.layout.message_list_other_image, parent,false);
57 | return new ImageViewHolder(v);
58 |
59 | default:
60 | v = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_list, parent, false);
61 | return new TextViewHolder(v);
62 | }
63 | }
64 |
65 | @Override
66 | public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {
67 |
68 | if (list.get(position).getMssg().length() >1) {
69 | ((TextViewHolder) holder).mssg.setText(list.get(position).getMssg().trim() + " "); //8 spaces
70 | ((TextViewHolder) holder).time.setText(list.get(position).getTime());
71 | }
72 | else {
73 | final Dialog dialog =new Dialog(context);
74 | dialog.setContentView(R.layout.dialog_image_layout);
75 | Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
76 | dialog.setCancelable(true);
77 |
78 | ((ImageViewHolder) holder).time.setText(list.get(position).getTime());
79 |
80 | StorageReference sr= FirebaseStorage.getInstance().getReference();
81 | try {
82 | sr.child(list.get(position).getImg())
83 | .getDownloadUrl()
84 | .addOnSuccessListener(new OnSuccessListener() {
85 | @Override
86 | public void onSuccess(Uri uri) {
87 | try {
88 | Glide.with(context.getApplicationContext())
89 | .load(uri)
90 | .into(((ImageViewHolder) holder).image);
91 |
92 | Glide.with(context.getApplicationContext())
93 | .load(uri)
94 | .into((ImageView) dialog.findViewById(R.id.img));
95 | }
96 | catch (Exception e){
97 | e.printStackTrace();
98 | }
99 | }
100 | });
101 | }
102 | catch (Exception e){
103 | e.printStackTrace();
104 | }
105 |
106 | holder.itemView.setOnClickListener(new View.OnClickListener() {
107 | @Override
108 | public void onClick(View v) {
109 | dialog.show();
110 | }
111 | });
112 | }
113 | }
114 |
115 | @Override
116 | public int getItemCount() {
117 | return list.size();
118 | }
119 |
120 | public static class TextViewHolder extends RecyclerView.ViewHolder {
121 | private TextView mssg;
122 | private TextView time;
123 | public TextViewHolder(@NonNull View itemView) {
124 | super(itemView);
125 | mssg=itemView.findViewById(R.id.mssg);
126 | time= itemView.findViewById(R.id.time);
127 | }
128 | }
129 |
130 | public static class ImageViewHolder extends RecyclerView.ViewHolder {
131 |
132 | TextView time;
133 | ImageView image;
134 |
135 | public ImageViewHolder(View itemView) {
136 | super(itemView);
137 |
138 | this.time = itemView.findViewById(R.id.time);
139 | this.image = itemView.findViewById(R.id.image);
140 | }
141 | }
142 |
143 |
144 | @Override
145 | public int getItemViewType(int position) {
146 | FirebaseAuth mAuth=FirebaseAuth.getInstance();
147 | if(list.get(position).getUser().equals(Objects.requireNonNull(mAuth.getCurrentUser()).getEmail())){
148 | if(list.get(position).getImg().length() > 1){
149 | return YOU_IMAGE;
150 | }
151 | else return YOU;
152 | }
153 | else{
154 | if (list.get(position).getImg().length() > 1){
155 | return OTHER_IMAGE;
156 | }
157 | else return OTHER;
158 | }
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Utility/AppVisibilityDetector.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Utility;
2 |
3 | import android.app.Activity;
4 | import android.app.ActivityManager;
5 | import android.app.Application;
6 | import android.content.Context;
7 | import android.os.Bundle;
8 | import android.os.Handler;
9 | import android.os.Message;
10 | import android.text.TextUtils;
11 | import android.util.Log;
12 |
13 | import java.util.List;
14 |
15 | public final class AppVisibilityDetector {
16 | private static boolean DEBUG = false;
17 | private static final String TAG = "AppVisibilityDetector";
18 | private static AppVisibilityCallback sAppVisibilityCallback;
19 | private static boolean sIsForeground = false;
20 | private static Handler sHandler;
21 | private static final int MSG_GOTO_FOREGROUND = 1;
22 | private static final int MSG_GOTO_BACKGROUND = 2;
23 |
24 | public static void init(final Application app, AppVisibilityCallback appVisibilityCallback) {
25 | if (!checkIsMainProcess(app)) {
26 | return;
27 | }
28 |
29 | sAppVisibilityCallback = appVisibilityCallback;
30 | app.registerActivityLifecycleCallbacks(new AppActivityLifecycleCallbacks());
31 |
32 | sHandler = new Handler(app.getMainLooper()) {
33 | @Override
34 | public void handleMessage(Message msg) {
35 | switch (msg.what) {
36 | case MSG_GOTO_FOREGROUND:
37 | if (DEBUG) {
38 | Log.d(TAG, "handleMessage(MSG_GOTO_FOREGROUND)");
39 | }
40 | performAppGotoForeground();
41 | break;
42 | case MSG_GOTO_BACKGROUND:
43 | if (DEBUG) {
44 | Log.d(TAG, "handleMessage(MSG_GOTO_BACKGROUND)");
45 | }
46 | performAppGotoBackground();
47 | break;
48 | default:
49 | break;
50 | }
51 | }
52 | };
53 | }
54 |
55 | public static boolean checkIsMainProcess(Application app) {
56 | ActivityManager activityManager = (ActivityManager) app.getSystemService(Context.ACTIVITY_SERVICE);
57 | List runningAppProcessInfoList = activityManager.getRunningAppProcesses();
58 | if (null == runningAppProcessInfoList) {
59 | return false;
60 | }
61 |
62 | String currProcessName = null;
63 | int currPid = android.os.Process.myPid();
64 | //find the process name
65 | for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcessInfoList) {
66 | if (null != processInfo && processInfo.pid == currPid) {
67 | currProcessName = processInfo.processName;
68 | }
69 | }
70 |
71 | //is current process the main process
72 | if (!TextUtils.equals(currProcessName, app.getPackageName())) {
73 | return false;
74 | }
75 |
76 | return true;
77 | }
78 |
79 | private static void performAppGotoForeground() {
80 | if (!sIsForeground && null != sAppVisibilityCallback) {
81 | sIsForeground = true;
82 | sAppVisibilityCallback.onAppGotoForeground();
83 | }
84 | }
85 |
86 | private static void performAppGotoBackground() {
87 | if (sIsForeground && null != sAppVisibilityCallback) {
88 | sIsForeground = false;
89 | sAppVisibilityCallback.onAppGotoBackground();
90 | }
91 | }
92 |
93 | public interface AppVisibilityCallback {
94 | void onAppGotoForeground();
95 |
96 | void onAppGotoBackground();
97 | }
98 |
99 | private static class AppActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
100 | int activityDisplayCount = 0;
101 |
102 | @Override
103 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
104 | if (DEBUG) {
105 | Log.d(TAG, activity.getClass().getName() + " onActivityCreated");
106 | }
107 | }
108 |
109 | @Override
110 | public void onActivityStarted(Activity activity) {
111 | sHandler.removeMessages(MSG_GOTO_FOREGROUND);
112 | sHandler.removeMessages(MSG_GOTO_BACKGROUND);
113 | if (activityDisplayCount == 0) {
114 | sHandler.sendEmptyMessage(MSG_GOTO_FOREGROUND);
115 | }
116 | activityDisplayCount++;
117 |
118 | if (DEBUG) {
119 | Log.d(TAG, activity.getClass().getName() + " onActivityStarted "
120 | + " activityDisplayCount: " + activityDisplayCount);
121 | }
122 | }
123 |
124 | @Override
125 | public void onActivityResumed(Activity activity) {
126 | if (DEBUG) {
127 | Log.d(TAG, activity.getClass().getName() + " onActivityResumed");
128 | }
129 | }
130 |
131 | @Override
132 | public void onActivityPaused(Activity activity) {
133 | if (DEBUG) {
134 | Log.d(TAG, activity.getClass().getName() + " onActivityPaused");
135 | }
136 | }
137 |
138 | @Override
139 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
140 | if (DEBUG) {
141 | Log.d(TAG, activity.getClass().getName() + " onActivitySaveInstanceState");
142 | }
143 | }
144 |
145 | @Override
146 | public void onActivityStopped(Activity activity) {
147 | sHandler.removeMessages(MSG_GOTO_FOREGROUND);
148 | sHandler.removeMessages(MSG_GOTO_BACKGROUND);
149 | if (activityDisplayCount > 0) {
150 | activityDisplayCount--;
151 | }
152 |
153 | if (activityDisplayCount == 0) {
154 | sHandler.sendEmptyMessage(MSG_GOTO_BACKGROUND);
155 | }
156 |
157 | if (DEBUG) {
158 | Log.d(TAG, activity.getClass().getName() + " onActivityStopped "
159 | + " activityDisplayCount: " + activityDisplayCount);
160 | }
161 | }
162 |
163 | @Override
164 | public void onActivityDestroyed(Activity activity) {
165 | if (DEBUG) {
166 | Log.d(TAG, activity.getClass().getName() + " onActivityDestroyed");
167 | }
168 | }
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vatsal/kesarwani/therapy/Fragment/ChatFragment.java:
--------------------------------------------------------------------------------
1 | package com.vatsal.kesarwani.therapy.Fragment;
2 |
3 | import android.os.Bundle;
4 | import android.util.Log;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.appcompat.app.AppCompatDelegate;
13 | import androidx.fragment.app.Fragment;
14 | import androidx.recyclerview.widget.RecyclerView;
15 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
16 |
17 | import com.google.android.gms.tasks.OnCompleteListener;
18 | import com.google.android.gms.tasks.Task;
19 | import com.google.firebase.auth.FirebaseAuth;
20 | import com.google.firebase.firestore.FirebaseFirestore;
21 | import com.google.firebase.firestore.QueryDocumentSnapshot;
22 | import com.google.firebase.firestore.QuerySnapshot;
23 | import com.vatsal.kesarwani.therapy.Adapter.ChatAdapter;
24 | import com.vatsal.kesarwani.therapy.Model.ChatModel;
25 | import com.vatsal.kesarwani.therapy.R;
26 |
27 | import java.util.ArrayList;
28 | import java.util.HashMap;
29 | import java.util.Map;
30 | import java.util.Objects;
31 |
32 | import es.dmoral.toasty.Toasty;
33 |
34 | /**
35 | * A simple {@link Fragment} subclass.
36 | * Use the {@link ChatFragment#newInstance} factory method to
37 | * create an instance of this fragment.
38 | */
39 | public class ChatFragment extends Fragment {
40 |
41 | // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
42 | private static final String ARG_PARAM1 = "param1";
43 | private static final String ARG_PARAM2 = "param2";
44 |
45 | private String mParam1;
46 | private String mParam2;
47 | private RecyclerView chatRecycle;
48 | private FirebaseAuth mAuth;
49 | private FirebaseFirestore db;
50 | private ArrayList list;
51 | private ChatAdapter adapter;
52 | private Map map;
53 | private static final String TAG = "ChatFragment";
54 | private SwipeRefreshLayout swipeRefreshLayout;
55 | private TextView warn;
56 |
57 |
58 | public ChatFragment() {
59 | // Required empty public constructor
60 | }
61 |
62 | /**
63 | * Use this factory method to create a new instance of
64 | * this fragment using the provided parameters.
65 | *
66 | * @param param1 Parameter 1.
67 | * @param param2 Parameter 2.
68 | * @return A new instance of fragment ChatFragment.
69 | */
70 | public static ChatFragment newInstance(String param1, String param2) {
71 | ChatFragment fragment = new ChatFragment();
72 | Bundle args = new Bundle();
73 | args.putString(ARG_PARAM1, param1);
74 | args.putString(ARG_PARAM2, param2);
75 | fragment.setArguments(args);
76 | return fragment;
77 | }
78 |
79 | @Override
80 | public void onCreate(Bundle savedInstanceState) {
81 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
82 | super.onCreate(savedInstanceState);
83 | if (getArguments() != null) {
84 | mParam1 = getArguments().getString(ARG_PARAM1);
85 | mParam2 = getArguments().getString(ARG_PARAM2);
86 | }
87 | }
88 |
89 | @Override
90 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
91 | Bundle savedInstanceState) {
92 | // Inflate the layout for this fragment
93 | View root = inflater.inflate(R.layout.fragment_chat, container, false);
94 |
95 | init(root);
96 |
97 | //fetchData();
98 |
99 | /*swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent); //cause recycling error
100 | swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
101 | @Override
102 | public void onRefresh() {
103 | fetchData();
104 | }
105 | });*/
106 |
107 | return root;
108 | }
109 |
110 | @Override
111 | public void onResume() {
112 | super.onResume();
113 |
114 | fetchData();
115 | }
116 |
117 | private void fetchData(){
118 | list.clear();
119 | db.collection("User")
120 | .document(Objects.requireNonNull(Objects.requireNonNull(mAuth.getCurrentUser()).getEmail()))
121 | .collection("Chat")
122 | .get()
123 | .addOnCompleteListener(new OnCompleteListener() {
124 | @Override
125 | public void onComplete(@NonNull Task task) {
126 | if (task.isSuccessful()){
127 |
128 | for (QueryDocumentSnapshot document : Objects.requireNonNull(task.getResult())){
129 | map=document.getData();
130 | Log.d("IDCollection", document.getId());
131 | if(!(boolean)map.get("Block")) {
132 | list.add(new ChatModel(
133 | document.getId()
134 | ));
135 | }
136 | }
137 | //swipeRefreshLayout.setRefreshing(false);
138 | if(list.size() == 0){
139 | warn.setVisibility(View.VISIBLE);
140 | }
141 | else {
142 | warn.setVisibility(View.GONE);
143 | }
144 | adapter.notifyDataSetChanged();
145 | }
146 | else{
147 | Toasty.error(Objects.requireNonNull(getContext()),"Error Fetching Data", Toast.LENGTH_SHORT).show();
148 | }
149 | }
150 | });
151 | }
152 |
153 | private void init(View root) {
154 | chatRecycle=root.findViewById(R.id.chat_recycler);
155 | mAuth=FirebaseAuth.getInstance();
156 | map=new HashMap<>();
157 | db=FirebaseFirestore.getInstance();
158 | list=new ArrayList<>();
159 | adapter=new ChatAdapter(getContext(),list);
160 | chatRecycle.setAdapter(adapter);
161 | //swipeRefreshLayout=root.findViewById(R.id.refreshChat);
162 | warn=root.findViewById(R.id.warn_chat);
163 | if(list.size() == 0){
164 | warn.setVisibility(View.VISIBLE);
165 | }
166 | }
167 | }
--------------------------------------------------------------------------------