Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
My notepad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731301
My notepad
Commits
9fedf74e
Commit
9fedf74e
authored
Oct 01, 2020
by
9731301
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ArchivedNotesActivity to ger selected notes and dateNotes
parent
91785dd1
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
464 additions
and
142 deletions
+464
-142
misc.xml
.idea/misc.xml
+39
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
CustomMenu.java
app/src/main/java/com/example/mynotepad/Menu/CustomMenu.java
+8
-8
AchivedNotesActivity.java
...d/MenuFeatures/AllAchievedNotes/AchivedNotesActivity.java
+0
-16
ArchivedNotesActivity.java
.../MenuFeatures/AllArchivedNotes/ArchivedNotesActivity.java
+160
-0
DateOrNote.java
...ArchivedNotes/MyArchivedNotesRecyclerView/DateOrNote.java
+31
-0
OnArchivedItemClickListener.java
...rchivedNotesRecyclerView/OnArchivedItemClickListener.java
+6
-0
AllNotesActivity.java
...ple/mynotepad/MenuFeatures/AllNotes/AllNotesActivity.java
+37
-24
DateEntity.java
.../mynotepad/MenuFeatures/AllNotes/DataBase/DateEntity.java
+6
-6
DateNoreDAO.java
...mynotepad/MenuFeatures/AllNotes/DataBase/DateNoreDAO.java
+2
-1
Note.java
...xample/mynotepad/MenuFeatures/AllNotes/DataBase/Note.java
+6
-6
NoteDAO.java
...ple/mynotepad/MenuFeatures/AllNotes/DataBase/NoteDAO.java
+3
-2
MyAllNotesAdaptor.java
...atures/AllNotes/MyNoteRecyclerView/MyAllNotesAdaptor.java
+3
-4
MyNote.java
...epad/MenuFeatures/AllNotes/MyNoteRecyclerView/MyNote.java
+14
-8
NoteFragment.java
...le/mynotepad/MenuFeatures/AllNotes/Note/NoteFragment.java
+1
-1
MyCalenderActivity.java
...e/mynotepad/MenuFeatures/Calender/MyCalenderActivity.java
+40
-27
MyCalenderAdaptor.java
...es/Calender/MyCalenderRecyclerView/MyCalenderAdaptor.java
+3
-3
MyDate.java
...es/Calender/MyCalenderRecyclerView/TimePicker/MyDate.java
+13
-7
CustomToolbarOption.java
...m/example/mynotepad/MenuFeatures/CustomToolbarOption.java
+21
-13
CustomToolbarOptionListener.java
...e/mynotepad/MenuFeatures/CustomToolbarOptionListener.java
+2
-4
VoiceMassagesActivity.java
...pad/MenuFeatures/VoiceMassages/VoiceMassagesActivity.java
+6
-5
activity_achived_notes.xml
app/src/main/res/layout/activity_achived_notes.xml
+59
-3
custom_menu.xml
app/src/main/res/layout/custom_menu.xml
+2
-2
strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
.idea/misc.xml
View file @
9fedf74e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"NullableNotNullManager"
>
<option
name=
"myDefaultNullable"
value=
"org.jetbrains.annotations.Nullable"
/>
<option
name=
"myDefaultNotNull"
value=
"androidx.annotation.NonNull"
/>
<option
name=
"myNullables"
>
<value>
<list
size=
"12"
>
<item
index=
"0"
class=
"java.lang.String"
itemvalue=
"org.jetbrains.annotations.Nullable"
/>
<item
index=
"1"
class=
"java.lang.String"
itemvalue=
"javax.annotation.Nullable"
/>
<item
index=
"2"
class=
"java.lang.String"
itemvalue=
"javax.annotation.CheckForNull"
/>
<item
index=
"3"
class=
"java.lang.String"
itemvalue=
"edu.umd.cs.findbugs.annotations.Nullable"
/>
<item
index=
"4"
class=
"java.lang.String"
itemvalue=
"android.support.annotation.Nullable"
/>
<item
index=
"5"
class=
"java.lang.String"
itemvalue=
"androidx.annotation.Nullable"
/>
<item
index=
"6"
class=
"java.lang.String"
itemvalue=
"android.annotation.Nullable"
/>
<item
index=
"7"
class=
"java.lang.String"
itemvalue=
"androidx.annotation.RecentlyNullable"
/>
<item
index=
"8"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.qual.Nullable"
/>
<item
index=
"9"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.compatqual.NullableDecl"
/>
<item
index=
"10"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.compatqual.NullableType"
/>
<item
index=
"11"
class=
"java.lang.String"
itemvalue=
"com.android.annotations.Nullable"
/>
</list>
</value>
</option>
<option
name=
"myNotNulls"
>
<value>
<list
size=
"11"
>
<item
index=
"0"
class=
"java.lang.String"
itemvalue=
"org.jetbrains.annotations.NotNull"
/>
<item
index=
"1"
class=
"java.lang.String"
itemvalue=
"javax.annotation.Nonnull"
/>
<item
index=
"2"
class=
"java.lang.String"
itemvalue=
"edu.umd.cs.findbugs.annotations.NonNull"
/>
<item
index=
"3"
class=
"java.lang.String"
itemvalue=
"android.support.annotation.NonNull"
/>
<item
index=
"4"
class=
"java.lang.String"
itemvalue=
"androidx.annotation.NonNull"
/>
<item
index=
"5"
class=
"java.lang.String"
itemvalue=
"android.annotation.NonNull"
/>
<item
index=
"6"
class=
"java.lang.String"
itemvalue=
"androidx.annotation.RecentlyNonNull"
/>
<item
index=
"7"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.qual.NonNull"
/>
<item
index=
"8"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.compatqual.NonNullDecl"
/>
<item
index=
"9"
class=
"java.lang.String"
itemvalue=
"org.checkerframework.checker.nullness.compatqual.NonNullType"
/>
<item
index=
"10"
class=
"java.lang.String"
itemvalue=
"com.android.annotations.NonNull"
/>
</list>
</value>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
...
...
app/src/main/AndroidManifest.xml
View file @
9fedf74e
...
...
@@ -17,7 +17,7 @@
<activity
android:name=
".MenuFeatures.Calender.MyCalenderActivity"
/>
<activity
android:name=
".MenuFeatures.VoiceMassages.VoiceMassagesActivity"
/>
<activity
android:name=
".MenuFeatures.AllNotes.AllNotesActivity"
/>
<activity
android:name=
".MenuFeatures.AllA
chievedNotes.A
chivedNotesActivity"
/>
<activity
android:name=
".MenuFeatures.AllA
rchivedNotes.Ar
chivedNotesActivity"
/>
<activity
android:name=
".MenuFeatures.Setting.SettingActivity"
/>
<activity
android:name=
".MainActivity"
>
<intent-filter>
...
...
app/src/main/java/com/example/mynotepad/Menu/CustomMenu.java
View file @
9fedf74e
...
...
@@ -8,7 +8,7 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.example.mynotepad.MenuFeatures.AllA
chievedNotes.A
chivedNotesActivity
;
import
com.example.mynotepad.MenuFeatures.AllA
rchivedNotes.Ar
chivedNotesActivity
;
import
com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity
;
import
com.example.mynotepad.MenuFeatures.Calender.MyCalenderActivity
;
import
com.example.mynotepad.MenuFeatures.Information.InfoClickListener
;
...
...
@@ -19,7 +19,7 @@ import com.google.android.material.snackbar.Snackbar;
public
class
CustomMenu
extends
LinearLayout
implements
View
.
OnClickListener
{
private
View
rootView
;
private
TextView
settingTv
,
allNotesTv
,
a
chie
vedTv
,
calenderTv
,
informationTv
,
voiceMassagesTv
;
private
TextView
settingTv
,
allNotesTv
,
a
rchi
vedTv
,
calenderTv
,
informationTv
,
voiceMassagesTv
;
private
ImageView
img
;
private
InfoClickListener
infoClickListener
;
...
...
@@ -38,7 +38,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
rootView
=
inflate
(
context
,
R
.
layout
.
custom_menu
,
this
);
settingTv
=
findViewById
(
R
.
id
.
settingTxt
);
allNotesTv
=
findViewById
(
R
.
id
.
allNotesTxt
);
a
chievedTv
=
findViewById
(
R
.
id
.
achie
vedTxt
);
a
rchivedTv
=
findViewById
(
R
.
id
.
archi
vedTxt
);
calenderTv
=
findViewById
(
R
.
id
.
calenderTxt
);
informationTv
=
findViewById
(
R
.
id
.
infoTxt
);
voiceMassagesTv
=
findViewById
(
R
.
id
.
voiceTxt
);
...
...
@@ -46,7 +46,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
settingTv
.
setOnClickListener
(
this
);
allNotesTv
.
setOnClickListener
(
this
);
a
chie
vedTv
.
setOnClickListener
(
this
);
a
rchi
vedTv
.
setOnClickListener
(
this
);
calenderTv
.
setOnClickListener
(
this
);
informationTv
.
setOnClickListener
(
this
);
voiceMassagesTv
.
setOnClickListener
(
this
);
...
...
@@ -59,8 +59,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
showSetting
();
}
else
if
(
view
.
getId
()
==
allNotesTv
.
getId
())
{
showAllNotes
();
}
else
if
(
view
.
getId
()
==
a
chie
vedTv
.
getId
())
{
showA
chie
ved
();
}
else
if
(
view
.
getId
()
==
a
rchi
vedTv
.
getId
())
{
showA
rchi
ved
();
}
else
if
(
view
.
getId
()
==
calenderTv
.
getId
())
{
showCalender
();
}
else
if
(
view
.
getId
()
==
informationTv
.
getId
())
{
...
...
@@ -82,8 +82,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
getContext
().
startActivity
(
intent
);
}
private
void
showA
chie
ved
()
{
Intent
newIntent
=
new
Intent
(
getContext
(),
AchivedNotesActivity
.
class
);
private
void
showA
rchi
ved
()
{
Intent
newIntent
=
new
Intent
(
getContext
(),
A
r
chivedNotesActivity
.
class
);
getContext
().
startActivity
(
newIntent
);
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/AllAchievedNotes/AchivedNotesActivity.java
deleted
100644 → 0
View file @
91785dd1
package
com
.
example
.
mynotepad
.
MenuFeatures
.
AllAchievedNotes
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
import
com.example.mynotepad.R
;
public
class
AchivedNotesActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_achived_notes
);
}
}
\ No newline at end of file
app/src/main/java/com/example/mynotepad/MenuFeatures/AllArchivedNotes/ArchivedNotesActivity.java
0 → 100644
View file @
9fedf74e
package
com
.
example
.
mynotepad
.
MenuFeatures
.
AllArchivedNotes
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.FrameLayout
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.example.mynotepad.MenuFeatures.AllArchivedNotes.MyArchivedNotesRecyclerView.*
;
import
com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity
;
import
com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity
;
import
com.example.mynotepad.MenuFeatures.AllNotes.DataBase.Note
;
import
com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote
;
import
com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment
;
import
com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.MyDate
;
import
com.example.mynotepad.MenuFeatures.CustomToolbarOption
;
import
com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener
;
import
com.example.mynotepad.R
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
com
.
example
.
mynotepad
.
MainActivity
.
noteDataBase
;
public
class
ArchivedNotesActivity
extends
AllNotesActivity
{
private
FrameLayout
fragPlace
;
private
LinearLayout
allNoteListAndTitle
;
private
CustomToolbarOption
customToolbarOption
;
private
FrameLayout
allNoteToolBar
;
private
RecyclerView
recyclerView
;
private
MyArchivedAdaptor
myarchivedAdaptor
;
private
List
<
Note
>
entityNotes
;
private
List
<
DateEntity
>
entityDates
;
private
List
<
MyNote
>
myNotes
;
private
List
<
MyDate
>
myDates
;
private
DateOrNote
chosenDateOrNote
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_achived_notes
);
init
();
}
private
void
init
()
{
// get data from database
setAllNoteListAndTitles
();
setAllDateNoteListAndTitles
();
customToolbarOption
=
findViewById
(
R
.
id
.
customToolbarOption2
);
customToolbarOption
.
setVisibility
(
View
.
GONE
);
allNoteToolBar
=
findViewById
(
R
.
id
.
allNotesToolbar2
);
allNoteToolBar
.
setEnabled
(
false
);
allNoteListAndTitle
=
findViewById
(
R
.
id
.
allNoteListAndTitle2
);
fragPlace
=
findViewById
(
R
.
id
.
fragmentPlace2
);
fragPlace
.
setVisibility
(
View
.
GONE
);
// show list with recycler view
recyclerView
=
findViewById
(
R
.
id
.
recyclerView2
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
);
myarchivedAdaptor
=
new
MyArchivedAdaptor
(
myNotes
,
myDates
);
recyclerView
.
setAdapter
(
myarchivedAdaptor
);
recyclerView
.
setLayoutManager
(
linearLayoutManager
);
addListeners
();
}
private
void
addListeners
()
{
// add listener to recyclerView
myarchivedAdaptor
.
setOnArchivedItemClickListener
(
new
OnArchivedItemClickListener
()
{
@Override
public
void
onItemClicked
(
DateOrNote
item
)
{
chosenDateOrNote
=
item
;
if
(
item
.
getType
().
equals
(
"note"
)){
//set noteFragment data
final
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"title"
,
item
.
getTitle
());
bundle
.
putString
(
"bodyTxt"
,
item
.
getDescription
());
final
NoteFragment
newNoteFrag
=
new
NoteFragment
(
false
);
newNoteFrag
.
setArguments
(
bundle
);
//change the fragment
fragPlace
.
setVisibility
(
View
.
VISIBLE
);
allNoteListAndTitle
.
setVisibility
(
View
.
GONE
);
replaceFragment
(
newNoteFrag
);
}
else
if
(
item
.
getType
().
equals
(
"date"
)){
//todo go to fragment
}
}
@Override
public
void
onItemLongClicked
(
DateOrNote
item
)
{
chosenDateOrNote
=
item
;
customToolbarOption
.
setVisibility
(
View
.
VISIBLE
);
customToolbarOption
.
hideRecycleBin
();
allNoteToolBar
.
setVisibility
(
View
.
GONE
);
}
});
//add listener to custom toolbar option and set being archived or not to be saved in database
customToolbarOption
.
setCustomToolbarOptionListener
(
new
CustomToolbarOptionListener
()
{
@Override
public
void
onStarClicked
()
{
customToolbarOption
.
setBlackStar
();
myarchivedAdaptor
.
getDateOrNoteList
().
remove
(
chosenDateOrNote
);
updateToUnarchiveInDataBase
();
Toast
.
makeText
(
ArchivedNotesActivity
.
this
,
"unarchived"
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onDeleteClicked
()
{
}
@Override
public
void
onCloseClicked
()
{
closeClicked
(
customToolbarOption
);
}
});
}
private
void
updateToUnarchiveInDataBase
()
{
if
(
chosenDateOrNote
.
getType
().
equals
(
"note"
)){
noteDataBase
.
noteDao
().
updateNote
(
chosenDateOrNote
.
getTitle
()
,
chosenDateOrNote
.
getDescription
()
,
false
,
chosenDateOrNote
.
getId
());
}
else
if
(
chosenDateOrNote
.
getType
().
equals
(
"date"
)){
noteDataBase
.
dateNoreDAO
().
updateDate
(
chosenDateOrNote
.
getTitle
()
,
chosenDateOrNote
.
getDescription
()
,
false
,
chosenDateOrNote
.
getId
());
}
}
private
void
setAllNoteListAndTitles
()
{
entityNotes
=
noteDataBase
.
noteDao
().
getAll
();
myNotes
=
new
ArrayList
<>();
for
(
Note
note
:
entityNotes
)
{
MyNote
myNote
=
new
MyNote
(
note
.
getTitle
(),
note
.
getDescription
(),
note
.
isarchived
()
,
note
.
getID
());
myNotes
.
add
(
myNote
);
}
}
private
void
setAllDateNoteListAndTitles
()
{
//get data from database to set in recyclerView
entityDates
=
noteDataBase
.
dateNoreDAO
().
getAllDateNotes
();
myDates
=
new
ArrayList
<>();
for
(
DateEntity
dateEntity
:
entityDates
)
{
MyDate
myDate
=
new
MyDate
(
dateEntity
.
getDate
(),
dateEntity
.
getDescription
(),
dateEntity
.
isarchived
()
,
dateEntity
.
getID
());
myDates
.
add
(
myDate
);
}
}
}
\ No newline at end of file
app/src/main/java/com/example/mynotepad/MenuFeatures/AllArchivedNotes/MyArchivedNotesRecyclerView/DateOrNote.java
0 → 100644
View file @
9fedf74e
package
com
.
example
.
mynotepad
.
MenuFeatures
.
AllArchivedNotes
.
MyArchivedNotesRecyclerView
;
public
class
DateOrNote
{
private
int
id
;
private
String
type
;
private
String
title
;
private
String
description
;
public
DateOrNote
(
int
id
,
String
type
,
String
title
,
String
description
)
{
this
.
id
=
id
;
this
.
type
=
type
;
this
.
title
=
title
;
this
.
description
=
description
;
}
public
int
getId
()
{
return
id
;
}
public
String
getType
()
{
return
type
;
}
public
String
getTitle
()
{
return
title
;
}
public
String
getDescription
()
{
return
description
;
}
}
app/src/main/java/com/example/mynotepad/MenuFeatures/AllArchivedNotes/MyArchivedNotesRecyclerView/OnArchivedItemClickListener.java
0 → 100644
View file @
9fedf74e
package
com
.
example
.
mynotepad
.
MenuFeatures
.
AllArchivedNotes
.
MyArchivedNotesRecyclerView
;
public
interface
OnArchivedItemClickListener
{
void
onItemClicked
(
DateOrNote
item
);
void
onItemLongClicked
(
DateOrNote
item
);
}
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/AllNotesActivity.java
View file @
9fedf74e
...
...
@@ -13,6 +13,7 @@ import android.view.View;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyAllNotesAdaptor
;
import
com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote
;
...
...
@@ -45,7 +46,6 @@ public class AllNotesActivity extends AppCompatActivity {
private
static
MyNote
myChosenNote
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -71,15 +71,15 @@ public class AllNotesActivity extends AppCompatActivity {
recyclerView
=
findViewById
(
R
.
id
.
recyclerView
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
);
myAdaptor
=
new
MyAllNotesAdaptor
(
myNotes
);
recyclerView
.
setAdapter
(
myAdaptor
);
recyclerView
.
setLayoutManager
(
linearLayoutManager
);
recyclerView
.
setLayoutManager
(
linearLayoutManager
);
recyclerView
.
setAdapter
(
myAdaptor
);
addListeners
();
}
p
ublic
void
addListeners
()
{
p
rivate
void
addListeners
()
{
addNoteButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
...
...
@@ -96,7 +96,7 @@ public class AllNotesActivity extends AppCompatActivity {
final
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"title"
,
myNote
.
getTitle
());
bundle
.
putString
(
"bodyTxt"
,
myNote
.
getDescription
());
final
NoteFragment
newNoteFrag
=
new
NoteFragment
(
false
);
final
NoteFragment
newNoteFrag
=
new
NoteFragment
(
false
);
newNoteFrag
.
setArguments
(
bundle
);
//change the fragment
...
...
@@ -111,41 +111,47 @@ public class AllNotesActivity extends AppCompatActivity {
customToolbarOption
.
setVisibility
(
View
.
VISIBLE
);
allNoteToolBar
.
setVisibility
(
View
.
GONE
);
myChosenNote
=
myNote
;
if
(
myChosenNote
.
isarchived
()){
customToolbarOption
.
setYellowStar
();
}
else
{
customToolbarOption
.
setBlackStar
();
}
}
});
//add listener to custom toolbar option and set being a
chie
ved or not to be saved in database
//add listener to custom toolbar option and set being a
rchi
ved or not to be saved in database
customToolbarOption
.
setCustomToolbarOptionListener
(
new
CustomToolbarOptionListener
()
{
@Override
public
void
onStarClicked
(
ImageView
yellowS
,
ImageView
blackS
)
{
starClicked
(
yellowS
,
blackS
);
public
void
onStarClicked
()
{
starClicked
();
}
@Override
public
void
onDeleteClicked
(
final
ImageView
imageView
)
{
deleteClicked
(
imageView
);
public
void
onDeleteClicked
()
{
Note
note
=
entityNotes
.
get
(
myNotes
.
indexOf
(
myChosenNote
)
);
deleteClicked
(
note
);
}
@Override
public
void
onCloseClicked
()
{
closeClicked
();
closeClicked
(
customToolbarOption
);
}
});
}
pr
ivate
void
closeClicked
(
)
{
pr
otected
void
closeClicked
(
CustomToolbarOption
customToolbarOption
)
{
customToolbarOption
.
setVisibility
(
View
.
GONE
);
allNoteToolBar
.
setVisibility
(
View
.
VISIBLE
);
}
pr
ivate
void
deleteClicked
(
ImageView
imageView
)
{
pr
otected
void
deleteClicked
(
final
Note
note
)
{
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
AllNotesActivity
.
this
);
alert
.
setMessage
(
"are you sure you wanna delete it ??? "
);
alert
.
setPositiveButton
(
"yes"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
noteDataBase
.
noteDao
().
deleteNote
(
entityNotes
.
get
(
myNotes
.
indexOf
(
myChosenNote
))
);
noteDataBase
.
noteDao
().
deleteNote
(
note
);
init
();
}
});
...
...
@@ -159,18 +165,25 @@ public class AllNotesActivity extends AppCompatActivity {
allNoteToolBar
.
setVisibility
(
View
.
VISIBLE
);
}
private
void
starClicked
(
ImageView
yellowS
,
ImageView
blackS
)
{
if
(
yellowS
.
getVisibility
()
==
View
.
VISIBLE
)
{
yellowS
.
setVisibility
(
View
.
GONE
);
blackS
.
setVisibility
(
View
.
VISIBLE
);
myChosenNote
.
setAchieved
(
false
);
protected
void
starClicked
()
{
if
(
myChosenNote
.
isarchived
())
{
customToolbarOption
.
setBlackStar
();
myChosenNote
.
setarchived
(
false
);
updatearchivedNotesInDataBase
();
Toast
.
makeText
(
this
,
"unarchived"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
yellowS
.
setVisibility
(
View
.
VISIBLE
);
blackS
.
setVisibility
(
View
.
GONE
);
myChosenNote
.
setAchieved
(
true
);
customToolbarOption
.
setYellowStar
();
myChosenNote
.
setarchived
(
true
);
updatearchivedNotesInDataBase
();
Toast
.
makeText
(
this
,
"archived"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
private
void
updatearchivedNotesInDataBase
()
{
noteDataBase
.
noteDao
().
updateNote
(
myChosenNote
.
getTitle
(),
myChosenNote
.
getDescription
()
,
myChosenNote
.
isarchived
(),
myChosenNote
.
getId
());
}
private
void
showAddAlert
()
{
final
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
this
);
...
...
@@ -212,7 +225,7 @@ public class AllNotesActivity extends AppCompatActivity {
entityNotes
=
noteDataBase
.
noteDao
().
getAll
();
myNotes
=
new
ArrayList
<>();
for
(
Note
note
:
entityNotes
)
{
MyNote
myNote
=
new
MyNote
(
note
.
getTitle
(),
note
.
getDescription
(),
note
.
is
Achieved
());
MyNote
myNote
=
new
MyNote
(
note
.
getTitle
(),
note
.
getDescription
(),
note
.
is
archived
(),
note
.
getID
());
myNotes
.
add
(
myNote
);
}
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/DataBase/DateEntity.java
View file @
9fedf74e
...
...
@@ -11,13 +11,13 @@ public class DateEntity {
String
date
;
@ColumnInfo
(
name
=
"description"
)
String
description
;
@ColumnInfo
(
name
=
"a
chie
ved"
)
boolean
is
Achie
ved
;
@ColumnInfo
(
name
=
"a
rchi
ved"
)
boolean
is
archi
ved
;
public
DateEntity
(
String
date
,
String
description
,
boolean
is
Achie
ved
){
public
DateEntity
(
String
date
,
String
description
,
boolean
is
archi
ved
){
this
.
date
=
date
;
this
.
description
=
description
;
this
.
is
Achieved
=
isAchie
ved
;
this
.
is
archived
=
isarchi
ved
;
}
...
...
@@ -33,7 +33,7 @@ public class DateEntity {
return
description
;
}
public
boolean
is
Achie
ved
(){
return
is
Achie
ved
;
public
boolean
is
archi
ved
(){
return
is
archi
ved
;
}
}
\ No newline at end of file
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/DataBase/DateNoreDAO.java
View file @
9fedf74e
...
...
@@ -25,5 +25,6 @@ public interface DateNoreDAO {
@Update
void
updateDateNote
(
DateEntity
dateEntity
);
@Query
(
"UPDATE DateEntity SET date = :date , description = :description ,archived = :isarchived Where ID = :id"
)
void
updateDate
(
String
date
,
String
description
,
boolean
isarchived
,
int
id
);
}
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/DataBase/Note.java
View file @
9fedf74e
...
...
@@ -11,13 +11,13 @@ import androidx.room.PrimaryKey;
String
title
;
@ColumnInfo
(
name
=
"description"
)
String
txtBody
;
@ColumnInfo
(
name
=
"a
chie
ved"
)
boolean
is
Achie
ved
;
@ColumnInfo
(
name
=
"a
rchi
ved"
)
boolean
is
archi
ved
;
public
Note
(
String
title
,
String
txtBody
,
boolean
is
Achie
ved
){
public
Note
(
String
title
,
String
txtBody
,
boolean
is
archi
ved
){
this
.
title
=
title
;
this
.
txtBody
=
txtBody
;
this
.
is
Achieved
=
isAchie
ved
;
this
.
is
archived
=
isarchi
ved
;
}
...
...
@@ -33,7 +33,7 @@ import androidx.room.PrimaryKey;
return
txtBody
;
}
public
boolean
is
Achie
ved
(){
return
is
Achie
ved
;
public
boolean
is
archi
ved
(){
return
is
archi
ved
;
}
}
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/DataBase/NoteDAO.java
View file @
9fedf74e
...
...
@@ -23,8 +23,9 @@ public interface NoteDAO {
void
deleteNote
(
Note
myNote
);
@Query
(
"UPDATE Note SET title = :title , description = :description ,achieved = :isAchieved Where ID = :id"
)
void
updateNote
(
String
title
,
String
description
,
boolean
isAchieved
,
int
id
);
@Query
(
"UPDATE Note SET title = :title , description = :description ,archived = :isarchived Where ID = :id"
)
void
updateNote
(
String
title
,
String
description
,
boolean
isarchived
,
int
id
);
}
\ No newline at end of file
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/MyNoteRecyclerView/MyAllNotesAdaptor.java
View file @
9fedf74e
...
...
@@ -21,7 +21,6 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
this
.
notes
=
notes
;
}
@NonNull
@Override
public
ViewHolder
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
View
view
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
custom_allnotes_item
,
parent
,
false
);
...
...
@@ -32,7 +31,7 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
holder
.
titleTV
.
setText
(
notes
.
get
(
position
).
getTitle
());
holder
.
descriptionTV
.
setText
(
notes
.
get
(
position
).
getDescription
());
holder
.
is
Achieved
=
notes
.
get
(
position
).
isAchie
ved
();
holder
.
is
archived
=
notes
.
get
(
position
).
isarchi
ved
();
}
@Override
...
...
@@ -46,13 +45,13 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
class
ViewHolder
extends
RecyclerView
.
ViewHolder
implements
View
.
OnClickListener
,
View
.
OnLongClickListener
{
protected
TextView
titleTV
,
descriptionTV
;
protected
boolean
is
Achie
ved
;
protected
boolean
is
archi
ved
;
public
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
titleTV
=
itemView
.
findViewById
(
R
.
id
.
titleTv
);
descriptionTV
=
itemView
.
findViewById
(
R
.
id
.
descriptionTv
);
is
Achie
ved
=
false
;
is
archi
ved
=
false
;
itemView
.
setOnClickListener
(
this
);
itemView
.
setOnLongClickListener
(
this
);
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/MyNoteRecyclerView/MyNote.java
View file @
9fedf74e
...
...
@@ -2,13 +2,15 @@ package com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView;
public
class
MyNote
{
private
String
title
,
description
;
private
boolean
isAchieved
;
private
String
title
,
description
;
private
boolean
isarchived
;
int
id
;
public
MyNote
(
String
title
,
String
description
,
boolean
is
Achieve
d
)
{
public
MyNote
(
String
title
,
String
description
,
boolean
is
archived
,
int
i
d
)
{
this
.
title
=
title
;
this
.
description
=
description
;
this
.
isAchieved
=
isAchieved
;
this
.
isarchived
=
isarchived
;
this
.
id
=
id
;
}
public
String
getTitle
()
{
...
...
@@ -19,11 +21,15 @@ public class MyNote {
return
description
;
}
public
boolean
is
Achie
ved
()
{
return
is
Achie
ved
;
public
boolean
is
archi
ved
()
{
return
is
archi
ved
;
}
public
void
setAchieved
(
boolean
achieved
)
{
isAchieved
=
achieved
;
public
void
setarchived
(
boolean
archived
)
{
isarchived
=
archived
;
}
public
int
getId
()
{
return
id
;
}
}
app/src/main/java/com/example/mynotepad/MenuFeatures/AllNotes/Note/NoteFragment.java
View file @
9fedf74e
...
...
@@ -95,7 +95,7 @@ public class NoteFragment extends Fragment {
noteDataBase
.
noteDao
().
insertNote
(
note
);
Toast
.
makeText
(
getActivity
(),
"saved"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
noteDataBase
.
noteDao
().
updateNote
(
titleTxt
.
getText
().
toString
()
,
bodyTxt
.
getText
().
toString
()
,
note
.
is
Achie
ved
()
,
note
.
getID
());
noteDataBase
.
noteDao
().
updateNote
(
titleTxt
.
getText
().
toString
()
,
bodyTxt
.
getText
().
toString
()
,
note
.
is
archi
ved
()
,
note
.
getID
());
Toast
.
makeText
(
getActivity
(),
"updated"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/Calender/MyCalenderActivity.java
View file @
9fedf74e
...
...
@@ -12,8 +12,10 @@ import android.view.View;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity
;
import
com.example.mynotepad.MenuFeatures.AllNotes.DataBase.Note
;
import
com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment
;
import
com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.MyCalenderAdaptor
;
import
com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.OnCalenderItemClickListener
;
...
...
@@ -58,7 +60,7 @@ public class MyCalenderActivity extends AppCompatActivity {
private
void
init
()
{
setAllNoteListAndTitles
();
setAll
Date
NoteListAndTitles
();
addDateBtn
=
findViewById
(
R
.
id
.
addDateButton
);
customToolbarOption
=
findViewById
(
R
.
id
.
calenderCustomToolbarOption
);
...
...
@@ -114,20 +116,26 @@ public class MyCalenderActivity extends AppCompatActivity {
customToolbarOption
.
setVisibility
(
View
.
VISIBLE
);
calenderToolbar
.
setVisibility
(
View
.
GONE
);
myChosenDateNote
=
myDate
;
if
(
myChosenDateNote
.
isarchived
()){
customToolbarOption
.
setYellowStar
();
}
else
{
customToolbarOption
.
setBlackStar
();
}
}
});
//add listener to custom toolbar option and set being a
chie
ved or not to be saved in database
//add listener to custom toolbar option and set being a
rchi
ved or not to be saved in database
customToolbarOption
.
setCustomToolbarOptionListener
(
new
CustomToolbarOptionListener
()
{
@Override
public
void
onStarClicked
(
ImageView
yellowS
,
ImageView
blackS
)
{
starClicked
(
yellowS
,
blackS
);
public
void
onStarClicked
()
{
starClicked
();
}
@Override
public
void
onDeleteClicked
(
final
ImageView
imageView
)
{
deleteClicked
(
imageView
);
public
void
onDeleteClicked
()
{
deleteClicked
();
}
...
...
@@ -144,7 +152,7 @@ public class MyCalenderActivity extends AppCompatActivity {
calenderToolbar
.
setVisibility
(
View
.
VISIBLE
);
}
private
void
deleteClicked
(
ImageView
imageView
)
{
private
void
deleteClicked
()
{
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
MyCalenderActivity
.
this
);
alert
.
setMessage
(
"are you sure you wanna delete it ??? "
);
alert
.
setPositiveButton
(
"yes"
,
new
DialogInterface
.
OnClickListener
()
{
...
...
@@ -164,31 +172,36 @@ public class MyCalenderActivity extends AppCompatActivity {
calenderToolbar
.
setVisibility
(
View
.
VISIBLE
);
}
private
void
starClicked
(
ImageView
yellowS
,
ImageView
blackS
)
{
if
(
yellowS
.
getVisibility
()
==
View
.
VISIBLE
)
{
yellowS
.
setVisibility
(
View
.
GONE
);
blackS
.
setVisibility
(
View
.
VISIBLE
);
myChosenDateNote
.
setAchieved
(
false
);
private
void
starClicked
()
{
if
(
myChosenDateNote
.
isarchived
())
{
customToolbarOption
.
setBlackStar
();
myChosenDateNote
.
setarchived
(
false
);
updatearchivedDatesInDataBase
();
Toast
.
makeText
(
this
,
"unarchived"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
yellowS
.
setVisibility
(
View
.
VISIBLE
);
blackS
.
setVisibility
(
View
.
GONE
);
myChosenDateNote
.
setAchieved
(
true
);
customToolbarOption
.
setYellowStar
();
myChosenDateNote
.
setarchived
(
true
);
updatearchivedDatesInDataBase
();
Toast
.
makeText
(
this
,
"archived"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
private
void
updatearchivedDatesInDataBase
()
{
noteDataBase
.
dateNoreDAO
().
updateDate
(
myChosenDateNote
.
getDate
(),
myChosenDateNote
.
getDescription
(),
myChosenDateNote
.
isarchived
(),
myChosenDateNote
.
getId
());
}
private
void
addNewDateAndDescription
()
{
Intent
intent
=
new
Intent
(
MyCalenderActivity
.
this
,
DatePickerActivity
.
class
);
startActivity
(
intent
);
}
private
void
setAllNoteListAndTitles
()
{
myDates
=
new
ArrayList
<>();
private
void
setAllDateNoteListAndTitles
()
{
//get data from database to set in recyclerView
entityDates
=
noteDataBase
.
dateNoreDAO
().
getAllDateNotes
();
myDates
=
new
ArrayList
<>();
for
(
DateEntity
dateEntity
:
entityDates
)
{
MyDate
myDate
=
new
MyDate
(
dateEntity
.
getDate
(),
dateEntity
.
getDescription
(),
dateEntity
.
is
Achieved
());
MyDate
myDate
=
new
MyDate
(
dateEntity
.
getDate
(),
dateEntity
.
getDescription
(),
dateEntity
.
is
archived
(),
dateEntity
.
getID
());
myDates
.
add
(
myDate
);
}
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/Calender/MyCalenderRecyclerView/MyCalenderAdaptor.java
View file @
9fedf74e
...
...
@@ -32,7 +32,7 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca
public
void
onBindViewHolder
(
@NonNull
CalenderViewHolder
holder
,
int
position
)
{
holder
.
dateTV
.
setText
(
dates
.
get
(
position
).
getDate
());
holder
.
descriptionTV
.
setText
(
dates
.
get
(
position
).
getDescription
());
holder
.
is
Achieved
=
dates
.
get
(
position
).
isAchie
ved
();
holder
.
is
archived
=
dates
.
get
(
position
).
isarchi
ved
();
}
@Override
...
...
@@ -46,13 +46,13 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca
class
CalenderViewHolder
extends
RecyclerView
.
ViewHolder
implements
View
.
OnClickListener
,
View
.
OnLongClickListener
{
protected
TextView
dateTV
,
descriptionTV
;
protected
boolean
is
Achie
ved
;
protected
boolean
is
archi
ved
;
public
CalenderViewHolder
(
@NonNull
View
itemView
)
{
super
(
itemView
);
dateTV
=
itemView
.
findViewById
(
R
.
id
.
titleTv
);
descriptionTV
=
itemView
.
findViewById
(
R
.
id
.
descriptionTv
);
is
Achie
ved
=
false
;
is
archi
ved
=
false
;
itemView
.
setOnClickListener
(
this
);
itemView
.
setOnLongClickListener
(
this
);
}
...
...
app/src/main/java/com/example/mynotepad/MenuFeatures/Calender/MyCalenderRecyclerView/TimePicker/MyDate.java
View file @
9fedf74e
...
...
@@ -3,12 +3,14 @@ package com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimeP
public
class
MyDate
{
private
String
date
,
description
;
private
boolean
isAchieved
;
private
boolean
isarchived
;
int
id
;
public
MyDate
(
String
date
,
String
description
,
boolean
is
Achieve
d
)
{
public
MyDate
(
String
date
,
String
description
,
boolean
is
archived
,
int
i
d
)
{
this
.
date
=
date
;
this
.
description
=
description
;
this
.
isAchieved
=
isAchieved
;
this
.
isarchived
=
isarchived
;
this
.
id
=
id
;
}
public
String
getDate
()
{
...
...
@@ -19,11 +21,15 @@ public class MyDate {
return
description
;
}
public
boolean
is
Achie
ved
()
{
return
is
Achie
ved
;
public
boolean
is
archi
ved
()
{
return
is
archi
ved
;
}
public
void
setAchieved
(
boolean
achieved
)
{
isAchieved
=
achieved
;
public
void
setarchived
(
boolean
archived
)
{
isarchived
=
archived
;
}
public
int
getId
()
{
return
id
;
}
}
app/src/main/java/com/example/mynotepad/MenuFeatures/CustomToolbarOption.java
View file @
9fedf74e
...
...
@@ -30,7 +30,6 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis
yellowStarImg
=
findViewById
(
R
.
id
.
yellow_star
);
deleteImg
=
findViewById
(
R
.
id
.
deleteImg
);
closeImg
=
findViewById
(
R
.
id
.
closeImg
);
//todo setStarColor();
yellowStarImg
.
setOnClickListener
(
this
);
blackStarImg
.
setOnClickListener
(
this
);
...
...
@@ -39,16 +38,6 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis
}
/* private void setStarColor() {
if (AllNotesActivity.myChosenNote.isAchieved()){
blackStarImg.setVisibility(GONE);
yellowStarImg.setVisibility(VISIBLE);
}
else {
blackStarImg.setVisibility(VISIBLE);
yellowStarImg.setVisibility(GONE);
}
}*/
@Override
public
void
onClick
(
View
view
)
{
...
...
@@ -56,13 +45,32 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis
if
(
view
.
getId
()
==
closeImg
.
getId
())
customToolbarOptionListener
.
onCloseClicked
();
if
(
view
.
getId
()
==
deleteImg
.
getId
())
customToolbarOptionListener
.
onDeleteClicked
(
deleteImg
);
customToolbarOptionListener
.
onDeleteClicked
();
if
(
view
.
getId
()
==
yellowStarImg
.
getId
()
||
view
.
getId
()
==
blackStarImg
.
getId
())
customToolbarOptionListener
.
onStarClicked
(
yellowStarImg
,
blackStarImg
);
customToolbarOptionListener
.
onStarClicked
();
}
}
public
void
setCustomToolbarOptionListener
(
CustomToolbarOptionListener
customToolbarOptionListener
)
{
this
.
customToolbarOptionListener
=
customToolbarOptionListener
;
}
public
void
setYellowStar
(){
yellowStarImg
.
setVisibility
(
VISIBLE
);
blackStarImg
.
setVisibility
(
GONE
);
}
public
void
setBlackStar
(){
yellowStarImg
.
setVisibility
(
GONE
);
blackStarImg
.
setVisibility
(
VISIBLE
);
}
public
void
hideRecycleBin
(){
deleteImg
.
setVisibility
(
GONE
);
}
public
void
hideStar
(){
yellowStarImg
.
setVisibility
(
GONE
);
blackStarImg
.
setVisibility
(
GONE
);
}
}
app/src/main/java/com/example/mynotepad/MenuFeatures/CustomToolbarOptionListener.java
View file @
9fedf74e
package
com
.
example
.
mynotepad
.
MenuFeatures
;
import
android.widget.ImageView
;
public
interface
CustomToolbarOptionListener
{
void
onStarClicked
(
ImageView
yellowS
,
ImageView
blackS
);
void
onDeleteClicked
(
ImageView
imageView
);
void
onStarClicked
();
void
onDeleteClicked
();
void
onCloseClicked
();
}
app/src/main/java/com/example/mynotepad/MenuFeatures/VoiceMassages/VoiceMassagesActivity.java
View file @
9fedf74e
...
...
@@ -105,19 +105,20 @@ public class VoiceMassagesActivity extends AppCompatActivity {
@Override
public
void
onItemLongClicked
(
MyVoice
item
)
{
customToolbarOption
.
setVisibility
(
View
.
VISIBLE
);
customToolbarOption
.
hideStar
();
myChosenVoice
=
item
;
}
});
//add listener to custom toolbar option and set being a
chie
ved or not to be saved in database
//add listener to custom toolbar option and set being a
rchi
ved or not to be saved in database
customToolbarOption
.
setCustomToolbarOptionListener
(
new
CustomToolbarOptionListener
()
{
@Override
public
void
onStarClicked
(
ImageView
yellowS
,
ImageView
blackS
)
{
public
void
onStarClicked
()
{
}
@Override
public
void
onDeleteClicked
(
final
ImageView
imageView
)
{
deleteClicked
(
imageView
);
public
void
onDeleteClicked
()
{
deleteClicked
();
}
@Override
...
...
@@ -127,7 +128,7 @@ public class VoiceMassagesActivity extends AppCompatActivity {
});
}
private
void
deleteClicked
(
ImageView
imageView
)
{
private
void
deleteClicked
()
{
AlertDialog
.
Builder
alert
=
new
AlertDialog
.
Builder
(
VoiceMassagesActivity
.
this
);
alert
.
setMessage
(
"are you sure you wanna delete it ??? "
);
alert
.
setPositiveButton
(
"yes"
,
new
DialogInterface
.
OnClickListener
()
{
...
...
app/src/main/res/layout/activity_achived_notes.xml
View file @
9fedf74e
<?xml version="1.0" encoding="utf-8"?>
<
androidx.constraintlayout.widget.Constraint
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Frame
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MenuFeatures.All
AchievedNotes.A
chivedNotesActivity"
>
tools:context=
".MenuFeatures.All
archivedNotes.ar
chivedNotesActivity"
>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<FrameLayout
android:id=
"@+id/fragmentPlace2"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<LinearLayout
android:id=
"@+id/allNoteListAndTitle2"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<FrameLayout
android:id=
"@+id/allNotesToolbar2"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/imageView72"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:scaleType=
"fitXY"
app:srcCompat=
"@drawable/index"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:enabled=
"false"
android:text=
"@string/archived"
android:textColor=
"#02091E"
android:textSize=
"26dp"
/>
</FrameLayout>
<com.example.mynotepad.MenuFeatures.CustomToolbarOption
android:id=
"@+id/customToolbarOption2"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recyclerView2"
android:layout_width=
"409dp"
android:layout_height=
"match_parent"
android:background=
"#4883B5DD"
tools:layout_editor_absoluteX=
"1dp"
tools:layout_editor_absoluteY=
"1dp"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/custom_menu.xml
View file @
9fedf74e
...
...
@@ -99,14 +99,14 @@
<TextView
android:id=
"@+id/a
chie
vedTxt"
android:id=
"@+id/a
rchi
vedTxt"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_weight=
"6"
android:gravity=
"center_vertical"
android:text=
"@string/a
chie
ved"
android:text=
"@string/a
rchi
ved"
android:textSize=
"20dp"
/>
<TextView
...
...
app/src/main/res/values/strings.xml
View file @
9fedf74e
<resources>
<string
name=
"app_name"
>
MyNotepad
</string>
<string
name=
"setting"
>
setting
</string>
<string
name=
"achieved"
>
achieved
</string>
<string
name=
"all_notes"
>
all notes
</string>
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"title"
>
title
</string>
...
...
@@ -12,4 +11,5 @@
<string
name=
"date"
>
date
</string>
<string
name=
"chosendate"
>
chosenDate
</string>
<string
name=
"dots"
>
...
</string>
<string
name=
"archived"
>
archived
</string>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment