Skip to content

Commit

Permalink
Fix keyboard not appearing in TimeRangePickerDialog (fixes #2799)
Browse files Browse the repository at this point in the history
  • Loading branch information
tapetis authored and matkoniecz committed Apr 28, 2021
1 parent 6bb4e0c commit 1fda71d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package de.westnordost.streetcomplete.quests.opening_hours

import android.content.Context
import android.content.DialogInterface
import android.os.Bundle
import com.google.android.material.tabs.TabLayout
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import androidx.appcompat.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.CheckBox
import android.widget.TimePicker

Expand Down Expand Up @@ -81,6 +83,13 @@ class TimeRangePickerDialog(
})
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
}

private fun setCurrentTab(position: Int) {
viewPager.currentItem = position
val buttonResId = if (position == END_TIME_TAB) android.R.string.ok else R.string.quest_openingHours_timeSelect_next
Expand Down

0 comments on commit 1fda71d

Please sign in to comment.