diff --git a/app/src/main/java/com/readrops/app/activities/ItemActivity.java b/app/src/main/java/com/readrops/app/activities/ItemActivity.java index 935ae3fe..acb177f2 100644 --- a/app/src/main/java/com/readrops/app/activities/ItemActivity.java +++ b/app/src/main/java/com/readrops/app/activities/ItemActivity.java @@ -1,7 +1,6 @@ package com.readrops.app.activities; import android.Manifest; -import android.app.DialogFragment; import android.app.DownloadManager; import android.content.Intent; import android.content.pm.PackageManager; @@ -40,7 +39,6 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.readrops.app.R; -import com.readrops.app.fragments.ImageCaptionFragment; import com.readrops.readropsdb.entities.Item; import com.readrops.readropsdb.pojo.ItemWithFeed; import com.readrops.app.utils.DateUtils; @@ -315,9 +313,10 @@ public class ItemActivity extends AppCompatActivity { imageTitle = ""; } } - - DialogFragment newFragment = ImageCaptionFragment.newInstance(urlToDownload, imageTitle); - newFragment.show(getFragmentManager(), "dialog"); + MaterialDialog.Builder captionBuilder = new MaterialDialog.Builder(this); + captionBuilder.title(urlToDownload); + captionBuilder.content(imageTitle); + captionBuilder.show(); break; default: throw new IllegalStateException("Unexpected value: " + position); diff --git a/app/src/main/java/com/readrops/app/fragments/ImageCaptionFragment.java b/app/src/main/java/com/readrops/app/fragments/ImageCaptionFragment.java deleted file mode 100644 index 6fc0a7f2..00000000 --- a/app/src/main/java/com/readrops/app/fragments/ImageCaptionFragment.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.readrops.app.fragments; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; -import android.os.Bundle; - -import com.readrops.app.R; - -public class ImageCaptionFragment extends DialogFragment { - - public static ImageCaptionFragment newInstance(CharSequence title, CharSequence message) { - ImageCaptionFragment f = new ImageCaptionFragment(); - - Bundle args = new Bundle(); - args.putCharSequence("title", title); - args.putCharSequence("message", message); - f.setArguments(args); - - return f; - } - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - - CharSequence title = getArguments().getCharSequence("title"); - CharSequence message = getArguments().getCharSequence("message"); - - AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - builder.setTitle(title); - builder.setMessage(message); - builder.setNegativeButton(R.string.back, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - // User cancelled the dialog - } - }); - - return builder.create(); - } -}