1 package com.example.imsmediatestingapp; 2 3 import android.content.Context; 4 import android.widget.TextView; 5 import androidx.annotation.NonNull; 6 import com.google.android.material.bottomsheet.BottomSheetDialog; 7 import java.util.EventListener; 8 9 /** 10 * The BottomSheerDialer class extends the BottomSheetDialog class. It is used when there is an 11 * active call session to send DTMF input. 12 */ 13 public class BottomSheetDialer extends BottomSheetDialog implements EventListener { 14 private boolean isOpen = false; 15 private TextView dtmfInput; 16 BottomSheetDialer(@onNull Context context)17 public BottomSheetDialer(@NonNull Context context) { 18 super(context); 19 } 20 21 @Override onStart()22 public void onStart() { 23 super.onStart(); 24 isOpen = true; 25 dtmfInput = findViewById(R.id.dtmfInputTextView); 26 } 27 28 @Override dismiss()29 public void dismiss() { 30 super.dismiss(); 31 isOpen = false; 32 } 33 34 /** 35 * @return boolean value if the dialer is open 36 */ isOpen()37 public boolean isOpen() { 38 return isOpen; 39 } 40 41 /** 42 * @return Textview containing the imputed dialer values. 43 */ getDtmfInput()44 public TextView getDtmfInput() { 45 return dtmfInput; 46 } 47 } 48