Skip to content

Commit

Permalink
fullscreen dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytamsf committed Apr 15, 2024
1 parent 1a81ee0 commit 2a1fc25
Showing 1 changed file with 19 additions and 2 deletions.
Expand Up @@ -5,6 +5,7 @@
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;

import androidx.annotation.NonNull;
Expand All @@ -18,6 +19,8 @@
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;

Expand Down Expand Up @@ -58,12 +61,26 @@ public class TranscriptFragment extends AppCompatDialogFragment {
View prevView = null;
Color prevColor;

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setStyle(STYLE_NO_TITLE, 0);
}

@Override
public void onResume() {
ViewGroup.LayoutParams params;
params = getDialog().getWindow().getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
getDialog().getWindow().setAttributes((WindowManager.LayoutParams) params);
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
super.onResume();
}

@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {

AlertDialog dialog = new MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.transcript_label))
.setView(onCreateView(getLayoutInflater()))
.setPositiveButton(getString(R.string.close_label), null) //dismisses
.create();
Expand Down

0 comments on commit 2a1fc25

Please sign in to comment.