├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── font │ │ │ │ ├── montserrat.ttf │ │ │ │ ├── spectral.ttf │ │ │ │ ├── vollkorn.ttf │ │ │ │ ├── font.xml │ │ │ │ └── my_font.xml │ │ │ ├── drawable │ │ │ │ ├── reg_img.png │ │ │ │ ├── btn_primary.png │ │ │ │ ├── fpass_img.png │ │ │ │ ├── input_panel.png │ │ │ │ ├── login_img.png │ │ │ │ ├── next_panel.png │ │ │ │ ├── start_img.png │ │ │ │ ├── start_panel.png │ │ │ │ ├── btn_secondary.png │ │ │ │ ├── tab_background.xml │ │ │ │ ├── background_right.xml │ │ │ │ ├── background_left.xml │ │ │ │ ├── tab_background_selected.xml │ │ │ │ ├── tab_layout_background.xml │ │ │ │ ├── tab_layout_selector.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── edit.png │ │ │ │ ├── mbg.png │ │ │ │ ├── pbg.png │ │ │ │ ├── search.png │ │ │ │ ├── friends.png │ │ │ │ ├── send_btn.png │ │ │ │ ├── signout.png │ │ │ │ └── user_item.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── search.png │ │ │ │ └── signout.png │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── default_avatar.png │ │ │ ├── values │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── menu │ │ │ │ └── menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-anydpi │ │ │ │ └── logout.xml │ │ │ ├── layout │ │ │ │ ├── fragment_chats.xml │ │ │ │ ├── bar_layout.xml │ │ │ │ ├── chat_item_left.xml │ │ │ │ ├── fragment_users.xml │ │ │ │ ├── chat_item_right.xml │ │ │ │ ├── fragment_profile.xml │ │ │ │ ├── activity_reset_password.xml │ │ │ │ ├── activity_start.xml │ │ │ │ ├── user_item.xml │ │ │ │ ├── activity_message.xml │ │ │ │ ├── activity_register.xml │ │ │ │ ├── activity_login.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── ic_launcher-playstore.png │ │ ├── java │ │ │ └── com │ │ │ │ └── dvlnitins │ │ │ │ └── friends │ │ │ │ ├── Notifications │ │ │ │ ├── MyResponse.java │ │ │ │ ├── Sender.java │ │ │ │ ├── Token.java │ │ │ │ ├── Client.java │ │ │ │ ├── Data.java │ │ │ │ ├── OreoNotification.java │ │ │ │ └── MyFirebaseMessaging.java │ │ │ │ ├── FRIENDS.java │ │ │ │ ├── Model │ │ │ │ ├── Chatlist.java │ │ │ │ ├── Chat.java │ │ │ │ └── User.java │ │ │ │ ├── Fragments │ │ │ │ ├── APIService.java │ │ │ │ ├── ChatsFragment.java │ │ │ │ ├── UsersFragment.java │ │ │ │ └── ProfileFragment.java │ │ │ │ ├── StartActivity.java │ │ │ │ ├── ResetPasswordActivity.java │ │ │ │ ├── Adapter │ │ │ │ ├── MessageAdapter.java │ │ │ │ └── UserAdapter.java │ │ │ │ ├── LoginActivity.java │ │ │ │ ├── RegisterActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── MessageActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── dvlnitins │ │ │ └── friends │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── dvlnitins │ │ └── friends │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── google-services.json └── build.gradle ├── settings.gradle ├── Mobile_UI.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── vcs.xml ├── render.experimental.xml ├── misc.xml ├── gradle.xml ├── jarRepositories.xml └── codeStyles │ └── Project.xml ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='FRIENDS' 3 | -------------------------------------------------------------------------------- /Mobile_UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/Mobile_UI.png -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/font/montserrat.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/font/montserrat.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/spectral.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/font/spectral.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/vollkorn.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/font/vollkorn.ttf -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/reg_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/reg_img.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/mbg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/pbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/pbg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_primary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/btn_primary.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/fpass_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/fpass_img.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/input_panel.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/login_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/login_img.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/next_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/next_panel.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/start_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/start_img.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/start_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/start_panel.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_secondary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable/btn_secondary.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/send_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/send_btn.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/signout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/signout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/user_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxhdpi/user_item.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxxhdpi/search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/signout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xxxhdpi/signout.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/drawable-xhdpi/default_avatar.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/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/nitinrai-dev/FRIENDS/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/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/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/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/font/font.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nitinrai-dev/FRIENDS/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFB4A2 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/render.experimental.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FRIENDS 3 | 4 | 5 | Hello blank fragment 6 | 7 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/MyResponse.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class MyResponse { 8 | 9 | public int success; 10 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 25 23:33:21 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-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /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/res/drawable/background_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/Sender.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class Sender { 8 | public Data data; 9 | public String to; 10 | 11 | public Sender(Data data, String to) { 12 | this.data = data; 13 | this.to = to; 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/FRIENDS.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends; 2 | 3 | import android.app.Application; 4 | 5 | import com.google.firebase.database.FirebaseDatabase; 6 | 7 | public class FRIENDS extends Application { 8 | 9 | @Override 10 | public void onCreate() { 11 | super.onCreate(); 12 | 13 | FirebaseDatabase.getInstance().setPersistenceEnabled(true); 14 | 15 | }} 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_background_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_layout_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/font/my_font.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/test/java/com/dvlnitins/friends/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends; 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/drawable/tab_layout_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Model/Chatlist.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Model; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class Chatlist { 8 | public String id; 9 | 10 | public Chatlist(String id) { 11 | this.id = id; 12 | } 13 | 14 | public Chatlist() { 15 | } 16 | 17 | public String getId() { 18 | return id; 19 | } 20 | 21 | public void setId(String id) { 22 | this.id = id; 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/Token.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class Token { 8 | private String token; 9 | 10 | public Token(String token) { 11 | this.token = token; 12 | } 13 | 14 | public Token() { 15 | } 16 | 17 | public String getToken() { 18 | return token; 19 | } 20 | 21 | public void setToken(String token) { 22 | this.token = token; 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-anydpi/logout.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_chats.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/bar_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/Client.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | import retrofit2.Retrofit; 8 | import retrofit2.converter.gson.GsonConverterFactory; 9 | 10 | public class Client { 11 | 12 | private static Retrofit retrofit = null; 13 | 14 | public static Retrofit getClient(String url){ 15 | if (retrofit == null){ 16 | retrofit = new Retrofit.Builder() 17 | .baseUrl(url) 18 | .addConverterFactory(GsonConverterFactory.create()) 19 | .build(); 20 | } 21 | return retrofit; 22 | } 23 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /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 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFB4A2 4 | #FFB4A2 5 | #B5838D 6 | #F2F2F2 7 | #FFB4A2 8 | #D34941 9 | #B5838D 10 | #6D6875 11 | #FAF9F9 12 | 13 | 14 | #FFB4A2 15 | #B5838D 16 | #FAF9F9 17 | #F2F2F2 18 | #6D6875 19 | #FFB4A2 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Fragments/APIService.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Fragments; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | import com.dvlnitins.friends.Notifications.MyResponse; 8 | import com.dvlnitins.friends.Notifications.Sender; 9 | 10 | import retrofit2.Call; 11 | import retrofit2.http.Body; 12 | import retrofit2.http.Headers; 13 | import retrofit2.http.POST; 14 | 15 | public interface APIService { 16 | @Headers( 17 | { 18 | "Content-Type:application/json", 19 | "Authorization:key=AAAAb-4KokE:APA91bGl2i1U5ZMbFC9EMRUPmECIDNsLIF9z5k-SL95RSKInyX2hkS8fMQDTagJSBIKlYpqw6gBO9xPB3s6ldnniLvRG597VCeskR5wj-KLaCNulFQ458nh3_kTeEW24W0cFLiJlZ4e_" 20 | } 21 | ) 22 | 23 | @POST("fcm/send") 24 | Call sendNotification(@Body Sender body); 25 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/dvlnitins/friends/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends; 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 | 25 | assertEquals("com.dvlnitins.friends", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | Logo 3 |
4 | 5 | # FRIENDS 6 | > Complete Open Source Real-Time Android Chat Application using Firebase. 7 | 8 | FRIENDS is a project that I started to improve my Android Development knowledge. 9 | Later on I have decided to make it public and open source. 10 | 11 | It uses Firebase's Authentication/Database/Storage/Messaging/CrashReporting libraries for it's implementation 12 | and several other libraries. 13 | 14 | ![](Mobile_UI.png) 15 | 16 | ## Download [APP](https://github.com/dvlnitins/FRIENDS/releases/download/v0.314-beta/FRIENDS-CHAT.apk) 17 | 18 | ## Installation 19 | ```sh 20 | *Setting up project* 21 | 22 | - Download Project 23 | - Create a new [Firebase](https://firebase.google.com) Project in console 24 | - Connect project with Firebase `(Tools/Firebase)` in Android Studio 25 | - Generate, download, paste `google-services.json` into the project 26 | 27 | ``` 28 | 29 | ## Upcoming 30 | 31 | - Blocking 32 | - Block user from sending messages 33 | 34 | 35 | -------------------------------------------------------------------------------- /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=-Xmx1536m 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 20 | 21 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Model/Chat.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Model; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class Chat { 8 | 9 | private String sender; 10 | private String receiver; 11 | private String message; 12 | private boolean isseen; 13 | 14 | public Chat(String sender, String receiver, String message, boolean isseen) { 15 | this.sender = sender; 16 | this.receiver = receiver; 17 | this.message = message; 18 | this.isseen = isseen; 19 | } 20 | 21 | public Chat() { 22 | } 23 | 24 | public String getSender() { 25 | return sender; 26 | } 27 | 28 | public void setSender(String sender) { 29 | this.sender = sender; 30 | } 31 | 32 | public String getReceiver() { 33 | return receiver; 34 | } 35 | 36 | public void setReceiver(String receiver) { 37 | this.receiver = receiver; 38 | } 39 | 40 | public String getMessage() { 41 | return message; 42 | } 43 | 44 | public void setMessage(String message) { 45 | this.message = message; 46 | } 47 | 48 | public boolean isIsseen() { 49 | return isseen; 50 | } 51 | 52 | public void setIsseen(boolean isseen) { 53 | this.isseen = isseen; 54 | } 55 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/chat_item_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | z 13 | 14 | 27 | 28 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/Data.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class Data { 8 | private String user; 9 | private int icon; 10 | private String body; 11 | private String title; 12 | private String sented; 13 | 14 | public Data(String user, int icon, String body, String title, String sented) { 15 | this.user = user; 16 | this.icon = icon; 17 | this.body = body; 18 | this.title = title; 19 | this.sented = sented; 20 | } 21 | 22 | public Data() { 23 | } 24 | 25 | public String getUser() { 26 | return user; 27 | } 28 | 29 | public void setUser(String user) { 30 | this.user = user; 31 | } 32 | 33 | public int getIcon() { 34 | return icon; 35 | } 36 | 37 | public void setIcon(int icon) { 38 | this.icon = icon; 39 | } 40 | 41 | public String getBody() { 42 | return body; 43 | } 44 | 45 | public void setBody(String body) { 46 | this.body = body; 47 | } 48 | 49 | public String getTitle() { 50 | return title; 51 | } 52 | 53 | public void setTitle(String title) { 54 | this.title = title; 55 | } 56 | 57 | public String getSented() { 58 | return sented; 59 | } 60 | 61 | public void setSented(String sented) { 62 | this.sented = sented; 63 | } 64 | } -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "480735044161", 4 | "firebase_url": "https://friends-a2f66.firebaseio.com", 5 | "project_id": "friends-a2f66", 6 | "storage_bucket": "friends-a2f66.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:480735044161:android:8fc4f158392f2701f6dcc0", 12 | "android_client_info": { 13 | "package_name": "com.dvlnitins.friends" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "480735044161-gg0t9k4r53omk3tdaiubh4kbdpqqp7fs.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.dvlnitins.friends", 22 | "certificate_hash": "b902b808cf96882b0427b57d9718b5109997e7b7" 23 | } 24 | }, 25 | { 26 | "client_id": "480735044161-c082d2gj3mc3s6rg8ljnlbiu8n8ppae9.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyDBlwA9_QZAhftsRYB4kt3OtDGiT_Z9PiY" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "480735044161-c082d2gj3mc3s6rg8ljnlbiu8n8ppae9.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Model/User.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Model; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | public class User { 8 | 9 | private String id; 10 | private String username; 11 | private String imageURL; 12 | private String status; 13 | private String search; 14 | 15 | public User(String id, String username, String imageURL, String status, String search) { 16 | this.id = id; 17 | this.username = username; 18 | this.imageURL = imageURL; 19 | this.status = status; 20 | this.search = search; 21 | } 22 | 23 | public User() { 24 | 25 | } 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public String getUsername() { 36 | return username; 37 | } 38 | 39 | public void setUsername(String username) { 40 | this.username = username; 41 | } 42 | 43 | public String getImageURL() { 44 | return imageURL; 45 | } 46 | 47 | public void setImageURL(String imageURL) { 48 | this.imageURL = imageURL; 49 | } 50 | 51 | public String getStatus() { 52 | return status; 53 | } 54 | 55 | public void setStatus(String status) { 56 | this.status = status; 57 | } 58 | 59 | public String getSearch() { 60 | return search; 61 | } 62 | 63 | public void setSearch(String search) { 64 | this.search = search; 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_users.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 30 | 31 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/chat_item_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 19 | 20 | 32 | 33 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.google.gms.google-services' 3 | 4 | android { 5 | compileSdkVersion 29 6 | buildToolsVersion "29.0.2" 7 | defaultConfig { 8 | applicationId "com.dvlnitins.friends" 9 | minSdkVersion 21 10 | targetSdkVersion 29 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation fileTree(dir: 'libs', include: ['*.jar']) 25 | 26 | implementation 'androidx.appcompat:appcompat:1.0.2' 27 | implementation 'androidx.constraintlayout:constraintlayout:1.1.1' 28 | 29 | implementation 'com.google.android.material:material:1.0.0' 30 | implementation 'androidx.cardview:cardview:1.0.0' 31 | implementation 'com.rengwuxian.materialedittext:library:2.1.4' 32 | 33 | implementation 'com.google.firebase:firebase-auth:19.2.0' 34 | implementation 'com.google.firebase:firebase-database:19.2.0' 35 | implementation 'com.google.firebase:firebase-messaging:20.1.0' 36 | implementation 'com.google.firebase:firebase-storage:19.1.0' 37 | 38 | implementation 'de.hdodenhof:circleimageview:2.2.0' 39 | implementation 'com.github.bumptech.glide:glide:4.8.0' 40 | 41 | //add these libraries 42 | implementation 'com.squareup.retrofit2:retrofit:2.3.0' 43 | implementation 'com.squareup.retrofit2:converter-gson:2.3.0' 44 | 45 | testImplementation 'junit:junit:4.12' 46 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 47 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 48 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 34 | 35 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/Notifications/OreoNotification.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends.Notifications; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.annotation.TargetApi; 6 | import android.app.Notification; 7 | import android.app.NotificationChannel; 8 | import android.app.NotificationManager; 9 | import android.app.PendingIntent; 10 | 11 | import android.content.Context; 12 | import android.content.ContextWrapper; 13 | import android.net.Uri; 14 | import android.os.Build; 15 | import android.os.Bundle; 16 | 17 | public class OreoNotification extends ContextWrapper { 18 | 19 | private static final String CHANNEL_ID = "com.dvlnitins.friends"; 20 | private static final String CHANNEL_NAME = "FRIENDS"; 21 | 22 | private NotificationManager notificationManager; 23 | 24 | public OreoNotification(Context base) { 25 | super(base); 26 | 27 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ 28 | createChannel(); 29 | } 30 | } 31 | 32 | @TargetApi(Build.VERSION_CODES.O) 33 | private void createChannel() { 34 | 35 | NotificationChannel channel = new NotificationChannel(CHANNEL_ID, 36 | CHANNEL_NAME, 37 | NotificationManager.IMPORTANCE_DEFAULT); 38 | channel.enableLights(false); 39 | channel.enableVibration(true); 40 | channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE); 41 | 42 | getManager().createNotificationChannel(channel); 43 | } 44 | 45 | public NotificationManager getManager(){ 46 | if (notificationManager == null){ 47 | notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); 48 | } 49 | 50 | return notificationManager; 51 | } 52 | 53 | @TargetApi(Build.VERSION_CODES.O) 54 | public Notification.Builder getOreoNotification(String title, String body, 55 | PendingIntent pendingIntent, Uri soundUri, String icon){ 56 | return new Notification.Builder(getApplicationContext(), CHANNEL_ID) 57 | .setContentIntent(pendingIntent) 58 | .setContentTitle(title) 59 | .setContentText(body) 60 | .setSmallIcon(Integer.parseInt(icon)) 61 | .setSound(soundUri) 62 | .setAutoCancel(true); 63 | } 64 | } -------------------------------------------------------------------------------- /app/src/main/java/com/dvlnitins/friends/StartActivity.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends; 2 | 3 | 4 | 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.util.Pair; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.ImageView; 11 | 12 | 13 | import androidx.appcompat.app.AppCompatActivity; 14 | import androidx.core.app.ActivityOptionsCompat; 15 | 16 | import com.google.firebase.auth.FirebaseAuth; 17 | import com.google.firebase.auth.FirebaseUser; 18 | 19 | public class StartActivity extends AppCompatActivity { 20 | 21 | Button login, register; 22 | 23 | FirebaseUser firebaseUser; 24 | 25 | @Override 26 | protected void onStart() { 27 | super.onStart(); 28 | 29 | firebaseUser = FirebaseAuth.getInstance().getCurrentUser(); 30 | 31 | //check if user is null 32 | if (firebaseUser != null){ 33 | Intent intent = new Intent(StartActivity.this, MainActivity.class); 34 | startActivity(intent); 35 | finish(); 36 | } 37 | } 38 | 39 | @Override 40 | protected void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | setContentView(R.layout.activity_start); 43 | 44 | login = findViewById(R.id.login); 45 | register = findViewById(R.id.register); 46 | 47 | login.setOnClickListener(new View.OnClickListener() { 48 | @Override 49 | public void onClick(View view) { 50 | Intent intent = new Intent(StartActivity.this, LoginActivity.class); 51 | 52 | ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(StartActivity.this,findViewById(R.id.login), "myLogin"); 53 | 54 | startActivity(intent, optionsCompat.toBundle()); 55 | } 56 | }); 57 | 58 | register.setOnClickListener(new View.OnClickListener() { 59 | @Override 60 | public void onClick(View view) { 61 | Intent intent = new Intent(StartActivity.this, RegisterActivity.class); 62 | 63 | ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(StartActivity.this,findViewById(R.id.register), "myRegister"); 64 | 65 | startActivity(intent, optionsCompat.toBundle()); 66 | } 67 | }); 68 | } 69 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 19 | 20 | 24 | 25 | 32 | 33 | 46 | 47 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /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/java/com/dvlnitins/friends/ResetPasswordActivity.java: -------------------------------------------------------------------------------- 1 | package com.dvlnitins.friends; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | import androidx.appcompat.widget.Toolbar; 6 | import androidx.core.content.ContextCompat; 7 | 8 | import android.content.Intent; 9 | import android.os.Bundle; 10 | import android.view.View; 11 | import android.widget.Button; 12 | import android.widget.EditText; 13 | import android.widget.Toast; 14 | 15 | import com.google.android.gms.tasks.OnCompleteListener; 16 | import com.google.android.gms.tasks.Task; 17 | import com.google.firebase.auth.FirebaseAuth; 18 | 19 | public class ResetPasswordActivity extends AppCompatActivity { 20 | 21 | EditText send_email; 22 | Button btn_reset; 23 | 24 | FirebaseAuth firebaseAuth; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.activity_reset_password); 30 | 31 | 32 | send_email = findViewById(R.id.send_email); 33 | btn_reset = findViewById(R.id.btn_reset); 34 | 35 | firebaseAuth = FirebaseAuth.getInstance(); 36 | 37 | btn_reset.setOnClickListener(new View.OnClickListener() { 38 | @Override 39 | public void onClick(View view) { 40 | String email = send_email.getText().toString(); 41 | 42 | if (email.equals("")){ 43 | Toast.makeText(ResetPasswordActivity.this, "All fileds are required!", Toast.LENGTH_SHORT).show(); 44 | } else { 45 | firebaseAuth.sendPasswordResetEmail(email).addOnCompleteListener(new OnCompleteListener() { 46 | @Override 47 | public void onComplete(@NonNull Task task) { 48 | if (task.isSuccessful()){ 49 | Toast.makeText(ResetPasswordActivity.this, "Please check you Email", Toast.LENGTH_SHORT).show(); 50 | startActivity(new Intent(ResetPasswordActivity.this, LoginActivity.class)); 51 | } else { 52 | String error = task.getException().getMessage(); 53 | Toast.makeText(ResetPasswordActivity.this, error, Toast.LENGTH_SHORT).show(); 54 | } 55 | } 56 | }); 57 | } 58 | } 59 | }); 60 | 61 | } 62 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_reset_password.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 19 | 20 | 25 | 26 | 38 | 39 |