Automation layouts improvement
This commit is contained in:
parent
2d395b625e
commit
3ecee09443
|
@ -77,7 +77,7 @@ class AutomationFragment : Fragment() {
|
|||
if (eventListAdapter == null) return
|
||||
eventListAdapter?.notifyDataSetChanged()
|
||||
val sb = StringBuilder()
|
||||
for (l in AutomationPlugin.executionLog) {
|
||||
for (l in AutomationPlugin.executionLog.reversed()) {
|
||||
sb.append(l)
|
||||
sb.append("\n")
|
||||
}
|
||||
|
|
|
@ -56,6 +56,11 @@ class ChooseActionDialog : DialogFragment() {
|
|||
cancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(bundle: Bundle) {
|
||||
bundle.putInt("checkedIndex", determineCheckedIndex())
|
||||
}
|
||||
|
|
|
@ -58,6 +58,11 @@ class ChooseTriggerDialog : DialogFragment() {
|
|||
cancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
fun setOnClickListener(clickListener: OnClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import kotlinx.android.synthetic.main.okcancel.*
|
|||
import org.json.JSONObject
|
||||
|
||||
class EditActionDialog : DialogFragment() {
|
||||
|
||||
private var action: Action? = null
|
||||
private var actionPosition: Int = -1
|
||||
|
||||
|
@ -51,6 +50,11 @@ class EditActionDialog : DialogFragment() {
|
|||
cancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(bundle: Bundle) {
|
||||
super.onSaveInstanceState(bundle)
|
||||
action?.let {
|
||||
|
|
|
@ -137,6 +137,11 @@ class EditEventDialog : DialogFragment() {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
disposable.clear()
|
||||
|
|
|
@ -31,18 +31,23 @@ class EditTriggerDialog : DialogFragment() {
|
|||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// display root trigger
|
||||
trigger?.let { it.generateDialog(automation_layoutTrigger, fragmentManager) }
|
||||
trigger?.generateDialog(automation_layoutTrigger, fragmentManager)
|
||||
|
||||
// OK button
|
||||
ok.setOnClickListener {
|
||||
dismiss()
|
||||
RxBus.send(EventAutomationUpdateTrigger(trigger!!))
|
||||
trigger?.let { trigger -> RxBus.send(EventAutomationUpdateTrigger(trigger)) }
|
||||
}
|
||||
|
||||
// Cancel button
|
||||
cancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(bundle: Bundle) {
|
||||
super.onSaveInstanceState(bundle)
|
||||
trigger?.let { bundle.putString("trigger", it.toJSON()) }
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minWidth="300dp"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/please_choose_an_action_type" />
|
||||
android:text="@string/please_choose_an_action_type"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/automation_radioGroup"
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/please_choose_a_trigger_type" />
|
||||
android:text="@string/please_choose_a_trigger_type"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/automation_chooseTriggerRadioGroup"
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/triggers" />
|
||||
android:text="@string/triggers"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/automation_layoutTrigger"
|
||||
|
|
Loading…
Reference in a new issue