couple UI changes

This commit is contained in:
tibbi
2016-11-02 19:34:15 +01:00
parent aeab50d606
commit 55a6cd6f35
4 changed files with 51 additions and 52 deletions

View File

@@ -186,9 +186,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventsListener {
} }
fun toggleCustomReminderVisibility(show: Boolean) { fun toggleCustomReminderVisibility(show: Boolean) {
custom_reminder_other_period.beVisibleIf(show) custom_reminder_holder.beVisibleIf(show)
custom_reminder_other_val.beVisibleIf(show)
custom_reminder_value.beVisibleIf(show)
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {

View File

@@ -89,6 +89,7 @@ class SettingsActivity : SimpleActivity() {
} }
mConfig.defaultReminderMinutes = Integer.valueOf(value) * multiplier mConfig.defaultReminderMinutes = Integer.valueOf(value) * multiplier
toast(R.string.reminder_saved) toast(R.string.reminder_saved)
hideKeyboard()
} }
private fun setupReminderPeriod(mins: Int) { private fun setupReminderPeriod(mins: Int) {

View File

@@ -127,46 +127,47 @@
android:entries="@array/reminders" android:entries="@array/reminders"
android:padding="@dimen/activity_margin"/> android:padding="@dimen/activity_margin"/>
<EditText <LinearLayout
android:id="@+id/custom_reminder_value" android:id="@+id/custom_reminder_holder"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/event_reminder" android:layout_below="@+id/event_reminder"
android:layout_marginLeft="@dimen/activity_margin" android:layout_marginLeft="@dimen/activity_margin"
android:digits="0123456789" android:orientation="horizontal"
android:inputType="number" android:visibility="gone">
android:minEms="5"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
<android.support.v7.widget.AppCompatSpinner <EditText
android:id="@+id/custom_reminder_other_period" android:id="@+id/custom_reminder_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/custom_reminder_value" android:digits="0123456789"
android:layout_alignTop="@+id/custom_reminder_value" android:inputType="number"
android:layout_toRightOf="@+id/custom_reminder_value" android:maxLength="10"
android:entries="@array/custom_reminders" android:minEms="5"
android:gravity="center_vertical" android:textSize="@dimen/day_text_size"/>
android:paddingLeft="@dimen/activity_margin"
android:visibility="gone"/>
<TextView <android.support.v7.widget.AppCompatSpinner
android:id="@+id/custom_reminder_other_val" android:id="@+id/custom_reminder_other_period"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignBottom="@+id/custom_reminder_value" android:entries="@array/custom_reminders"
android:layout_alignTop="@+id/custom_reminder_value" android:gravity="center_vertical"
android:layout_toRightOf="@+id/custom_reminder_other_period" android:paddingLeft="@dimen/activity_margin"/>
android:gravity="center_vertical"
android:text="@string/before" <TextView
android:visibility="gone"/> android:id="@+id/custom_reminder_other_val"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="@dimen/activity_margin"
android:text="@string/before"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/event_repetition_label" android:id="@+id/event_repetition_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/custom_reminder_value" android:layout_below="@+id/custom_reminder_holder"
android:layout_marginTop="@dimen/activity_margin" android:layout_marginTop="@dimen/activity_margin"
android:text="@string/repetition" android:text="@string/repetition"
android:textSize="@dimen/day_text_size"/> android:textSize="@dimen/day_text_size"/>

View File

@@ -114,13 +114,14 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <LinearLayout
android:id="@+id/settings_custom_reminder_holder" android:id="@+id/settings_custom_reminder_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/settings_padding" android:layout_marginLeft="@dimen/settings_padding"
android:layout_marginRight="@dimen/activity_margin" android:layout_marginRight="@dimen/activity_margin"
android:layout_marginTop="@dimen/settings_padding" android:layout_marginTop="@dimen/settings_padding"
android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone">
<EditText <EditText
@@ -130,41 +131,39 @@
android:layout_marginLeft="@dimen/activity_margin" android:layout_marginLeft="@dimen/activity_margin"
android:digits="0123456789" android:digits="0123456789"
android:inputType="number" android:inputType="number"
android:maxLength="10"
android:minEms="3" android:minEms="3"
android:textSize="@dimen/day_text_size"/> android:textSize="@dimen/day_text_size"/>
<android.support.v7.widget.AppCompatSpinner <android.support.v7.widget.AppCompatSpinner
android:id="@+id/custom_reminder_other_period" android:id="@+id/custom_reminder_other_period"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignBottom="@+id/custom_reminder_value"
android:layout_alignTop="@+id/custom_reminder_value"
android:layout_toRightOf="@+id/custom_reminder_value"
android:entries="@array/custom_reminders" android:entries="@array/custom_reminders"
android:gravity="center_vertical" android:gravity="center"
android:paddingLeft="@dimen/settings_padding"/> android:paddingLeft="@dimen/settings_padding"/>
<TextView <TextView
android:id="@+id/custom_reminder_other_val" android:id="@+id/custom_reminder_other_val"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignBottom="@+id/custom_reminder_value" android:layout_marginLeft="@dimen/settings_padding"
android:layout_alignTop="@+id/custom_reminder_value" android:gravity="center"
android:layout_toRightOf="@+id/custom_reminder_other_period"
android:gravity="center_vertical"
android:text="@string/before"/> android:text="@string/before"/>
<android.support.v4.widget.Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button <Button
android:id="@+id/custom_reminder_save" android:id="@+id/custom_reminder_save"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignBottom="@+id/custom_reminder_value" android:background="?attr/selectableItemBackground"
android:layout_alignParentRight="true" android:text="@string/save"
android:layout_alignTop="@+id/custom_reminder_value" android:textSize="@dimen/day_text_size"/>
android:background="?android:attr/selectableItemBackground"
android:textSize="@dimen/day_text_size"
android:text="@string/save"/>
</RelativeLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>