Commit 6ed5866a authored by 9731301's avatar 9731301

change the recorder structure to fragments and add animations

parent b9db25b6
......@@ -39,4 +39,11 @@ dependencies {
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//i added these parts just for voice recorder
def nav_version = "2.3.0"
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
implementation 'com.google.android.material:material:1.3.0-alpha03'
}
\ No newline at end of file
package com.example.mynotepad.MenuFeatures.VoiceMassages;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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.bottomsheet.BottomSheetBehavior;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import java.io.File;
import java.util.ArrayList;
public class AudioListFragment extends Fragment {
private ConstraintLayout playerSheet;
private BottomSheetBehavior bottomSheetBehavior;
private RecyclerView recyclerViewRecordings;
private VoiceAdaptor recordingAdapter;
private ArrayList<MyVoice> myVoiceArrayList;
private CustomToolbarOption customToolbarOption;
private MyVoice myChosenVoice;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_audio_list, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
init(view);
fetchRecordings();
addListener();
}
private void init(View v) {
playerSheet = v.findViewById(R.id.player_sheet);
bottomSheetBehavior = BottomSheetBehavior.from(playerSheet);
setBottomSheet();
customToolbarOption = v.findViewById(R.id.customToolbarOption);
customToolbarOption.setVisibility(View.GONE);
myVoiceArrayList = new ArrayList<>();
recyclerViewRecordings = v.findViewById(R.id.recyclerView);
recyclerViewRecordings.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
recyclerViewRecordings.setHasFixedSize(true);
}
private void fetchRecordings() {
File root = android.os.Environment.getExternalStorageDirectory();
String path = root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios";
Log.d("Files", "Path: " + path);
File directory = new File(path);
File[] files = directory.listFiles();
if (files != null) {
for (int i = 0; i < files.length; i++) {
String fileName = files[i].getName();
String recordingUri = root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios/" + fileName;
MyVoice myVoice = new MyVoice(recordingUri, fileName, false);
myVoiceArrayList.add(myVoice);
}
}
recordingAdapter = new VoiceAdaptor(getContext(), myVoiceArrayList);
recyclerViewRecordings.setAdapter(recordingAdapter);
}
private void setBottomSheet() {
bottomSheetBehavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN){//if it goes to the bottom of the screen
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);// in the first position that it used to be
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
});
}
private void addListener() {
recordingAdapter.setOnVoiceMassageClickListener(new OnVoiceMassageClickListener() {
@Override
public void onItemLongClicked(MyVoice item) {
customToolbarOption.setVisibility(View.VISIBLE);
customToolbarOption.hideStar();
myChosenVoice = item;
}
});
//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() {
}
@Override
public void onDeleteClicked() {
deleteClicked();
}
@Override
public void onCloseClicked() {
customToolbarOption.setVisibility(View.GONE);
}
});
}
private void deleteClicked() {
AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
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();
customToolbarOption.setVisibility(View.GONE);
recyclerViewRecordings.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
recyclerViewRecordings.setHasFixedSize(true);
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
});
alert.show();
}
}
\ No newline at end of file
package com.example.mynotepad.MenuFeatures.VoiceMassages;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.media.MediaRecorder;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import android.os.SystemClock;
import android.transition.TransitionManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Chronometer;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Toast;
import com.example.mynotepad.R;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class RecordFragment extends Fragment implements View.OnClickListener {
private NavController navController;
private ImageView listBtn;
private ImageButton recordBtn;
private boolean isRecording = false;
private MediaRecorder mRecorder;
private String fileName = null;
private Chronometer chronometer;
private int RECORD_AUDIO_REQUEST_CODE = 123;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_record, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getPermissionToRecordAudio();
}
init(view);
}
@RequiresApi(api = Build.VERSION_CODES.M)
public void getPermissionToRecordAudio() {
if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED
|| ContextCompat.checkSelfPermission(getContext(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
|| ContextCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE},
RECORD_AUDIO_REQUEST_CODE);
}
}
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (requestCode == RECORD_AUDIO_REQUEST_CODE) {
if (grantResults.length == 3 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED && grantResults[2] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(getContext(), "accepted", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "You must give permissions to use this app. App is exiting.", Toast.LENGTH_SHORT).show();
getActivity().finish();
}
}
}
private void init(View view) {
navController = Navigation.findNavController(view);
listBtn = view.findViewById(R.id.recordList);
recordBtn = view.findViewById(R.id.recordBtn);
chronometer = view.findViewById(R.id.chronometerTimer);
listBtn.setOnClickListener(this);
recordBtn.setOnClickListener(this);
}
@SuppressLint("UseCompatLoadingForDrawables")
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.recordList: {
navController.navigate(R.id.action_recordFragment_to_audioListFragment);
break;
}
case R.id.recordBtn: {
if (isRecording) {
//stop recording
isRecording = false;
recordBtn.setBackground(getResources().getDrawable(R.drawable.start_stop_bg));
stopRecording();
} else {
//start recording
isRecording = true;
recordBtn.setBackground(getResources().getDrawable(R.drawable.stop_btn_bg));
startRecording();
}
break;
}
}
}
private void startRecording() {
File root = android.os.Environment.getExternalStorageDirectory();
File file = new File(root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios");//create a 2 folders inside each other to save voices
if (!file.exists()) {
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);
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFile( root.getAbsolutePath() + "/NotepadVoiceRecorder/Audios/" +fileName);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
mRecorder.prepare();
} catch (IOException e) {
e.printStackTrace();
}
mRecorder.start();
chronometer.setBase(SystemClock.elapsedRealtime());// to start from 00:00
chronometer.start();
}
private void stopRecording() {
mRecorder.stop();
mRecorder.release();
mRecorder = null;
chronometer.stop();
chronometer.setBase(SystemClock.elapsedRealtime());
Toast.makeText(getContext(), "Recording saved successfully.", Toast.LENGTH_SHORT).show();
}
}
\ No newline at end of file
......@@ -27,129 +27,12 @@ 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);
customToolbarOption.hideStar();
myChosenVoice = item;
}
});
//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() {
}
@Override
public void onDeleteClicked() {
deleteClicked();
}
@Override
public void onCloseClicked() {
customToolbarOption.setVisibility(View.GONE);
}
});
}
private void deleteClicked() {
AlertDialog.Builder alert = new AlertDialog.Builder(VoiceMassagesActivity.this);
alert.setMessage("are you sure you wanna delete it ??? ");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@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;
import java.util.Date;
import java.util.concurrent.TimeUnit;
public class TimeAgo {
Date now = new Date();
/* public String getTimeAgo(long duration){
long seconds = TimeUnit.MILLISECONDS.toSeconds(now.getTime() - duration);
long minutes = TimeUnit.MINUTES.toMinutes(now.getTime() - duration);
long hours = TimeUnit.HOURS.toHours(now.getTime() - duration);
long days = TimeUnit.DAYS.toDays(now.getTime() - duration);
if (seconds <)
}*/
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0"
android:toAlpha="1"
android:duration="300"
/>
<scale android:fromXScale="40%"
android:fromYScale="40%"
android:toXScale="100%"
android:toYScale="100%"
android:duration="300"
android:pivotX="50%"
android:pivotY="50%"
/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="1"
android:toAlpha="0"
android:duration="300"
/>
<scale android:fromXScale="100%"
android:fromYScale="100%"
android:toXScale="40%"
android:toYScale="40%"
android:duration="300"
android:pivotX="50%"
android:pivotY="50%"
/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="0%"
android:duration="300"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="100%"
android:toYDelta="0%"
android:duration="300"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid
android:color="#3A478C"/>
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp"/>
</shape>
</item>
</selector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,14c1.66,0 2.99,-1.34 2.99,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17.3,11c0,3 -2.54,5.1 -5.3,5.1S6.7,14 6.7,11L5,11c0,3.41 2.72,6.23 6,6.72L11,21h2v-3.28c3.28,-0.48 6,-3.3 6,-6.72h-1.7z"/>
</vector>
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,3v10.55c-0.59,-0.34 -1.27,-0.55 -2,-0.55 -2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4V7h4V3h-6z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#DC35438C" />
<corners android:radius="0dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<vector android:height="40dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M8,5v14l11,-7z"/>
</vector>
......@@ -4,72 +4,15 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MenuFeatures.VoiceMassages.VoiceMassagesActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/voiceToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView7"
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="all voice massages"
android:textColor="#02091E"
android:textSize="26dp" />
<com.example.mynotepad.MenuFeatures.CustomToolbarOption
android:id="@+id/customToolbarOption"
<fragment
android:id="@+id/fragment_container"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="50dp" />
</FrameLayout>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
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
android:id="@+id/addVoiceButton"
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:clickable="true"
android:src="@drawable/add"
app:backgroundTint="#5266D5"
tools:layout_editor_absoluteX="310dp"
tools:layout_editor_absoluteY="612dp" />
</RelativeLayout>
</FrameLayout>
app:defaultNavHost="true"
app:navGraph="@navigation/nav_graph" />
</LinearLayout>
......@@ -8,8 +8,8 @@
android:id="@+id/start_stopBtn"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:background="@drawable/start_stop_bg">
......@@ -28,8 +28,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/start_stopBtn"
android:orientation="vertical">
android:layout_toRightOf="@id/start_stopBtn"
android:orientation="vertical"
android:layout_marginLeft="10dp">
<TextView
android:id="@+id/voiceName"
android:layout_width="match_parent"
......@@ -41,6 +42,17 @@
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
<TextView
android:id="@+id/voiceTime"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:textSize="8dp"
android:text="time"
android:gravity="center_vertical"
android:layout_marginLeft="10dp" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MenuFeatures.VoiceMassages.AudioListFragment">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/voiceToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView7"
android:layout_width="match_parent"
android:layout_height="50dp"
android:scaleType="fitXY"
android:src="@drawable/index" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:enabled="false"
android:text="all voice massages"
android:textColor="#02091E"
android:textSize="26dp" />
<com.example.mynotepad.MenuFeatures.CustomToolbarOption
android:id="@+id/customToolbarOption"
android:layout_width="match_parent"
android:layout_height="50dp" />
</FrameLayout>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="409dp"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:background="#4883B5DD"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp" />
<include layout="@layout/player_sheet"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MenuFeatures.VoiceMassages.RecorderActivity">
tools:context=".MenuFeatures.VoiceMassages.RecordFragment">
<ImageView
android:id="@+id/imageView8"
......@@ -13,68 +11,56 @@
android:layout_height="50dp"
android:layout_marginTop="0dp"
android:scaleType="fitXY"
app:srcCompat="@drawable/index" />
android:src="@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:layout_below="@+id/imageView8"
android:layout_alignParentBottom="@id/imageView8"
android:layout_marginTop="80dp"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/stones" />
<Chronometer
android:id="@+id/chronometerTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
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
android:id="@+id/start_stopBtn"
android:layout_width="50dp"
android:layout_height="50dp"
<ImageButton
android:id="@+id/recordBtn"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:background="@drawable/start_stop_bg" />
<ImageView
android:id="@+id/play_pause"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="@id/start_stopBtn"
android:layout_marginRight="30dp"
android:layout_toLeftOf="@id/start_stopBtn"
android:src="@drawable/play" />
android:background="@drawable/start_stop_bg"
android:src="@drawable/mic" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/start_stopBtn"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@id/start_stopBtn">
<ImageView
android:id="@+id/saveVoice"
android:id="@+id/recordList"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/square" />
</LinearLayout>
android:layout_alignBottom="@id/recordBtn"
android:layout_marginLeft="40dp"
android:layout_toRightOf="@id/recordBtn"
android:src="@drawable/list" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/player_sheet"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
app:behavior_hideable="true"
app:behavior_peekHeight="70dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="10dp"
android:background="@drawable/media_header_bg"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="4dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="5"
android:paddingTop="10dp"
android:paddingBottom="10dp"
app:srcCompat="@drawable/music"
tools:ignore="VectorDrawableCompat" />
<TextView
android:id="@+id/player_header_name"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/media_player"
android:textColor="#FFFFFF"
android:gravity="center_vertical"
android:textSize="20dp" />
<TextView
android:id="@+id/player_header_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="center_vertical"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:paddingBottom="10dp"
android:text="@string/not_playing"
android:textAlignment="textEnd"
android:textColor="#FFFFFF"
android:textSize="20dp"
tools:ignore="RtlCompat" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/player_bg">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/file_name"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textSize="16dp"
android:gravity="center_horizontal"
android:textColor="@color/white"
tools:ignore="MissingConstraints" />
<ImageButton
android:id="@+id/player_play_btn"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="28dp"
android:background="#0035438C"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3"
app:srcCompat="@drawable/white_play_arrow"
tools:ignore="VectorDrawableCompat" />
<ImageButton
android:id="@+id/imageView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/player_play_btn"
app:layout_constraintEnd_toStartOf="@+id/player_play_btn"
app:layout_constraintHorizontal_bias="0.519"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/player_play_btn"
android:background="#0035438C"
app:layout_constraintVertical_bias="0.545"
app:srcCompat="@android:drawable/ic_media_rew" />
<ImageButton
android:id="@+id/imageView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/player_play_btn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/player_play_btn"
app:layout_constraintTop_toTopOf="@+id/player_play_btn"
android:background="#0035438C"
app:srcCompat="@android:drawable/ic_media_ff" />
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_marginTop="16dp"
android:thumb="@android:drawable/presence_invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/player_play_btn" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/recordFragment"
tools:ignore="UnusedNavigation">
<fragment
android:id="@+id/recordFragment"
android:name="com.example.mynotepad.MenuFeatures.VoiceMassages.RecordFragment"
android:label="fragment_record"
tools:layout="@layout/fragment_record" >
<action
android:id="@+id/action_recordFragment_to_audioListFragment"
app:destination="@id/audioListFragment"
app:exitAnim="@anim/fade_out"
app:enterAnim="@anim/slide_in"
app:popEnterAnim="@anim/fade_in"
app:popExitAnim="@anim/slide_out"/>
</fragment>
<fragment
android:id="@+id/audioListFragment"
android:name="com.example.mynotepad.MenuFeatures.VoiceMassages.AudioListFragment"
android:label="fragment_audio_list"
tools:layout="@layout/fragment_audio_list" />
</navigation>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="colorPrimary">#457FAE</color>
<color name="colorPrimaryDark">#3A478C</color>
<color name="colorAccent">#41A69D</color>
</resources>
\ No newline at end of file
......@@ -12,4 +12,7 @@
<string name="chosendate">chosenDate</string>
<string name="dots">...</string>
<string name="archived">archived</string>
<string name="not_playing">Not playing</string>
<string name="media_player">Media player</string>
<string name="file_name">file name</string>
</resources>
\ No newline at end of file
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
......
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