diff --git a/app/src/main/java/com/stormtales/notevault/ui/home/HomeFragment.java b/app/src/main/java/com/stormtales/notevault/ui/home/HomeFragment.java index cc845a7..9782c48 100644 --- a/app/src/main/java/com/stormtales/notevault/ui/home/HomeFragment.java +++ b/app/src/main/java/com/stormtales/notevault/ui/home/HomeFragment.java @@ -83,10 +83,7 @@ public class HomeFragment extends Fragment { private void handleSelectedNoteSheets(Uri... files) { SongEditorDialog songEditorDialog = new SongEditorDialog(); - - int width = getResources().getDisplayMetrics().widthPixels; - - + songEditorDialog.setNoteSheetFiles(files); songEditorDialog.show(getParentFragmentManager(), "songEditorDialog"); } } \ No newline at end of file diff --git a/app/src/main/java/com/stormtales/notevault/ui/songeditor/SongEditorDialog.java b/app/src/main/java/com/stormtales/notevault/ui/songeditor/SongEditorDialog.java index 332f613..81d48b1 100644 --- a/app/src/main/java/com/stormtales/notevault/ui/songeditor/SongEditorDialog.java +++ b/app/src/main/java/com/stormtales/notevault/ui/songeditor/SongEditorDialog.java @@ -2,6 +2,7 @@ package com.stormtales.notevault.ui.songeditor; import android.app.AlertDialog; import android.app.Dialog; +import android.net.Uri; import android.os.Bundle; import android.text.Layout; import android.widget.Button; @@ -23,6 +24,7 @@ import org.jetbrains.annotations.NotNull; public class SongEditorDialog extends DialogFragment { Dialog dialog; + private Uri[] noteSheetFiles; public SongEditorDialog() { // Required empty public constructor @@ -36,6 +38,7 @@ public class SongEditorDialog extends DialogFragment { View dialogView = inflater.inflate(R.layout.fragment_song_editor_dialog, null); dialogView.findViewById(R.id.btnCancel).setOnClickListener(v-> onCancel()); + dialogView.findViewById(R.id.btnSave).setOnClickListener(v -> onSave()); AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setCancelable(false); @@ -64,4 +67,8 @@ public class SongEditorDialog extends DialogFragment { dialog.dismiss(); } + + public void setNoteSheetFiles(Uri[] noteSheetFiles) { + this.noteSheetFiles = noteSheetFiles; + } } \ No newline at end of file