Skip to content

Commit

Permalink
Ensured Dialogs do not render a title area
Browse files Browse the repository at this point in the history
AppCompatDialogFragments render a title area by default if the parent team is configured to show an ActionBar, unlike regular DialogFragments
Fixes #593
  • Loading branch information
wdullaer committed Jun 1, 2019
1 parent 8c6b630 commit 4bfaaf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public void onCreate(Bundle savedInstanceState) {
final Activity activity = requireActivity();
activity.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
setStyle(AppCompatDialogFragment.STYLE_NO_TITLE, 0);
mCurrentView = UNINITIALIZED;
if (savedInstanceState != null) {
mCalendar.set(Calendar.YEAR, savedInstanceState.getInt(KEY_SELECTED_YEAR));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ public void setLocale(Locale locale) {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(AppCompatDialogFragment.STYLE_NO_TITLE, 0);
if (savedInstanceState != null && savedInstanceState.containsKey(KEY_INITIAL_TIME)
&& savedInstanceState.containsKey(KEY_IS_24_HOUR_VIEW)) {
mInitialTime = savedInstanceState.getParcelable(KEY_INITIAL_TIME);
Expand Down Expand Up @@ -671,7 +672,6 @@ affect the behaviour of the picker (in the unlikely event the user reconfigures
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

int viewRes = mVersion == Version.VERSION_1 ? R.layout.mdtp_time_picker_dialog : R.layout.mdtp_time_picker_dialog_v2;
View view = inflater.inflate(viewRes, container,false);
KeyboardListener keyboardListener = new KeyboardListener();
Expand Down

0 comments on commit 4bfaaf6

Please sign in to comment.