├── .gitignore
├── .idea
├── .gitignore
├── compiler.xml
├── gradle.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── misc.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── release
│ └── output-metadata.json
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── notes
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── notes
│ │ │ ├── CreateNotesActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── SplashActivity.java
│ │ │ ├── auth
│ │ │ ├── ForgotActivity.java
│ │ │ ├── SignInActivity.java
│ │ │ └── SignUpActivity.java
│ │ │ ├── models
│ │ │ └── FirebaseModel.java
│ │ │ └── utils
│ │ │ └── Constraint.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── blue_gradient.xml
│ │ ├── btn_drawable_layout.xml
│ │ ├── button_selector.xml
│ │ ├── edit_drawable_layout.xml
│ │ ├── edit_error_drawable.xml
│ │ ├── gray_gradient.xml
│ │ ├── ic_add.xml
│ │ ├── ic_exit.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_menu.xml
│ │ ├── ic_save.xml
│ │ ├── tickets.png
│ │ └── tool_bar.xml
│ │ ├── layout
│ │ ├── activity_create_notes.xml
│ │ ├── activity_forgot.xml
│ │ ├── activity_main.xml
│ │ ├── activity_sign_in.xml
│ │ ├── activity_sign_up.xml
│ │ ├── activity_splash.xml
│ │ ├── created_notes_layout.xml
│ │ └── tool_bar_layout.xml
│ │ ├── menu
│ │ └── menus.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values-night
│ │ └── themes.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ ├── backup_rules.xml
│ │ └── data_extraction_rules.xml
│ └── test
│ └── java
│ └── com
│ └── notes
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.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 | local.properties
16 | CameraSourcePreview.java
17 | GraphicOverlay.java
18 | FaceGraphic.java
19 | FaceTrackerActivity.java
20 | FaceDetectionActivity.java
21 | activity_face_detection.xml
22 | activity_face_tracker.xml
23 | google-services.json
24 | keystore.jks
25 | app-release.apk
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # notes Firebase
2 | JAVA Project
3 | using Firebasessssssssssss
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'com.google.gms.google-services'
4 | id 'org.jetbrains.kotlin.android'
5 | }
6 |
7 | android {
8 | namespace 'com.notes'
9 | compileSdk 33
10 | defaultConfig {
11 | applicationId "com.notes"
12 | minSdk 24
13 | targetSdk 33
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 | }
31 |
32 | dependencies {
33 | implementation 'androidx.appcompat:appcompat:1.5.1'
34 | implementation 'com.google.android.material:material:1.6.1'
35 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
36 | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
37 | implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
38 | implementation 'androidx.camera:camera-core:1.1.0'
39 | implementation 'androidx.camera:camera-lifecycle:1.1.0'
40 | implementation 'androidx.camera:camera-view:1.1.0'
41 | testImplementation 'junit:junit:4.13.2'
42 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
44 |
45 | // TODO Firebase
46 | implementation platform('com.google.firebase:firebase-bom:30.5.0')
47 | implementation 'com.google.firebase:firebase-analytics'
48 | implementation 'com.google.firebase:firebase-auth'
49 | implementation 'com.google.firebase:firebase-firestore'
50 | // implementation 'com.google.mlkit:face-detection:16.1.5'
51 | implementation 'com.google.android.gms:play-services-mlkit-face-detection:17.1.0'
52 | implementation 'androidx.paging:paging-runtime:3.1.1'
53 | // FirebaseUI for Firebase Auth
54 | implementation 'com.firebaseui:firebase-ui-auth:8.0.2'
55 |
56 | // FirebaseUI for Cloud Firestore
57 | implementation 'com.firebaseui:firebase-ui-firestore:8.0.2'
58 |
59 |
60 | implementation 'com.google.android.gms:play-services-vision:20.1.3'
61 | //noinspection OutdatedLibrary
62 | implementation 'com.google.firebase:firebase-ml-vision:24.1.0'
63 | // If you want to detect face contours (landmark detection and classification
64 | // don't require this additional model):
65 | // implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
66 |
67 | // implementation 'com.github.sujithkanna:smileyrating:2.0.0'
68 |
69 | implementation("org.greenrobot:eventbus:3.3.1")
70 | }
71 |
72 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/app/release/output-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "artifactType": {
4 | "type": "APK",
5 | "kind": "Directory"
6 | },
7 | "applicationId": "com.notes",
8 | "variantName": "release",
9 | "elements": [
10 | {
11 | "type": "SINGLE",
12 | "filters": [],
13 | "attributes": [],
14 | "versionCode": 1,
15 | "versionName": "1.0",
16 | "outputFile": "app-release.apk"
17 | }
18 | ],
19 | "elementType": "File"
20 | }
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/notes/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.notes;
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.notes", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
26 |
28 |
29 |
32 |
33 |
36 |
39 |
40 |
41 |
44 |
47 |
48 |
49 |
52 |
53 |
58 |
61 |
62 |
67 |
70 |
71 |
76 |
79 |
80 |
85 |
88 |
89 |
95 |
96 |
97 |
98 |
99 |
100 |
103 |
104 |
109 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/CreateNotesActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.annotation.SuppressLint;
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.widget.EditText;
12 | import android.widget.Toast;
13 |
14 | import com.google.android.gms.tasks.OnCompleteListener;
15 | import com.google.android.gms.tasks.OnFailureListener;
16 | import com.google.android.gms.tasks.OnSuccessListener;
17 | import com.google.android.gms.tasks.Task;
18 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
19 | import com.google.firebase.auth.FirebaseAuth;
20 | import com.google.firebase.auth.FirebaseUser;
21 | import com.google.firebase.firestore.DocumentReference;
22 | import com.google.firebase.firestore.FirebaseFirestore;
23 | import com.notes.utils.Constraint;
24 |
25 | import java.util.HashMap;
26 | import java.util.Map;
27 |
28 | public class CreateNotesActivity extends AppCompatActivity {
29 |
30 | private EditText eTitle, eNotes;
31 | private FloatingActionButton fabSave;
32 | private FirebaseAuth auth;
33 | private FirebaseUser user;
34 | private FirebaseFirestore firebaseFirestore;
35 | private String title, content, noteId;
36 |
37 | @SuppressLint("MissingInflatedId")
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.activity_create_notes);
42 |
43 | fabSave = findViewById(R.id.fabSave);
44 | eTitle = findViewById(R.id.eTitle);
45 | eNotes = findViewById(R.id.eNotes);
46 | auth = FirebaseAuth.getInstance();
47 | firebaseFirestore = FirebaseFirestore.getInstance();
48 | user = auth.getCurrentUser();
49 |
50 | Log.d("TAG", "onCreate "+new Exception().getMessage());
51 |
52 | title = getIntent().getStringExtra("title");
53 | content = getIntent().getStringExtra("content");
54 | noteId = getIntent().getStringExtra("noteId");
55 | if (title != null && content != null && noteId != null){
56 | eTitle.setText(title);
57 | eNotes.setText(content);
58 | fabSave.setOnClickListener(v -> {
59 | String title = eTitle.getText().toString();
60 | String content = eNotes.getText().toString();
61 | Constraint.setToast(v.getContext(),"Update");
62 |
63 | if (title.isEmpty() || content.isEmpty()){
64 | Constraint.setToast(CreateNotesActivity.this, "Both field are require.");
65 | }else {
66 | DocumentReference reference = firebaseFirestore.collection("notes")
67 | .document(user.getUid())
68 | .collection("myNotes").document(noteId);
69 |
70 | Map note = new HashMap<>();
71 | note.put("title", title);
72 | note.put("content", content);
73 |
74 | reference.set(note).addOnSuccessListener(unused -> {
75 | Constraint.setToast(CreateNotesActivity.this, "Note updated successfully..!");
76 | startActivity(new Intent(getApplicationContext(), MainActivity.class));
77 | finish();
78 | }).addOnFailureListener(e -> Constraint.setToast(CreateNotesActivity.this, e.getMessage()));
79 |
80 | }
81 |
82 | });
83 | }else {
84 | fabSave.setOnClickListener(v -> {
85 | String title = eTitle.getText().toString();
86 | String content = eNotes.getText().toString();
87 |
88 |
89 | if (title.isEmpty() || content.isEmpty()){
90 | Constraint.setToast(CreateNotesActivity.this, "Both field are require.");
91 | }else {
92 | DocumentReference reference = firebaseFirestore.collection("notes")
93 | .document(user.getUid())
94 | .collection("myNotes").document();
95 |
96 | Map note = new HashMap<>();
97 | note.put("title", title);
98 | note.put("content", content);
99 |
100 | reference.set(note).addOnSuccessListener(unused -> {
101 | Constraint.setToast(CreateNotesActivity.this, "Note created successfully..!");
102 | startActivity(new Intent(getApplicationContext(), MainActivity.class));
103 | finish();
104 | }).addOnFailureListener(e -> Constraint.setToast(CreateNotesActivity.this, e.getMessage()));
105 |
106 | }
107 | });
108 | }
109 |
110 |
111 |
112 |
113 | }
114 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.appcompat.widget.Toolbar;
6 | import androidx.constraintlayout.widget.ConstraintLayout;
7 | import androidx.recyclerview.widget.RecyclerView;
8 | import androidx.recyclerview.widget.StaggeredGridLayoutManager;
9 |
10 | import android.annotation.SuppressLint;
11 | import android.content.Intent;
12 | import android.os.Bundle;
13 | import android.util.Log;
14 | import android.view.Gravity;
15 | import android.view.LayoutInflater;
16 | import android.view.Menu;
17 | import android.view.MenuItem;
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.ImageView;
21 | import android.widget.PopupMenu;
22 | import android.widget.TextView;
23 |
24 | import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
25 | import com.firebase.ui.firestore.FirestoreRecyclerOptions;
26 | import com.google.android.gms.tasks.OnFailureListener;
27 | import com.google.android.gms.tasks.OnSuccessListener;
28 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
29 | import com.google.firebase.auth.FirebaseAuth;
30 | import com.google.firebase.auth.FirebaseUser;
31 | import com.google.firebase.firestore.DocumentReference;
32 | import com.google.firebase.firestore.FirebaseFirestore;
33 | import com.google.firebase.firestore.Query;
34 | import com.notes.auth.SignInActivity;
35 | import com.notes.models.FirebaseModel;
36 | import com.notes.utils.Constraint;
37 |
38 | import java.util.ArrayList;
39 | import java.util.List;
40 | import java.util.Random;
41 |
42 | public class MainActivity extends AppCompatActivity {
43 |
44 | private FirebaseAuth auth;
45 | private FirestoreRecyclerAdapter adapter;
46 | private Toolbar toolbar;
47 |
48 | @SuppressLint("NotifyDataSetChanged")
49 | @Override
50 | protected void onCreate(Bundle savedInstanceState) {
51 | super.onCreate(savedInstanceState);
52 | setContentView(R.layout.activity_main);
53 |
54 | toolbar = findViewById(R.id.toolbar);
55 | setSupportActionBar(toolbar);
56 |
57 |
58 | auth=FirebaseAuth.getInstance();
59 | FloatingActionButton fabCreateNotes = findViewById(R.id.fabNotesCreate);
60 | RecyclerView recyclerViewNotes = findViewById(R.id.recyclerViewNotes);
61 |
62 |
63 |
64 | FirebaseUser user = auth.getCurrentUser();
65 | FirebaseFirestore firebaseFirestore = FirebaseFirestore.getInstance();
66 | fabCreateNotes.setOnClickListener(v -> {
67 | startActivity(new Intent(getApplicationContext(), CreateNotesActivity.class));
68 | });
69 |
70 | assert user != null;
71 | Query query = firebaseFirestore
72 | .collection("notes")
73 | .document(user.getUid())
74 | .collection("myNotes")
75 | .orderBy("title",Query.Direction.ASCENDING);
76 |
77 | FirestoreRecyclerOptions allUserNotes = new FirestoreRecyclerOptions.Builder()
78 | .setQuery(query, FirebaseModel.class)
79 | .build();
80 |
81 | adapter = new FirestoreRecyclerAdapter(allUserNotes) {
82 | @Override
83 | protected void onBindViewHolder(@NonNull NotesViewHolder holder, int position, @NonNull FirebaseModel model) {
84 |
85 | ImageView popupImg = holder.itemView.findViewById(R.id.imgMenu);
86 |
87 | holder.itemView.setOnClickListener(v -> startActivity(new Intent(getApplicationContext(),CreateNotesActivity.class)
88 | .putExtra("title",holder.titleNote.getText())
89 | .putExtra("content",holder.contentNote.getText())
90 | .putExtra("noteId",adapter.getSnapshots().getSnapshot(position).getId())));
91 |
92 | popupImg.setOnClickListener(v -> {
93 | PopupMenu popupMenu = new PopupMenu(v.getContext(),popupImg);
94 | popupMenu.setGravity(Gravity.END);
95 | popupMenu.getMenu().add("Edit").setOnMenuItemClickListener(item -> {
96 | startActivity(new Intent(getApplicationContext(),CreateNotesActivity.class)
97 | .putExtra("title",holder.titleNote.getText())
98 | .putExtra("content",holder.contentNote.getText())
99 | .putExtra("noteId",adapter.getSnapshots().getSnapshot(position).getId()));
100 | return false;
101 | });
102 | popupMenu.getMenu().add("Delete").setOnMenuItemClickListener(item -> {
103 | DocumentReference reference = firebaseFirestore
104 | .collection("notes")
105 | .document(user.getUid())
106 | .collection("myNotes")
107 | .document(adapter.getSnapshots().getSnapshot(position).getId());
108 |
109 | reference.delete().addOnSuccessListener(unused -> {
110 | Constraint.setToast(v.getContext(), "Delete successfully");
111 | adapter.notifyDataSetChanged();
112 | }).addOnFailureListener(e -> Constraint.setToast(v.getContext(),"Delete failed "+ e.getMessage()));
113 |
114 | return false;
115 | });
116 | popupMenu.show();
117 | });
118 |
119 | int colorCode = getRandomColor();
120 | holder.note.setBackgroundColor(holder.itemView.getResources().getColor(colorCode, null));
121 |
122 | holder.titleNote.setText(model.getTitle());
123 | holder.contentNote.setText(model.getContent());
124 | }
125 |
126 | @NonNull
127 | @Override
128 | public NotesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
129 | return new NotesViewHolder(LayoutInflater
130 | .from(parent.getContext())
131 | .inflate(R.layout.created_notes_layout, parent, false));
132 | }
133 | };
134 |
135 | recyclerViewNotes.setHasFixedSize(true);
136 | recyclerViewNotes.setLayoutManager(new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL));
137 | recyclerViewNotes.setAdapter(adapter);
138 | adapter.notifyDataSetChanged();
139 | }
140 |
141 | private int getRandomColor() {
142 | List colorcode = new ArrayList<>();
143 | colorcode.add(R.color.gray);
144 | colorcode.add(R.color.greens);
145 | colorcode.add(R.color.lightgreen);
146 | colorcode.add(R.color.skyblue);
147 | colorcode.add(R.color.pink);
148 | colorcode.add(R.color.color1);
149 | colorcode.add(R.color.color2);
150 | colorcode.add(R.color.color3);
151 | colorcode.add(R.color.color4);
152 | colorcode.add(R.color.color5);
153 | Random random = new Random();
154 | int number = random.nextInt(colorcode.size());
155 |
156 | return colorcode.get(number);
157 |
158 | }
159 |
160 | @Override
161 | protected void onStart() {
162 | super.onStart();
163 | adapter.startListening();
164 | }
165 |
166 | @Override
167 | protected void onStop() {
168 | super.onStop();
169 | if (adapter != null){
170 | adapter.startListening();
171 | }
172 | }
173 |
174 | public static class NotesViewHolder extends RecyclerView.ViewHolder{
175 | private TextView titleNote;
176 | private TextView contentNote;
177 | private ConstraintLayout note;
178 |
179 | public NotesViewHolder(@NonNull View itemView) {
180 | super(itemView);
181 | titleNote = itemView.findViewById(R.id.txtTitle);
182 | contentNote = itemView.findViewById(R.id.txtContent);
183 | note = itemView.findViewById(R.id.note);
184 |
185 | }
186 | }
187 |
188 | @Override
189 | public boolean onCreateOptionsMenu(Menu menu) {
190 | getMenuInflater().inflate(R.menu.menus,menu);
191 | return true;
192 | }
193 |
194 | @Override
195 | public boolean onOptionsItemSelected(@NonNull MenuItem item) {
196 |
197 | if (item.getItemId() == R.id.logout){
198 | auth.signOut();
199 | startActivity(new Intent(getApplicationContext(), SignInActivity.class));
200 | finish();
201 | }
202 |
203 | return super.onOptionsItemSelected(item);
204 | }
205 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/SplashActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.annotation.SuppressLint;
6 | import android.content.Intent;
7 | import android.graphics.Color;
8 | import android.os.Bundle;
9 | import android.os.Handler;
10 | import android.view.WindowManager;
11 |
12 | import com.google.firebase.auth.FirebaseAuth;
13 | import com.google.firebase.auth.FirebaseUser;
14 | import com.notes.auth.SignInActivity;
15 |
16 | @SuppressLint("CustomSplashScreen")
17 | public class SplashActivity extends AppCompatActivity {
18 |
19 | private static final int TIME_COUNT = 3000;
20 |
21 | private FirebaseUser user;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | requestWindowFeature(1);
27 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
28 | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
29 | getWindow().setStatusBarColor(Color.TRANSPARENT);
30 | setContentView(R.layout.activity_splash);
31 |
32 | user = FirebaseAuth.getInstance().getCurrentUser();
33 |
34 | new Handler().postDelayed(() -> {
35 | if (user != null){
36 | startActivity(new Intent(getApplicationContext(), MainActivity.class));
37 | finish();
38 | }else {
39 | startActivity(new Intent(getApplicationContext(), SignInActivity.class));
40 | finish();
41 | }
42 | },TIME_COUNT);
43 | }
44 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/auth/ForgotActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes.auth;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.text.Editable;
9 | import android.text.TextWatcher;
10 | import android.view.View;
11 | import android.widget.EditText;
12 | import android.widget.TextView;
13 |
14 | import com.google.android.gms.tasks.OnCompleteListener;
15 | import com.google.android.gms.tasks.OnFailureListener;
16 | import com.google.android.gms.tasks.Task;
17 | import com.google.firebase.auth.FirebaseAuth;
18 | import com.notes.R;
19 | import com.notes.utils.Constraint;
20 |
21 | public class ForgotActivity extends AppCompatActivity {
22 |
23 | private EditText eEmailAddress;
24 | private TextView btnForgot;
25 | private TextView txtSignIn;
26 | private FirebaseAuth auth;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | getWindow().setNavigationBarColor(getResources().getColor(R.color.purple_500));
32 | setContentView(R.layout.activity_forgot);
33 |
34 | eEmailAddress = findViewById(R.id.eEmailAddress);
35 | btnForgot = findViewById(R.id.btnForgot);
36 | txtSignIn = findViewById(R.id.txtSignIn);
37 | auth = FirebaseAuth.getInstance();
38 | validation();
39 |
40 | btnForgot.setOnClickListener(v -> {
41 | if (eEmailAddress.getText().toString().isEmpty()){
42 | eEmailAddress.setBackgroundResource(R.drawable.edit_error_drawable);
43 | eEmailAddress.setError(Constraint.empty);
44 | }else {
45 | forgot(eEmailAddress.getText().toString().trim());
46 | }
47 | });
48 |
49 | txtSignIn.setOnClickListener(v -> {
50 | startActivity(new Intent(getApplicationContext(), SignInActivity.class));
51 | finish();
52 | });
53 | }
54 |
55 | private void validation() {
56 |
57 | eEmailAddress.addTextChangedListener(new TextWatcher() {
58 | @Override
59 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
60 |
61 | }
62 |
63 | @Override
64 | public void onTextChanged(CharSequence s, int start, int before, int count) {
65 |
66 | }
67 |
68 | @Override
69 | public void afterTextChanged(Editable s) {
70 | if (!eEmailAddress.getText().toString().matches(Constraint.emailPattern)){
71 | eEmailAddress.setError(Constraint.email_valid);
72 | eEmailAddress.setBackgroundResource(R.drawable.edit_error_drawable);
73 | btnForgot.setEnabled(false);
74 | }else {
75 | eEmailAddress.setBackgroundResource(R.drawable.edit_drawable_layout);
76 | btnForgot.setEnabled(true);
77 | }
78 | }
79 | });
80 | }
81 |
82 | private void forgot(String email) {
83 | auth.sendPasswordResetEmail(email)
84 | .addOnCompleteListener(task -> {
85 | if (task.isSuccessful()){
86 | Constraint.setToast(ForgotActivity.this,Constraint.reset_mail);
87 | }else {
88 | Constraint.setToast(ForgotActivity.this,Constraint.reset_mail_not);
89 | }
90 | }).addOnFailureListener(e -> Constraint.setToast(ForgotActivity.this,e.getMessage()));
91 | }
92 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/auth/SignInActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes.auth;
2 |
3 |
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.text.Editable;
9 | import android.text.TextWatcher;
10 | import android.widget.EditText;
11 | import android.widget.TextView;
12 | import com.google.firebase.auth.FirebaseAuth;
13 | import com.google.firebase.auth.FirebaseUser;
14 | import com.notes.MainActivity;
15 | import com.notes.R;
16 | import com.notes.utils.Constraint;
17 |
18 | import java.util.Objects;
19 |
20 | public class SignInActivity extends AppCompatActivity {
21 |
22 | private EditText eEmailAddress;
23 | private EditText ePassword;
24 | private TextView btnSignIn;
25 | private TextView txtForgotPassword;
26 | private TextView txtSignUp;
27 |
28 | private FirebaseAuth auth;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | getWindow().setNavigationBarColor(getResources().getColor(R.color.purple_500));
34 | setContentView(R.layout.activity_sign_in);
35 | init();
36 | validation();
37 | auth = FirebaseAuth.getInstance();
38 |
39 | btnSignIn.setOnClickListener(v -> {
40 | if (eEmailAddress.getText().toString().isEmpty()){
41 | eEmailAddress.setError(Constraint.empty);
42 | eEmailAddress.setBackgroundResource(R.drawable.edit_error_drawable);
43 | }else if (ePassword.getText().toString().isEmpty()){
44 | ePassword.setError(Constraint.empty);
45 | ePassword.setBackgroundResource(R.drawable.edit_error_drawable);
46 | }else {
47 | signIn(eEmailAddress.getText().toString().trim(), ePassword.getText().toString().trim());
48 | }
49 | });
50 |
51 | txtForgotPassword.setOnClickListener(v -> startActivity(new Intent(getApplicationContext(), ForgotActivity.class)));
52 |
53 | txtSignUp.setOnClickListener(v -> startActivity(new Intent(getApplicationContext(),SignUpActivity.class)));
54 | }
55 | private void validation(){
56 | eEmailAddress.addTextChangedListener(new TextWatcher() {
57 | @Override
58 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
59 |
60 | }
61 |
62 | @Override
63 | public void onTextChanged(CharSequence s, int start, int before, int count) {
64 |
65 | }
66 |
67 | @Override
68 | public void afterTextChanged(Editable s) {
69 | if (!s.toString().matches(Constraint.emailPattern)){
70 | eEmailAddress.setError(Constraint.email_valid);
71 | eEmailAddress.setBackgroundResource(R.drawable.edit_error_drawable);
72 | btnSignIn.setEnabled(false);
73 | }else {
74 | eEmailAddress.setBackgroundResource(R.drawable.edit_drawable_layout);
75 | btnSignIn.setEnabled(true);
76 | }
77 | }
78 | });
79 | ePassword.addTextChangedListener(new TextWatcher() {
80 | @Override
81 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
82 |
83 | }
84 |
85 | @Override
86 | public void onTextChanged(CharSequence s, int start, int before, int count) {
87 |
88 | }
89 |
90 | @Override
91 | public void afterTextChanged(Editable s) {
92 | if (!(s.toString().length() > 7)){
93 | ePassword.setError(Constraint.password_length);
94 | ePassword.setBackgroundResource(R.drawable.edit_error_drawable);
95 | btnSignIn.setEnabled(false);
96 | }else {
97 | ePassword.setBackgroundResource(R.drawable.edit_drawable_layout);
98 | btnSignIn.setEnabled(true);
99 | }
100 | }
101 | });
102 | }
103 |
104 | private void init(){
105 | eEmailAddress =findViewById(R.id.eEmailAddress);
106 | ePassword =findViewById(R.id.ePassword);
107 | btnSignIn =findViewById(R.id.btnSignIn);
108 | txtForgotPassword =findViewById(R.id.txtForgotPassword);
109 | txtSignUp =findViewById(R.id.txtSignUp);
110 | }
111 |
112 | private void signIn(String email, String password){
113 | if (email.isEmpty() || password.isEmpty()){
114 | Constraint.setToast(SignInActivity.this, Constraint.empty);
115 | }else if (!email.matches(Constraint.emailPattern)){
116 | eEmailAddress.setError(Constraint.email_valid);
117 | }else {
118 | auth.signInWithEmailAndPassword(email,password)
119 | .addOnCompleteListener(task -> {
120 | if (task.isSuccessful()){
121 | isEmailVerified();
122 | }else {
123 | Constraint.setToast(SignInActivity.this,Constraint.check_credential);
124 | }
125 | }).addOnFailureListener(e -> Constraint.setToast(SignInActivity.this, e.getMessage()));
126 | }
127 |
128 | }
129 |
130 | private void isEmailVerified() {
131 | FirebaseUser user = auth.getCurrentUser();
132 | if (Objects.requireNonNull(user).isEmailVerified()){
133 | Constraint.setToast(SignInActivity.this,Constraint.sign_in_success);
134 | startActivity(new Intent(getApplicationContext(), MainActivity.class));
135 | }else {
136 | Constraint.setToast(SignInActivity.this,Constraint.not_verified);
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/auth/SignUpActivity.java:
--------------------------------------------------------------------------------
1 | package com.notes.auth;
2 |
3 |
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.text.Editable;
9 | import android.text.TextWatcher;
10 | import android.widget.EditText;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 |
14 | import com.google.firebase.auth.FirebaseAuth;
15 | import com.google.firebase.auth.FirebaseUser;
16 | import com.notes.R;
17 | import com.notes.utils.Constraint;
18 |
19 | import java.util.Objects;
20 |
21 | public class SignUpActivity extends AppCompatActivity {
22 |
23 | private EditText eFullName;
24 | private EditText eEmail;
25 | private EditText ePass;
26 | private TextView btnSignUp;
27 | private TextView txtSignIn;
28 | private FirebaseAuth auth;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | getWindow().setNavigationBarColor(getResources().getColor(R.color.purple_500));
34 | setContentView(R.layout.activity_sign_up);
35 | init();
36 | auth = FirebaseAuth.getInstance();
37 |
38 | txtSignIn.setOnClickListener(v -> {
39 | startActivity(new Intent(getApplicationContext(), SignInActivity.class));
40 | finish();
41 | });
42 |
43 | validation();
44 | btnSignUp.setOnClickListener(v -> {
45 | if (eFullName.getText().toString().isEmpty()){
46 | eFullName.setError(Constraint.empty);
47 | eFullName.setBackgroundResource(R.drawable.edit_error_drawable);
48 | }else if (eEmail.getText().toString().isEmpty()){
49 | eEmail.setError(Constraint.empty);
50 | eEmail.setBackgroundResource(R.drawable.edit_error_drawable);
51 | }else if (ePass.getText().toString().isEmpty()){
52 | ePass.setError(Constraint.empty);
53 | ePass.setBackgroundResource(R.drawable.edit_error_drawable);
54 | }else {
55 | eEmail.setBackgroundResource(R.drawable.edit_drawable_layout);
56 | ePass.setBackgroundResource(R.drawable.edit_drawable_layout);
57 | signUp(eEmail.getText().toString().trim(), ePass.getText().toString().trim());
58 | }
59 | });
60 |
61 | }
62 |
63 | private void init(){
64 | eFullName = findViewById(R.id.eFullName);
65 | eEmail = findViewById(R.id.eEmail);
66 | ePass = findViewById(R.id.ePass);
67 | btnSignUp = findViewById(R.id.btnSignUp);
68 | txtSignIn = findViewById(R.id.txtSignIn);
69 | }
70 |
71 | private void validation() {
72 | eEmail.addTextChangedListener(new TextWatcher() {
73 | @Override
74 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
75 |
76 | }
77 |
78 | @Override
79 | public void onTextChanged(CharSequence s, int start, int before, int count) {
80 |
81 | }
82 |
83 | @Override
84 | public void afterTextChanged(Editable s) {
85 | if (!s.toString().matches(Constraint.emailPattern)){
86 | eEmail.setError(Constraint.email_valid);
87 | btnSignUp.setEnabled(false);
88 | }else {
89 | btnSignUp.setEnabled(true);
90 | }
91 | }
92 | });
93 | ePass.addTextChangedListener(new TextWatcher() {
94 | @Override
95 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
96 |
97 | }
98 |
99 | @Override
100 | public void onTextChanged(CharSequence s, int start, int before, int count) {
101 |
102 | }
103 |
104 | @Override
105 | public void afterTextChanged(Editable s) {
106 | if (!(s.toString().length() > 7)){
107 | ePass.setError(Constraint.password_length);
108 | btnSignUp.setEnabled(false);
109 | }else {
110 | btnSignUp.setEnabled(true);
111 | }
112 | }
113 | });
114 | }
115 |
116 |
117 | private void signUp(String email, String password) {
118 | auth.createUserWithEmailAndPassword(email,password)
119 | .addOnCompleteListener(task -> {
120 | if (task.isSuccessful()){
121 | verifyEmailLinkSent();
122 | }else {
123 | Toast.makeText(SignUpActivity.this, Constraint.exist_user, Toast.LENGTH_SHORT).show();
124 | }
125 | }).addOnFailureListener(e -> Constraint.setToast(SignUpActivity.this,e.getMessage()));
126 | }
127 |
128 | private void verifyEmailLinkSent() {
129 | FirebaseUser user = auth.getCurrentUser();
130 |
131 | Objects.requireNonNull(user).sendEmailVerification().addOnCompleteListener(task -> {
132 | if (task.isSuccessful()){
133 | Constraint.setToast(SignUpActivity.this,Constraint.verify_your_email);
134 | }else {
135 | Constraint.setToast(SignUpActivity.this,Constraint.verify_email_not_sent);
136 | }
137 | }).addOnFailureListener(e -> Constraint.setToast(SignUpActivity.this,e.getMessage()));
138 | }
139 |
140 |
141 |
142 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/models/FirebaseModel.java:
--------------------------------------------------------------------------------
1 | package com.notes.models;
2 |
3 | public class FirebaseModel {
4 | private String title;
5 | private String content;
6 |
7 | public FirebaseModel(String title, String content) {
8 | this.title = title;
9 | this.content = content;
10 | }
11 |
12 | public FirebaseModel() {
13 | }
14 |
15 | public String getTitle() {
16 | return title;
17 | }
18 |
19 | public void setTitle(String title) {
20 | this.title = title;
21 | }
22 |
23 | public String getContent() {
24 | return content;
25 | }
26 |
27 | public void setContent(String content) {
28 | this.content = content;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/notes/utils/Constraint.java:
--------------------------------------------------------------------------------
1 | package com.notes.utils;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 |
7 | public class Constraint {
8 |
9 | public static final String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
10 |
11 | public static String empty = "Empty";
12 | public static String email_valid = "Email Address is not valid";
13 | public static String sign_in_success = "Sign in successfully";
14 | public static String check_credential = "Please check your email and password";
15 | public static String empty_credential = "Empty credentials";
16 | public static String password_length = "Please must be write least 8 letters";
17 | public static String exist_user = "Already registered";
18 | public static String verify_your_email = "Registration successful\nPlease verify your email address than sign in";
19 | public static String verify_email_not_sent = "Registration failed\nPlease provide valid email address";
20 | public static String not_verified = "Your email is not verified";
21 | public static String reset_mail = "Reset mail has been sent !";
22 | public static String reset_mail_not = "Reset mail has been not sent. Please provide valid mail.";
23 |
24 |
25 | public static void setToast(Context context, String msg){
26 | Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
27 | }
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/blue_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_drawable_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/edit_drawable_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/edit_error_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/gray_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_exit.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/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/res/drawable/ic_menu.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_save.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tickets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/drawable/tickets.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/tool_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_create_notes.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
24 |
25 |
41 |
42 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_forgot.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
41 |
42 |
57 |
58 |
72 |
73 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
12 |
13 |
19 |
20 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sign_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
41 |
42 |
58 |
59 |
74 |
75 |
89 |
90 |
104 |
105 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sign_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
41 |
42 |
43 |
59 |
60 |
76 |
77 |
92 |
93 |
94 |
108 |
109 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/created_notes_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
31 |
32 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tool_bar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menus.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/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/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #7DE5F3
4 | #00BCD4
5 | #00BCD4
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 | #919191
11 | #F44336
12 | #4BC752
13 | #00B4DB
14 | #0083B0
15 | #A2A2A2
16 | #757575
17 |
18 | #cdc9c3
19 | #c6ebc9
20 | #cfffa5
21 | #a7c5eb
22 | #f3e6e3
23 | #efbbcf
24 | #d6b0b1
25 | #ccf6c8
26 | #ffe0ac
27 | #e5cfe5
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Notes
3 | Personal Notepad
4 | Email Address
5 | Password
6 | Sign In
7 | Forgot Password ?
8 | Don\'t have an account ?
9 | Sign Up
10 | Already have an account ?
11 | Full Name
12 | Mail sent !
13 | Forgot Password
14 | Go back
15 | Title here...
16 | Write note here...
17 |
18 | OK
19 | Access to the camera is needed for detection
20 | This application cannot run because it does not have the camera permission. The application will now exit.
21 | Face detector dependencies cannot be downloaded due to low device storage
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
31 |
32 |
33 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/test/java/com/notes/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.notes;
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 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | dependencies {
3 | classpath 'com.google.gms:google-services:4.3.14'
4 | }
5 | repositories {
6 | google()
7 | mavenCentral()
8 |
9 | maven {
10 | url 'https://jitpack.io'
11 | }
12 | }
13 | }// Top-level build file where you can add configuration options common to all sub-projects/modules.
14 | plugins {
15 | id 'com.android.application' version '7.3.1' apply false
16 | id 'com.android.library' version '7.3.1' apply false
17 | id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
18 | }
19 |
--------------------------------------------------------------------------------
/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 -Dfile.encoding=UTF-8
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 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
22 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/laidbackvalen/notes/802ca5e4c0b7d1b63b7e6340d51108255cf5f70b/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Sep 21 09:41:48 IST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | maven {
7 | url 'https://jitpack.io'
8 | }
9 | }
10 | }
11 | dependencyResolutionManagement {
12 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
13 | repositories {
14 | google()
15 | mavenCentral()
16 | maven {
17 | url 'https://jitpack.io'
18 | }
19 | }
20 | }
21 | rootProject.name = "Notes"
22 | include ':app'
23 |
--------------------------------------------------------------------------------