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