Commit 91785dd1 authored by 9731301's avatar 9731301

add voiceMassages

parent ffa0cd7d
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mynotepad"> package="com.example.mynotepad">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
...@@ -12,7 +15,7 @@ ...@@ -12,7 +15,7 @@
<activity android:name=".MenuFeatures.VoiceMassages.RecorderActivity"></activity> <activity android:name=".MenuFeatures.VoiceMassages.RecorderActivity"></activity>
<activity android:name=".MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.DatePickerActivity" /> <activity android:name=".MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.DatePickerActivity" />
<activity android:name=".MenuFeatures.Calender.MyCalenderActivity" /> <activity android:name=".MenuFeatures.Calender.MyCalenderActivity" />
<activity android:name=".MenuFeatures.VoiceMassages.VoiceMassages" /> <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.AllAchievedNotes.AchivedNotesActivity" />
<activity android:name=".MenuFeatures.Setting.SettingActivity" /> <activity android:name=".MenuFeatures.Setting.SettingActivity" />
......
...@@ -3,6 +3,7 @@ package com.example.mynotepad; ...@@ -3,6 +3,7 @@ package com.example.mynotepad;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.room.Room; import androidx.room.Room;
import android.animation.ObjectAnimator;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
...@@ -10,7 +11,7 @@ import android.widget.ImageView; ...@@ -10,7 +11,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.example.mynotepad.Menu.CustomMenu; import com.example.mynotepad.Menu.CustomMenu;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.NoteDataBase; import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.NoteDataBase;
import com.example.mynotepad.MenuFeatures.Information.InfoClickListener; import com.example.mynotepad.MenuFeatures.Information.InfoClickListener;
import com.example.mynotepad.MenuFeatures.Information.Information; import com.example.mynotepad.MenuFeatures.Information.Information;
...@@ -21,6 +22,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe ...@@ -21,6 +22,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
private TextView wlcTxt; private TextView wlcTxt;
private Information informationView; private Information informationView;
public static NoteDataBase noteDataBase; public static NoteDataBase noteDataBase;
private ObjectAnimator objectAnimator;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -52,10 +54,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe ...@@ -52,10 +54,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
findViewById(R.id.main).setOnClickListener(this); findViewById(R.id.main).setOnClickListener(this);
customMenu.setOnClickListener(this); customMenu.setOnClickListener(this);
objectAnimator = ObjectAnimator.ofFloat(customMenu , "x" , 400);
customMenu.setInfoClickListener(new InfoClickListener() { customMenu.setInfoClickListener(new InfoClickListener() {
@Override @Override
public void onInfoTvClicked(TextView infoTv) { public void onInfoTvClicked(TextView infoTv) {
informationView.setVisibility(View.VISIBLE); informationView.setVisibility(View.VISIBLE);
} }
}); });
} }
...@@ -64,6 +68,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe ...@@ -64,6 +68,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (view.getId() == toolbarListImg.getId() || customMenu.getId() == view.getId()) { if (view.getId() == toolbarListImg.getId() || customMenu.getId() == view.getId()) {
objectAnimator.setDuration(2000);
objectAnimator.start();
customMenu.setVisibility(customMenu.VISIBLE); customMenu.setVisibility(customMenu.VISIBLE);
informationView.setVisibility(View.GONE); informationView.setVisibility(View.GONE);
} else if (R.id.main == view.getId()) { } else if (R.id.main == view.getId()) {
......
...@@ -13,7 +13,7 @@ import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity; ...@@ -13,7 +13,7 @@ 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;
import com.example.mynotepad.MenuFeatures.Setting.SettingActivity; import com.example.mynotepad.MenuFeatures.Setting.SettingActivity;
import com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassages; import com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesActivity;
import com.example.mynotepad.R; import com.example.mynotepad.R;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
...@@ -73,7 +73,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener { ...@@ -73,7 +73,7 @@ public class CustomMenu extends LinearLayout implements View.OnClickListener {
} }
private void showVoiceMassages() { private void showVoiceMassages() {
Intent intent = new Intent(getContext(), VoiceMassages.class); Intent intent = new Intent(getContext(), VoiceMassagesActivity.class);
getContext().startActivity(intent); getContext().startActivity(intent);
} }
......
...@@ -5,7 +5,6 @@ import androidx.fragment.app.Fragment; ...@@ -5,7 +5,6 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.room.Room;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -15,13 +14,11 @@ import android.widget.FrameLayout; ...@@ -15,13 +14,11 @@ import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.example.mynotepad.MainActivity;
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;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.OnAllNotesItemClickListener; import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.OnAllNotesItemClickListener;
import com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment; import com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.Note; import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.Note;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.NoteDataBase;
import com.example.mynotepad.MenuFeatures.CustomToolbarOption; import com.example.mynotepad.MenuFeatures.CustomToolbarOption;
import com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener; import com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener;
import com.example.mynotepad.R; import com.example.mynotepad.R;
...@@ -45,8 +42,7 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -45,8 +42,7 @@ public class AllNotesActivity extends AppCompatActivity {
private MyAllNotesAdaptor myAdaptor; private MyAllNotesAdaptor myAdaptor;
private List<Note> entityNotes; private List<Note> entityNotes;
private List<MyNote> myNotes; private List<MyNote> myNotes;
public static MyNote myChosenNote; private static MyNote myChosenNote;
public static HashMap<MyNote , Note> myNoteNoteHashMap;
...@@ -58,7 +54,7 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -58,7 +54,7 @@ public class AllNotesActivity extends AppCompatActivity {
} }
private void init() { private void init() {
// get data from databas // get data from database
setAllNoteListAndTitles(); setAllNoteListAndTitles();
customToolbarOption = findViewById(R.id.customToolbarOption); customToolbarOption = findViewById(R.id.customToolbarOption);
...@@ -213,13 +209,11 @@ public class AllNotesActivity extends AppCompatActivity { ...@@ -213,13 +209,11 @@ public class AllNotesActivity extends AppCompatActivity {
private void setAllNoteListAndTitles() { private void setAllNoteListAndTitles() {
myNoteNoteHashMap = new HashMap<>();
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.isAchieved());
myNotes.add(myNote); myNotes.add(myNote);
myNoteNoteHashMap.put(myNote , note);
} }
} }
......
package com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase; package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;
import androidx.room.ColumnInfo; import androidx.room.ColumnInfo;
import androidx.room.Entity; import androidx.room.Entity;
......
package com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase; package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;
import androidx.room.Dao; import androidx.room.Dao;
import androidx.room.Delete; import androidx.room.Delete;
......
package com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase; package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;
import androidx.room.ColumnInfo; import androidx.room.ColumnInfo;
import androidx.room.Entity; import androidx.room.Entity;
......
package com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase; package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;
import androidx.room.Dao; import androidx.room.Dao;
import androidx.room.Delete; import androidx.room.Delete;
...@@ -22,8 +22,9 @@ public interface NoteDAO { ...@@ -22,8 +22,9 @@ public interface NoteDAO {
@Delete @Delete
void deleteNote(Note myNote); void deleteNote(Note myNote);
@Update
void updateNote(Note note); @Query("UPDATE Note SET title = :title , description = :description ,achieved = :isAchieved Where ID = :id")
void updateNote(String title , String description , boolean isAchieved , int id);
} }
\ No newline at end of file
package com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase; package com.example.mynotepad.MenuFeatures.AllNotes.DataBase;
import androidx.room.Database; import androidx.room.Database;
import androidx.room.RoomDatabase; import androidx.room.RoomDatabase;
......
...@@ -15,7 +15,7 @@ import android.widget.EditText; ...@@ -15,7 +15,7 @@ import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity; import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.Note; import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.Note;
import com.example.mynotepad.R; import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
...@@ -95,8 +95,7 @@ public class NoteFragment extends Fragment { ...@@ -95,8 +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 {
note = AllNotesActivity.myNoteNoteHashMap.get(AllNotesActivity.myChosenNote); noteDataBase.noteDao().updateNote(titleTxt.getText().toString() , bodyTxt.getText().toString() , note.isAchieved() , note.getID());
noteDataBase.noteDao().updateNote(note);
Toast.makeText(getActivity(), "updated", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "updated", Toast.LENGTH_SHORT).show();
} }
} }
......
...@@ -13,8 +13,8 @@ import android.widget.FrameLayout; ...@@ -13,8 +13,8 @@ import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity;
import com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment; import com.example.mynotepad.MenuFeatures.AllNotes.Note.NoteFragment;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.DateEntity;
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;
import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.DatePickerActivity; import com.example.mynotepad.MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.DatePickerActivity;
...@@ -32,15 +32,15 @@ import static com.example.mynotepad.MainActivity.noteDataBase; ...@@ -32,15 +32,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
......
...@@ -12,9 +12,8 @@ import android.widget.Toast; ...@@ -12,9 +12,8 @@ import android.widget.Toast;
import com.alirezaafkar.sundatepicker.DatePicker; import com.alirezaafkar.sundatepicker.DatePicker;
import com.alirezaafkar.sundatepicker.interfaces.DateSetListener; import com.alirezaafkar.sundatepicker.interfaces.DateSetListener;
import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity;
import com.example.mynotepad.MenuFeatures.Calender.Date; import com.example.mynotepad.MenuFeatures.Calender.Date;
import com.example.mynotepad.MenuFeatures.AllNotes.NotesDataBase.DateEntity; import com.example.mynotepad.MenuFeatures.AllNotes.DataBase.DateEntity;
import com.example.mynotepad.R; import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
......
package com.example.mynotepad.MenuFeatures.VoiceMassages;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class VoiceMassages extends AppCompatActivity {
private FloatingActionButton allVoiceBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_voice_massages);
init();
}
private void init() {
allVoiceBtn = findViewById(R.id.addVoiceButton);
addListener();
}
private void addListener() {
allVoiceBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(VoiceMassages.this , RecorderActivity.class);
startActivity(intent);
}
});
}
}
\ No newline at end of file
package com.example.mynotepad.MenuFeatures.VoiceMassages;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import com.example.mynotepad.MenuFeatures.AllNotes.AllNotesActivity;
import com.example.mynotepad.MenuFeatures.CustomToolbarOption;
import com.example.mynotepad.MenuFeatures.CustomToolbarOptionListener;
import com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView.MyVoice;
import com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView.OnVoiceMassageClickListener;
import com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView.VoiceAdaptor;
import com.example.mynotepad.R;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.io.File;
import java.util.ArrayList;
import static com.example.mynotepad.MainActivity.noteDataBase;
public class VoiceMassagesActivity extends AppCompatActivity {
private FloatingActionButton allVoiceBtn;
private RecyclerView recyclerViewRecordings;
private VoiceAdaptor recordingAdapter;
private ArrayList<MyVoice> myVoiceArrayList;
private CustomToolbarOption customToolbarOption;
private MyVoice myChosenVoice;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_voice_massages);
init();
fetchRecordings();
addListener();
}
/* @Override
protected void onResume() {
super.onResume();
init();
}*/
private void init() {
customToolbarOption = findViewById(R.id.customToolbarOption);
customToolbarOption.setVisibility(View.GONE);
myVoiceArrayList = new ArrayList<>();
allVoiceBtn = findViewById(R.id.addVoiceButton);
/** enabling back button ***/
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
/** setting up recyclerView **/
recyclerViewRecordings = findViewById(R.id.recyclerView);
recyclerViewRecordings.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
recyclerViewRecordings.setHasFixedSize(true);
}
private void fetchRecordings() {
File root = android.os.Environment.getExternalStorageDirectory();
String path = root.getAbsolutePath() + "/VoiceRecorderSimplifiedCoding/Audios";
Log.d("Files", "Path: " + path);
File directory = new File(path);
File[] files = directory.listFiles();
// Log.d("Files", "Size: " + files.length);
if (files != null) {
for (int i = 0; i < files.length; i++) {
Log.d("Files", "FileName:" + files[i].getName());
String fileName = files[i].getName();
String recordingUri = root.getAbsolutePath() + "/VoiceRecorderSimplifiedCoding/Audios/" + fileName;
MyVoice myVoice = new MyVoice(recordingUri, fileName, false);
myVoiceArrayList.add(myVoice);
}
}
recordingAdapter = new VoiceAdaptor(this, myVoiceArrayList);
recyclerViewRecordings.setAdapter(recordingAdapter);
}
private void addListener() {
allVoiceBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(VoiceMassagesActivity.this, RecorderActivity.class);
startActivity(intent);
}
});
recordingAdapter.setOnVoiceMassageClickListener(new OnVoiceMassageClickListener() {
@Override
public void onItemLongClicked(MyVoice item) {
customToolbarOption.setVisibility(View.VISIBLE);
myChosenVoice = item;
}
});
//add listener to custom toolbar option and set being achieved or not to be saved in database
customToolbarOption.setCustomToolbarOptionListener(new CustomToolbarOptionListener() {
@Override
public void onStarClicked(ImageView yellowS, ImageView blackS) {
}
@Override
public void onDeleteClicked(final ImageView imageView) {
deleteClicked(imageView);
}
@Override
public void onCloseClicked() {
customToolbarOption.setVisibility(View.GONE);
}
});
}
private void deleteClicked(ImageView imageView) {
AlertDialog.Builder alert = new AlertDialog.Builder(VoiceMassagesActivity.this);
alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
myVoiceArrayList.remove(myChosenVoice);
System.out.println(myChosenVoice.getFileName() +" "+myChosenVoice.getUri() );
new File(myChosenVoice.getFileName()).delete();
init();
fetchRecordings();
addListener();
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
});
alert.show();
}
}
package com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView;
public class MyVoice {
String Uri, fileName;
boolean isPlaying = false;
public MyVoice(String uri, String fileName, boolean isPlaying) {
Uri = uri;
this.fileName = fileName;
this.isPlaying = isPlaying;
}
public String getUri() {
return Uri;
}
public String getFileName() {
return fileName;
}
public boolean isPlaying() {
return isPlaying;
}
public void setPlaying(boolean playing) {
this.isPlaying = playing;
}
}
package com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView;
import com.example.mynotepad.MenuFeatures.AllNotes.MyNoteRecyclerView.MyNote;
public interface OnVoiceMassageClickListener {
void onItemLongClicked(MyVoice item);
}
package com.example.mynotepad.MenuFeatures.VoiceMassages.VoiceMassagesRecyclerView;
import android.content.Context;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Handler;
import android.transition.TransitionManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import com.example.mynotepad.R;
import java.io.IOException;
import java.util.ArrayList;
public class VoiceAdaptor extends RecyclerView.Adapter<VoiceAdaptor.VoiceViewHolder> {
private Context context;
private ArrayList<MyVoice> myVoiceArrayList;
private MediaPlayer mPlayer;
private boolean isPlaying = false;
private int last_index = -1;
private OnVoiceMassageClickListener onVoiceMassageClickListener;
public VoiceAdaptor(Context context, ArrayList<MyVoice> myVoiceArrayList) {
this.context = context;
this.myVoiceArrayList = myVoiceArrayList;
}
@NonNull
@Override
public VoiceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.custom_voice_item, parent, false);
return new VoiceViewHolder(view);
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void onBindViewHolder(@NonNull VoiceViewHolder holder, int position) {
setUpData(holder, position);
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void setUpData(VoiceViewHolder holder, int position) {
MyVoice myVoice = myVoiceArrayList.get(position);
holder.textViewName.setText(myVoice.getFileName());
if (myVoice.isPlaying()) {
holder.imageViewStop.setVisibility(View.VISIBLE);
holder.imageViewPlay.setVisibility(View.GONE);
TransitionManager.beginDelayedTransition((ViewGroup) holder.itemView);
holder.seekBar.setVisibility(View.VISIBLE);
holder.seekUpdation(holder);
} else {
holder.imageViewStop.setVisibility(View.GONE);
holder.imageViewPlay.setVisibility(View.VISIBLE);
TransitionManager.beginDelayedTransition((ViewGroup) holder.itemView);
holder.seekBar.setVisibility(View.GONE);
}
holder.manageSeekBar(holder);
}
@Override
public int getItemCount() {
return myVoiceArrayList.size();
}
public void setOnVoiceMassageClickListener(OnVoiceMassageClickListener onVoiceMassageClickListener) {
this.onVoiceMassageClickListener = onVoiceMassageClickListener;
}
class VoiceViewHolder extends RecyclerView.ViewHolder implements View.OnLongClickListener {
FrameLayout startStopBtn;
ImageView imageViewPlay, imageViewStop;
SeekBar seekBar;
TextView textViewName;
private String recordingUri;
private Handler mHandler = new Handler();
VoiceViewHolder holder;
public VoiceViewHolder(View itemView) {
super(itemView);
imageViewPlay = itemView.findViewById(R.id.playImg);
imageViewStop = itemView.findViewById(R.id.pauseImg);
seekBar = itemView.findViewById(R.id.seekBar);
textViewName = itemView.findViewById(R.id.voiceName);
startStopBtn = itemView.findViewById(R.id.start_stopBtn);
imageViewStop.setVisibility(View.GONE);
itemView.setOnLongClickListener(this);
/*
add clickListener to stop or start playing
*/
startStopBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int position = getAdapterPosition();
MyVoice myVoice = myVoiceArrayList.get(position);
recordingUri = myVoice.getUri();
//if media player is playing
if (isPlaying) {
stopPlaying();
//if another clicked item (your last chosen item) is playing and you click on it again to stop it
if (position == last_index) {
myVoice.setPlaying(false);
stopPlaying();
notifyItemChanged(position);
}
// if you click on another item while your last one(your last chosen item) is playing
else {
markAllPaused();
myVoice.setPlaying(true);
notifyItemChanged(position);
startPlaying(myVoice, position);
last_index = position;// set the last playing item on the one which is playing
}
}
//if media player is not playing
else {
//if clicked item is playing it is wrong so it should be stopped
if (myVoice.isPlaying()) {
myVoice.setPlaying(false);
stopPlaying();
Log.d("isPlayin", "True");
}
//if nothing is playing and you want to play a new voice massage
else {
startPlaying(myVoice, position);
myVoice.setPlaying(true);
seekBar.setMax(mPlayer.getDuration());
Log.d("isPlayin", "False");
}
notifyItemChanged(position);
last_index = position;// set the last playing item on the one which is playing
}
}
});
}
public void manageSeekBar(VoiceViewHolder holder) {
holder.seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (mPlayer != null && fromUser) {
mPlayer.seekTo(progress);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
Runnable runnable = new Runnable() {
@Override
public void run() {
seekUpdation(holder);
}
};
private void seekUpdation(VoiceViewHolder holder) {
this.holder = holder;
if (mPlayer != null) {
int mCurrentPosition = mPlayer.getCurrentPosition();
holder.seekBar.setMax(mPlayer.getDuration());
holder.seekBar.setProgress(mCurrentPosition);
}
mHandler.postDelayed(runnable, 100);
}
private void stopPlaying() {
try {
mPlayer.release();
} catch (Exception e) {
e.printStackTrace();
}
mPlayer = null;
isPlaying = false;
}
private void startPlaying(final MyVoice audio, final int position) {
mPlayer = new MediaPlayer();
try {
mPlayer.setDataSource(recordingUri);
mPlayer.prepare();
mPlayer.start();
} catch (IOException e) {
Log.e("LOG_TAG", "prepare() failed");
}
//showing the pause button
seekBar.setMax(mPlayer.getDuration());
isPlaying = true;
mPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
audio.setPlaying(false);
notifyItemChanged(position);
}
});
}
@Override
public boolean onLongClick(View view) {
if (onVoiceMassageClickListener != null)
onVoiceMassageClickListener.onItemLongClicked(myVoiceArrayList.get(getAdapterPosition()));
return true;
}
}
/*
* set all voice items on pause and stop all of them
*/
private void markAllPaused() {
for (int i = 0; i < myVoiceArrayList.size(); i++) {
myVoiceArrayList.get(i).setPlaying(false);
myVoiceArrayList.set(i, myVoiceArrayList.get(i));
}
notifyDataSetChanged();
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#ABE60C25"/>
<stroke
android:width="10dp"
android:color="#F0A84F4F"/>
<corners android:radius="0dp"/>
</shape>
\ No newline at end of file
...@@ -54,25 +54,34 @@ ...@@ -54,25 +54,34 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <RelativeLayout
android:id="@+id/recyclerView" android:layout_width="match_parent"
android:layout_width="409dp" android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#4883B5DD" <androidx.recyclerview.widget.RecyclerView
tools:layout_editor_absoluteX="1dp" android:id="@+id/recyclerView"
tools:layout_editor_absoluteY="1dp" /> android:layout_width="409dp"
android:layout_height="match_parent"
android:background="#4883B5DD"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addNoteButton" android:id="@+id/addNoteButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="330dp" android:layout_alignParentRight="true"
android:layout_marginTop="480dp" android:layout_alignParentBottom="true"
android:clickable="true" android:layout_marginBottom="30dp"
android:src="@drawable/add" android:layout_marginRight="30dp"
app:backgroundTint="#5266D5" android:clickable="true"
tools:layout_editor_absoluteX="310dp" android:src="@drawable/add"
tools:layout_editor_absoluteY="612dp" /> app:backgroundTint="#5266D5"
tools:layout_editor_absoluteX="310dp"
tools:layout_editor_absoluteY="612dp"
android:layout_alignParentEnd="true"
android:focusable="true" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -73,18 +73,24 @@ ...@@ -73,18 +73,24 @@
android:layout_width="260dp" android:layout_width="260dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:gravity="top"
android:lines="9" android:lines="9"
android:textColor="#000000" /> android:textColor="#000000"
android:layout_marginStart="20dp" />
</LinearLayout> </LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/calenderBackBtn" android:id="@+id/calenderBackBtn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="330dp" android:layout_alignParentBottom="true"
android:layout_marginTop="520dp" android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:layout_marginBottom="30dp"
android:src="@drawable/ic_baseline_keyboard_backspace_24" android:src="@drawable/ic_baseline_keyboard_backspace_24"
app:backgroundTint="#DF4141" /> app:backgroundTint="#DF4141"
android:layout_marginEnd="30dp"
android:layout_alignParentEnd="true" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
android:layout_marginTop="-6dp" android:layout_marginTop="-6dp"
android:layout_marginEnd="-2dp" android:layout_marginEnd="-2dp"
android:layout_marginRight="-2dp" android:layout_marginRight="-2dp"
android:background="#4883B5DD"> android:background="@drawable/simple_color">
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/imageView"
......
...@@ -55,25 +55,32 @@ ...@@ -55,25 +55,32 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <RelativeLayout
android:id="@+id/calenderRecyclerView" android:layout_width="match_parent"
android:layout_width="409dp" android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#4883B5DD" <androidx.recyclerview.widget.RecyclerView
tools:layout_editor_absoluteX="1dp" android:id="@+id/calenderRecyclerView"
tools:layout_editor_absoluteY="1dp" /> android:layout_width="409dp"
android:layout_height="match_parent"
android:background="#4883B5DD"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addDateButton" android:id="@+id/addDateButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="330dp" android:layout_alignParentBottom="true"
android:layout_marginTop="480dp" android:layout_alignParentRight="true"
android:clickable="true" android:layout_marginRight="30dp"
android:src="@drawable/add" android:layout_marginBottom="30dp"
app:backgroundTint="#5266D5" android:clickable="true"
tools:layout_editor_absoluteX="310dp" android:src="@drawable/add"
tools:layout_editor_absoluteY="612dp" /> app:backgroundTint="#5266D5"
tools:layout_editor_absoluteX="310dp"
tools:layout_editor_absoluteY="612dp" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -15,6 +15,35 @@ ...@@ -15,6 +15,35 @@
android:scaleType="fitXY" android:scaleType="fitXY"
app:srcCompat="@drawable/index" /> app:srcCompat="@drawable/index" />
<LinearLayout
android:id="@+id/linearLayoutRecorder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="20dp"
android:orientation="vertical">
<Chronometer
android:id="@+id/chronometerTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="#016D91"
android:textSize="60sp" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:thumb="@android:drawable/presence_invisible" />
</LinearLayout>
<Button <Button
android:id="@+id/start_stopBtn" android:id="@+id/start_stopBtn"
android:layout_width="50dp" android:layout_width="50dp"
...@@ -24,26 +53,17 @@ ...@@ -24,26 +53,17 @@
android:layout_marginBottom="50dp" android:layout_marginBottom="50dp"
android:background="@drawable/start_stop_bg" /> android:background="@drawable/start_stop_bg" />
<FrameLayout <ImageView
android:layout_width="wrap_content" android:id="@+id/play_pause"
android:layout_height="wrap_content" android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="@id/start_stopBtn" android:layout_alignBottom="@id/start_stopBtn"
android:layout_marginRight="30dp" android:layout_marginRight="30dp"
android:layout_toLeftOf="@id/start_stopBtn"> android:layout_toLeftOf="@id/start_stopBtn"
android:src="@drawable/play" />
<ImageView
android:id="@+id/play"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/play"/>
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/pause"/>
</FrameLayout>
<FrameLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/start_stopBtn" android:layout_alignBottom="@id/start_stopBtn"
...@@ -54,8 +74,7 @@ ...@@ -54,8 +74,7 @@
android:id="@+id/saveVoice" android:id="@+id/saveVoice"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:src="@drawable/square" android:src="@drawable/square" />
/> </LinearLayout>
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".MenuFeatures.VoiceMassages.VoiceMassages"> tools:context=".MenuFeatures.VoiceMassages.VoiceMassagesActivity">
<FrameLayout <FrameLayout
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:enabled="false" android:enabled="false"
android:text="@string/all_notes" android:text="all voice massages"
android:textColor="#02091E" android:textColor="#02091E"
android:textSize="26dp" /> android:textSize="26dp" />
...@@ -45,24 +45,31 @@ ...@@ -45,24 +45,31 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <RelativeLayout
android:id="@+id/recyclerView" android:layout_width="match_parent"
android:layout_width="409dp" android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#4883B5DD" <androidx.recyclerview.widget.RecyclerView
tools:layout_editor_absoluteX="1dp" android:id="@+id/recyclerView"
tools:layout_editor_absoluteY="1dp" /> android:layout_width="409dp"
android:layout_height="match_parent"
android:background="#4883B5DD"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addVoiceButton" android:id="@+id/addVoiceButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="330dp" android:layout_alignParentRight="true"
android:layout_marginTop="480dp" android:layout_alignParentBottom="true"
android:clickable="true" android:layout_marginRight="30dp"
android:src="@drawable/add" android:layout_marginBottom="30dp"
app:backgroundTint="#5266D5" android:clickable="true"
tools:layout_editor_absoluteX="310dp" android:src="@drawable/add"
tools:layout_editor_absoluteY="612dp" /> app:backgroundTint="#5266D5"
tools:layout_editor_absoluteX="310dp"
tools:layout_editor_absoluteY="612dp" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:text="title" android:text="title"
android:textColor="#000A43" android:textColor="#000A43"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="80dp"
android:background="@drawable/row_bg" android:background="@drawable/row_bg">
android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/start_stopBtn" android:id="@+id/start_stopBtn"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="10dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="20dp"> android:layout_marginRight="20dp"
<Button android:layout_centerVertical="true"
android:background="@drawable/start_stop_bg">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/start_stop_bg" />
<ImageView <ImageView
android:id="@+id/playImg" android:id="@+id/playImg"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -26,17 +22,32 @@ ...@@ -26,17 +22,32 @@
<ImageView <ImageView
android:id="@+id/pauseImg" android:id="@+id/pauseImg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="37dp"
android:src="@drawable/pause"/> android:src="@drawable/pause" />
</FrameLayout> </FrameLayout>
<LinearLayout
<TextView
android:id="@+id/voiceName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_toLeftOf="@id/start_stopBtn" android:layout_toLeftOf="@id/start_stopBtn"
android:orientation="vertical">
<TextView
android:id="@+id/voiceName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:textSize="20dp" android:textSize="18dp"
android:text="fdsgrgr"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_marginLeft="10dp" /> android:layout_marginLeft="10dp" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="2"
android:thumb="@android:drawable/presence_invisible" />
</LinearLayout>
</RelativeLayout> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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"
...@@ -8,44 +8,62 @@ ...@@ -8,44 +8,62 @@
android:orientation="vertical"> android:orientation="vertical">
<EditText <RelativeLayout
android:id="@+id/myTitle" android:id="@+id/myTitleParent"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="50dp" android:layout_marginTop="5dp"
android:hint=" title" android:layout_marginRight="10dp"
android:textSize="24dp"
android:background="@drawable/title_background"/> android:background="@drawable/title_background">
<EditText
android:id="@+id/myTitle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint=" title"
android:textSize="24dp" />
</RelativeLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:id="@+id/myTitleParent2"
android:layout_below="@id/myTitleParent">
<EditText <RelativeLayout
android:id="@+id/textBody"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignTop="@+id/title" android:layout_alignTop="@+id/myTitleParent"
android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginBottom="3dp" android:layout_marginBottom="10dp"
android:background="@drawable/description_backgroung" android:background="@drawable/description_backgroung"
android:gravity="top" android:gravity="top">
android:hint=" ..."
android:lines="20" /> <EditText
android:id="@+id/textBody"
<com.google.android.material.floatingactionbutton.FloatingActionButton android:layout_width="match_parent"
android:id="@+id/backBtn" android:layout_height="match_parent"
android:layout_width="wrap_content" android:gravity="top"
android:layout_height="wrap_content" android:hint="@string/dots"
android:layout_marginLeft="330dp" android:layout_marginRight="10dp"
android:layout_marginTop="480dp" android:layout_marginLeft="10dp"/>
android:src="@drawable/ic_baseline_keyboard_backspace_24"
app:backgroundTint="#DF4141" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/backBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="30dp"
android:layout_marginBottom="30dp"
android:src="@drawable/ic_baseline_keyboard_backspace_24"
app:backgroundTint="#DF4141" />
</RelativeLayout>
</FrameLayout> </FrameLayout>
</LinearLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" /> <background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" /> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
...@@ -11,4 +11,5 @@ ...@@ -11,4 +11,5 @@
<string name="description">description</string> <string name="description">description</string>
<string name="date">date</string> <string name="date">date</string>
<string name="chosendate">chosenDate</string> <string name="chosendate">chosenDate</string>
<string name="dots">...</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