Skip to content

Commit feb4125

Browse files
committed
Merge branch 'latest_code_16_05_2023'
2 parents 91bca8a + ae2af25 commit feb4125

80 files changed

Lines changed: 3805 additions & 527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'com.android.application'
3+
id 'com.google.gms.google-services'
34
}
45

56
android {
@@ -27,6 +28,7 @@ android {
2728
}
2829
buildFeatures {
2930
viewBinding true
31+
dataBinding true
3032
}
3133
namespace 'com.btn.pronotes'
3234
}
@@ -48,7 +50,33 @@ dependencies {
4850
implementation 'com.intuit.ssp:ssp-android:1.0.5'
4951

5052
// https://github.com/bumptech/glide
51-
implementation 'com.github.bumptech.glide:glide:4.11.0'
52-
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
53+
implementation 'com.github.bumptech.glide:glide:4.14.2'
54+
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
55+
56+
// expandable fab
57+
implementation 'com.nambimobile.widgets:expandable-fab:1.2.1'
58+
// color picker
59+
implementation 'com.github.Dhaval2404:ColorPicker:2.3'
60+
// text editor
61+
62+
implementation 'jp.wasabeef:richeditor-android:2.0.0'
63+
64+
65+
// free hand drawing
66+
67+
implementation 'com.github.DonghanX:Draw:v1.0.3'
68+
69+
//permission
70+
implementation 'com.guolindev.permissionx:permissionx:1.7.1'
71+
72+
//firebase
73+
implementation platform('com.google.firebase:firebase-bom:32.0.0')
74+
implementation 'com.google.firebase:firebase-analytics'
75+
implementation 'com.google.firebase:firebase-firestore'
76+
implementation 'com.google.firebase:firebase-storage'
77+
//photo view
78+
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
79+
80+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
5381

5482
}

app/google-services.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"project_info": {
3+
"project_number": "929613269133",
4+
"project_id": "pronotes-41e5a",
5+
"storage_bucket": "pronotes-41e5a.appspot.com"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:929613269133:android:ef46957c446b325a647ac4",
11+
"android_client_info": {
12+
"package_name": "com.btn.pronotes"
13+
}
14+
},
15+
"oauth_client": [
16+
{
17+
"client_id": "929613269133-ftd0ncsm2pnrrr38tu2k7ckuf958ob6i.apps.googleusercontent.com",
18+
"client_type": 3
19+
}
20+
],
21+
"api_key": [
22+
{
23+
"current_key": "AIzaSyCaTBtQ_9A8GeUuQmiDx5rSyeOEwI41BQ0"
24+
}
25+
],
26+
"services": {
27+
"appinvite_service": {
28+
"other_platform_oauth_client": [
29+
{
30+
"client_id": "929613269133-ftd0ncsm2pnrrr38tu2k7ckuf958ob6i.apps.googleusercontent.com",
31+
"client_type": 3
32+
}
33+
]
34+
}
35+
}
36+
}
37+
],
38+
"configuration_version": "1"
39+
}

app/src/main/AndroidManifest.xml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,32 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
8+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
9+
510
<application
611
android:allowBackup="true"
7-
android:fullBackupContent="@xml/backup_rules"
812
android:dataExtractionRules="@xml/data_extraction_rules"
13+
android:fullBackupContent="@xml/backup_rules"
914
android:icon="@mipmap/ic_launcher"
1015
android:label="@string/app_name"
1116
android:roundIcon="@mipmap/ic_launcher_round"
1217
android:supportsRtl="true"
1318
android:theme="@style/Theme.ProNotes"
14-
tools:targetApi="31"
15-
>
19+
tools:targetApi="31">
20+
<activity
21+
android:name=".ImageActivity"
22+
android:exported="false" />
23+
<activity
24+
android:name=".DrawingActivity"
25+
android:exported="false"
26+
android:label="@string/title_activity_drawing"
27+
android:theme="@style/Theme.ProNotes.NoActionBar" />
28+
<activity
29+
android:name=".FolderActivity"
30+
android:exported="false" />
1631
<activity
1732
android:name=".NotesTakerActivity"
1833
android:exported="false"
@@ -27,13 +42,43 @@
2742
android:theme="@style/Theme.ProNotes.NoActionBar" />
2843
<activity
2944
android:name=".MainActivity"
30-
android:exported="true" >
45+
android:exported="true">
3146
<intent-filter>
3247
<action android:name="android.intent.action.MAIN" />
3348

3449
<category android:name="android.intent.category.LAUNCHER" />
3550
</intent-filter>
3651
</activity>
52+
53+
<receiver
54+
android:name=".widgets.NoteWidget"
55+
android:exported="true">
56+
<intent-filter>
57+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
58+
<action android:name="com.btn.pronotes.DATA_UPDATED" />
59+
</intent-filter>
60+
61+
<meta-data
62+
android:name="android.appwidget.provider"
63+
android:resource="@xml/note_widget_info" />
64+
</receiver>
65+
66+
<service
67+
android:name=".services.BackupService"
68+
android:foregroundServiceType="dataSync" />
69+
70+
<provider
71+
android:name="androidx.core.content.FileProvider"
72+
android:authorities="${applicationId}.fileprovider"
73+
android:exported="false"
74+
android:grantUriPermissions="true"
75+
tools:replace="android:authorities,android:exported">
76+
<meta-data
77+
android:name="android.support.FILE_PROVIDER_PATHS"
78+
android:resource="@xml/file_paths"
79+
tools:replace="android:resource" />
80+
</provider>
81+
3782
</application>
3883

3984
</manifest>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package com.btn.pronotes.Adapters;
2+
3+
import android.content.Context;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.core.content.ContextCompat;
10+
import androidx.recyclerview.widget.RecyclerView;
11+
12+
import com.btn.pronotes.Database.RoomDB;
13+
import com.btn.pronotes.Models.Folder;
14+
import com.btn.pronotes.R;
15+
import com.btn.pronotes.databinding.RvItemFolderBinding;
16+
import com.btn.pronotes.interfaces.FolderClickListener;
17+
import com.btn.pronotes.interfaces.MainFolderClickListener;
18+
19+
import java.util.List;
20+
21+
//Notes List Adapter Class
22+
public class FolderListAdapter extends RecyclerView.Adapter<FolderViewHolder> {
23+
Context context;
24+
List<Folder> list;
25+
FolderClickListener listener;
26+
27+
public FolderListAdapter(Context context, List<Folder> list, FolderClickListener listener) {
28+
this.context = context;
29+
this.list = list;
30+
this.listener = listener;
31+
}
32+
33+
@NonNull
34+
@Override
35+
public FolderViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
36+
return new FolderViewHolder(RvItemFolderBinding
37+
.inflate(LayoutInflater.from(parent.getContext()), parent, false));
38+
}
39+
40+
@Override
41+
public void onBindViewHolder(@NonNull FolderViewHolder holder, int position) {
42+
43+
holder.binding.tvName.setText(list.get(position).getName());
44+
if (list.get(position).getId() != 1) {
45+
int count = RoomDB.getInstance(context).mainDAO().getNotesCount(list.get(position).getId());
46+
holder.binding.tvCount.setText(String.valueOf(count));
47+
} else {
48+
int count = RoomDB.getInstance(context).mainDAO().getNotesCount();
49+
holder.binding.tvCount.setText(String.valueOf(count));
50+
}
51+
if (list.get(position).isSelected()) {
52+
holder.binding.ivCurrentIcon.setVisibility(View.VISIBLE);
53+
holder.binding.tvName.setTextColor(ContextCompat.getColor(context, R.color.white));
54+
holder.binding.tvCount.setTextColor(ContextCompat.getColor(context, R.color.white));
55+
holder.binding.card.setStrokeWidth(1);
56+
57+
} else {
58+
holder.binding.tvName.setTextColor(ContextCompat.getColor(context, R.color.grey1));
59+
holder.binding.tvCount.setTextColor(ContextCompat.getColor(context, R.color.grey1));
60+
holder.binding.ivCurrentIcon.setVisibility(View.INVISIBLE);
61+
holder.binding.card.setStrokeWidth(0);
62+
63+
}
64+
65+
holder.binding.card.setOnClickListener(v -> listener.onClick(list.get(position)));
66+
}
67+
68+
public void setList(List<Folder> list) {
69+
this.list.clear();
70+
this.list.addAll(list);
71+
notifyDataSetChanged();
72+
}
73+
74+
75+
@Override
76+
public int getItemCount() {
77+
return list.size();
78+
}
79+
80+
}
81+
82+
class FolderViewHolder extends RecyclerView.ViewHolder {
83+
84+
RvItemFolderBinding binding;
85+
86+
public FolderViewHolder(@NonNull RvItemFolderBinding binding) {
87+
super(binding.getRoot());
88+
89+
this.binding = binding;
90+
91+
92+
}
93+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
package com.btn.pronotes.Adapters;
2+
3+
import android.content.Context;
4+
import android.view.LayoutInflater;
5+
import android.view.ViewGroup;
6+
7+
import androidx.annotation.NonNull;
8+
import androidx.core.content.ContextCompat;
9+
import androidx.recyclerview.widget.RecyclerView;
10+
11+
import com.btn.pronotes.Models.Folder;
12+
import com.btn.pronotes.R;
13+
import com.btn.pronotes.databinding.RvItemFolderMainBinding;
14+
import com.btn.pronotes.interfaces.MainFolderClickListener;
15+
16+
import java.util.List;
17+
18+
//Notes List Adapter Class
19+
public class FolderListMainAdapter extends RecyclerView.Adapter<MainFolderViewHolder> {
20+
Context context;
21+
List<Folder> list;
22+
MainFolderClickListener listener;
23+
24+
public FolderListMainAdapter(Context context, List<Folder> list, MainFolderClickListener listener) {
25+
this.context = context;
26+
this.list = list;
27+
this.listener = listener;
28+
}
29+
30+
@NonNull
31+
@Override
32+
public MainFolderViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
33+
return new MainFolderViewHolder(RvItemFolderMainBinding
34+
.inflate(LayoutInflater.from(parent.getContext()), parent, false));
35+
}
36+
37+
@Override
38+
public void onBindViewHolder(@NonNull MainFolderViewHolder holder, int position) {
39+
40+
holder.binding.tvName.setText(list.get(position).getName());
41+
if (list.get(position).isSelected()) {
42+
holder.binding.card.setCardBackgroundColor(
43+
ContextCompat.getColor(holder.binding.getRoot().getContext(), R.color.color1));
44+
} else {
45+
holder.binding.card.setCardBackgroundColor(
46+
ContextCompat.getColor(holder.binding.getRoot().getContext(), R.color.grey));
47+
}
48+
49+
holder.binding.card.setOnClickListener(v -> {
50+
listener.onClick(list.get(position));
51+
unSelectAll();
52+
list.get(position).setSelected(true);
53+
notifyDataSetChanged();
54+
});
55+
}
56+
57+
public void unSelectAll() {
58+
for (Folder folder : list) {
59+
folder.setSelected(false);
60+
}
61+
}
62+
63+
public void setList(List<Folder> list) {
64+
this.list.clear();
65+
this.list.addAll(list);
66+
notifyDataSetChanged();
67+
}
68+
69+
70+
@Override
71+
public int getItemCount() {
72+
return list.size();
73+
}
74+
75+
}
76+
77+
class MainFolderViewHolder extends RecyclerView.ViewHolder {
78+
79+
RvItemFolderMainBinding binding;
80+
81+
public MainFolderViewHolder(@NonNull RvItemFolderMainBinding binding) {
82+
super(binding.getRoot());
83+
84+
this.binding = binding;
85+
86+
87+
}
88+
}

0 commit comments

Comments
 (0)