Automation layouts improvement

This commit is contained in:
Milos Kozak 2019-10-01 13:11:10 +02:00
parent 2d395b625e
commit 3ecee09443
10 changed files with 34 additions and 8 deletions

View file

@ -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")
}

View file

@ -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())
}

View file

@ -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
}

View file

@ -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 {

View file

@ -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()

View file

@ -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()) }

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"