do not show the keyboard at Editing event

This commit is contained in:
tibbi 2016-11-26 11:11:09 +01:00
parent e3e0ffee13
commit 4010daf08e
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.view.WindowManager
import android.widget.AdapterView import android.widget.AdapterView
import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.R
import com.simplemobiletools.calendar.extensions.* import com.simplemobiletools.calendar.extensions.*
@ -78,6 +79,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventsListener {
} }
private fun setupEditEvent() { private fun setupEditEvent() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)
title = resources.getString(R.string.edit_event) title = resources.getString(R.string.edit_event)
mEventStartDateTime = Formatter.getDateTimeFromTS(mEvent.startTS) mEventStartDateTime = Formatter.getDateTimeFromTS(mEvent.startTS)
mEventEndDateTime = Formatter.getDateTimeFromTS(mEvent.endTS) mEventEndDateTime = Formatter.getDateTimeFromTS(mEvent.endTS)
@ -85,10 +87,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventsListener {
endCheckboxChecked(event_end_checkbox.isChecked) endCheckboxChecked(event_end_checkbox.isChecked)
event_title.setText(mEvent.title) event_title.setText(mEvent.title)
event_description.setText(mEvent.description) event_description.setText(mEvent.description)
hideKeyboard()
} }
private fun setupNewEvent(dayCode: String) { private fun setupNewEvent(dayCode: String) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
title = resources.getString(R.string.new_event) title = resources.getString(R.string.new_event)
mEventStartDateTime = Formatter.getDateTimeFromCode(dayCode).withZoneRetainFields(DateTimeZone.getDefault()).withHourOfDay(13) mEventStartDateTime = Formatter.getDateTimeFromCode(dayCode).withZoneRetainFields(DateTimeZone.getDefault()).withHourOfDay(13)
mEventEndDateTime = mEventStartDateTime mEventEndDateTime = mEventStartDateTime