Commit 9fedf74e authored by 9731301's avatar 9731301

add ArchivedNotesActivity to ger selected notes and dateNotes

parent 91785dd1
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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"> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<activity android:name=".MenuFeatures.Calender.MyCalenderActivity" /> <activity android:name=".MenuFeatures.Calender.MyCalenderActivity" />
<activity android:name=".MenuFeatures.VoiceMassages.VoiceMassagesActivity" /> <activity android:name=".MenuFeatures.VoiceMassages.VoiceMassagesActivity" />
<activity android:name=".MenuFeatures.AllNotes.AllNotesActivity" /> <activity android:name=".MenuFeatures.AllNotes.AllNotesActivity" />
<activity android:name=".MenuFeatures.AllAchievedNotes.AchivedNotesActivity" /> <activity android:name=".MenuFeatures.AllArchivedNotes.ArchivedNotesActivity" />
<activity android:name=".MenuFeatures.Setting.SettingActivity" /> <activity android:name=".MenuFeatures.Setting.SettingActivity" />
<activity android:name=".MainActivity"> <activity android:name=".MainActivity">
<intent-filter> <intent-filter>
......
...@@ -8,7 +8,7 @@ import android.widget.ImageView; ...@@ -8,7 +8,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.example.mynotepad.MenuFeatures.AllAchievedNotes.AchivedNotesActivity; import com.example.mynotepad.MenuFeatures.AllArchivedNotes.ArchivedNotesActivity;
import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity; import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderActivity; import com.example.mynotepad.MenuFeatures.Calender.MyCalenderActivity;
import com.example.mynotepad.MenuFeatures.Information.InfoClickListener; import com.example.mynotepad.MenuFeatures.Information.InfoClickListener;
...@@ -19,7 +19,7 @@ import com.google.android.material.snackbar.Snackbar; ...@@ -19,7 +19,7 @@ import com.google.android.material.snackbar.Snackbar;
public class CustomMenu extends LinearLayout implements View.OnClickListener { public class CustomMenu extends LinearLayout implements View.OnClickListener {
private View rootView; private View rootView;
private TextView settingTv, allNotesTv, achievedTv, calenderTv, informationTv, voiceMassagesTv; private TextView settingTv, allNotesTv, archivedTv, calenderTv, informationTv, voiceMassagesTv;
private ImageView img; private ImageView img;
private InfoClickListener infoClickListener; private InfoClickListener infoClickListener;
...@@ -38,7 +38,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener { ...@@ -38,7 +38,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
rootView = inflate(context, R.layout.custom_menu, this); rootView = inflate(context, R.layout.custom_menu, this);
settingTv = findViewById(R.id.settingTxt); settingTv = findViewById(R.id.settingTxt);
allNotesTv = findViewById(R.id.allNotesTxt); allNotesTv = findViewById(R.id.allNotesTxt);
achievedTv = findViewById(R.id.achievedTxt); archivedTv = findViewById(R.id.archivedTxt);
calenderTv = findViewById(R.id.calenderTxt); calenderTv = findViewById(R.id.calenderTxt);
informationTv = findViewById(R.id.infoTxt); informationTv = findViewById(R.id.infoTxt);
voiceMassagesTv = findViewById(R.id.voiceTxt); voiceMassagesTv = findViewById(R.id.voiceTxt);
...@@ -46,7 +46,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener { ...@@ -46,7 +46,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
settingTv.setOnClickListener(this); settingTv.setOnClickListener(this);
allNotesTv.setOnClickListener(this); allNotesTv.setOnClickListener(this);
achievedTv.setOnClickListener(this); archivedTv.setOnClickListener(this);
calenderTv.setOnClickListener(this); calenderTv.setOnClickListener(this);
informationTv.setOnClickListener(this); informationTv.setOnClickListener(this);
voiceMassagesTv.setOnClickListener(this); voiceMassagesTv.setOnClickListener(this);
...@@ -59,8 +59,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener { ...@@ -59,8 +59,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
showSetting(); showSetting();
} else if (view.getId() == allNotesTv.getId()) { } else if (view.getId() == allNotesTv.getId()) {
showAllNotes(); showAllNotes();
} else if (view.getId() == achievedTv.getId()) { } else if (view.getId() == archivedTv.getId()) {
showAchieved(); showArchived();
} else if (view.getId() == calenderTv.getId()) { } else if (view.getId() == calenderTv.getId()) {
showCalender(); showCalender();
} else if (view.getId() == informationTv.getId()) { } else if (view.getId() == informationTv.getId()) {
...@@ -82,8 +82,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener { ...@@ -82,8 +82,8 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
getContext().startActivity(intent); getContext().startActivity(intent);
} }
private void showAchieved() { private void showArchived() {
Intent newIntent = new Intent(getContext(), AchivedNotesActivity.class); Intent newIntent = new Intent(getContext(), ArchivedNotesActivity.class);
getContext().startActivity(newIntent); getContext().startActivity(newIntent);
} }
......
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
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
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;
}
}
package com.example.mynotepad.MenuFeatures.AllArchivedNotes.MyArchivedNotesRecyclerView;
public interface OnArchivedItemClickListener {
void onItemClicked(DateOrNote item);
void onItemLongClicked(DateOrNote item);
}
...@@ -13,6 +13,7 @@ import android.view.View; ...@@ -13,6 +13,7 @@ import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyAllNotesAdaptor; import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyAllNotesAdaptor;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote; import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote;
...@@ -45,7 +46,6 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -45,7 +46,6 @@ public class AllNotesActivity extends AppCompatActivity {
private static MyNote myChosenNote; private static MyNote myChosenNote;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
...@@ -71,15 +71,15 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -71,15 +71,15 @@ public class AllNotesActivity extends AppCompatActivity {
recyclerView = findViewById(R.id.recyclerView); recyclerView = findViewById(R.id.recyclerView);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
myAdaptor = new MyAllNotesAdaptor(myNotes); myAdaptor = new MyAllNotesAdaptor(myNotes);
recyclerView.setAdapter(myAdaptor);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(myAdaptor);
addListeners(); addListeners();
} }
public void addListeners() { private void addListeners() {
addNoteButton.setOnClickListener(new View.OnClickListener() { addNoteButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -96,7 +96,7 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -96,7 +96,7 @@ public class AllNotesActivity extends AppCompatActivity {
final Bundle bundle = new Bundle(); final Bundle bundle = new Bundle();
bundle.putString("title", myNote.getTitle()); bundle.putString("title", myNote.getTitle());
bundle.putString("bodyTxt", myNote.getDescription()); bundle.putString("bodyTxt", myNote.getDescription());
final NoteFragment newNoteFrag = new NoteFragment(false ); final NoteFragment newNoteFrag = new NoteFragment(false);
newNoteFrag.setArguments(bundle); newNoteFrag.setArguments(bundle);
//change the fragment //change the fragment
...@@ -111,41 +111,47 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -111,41 +111,47 @@ public class AllNotesActivity extends AppCompatActivity {
customToolbarOption.setVisibility(View.VISIBLE); customToolbarOption.setVisibility(View.VISIBLE);
allNoteToolBar.setVisibility(View.GONE); allNoteToolBar.setVisibility(View.GONE);
myChosenNote = myNote; myChosenNote = myNote;
if (myChosenNote.isarchived()){
customToolbarOption.setYellowStar();
}
else {
customToolbarOption.setBlackStar();
}
} }
}); });
//add listener to custom toolbar option and set being achieved or not to be saved in database //add listener to custom toolbar option and set being archived or not to be saved in database
customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() { customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() {
@Override @Override
public void onStarClicked(ImageView yellowS, ImageView blackS) { public void onStarClicked() {
starClicked(yellowS, blackS); starClicked();
} }
@Override @Override
public void onDeleteClicked(final ImageView imageView) { public void onDeleteClicked() {
deleteClicked(imageView); Note note = entityNotes.get(myNotes.indexOf(myChosenNote));
deleteClicked(note);
} }
@Override @Override
public void onCloseClicked() { public void onCloseClicked() {
closeClicked(); closeClicked(customToolbarOption);
} }
}); });
} }
private void closeClicked() { protected void closeClicked(CustomToolbarOption customToolbarOption) {
customToolbarOption.setVisibility(View.GONE); customToolbarOption.setVisibility(View.GONE);
allNoteToolBar.setVisibility(View.VISIBLE); allNoteToolBar.setVisibility(View.VISIBLE);
} }
private void deleteClicked(ImageView imageView) { protected void deleteClicked(final Note note) {
AlertDialog.Builder alert = new AlertDialog.Builder(AllNotesActivity.this); AlertDialog.Builder alert = new AlertDialog.Builder(AllNotesActivity.this);
alert.setMessage("are you sure you wanna delete it ??? "); alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() { alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
noteDataBase.noteDao().deleteNote(entityNotes.get(myNotes.indexOf(myChosenNote))); noteDataBase.noteDao().deleteNote(note);
init(); init();
} }
}); });
...@@ -159,18 +165,25 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -159,18 +165,25 @@ public class AllNotesActivity extends AppCompatActivity {
allNoteToolBar.setVisibility(View.VISIBLE); allNoteToolBar.setVisibility(View.VISIBLE);
} }
private void starClicked(ImageView yellowS, ImageView blackS) { protected void starClicked() {
if (yellowS.getVisibility() == View.VISIBLE) { if (myChosenNote.isarchived()) {
yellowS.setVisibility(View.GONE); customToolbarOption.setBlackStar();
blackS.setVisibility(View.VISIBLE); myChosenNote.setarchived(false);
myChosenNote.setAchieved(false); updatearchivedNotesInDataBase();
Toast.makeText(this, "unarchived", Toast.LENGTH_SHORT).show();
} else { } else {
yellowS.setVisibility(View.VISIBLE); customToolbarOption.setYellowStar();
blackS.setVisibility(View.GONE); myChosenNote.setarchived(true);
myChosenNote.setAchieved(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() { private void showAddAlert() {
final AlertDialog.Builder alert = new AlertDialog.Builder(this); final AlertDialog.Builder alert = new AlertDialog.Builder(this);
...@@ -212,7 +225,7 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -212,7 +225,7 @@ public class AllNotesActivity extends AppCompatActivity {
entityNotes = noteDataBase.noteDao().getAll(); entityNotes = noteDataBase.noteDao().getAll();
myNotes = new ArrayList<>(); myNotes = new ArrayList<>();
for (Note note : entityNotes) { for (Note note : entityNotes) {
MyNote myNote = new MyNote(note.getTitle(), note.getDescription(), note.isAchieved()); MyNote myNote = new MyNote(note.getTitle(), note.getDescription(), note.isarchived(), note.getID());
myNotes.add(myNote); myNotes.add(myNote);
} }
} }
......
...@@ -11,13 +11,13 @@ public class DateEntity { ...@@ -11,13 +11,13 @@ public class DateEntity {
String date ; String date ;
@ColumnInfo(name = "description") @ColumnInfo(name = "description")
String description; String description;
@ColumnInfo(name = "achieved") @ColumnInfo(name = "archived")
boolean isAchieved; boolean isarchived;
public DateEntity(String date , String description , boolean isAchieved){ public DateEntity(String date , String description , boolean isarchived){
this.date = date; this.date = date;
this.description = description; this.description = description;
this.isAchieved = isAchieved; this.isarchived = isarchived;
} }
...@@ -33,7 +33,7 @@ public class DateEntity { ...@@ -33,7 +33,7 @@ public class DateEntity {
return description; return description;
} }
public boolean isAchieved(){ public boolean isarchived(){
return isAchieved; return isarchived;
} }
} }
\ No newline at end of file
...@@ -25,5 +25,6 @@ public interface DateNoreDAO { ...@@ -25,5 +25,6 @@ public interface DateNoreDAO {
@Update @Update
void updateDateNote(DateEntity dateEntity); 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);
} }
...@@ -11,13 +11,13 @@ import androidx.room.PrimaryKey; ...@@ -11,13 +11,13 @@ import androidx.room.PrimaryKey;
String title ; String title ;
@ColumnInfo(name = "description") @ColumnInfo(name = "description")
String txtBody; String txtBody;
@ColumnInfo(name = "achieved") @ColumnInfo(name = "archived")
boolean isAchieved; boolean isarchived;
public Note(String title , String txtBody , boolean isAchieved){ public Note(String title , String txtBody , boolean isarchived){
this.title = title; this.title = title;
this.txtBody = txtBody; this.txtBody = txtBody;
this.isAchieved = isAchieved; this.isarchived = isarchived;
} }
...@@ -33,7 +33,7 @@ import androidx.room.PrimaryKey; ...@@ -33,7 +33,7 @@ import androidx.room.PrimaryKey;
return txtBody; return txtBody;
} }
public boolean isAchieved(){ public boolean isarchived(){
return isAchieved; return isarchived;
} }
} }
...@@ -23,8 +23,9 @@ public interface NoteDAO { ...@@ -23,8 +23,9 @@ public interface NoteDAO {
void deleteNote(Note myNote); void deleteNote(Note myNote);
@Query("UPDATE Note SET title = :title , description = :description ,achieved = :isAchieved Where ID = :id") @Query("UPDATE Note SET title = :title , description = :description ,archived = :isarchived Where ID = :id")
void updateNote(String title , String description , boolean isAchieved , int id); void updateNote(String title , String description , boolean isarchived , int id);
} }
\ No newline at end of file
...@@ -21,7 +21,6 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi ...@@ -21,7 +21,6 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
this.notes = notes; this.notes = notes;
} }
@NonNull
@Override @Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_allnotes_item, parent, false); 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 ...@@ -32,7 +31,7 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
public void onBindViewHolder(ViewHolder holder, int position) { public void onBindViewHolder(ViewHolder holder, int position) {
holder.titleTV.setText(notes.get(position).getTitle()); holder.titleTV.setText(notes.get(position).getTitle());
holder.descriptionTV.setText(notes.get(position).getDescription()); holder.descriptionTV.setText(notes.get(position).getDescription());
holder.isAchieved = notes.get(position).isAchieved(); holder.isarchived = notes.get(position).isarchived();
} }
@Override @Override
...@@ -46,13 +45,13 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi ...@@ -46,13 +45,13 @@ public class MyAllNotesAdaptor extends RecyclerView.Adapter<MyAllNotesAdaptor.Vi
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
protected TextView titleTV, descriptionTV; protected TextView titleTV, descriptionTV;
protected boolean isAchieved; protected boolean isarchived;
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
titleTV = itemView.findViewById(R.id.titleTv); titleTV = itemView.findViewById(R.id.titleTv);
descriptionTV = itemView.findViewById(R.id.descriptionTv); descriptionTV = itemView.findViewById(R.id.descriptionTv);
isAchieved = false; isarchived = false;
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this); itemView.setOnLongClickListener(this);
} }
......
...@@ -2,13 +2,15 @@ package com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView; ...@@ -2,13 +2,15 @@ package com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView;
public class MyNote { public class MyNote {
private String title , description ; private String title, description;
private boolean isAchieved; private boolean isarchived;
int id;
public MyNote(String title, String description, boolean isAchieved) { public MyNote(String title, String description, boolean isarchived, int id) {
this.title = title; this.title = title;
this.description = description; this.description = description;
this.isAchieved = isAchieved; this.isarchived = isarchived;
this.id = id;
} }
public String getTitle() { public String getTitle() {
...@@ -19,11 +21,15 @@ public class MyNote { ...@@ -19,11 +21,15 @@ public class MyNote {
return description; return description;
} }
public boolean isAchieved() { public boolean isarchived() {
return isAchieved; return isarchived;
} }
public void setAchieved(boolean achieved) { public void setarchived(boolean archived) {
isAchieved = achieved; isarchived = archived;
}
public int getId() {
return id;
} }
} }
...@@ -95,7 +95,7 @@ public class NoteFragment extends Fragment { ...@@ -95,7 +95,7 @@ public class NoteFragment extends Fragment {
noteDataBase.noteDao().insertNote(note); noteDataBase.noteDao().insertNote(note);
Toast.makeText(getActivity(), "saved", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "saved", Toast.LENGTH_SHORT).show();
}else { }else {
noteDataBase.noteDao().updateNote(titleTxt.getText().toString() , bodyTxt.getText().toString() , note.isAchieved() , note.getID()); noteDataBase.noteDao().updateNote(titleTxt.getText().toString() , bodyTxt.getText().toString() , note.isarchived() , note.getID());
Toast.makeText(getActivity(), "updated", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "updated", Toast.LENGTH_SHORT).show();
} }
} }
......
...@@ -12,8 +12,10 @@ import android.view.View; ...@@ -12,8 +12,10 @@ import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast;
import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity; 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.AllNotes.Note.NoteFragment;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.MyCalenderAdaptor; import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.MyCalenderAdaptor;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.OnCalenderItemClickListener; import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.OnCalenderItemClickListener;
...@@ -32,15 +34,15 @@ import static com.example.mynotepad.MainActivity.noteDataBase; ...@@ -32,15 +34,15 @@ import static com.example.mynotepad.MainActivity.noteDataBase;
public class MyCalenderActivity extends AppCompatActivity { public class MyCalenderActivity extends AppCompatActivity {
private FloatingActionButton addDateBtn; private FloatingActionButton addDateBtn;
private CustomToolbarOption customToolbarOption; private CustomToolbarOption customToolbarOption;
private FrameLayout calenderToolbar; private FrameLayout calenderToolbar;
private LinearLayout allDateListAndTitle; private LinearLayout allDateListAndTitle;
private FrameLayout fragPlace; private FrameLayout fragPlace;
private RecyclerView recyclerView; private RecyclerView recyclerView;
private MyCalenderAdaptor myAdaptor; private MyCalenderAdaptor myAdaptor;
private List<MyDate> myDates; private List<MyDate> myDates;
private List<DateEntity> entityDates; private List<DateEntity> entityDates;
private MyDate myChosenDateNote; private MyDate myChosenDateNote;
@Override @Override
...@@ -58,7 +60,7 @@ public class MyCalenderActivity extends AppCompatActivity { ...@@ -58,7 +60,7 @@ public class MyCalenderActivity extends AppCompatActivity {
private void init() { private void init() {
setAllNoteListAndTitles(); setAllDateNoteListAndTitles();
addDateBtn = findViewById(R.id.addDateButton); addDateBtn = findViewById(R.id.addDateButton);
customToolbarOption = findViewById(R.id.calenderCustomToolbarOption); customToolbarOption = findViewById(R.id.calenderCustomToolbarOption);
...@@ -114,20 +116,26 @@ public class MyCalenderActivity extends AppCompatActivity { ...@@ -114,20 +116,26 @@ public class MyCalenderActivity extends AppCompatActivity {
customToolbarOption.setVisibility(View.VISIBLE); customToolbarOption.setVisibility(View.VISIBLE);
calenderToolbar.setVisibility(View.GONE); calenderToolbar.setVisibility(View.GONE);
myChosenDateNote = myDate; myChosenDateNote = myDate;
if (myChosenDateNote.isarchived()){
customToolbarOption.setYellowStar();
}
else {
customToolbarOption.setBlackStar();
}
} }
}); });
//add listener to custom toolbar option and set being achieved or not to be saved in database //add listener to custom toolbar option and set being archived or not to be saved in database
customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() { customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() {
@Override @Override
public void onStarClicked(ImageView yellowS, ImageView blackS) { public void onStarClicked() {
starClicked(yellowS, blackS); starClicked();
} }
@Override @Override
public void onDeleteClicked(final ImageView imageView) { public void onDeleteClicked() {
deleteClicked(imageView); deleteClicked();
} }
...@@ -144,7 +152,7 @@ public class MyCalenderActivity extends AppCompatActivity { ...@@ -144,7 +152,7 @@ public class MyCalenderActivity extends AppCompatActivity {
calenderToolbar.setVisibility(View.VISIBLE); calenderToolbar.setVisibility(View.VISIBLE);
} }
private void deleteClicked(ImageView imageView) { private void deleteClicked() {
AlertDialog.Builder alert = new AlertDialog.Builder(MyCalenderActivity.this); AlertDialog.Builder alert = new AlertDialog.Builder(MyCalenderActivity.this);
alert.setMessage("are you sure you wanna delete it ??? "); alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() { alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
...@@ -164,31 +172,36 @@ public class MyCalenderActivity extends AppCompatActivity { ...@@ -164,31 +172,36 @@ public class MyCalenderActivity extends AppCompatActivity {
calenderToolbar.setVisibility(View.VISIBLE); calenderToolbar.setVisibility(View.VISIBLE);
} }
private void starClicked(ImageView yellowS, ImageView blackS) { private void starClicked() {
if (yellowS.getVisibility() == View.VISIBLE) { if (myChosenDateNote.isarchived()) {
yellowS.setVisibility(View.GONE); customToolbarOption.setBlackStar();
blackS.setVisibility(View.VISIBLE); myChosenDateNote.setarchived(false);
myChosenDateNote.setAchieved(false); updatearchivedDatesInDataBase();
Toast.makeText(this, "unarchived", Toast.LENGTH_SHORT).show();
} else { } else {
yellowS.setVisibility(View.VISIBLE); customToolbarOption.setYellowStar();
blackS.setVisibility(View.GONE); myChosenDateNote.setarchived(true);
myChosenDateNote.setAchieved(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() { private void addNewDateAndDescription() {
Intent intent = new Intent(MyCalenderActivity.this, DatePickerActivity.class); Intent intent = new Intent(MyCalenderActivity.this, DatePickerActivity.class);
startActivity(intent); startActivity(intent);
} }
private void setAllNoteListAndTitles() { private void setAllDateNoteListAndTitles() {
myDates = new ArrayList<>();
//get data from database to set in recyclerView //get data from database to set in recyclerView
entityDates = noteDataBase.dateNoreDAO().getAllDateNotes(); entityDates = noteDataBase.dateNoreDAO().getAllDateNotes();
myDates = new ArrayList<>(); myDates = new ArrayList<>();
for (DateEntity dateEntity : entityDates) { for (DateEntity dateEntity : entityDates) {
MyDate myDate = new MyDate(dateEntity.getDate(), dateEntity.getDescription(), dateEntity.isAchieved()); MyDate myDate = new MyDate(dateEntity.getDate(), dateEntity.getDescription(), dateEntity.isarchived(), dateEntity.getID());
myDates.add(myDate); myDates.add(myDate);
} }
} }
......
...@@ -32,7 +32,7 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca ...@@ -32,7 +32,7 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca
public void onBindViewHolder(@NonNull CalenderViewHolder holder, int position) { public void onBindViewHolder(@NonNull CalenderViewHolder holder, int position) {
holder.dateTV.setText(dates.get(position).getDate()); holder.dateTV.setText(dates.get(position).getDate());
holder.descriptionTV.setText(dates.get(position).getDescription()); holder.descriptionTV.setText(dates.get(position).getDescription());
holder.isAchieved = dates.get(position).isAchieved(); holder.isarchived = dates.get(position).isarchived();
} }
@Override @Override
...@@ -46,13 +46,13 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca ...@@ -46,13 +46,13 @@ public class MyCalenderAdaptor extends RecyclerView.Adapter<MyCalenderAdaptor.Ca
class CalenderViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { class CalenderViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
protected TextView dateTV, descriptionTV; protected TextView dateTV, descriptionTV;
protected boolean isAchieved; protected boolean isarchived;
public CalenderViewHolder(@NonNull View itemView) { public CalenderViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
dateTV = itemView.findViewById(R.id.titleTv); dateTV = itemView.findViewById(R.id.titleTv);
descriptionTV = itemView.findViewById(R.id.descriptionTv); descriptionTV = itemView.findViewById(R.id.descriptionTv);
isAchieved = false; isarchived = false;
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this); itemView.setOnLongClickListener(this);
} }
......
...@@ -3,12 +3,14 @@ package com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimeP ...@@ -3,12 +3,14 @@ package com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimeP
public class MyDate { public class MyDate {
private String date , description ; private String date , description ;
private boolean isAchieved; private boolean isarchived;
int id;
public MyDate(String date, String description, boolean isAchieved) { public MyDate(String date, String description, boolean isarchived , int id) {
this.date = date; this.date = date;
this.description = description; this.description = description;
this.isAchieved = isAchieved; this.isarchived = isarchived;
this.id = id;
} }
public String getDate() { public String getDate() {
...@@ -19,11 +21,15 @@ public class MyDate { ...@@ -19,11 +21,15 @@ public class MyDate {
return description; return description;
} }
public boolean isAchieved() { public boolean isarchived() {
return isAchieved; return isarchived;
} }
public void setAchieved(boolean achieved) { public void setarchived(boolean archived) {
isAchieved = achieved; isarchived = archived;
}
public int getId() {
return id;
} }
} }
...@@ -30,7 +30,6 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis ...@@ -30,7 +30,6 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis
yellowStarImg = findViewById(R.id.yellow_star); yellowStarImg = findViewById(R.id.yellow_star);
deleteImg = findViewById(R.id.deleteImg); deleteImg = findViewById(R.id.deleteImg);
closeImg = findViewById(R.id.closeImg); closeImg = findViewById(R.id.closeImg);
//todo setStarColor();
yellowStarImg.setOnClickListener(this); yellowStarImg.setOnClickListener(this);
blackStarImg.setOnClickListener(this); blackStarImg.setOnClickListener(this);
...@@ -39,16 +38,6 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis ...@@ -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 @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -56,13 +45,32 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis ...@@ -56,13 +45,32 @@ public class CustomToolbarOption extends LinearLayout implements View.OnClickLis
if (view.getId() == closeImg.getId()) if (view.getId() == closeImg.getId())
customToolbarOptionListener.onCloseClicked(); customToolbarOptionListener.onCloseClicked();
if (view.getId() == deleteImg.getId()) if (view.getId() == deleteImg.getId())
customToolbarOptionListener.onDeleteClicked(deleteImg); customToolbarOptionListener.onDeleteClicked();
if (view.getId() == yellowStarImg.getId() || view.getId() == blackStarImg.getId()) if (view.getId() == yellowStarImg.getId() || view.getId() == blackStarImg.getId())
customToolbarOptionListener.onStarClicked(yellowStarImg , blackStarImg); customToolbarOptionListener.onStarClicked();
} }
} }
public void setCustomToolbarOptionListener(CustomToolbarOptionListener customToolbarOptionListener) { public void setCustomToolbarOptionListener(CustomToolbarOptionListener customToolbarOptionListener) {
this.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);
}
} }
package com.example.mynotepad.MenuFeatures; package com.example.mynotepad.MenuFeatures;
import android.widget.ImageView;
public interface CustomToolbarOptionListener { public interface CustomToolbarOptionListener {
void onStarClicked(ImageView yellowS , ImageView blackS); void onStarClicked();
void onDeleteClicked(ImageView imageView); void onDeleteClicked();
void onCloseClicked(); void onCloseClicked();
} }
...@@ -105,19 +105,20 @@ public class VoiceMassagesActivity extends AppCompatActivity { ...@@ -105,19 +105,20 @@ public class VoiceMassagesActivity extends AppCompatActivity {
@Override @Override
public void onItemLongClicked(MyVoice item) { public void onItemLongClicked(MyVoice item) {
customToolbarOption.setVisibility(View.VISIBLE); customToolbarOption.setVisibility(View.VISIBLE);
customToolbarOption.hideStar();
myChosenVoice = item; myChosenVoice = item;
} }
}); });
//add listener to custom toolbar option and set being achieved or not to be saved in database //add listener to custom toolbar option and set being archived or not to be saved in database
customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() { customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() {
@Override @Override
public void onStarClicked(ImageView yellowS, ImageView blackS) { public void onStarClicked() {
} }
@Override @Override
public void onDeleteClicked(final ImageView imageView) { public void onDeleteClicked() {
deleteClicked(imageView); deleteClicked();
} }
@Override @Override
...@@ -127,7 +128,7 @@ public class VoiceMassagesActivity extends AppCompatActivity { ...@@ -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); AlertDialog.Builder alert = new AlertDialog.Builder(VoiceMassagesActivity.this);
alert.setMessage("are you sure you wanna delete it ??? "); alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() { alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MenuFeatures.AllAchievedNotes.AchivedNotesActivity"> tools:context=".MenuFeatures.AllarchivedNotes.archivedNotesActivity">
</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
...@@ -99,14 +99,14 @@ ...@@ -99,14 +99,14 @@
<TextView <TextView
android:id="@+id/achievedTxt" android:id="@+id/archivedTxt"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_weight="6" android:layout_weight="6"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/achieved" android:text="@string/archived"
android:textSize="20dp" /> android:textSize="20dp" />
<TextView <TextView
......
<resources> <resources>
<string name="app_name">MyNotepad</string> <string name="app_name">MyNotepad</string>
<string name="setting">setting</string> <string name="setting">setting</string>
<string name="achieved">achieved</string>
<string name="all_notes">all notes</string> <string name="all_notes">all notes</string>
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title">title</string> <string name="title">title</string>
...@@ -12,4 +11,5 @@ ...@@ -12,4 +11,5 @@
<string name="date">date</string> <string name="date">date</string>
<string name="chosendate">chosenDate</string> <string name="chosendate">chosenDate</string>
<string name="dots">...</string> <string name="dots">...</string>
<string name="archived">archived</string>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment