未验证 提交 b5ce3f14 编写于 作者: T Takeshi Hagikura 提交者: GitHub

Fix crash on rotation. (#392)

By chanigng the View type as nullable in onItemSelected
上级 5835b17a
......@@ -180,7 +180,8 @@ internal class FlexItemEditFragment : DialogFragment() {
R.array.array_align_self, R.layout.spinner_item)
alignSelfSpinner.adapter = arrayAdapter
alignSelfSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, ignored: View, position: Int, id: Long) {
override fun onItemSelected(parent: AdapterView<*>, ignored: View?, position: Int,
id: Long) {
flexItemInEdit.alignSelf = when (parent.getItemAtPosition(position).toString()) {
alignSelfAuto -> AlignSelf.AUTO
alignSelfFlexStart -> AlignItems.FLEX_START
......@@ -199,7 +200,8 @@ internal class FlexItemEditFragment : DialogFragment() {
val wrapBeforeCheckBox: CheckBox = view.findViewById(R.id.checkbox_wrap_before)
wrapBeforeCheckBox.isChecked = flexItem.isWrapBefore
wrapBeforeCheckBox.setOnCheckedChangeListener { _, isChecked -> flexItemInEdit.isWrapBefore = isChecked }
wrapBeforeCheckBox.setOnCheckedChangeListener { _, isChecked ->
flexItemInEdit.isWrapBefore = isChecked }
val alignSelfPosition = arrayAdapter
.getPosition(alignSelfAsString(flexItem.alignSelf))
alignSelfSpinner.setSelection(alignSelfPosition)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册