Commit 00410a7c authored by 9731301's avatar 9731301

add some changes

parent c7d4b10e
......@@ -12,7 +12,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MenuFeatures.VoiceMassages.RecorderActivity"></activity>
<activity android:name=".MenuFeatures.Calender.MyCalenderRecyclerView.TimePicker.DatePickerActivity" />
<activity android:name=".MenuFeatures.Calender.MyCalenderActivity" />
<activity android:name=".MenuFeatures.VoiceMassages.VoiceMassagesActivity" />
......
......@@ -42,7 +42,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
}
private void init() {
noteDataBase = Room.databaseBuilder(this, NoteDataBase.class, "RoomDb").allowMainThreadQueries().build();
noteDataBase = Room.databaseBuilder(this, NoteDataBase.class, "RoomDb").fallbackToDestructiveMigration().allowMainThreadQueries().build();
customMenu = findViewById(R.id.mainListItem);
customMenu.setVisibility(customMenu.GONE);
wlcTxt = findViewById(R.id.wlcTxt);
......
......@@ -206,7 +206,14 @@ public class AllNotesListFragment extends Fragment {
}
private void showABlankNote() {
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment);
//set noteFragment data
final Bundle bundle = new Bundle();
bundle.putString("title", "");
bundle.putString("bodyTxt","");
bundle.putString("type" , "note");
//change the fragment
navController.navigate(R.id.action_allNotesListFragment_to_noteFragment ,bundle);
}
......
......@@ -59,14 +59,13 @@ public class NoteFragment extends Fragment {
back = view.findViewById(R.id.backBtn);
titleTxt = view.findViewById(R.id.myTitle);
bodyTxt = view.findViewById(R.id.textBody);
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (titleTxt.getText().length()!=0&&bodyTxt.getText().length()!=0)
showAlert();
}
});
}
......@@ -132,8 +131,14 @@ public class NoteFragment extends Fragment {
private void setTitleAndBodyTxt() {
Bundle bundle = getArguments();
isAnewNote = false;
if (bundle != null) {
if (bundle != null)
if (bundle.getString("title").equals("") && bundle.getString("bodyTxt").equals("")){
isAnewNote = true;
type = bundle.getString("type");
}
else {
isAnewNote = false;
titleTxt.setText(bundle.getString("title"));
bodyTxt.setText(bundle.getString("bodyTxt"));
type = bundle.getString("type");
......
......@@ -129,7 +129,7 @@ public class RecordFragment extends Fragment implements View.OnClickListener {
file.mkdirs();//create a the folders if it does not exists
}
fileName = new SimpleDateFormat("yyyy_MM_dd_hh_mm_ss" , Locale.CANADA).format(new Date()) + ".mp3";
Log.d("filename", root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios/" + fileName);
Log.e("filename", root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios/" + fileName);
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
......@@ -139,18 +139,22 @@ public class RecordFragment extends Fragment implements View.OnClickListener {
try {
mRecorder.prepare();
if (mRecorder!=null)
mRecorder.start();
chronometer.setBase(SystemClock.elapsedRealtime());// to start from 00:00
chronometer.start();
} catch (IOException e) {
e.printStackTrace();
Log.e("IOException",e.getMessage()+"");
}
mRecorder.start();
chronometer.setBase(SystemClock.elapsedRealtime());// to start from 00:00
chronometer.start();
}
private void stopRecording() {
mRecorder.stop();
mRecorder.release();
if (mRecorder!=null)
{ mRecorder.stop();
mRecorder.release();}
mRecorder = null;
chronometer.stop();
chronometer.setBase(SystemClock.elapsedRealtime());
......
......@@ -46,12 +46,11 @@
<TextView
android:id="@+id/wlcTxt"
android:layout_width="211dp"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="73dp"
android:layout_above="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_marginTop="173dp"
android:layout_marginBottom="37dp" />
android:layout_marginBottom="30dp"/>
</RelativeLayout>
......
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