Layout fixes and improvements to shortcutless date/time picker

pull/14/head
Sam Bosley 12 years ago
parent e67e7aa96e
commit 861f2957c8

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="320dip"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="5dip"
android:paddingBottom="5dip">
<LinearLayout
android:id="@+id/datetime_body"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/datetime_extras"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:layout_marginLeft="5dip"
android:layout_gravity="center_vertical">
<com.todoroo.astrid.ui.CalendarView
android:id="@+id/calendar"
android:layout_width="0dip"
android:layout_height="280dip"
android:layout_weight="50"
android:layout_marginRight="5dip"/>
<LinearLayout
android:id="@+id/date_shortcuts"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_marginTop="5dip"
android:layout_marginRight="5dip"
android:layout_weight="25"
android:visibility="gone"
android:orientation="vertical"/>
<com.todoroo.astrid.ui.AstridTimePicker
android:id="@+id/time_picker"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip"
android:layout_weight="50"
android:orientation="vertical"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</merge>

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="5dip"
android:paddingBottom="5dip">
<LinearLayout
android:id="@+id/datetime_body"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/datetime_extras"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dip"
android:orientation="horizontal"
android:layout_weight="1">
<LinearLayout
android:id="@+id/date_shortcuts"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dip"
android:layout_marginRight="5dip"
android:layout_weight="1"
android:orientation="vertical"/>
<com.todoroo.astrid.ui.AstridTimePicker
android:id="@+id/time_picker"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip"
android:layout_weight="1"
android:orientation="vertical"/>
</LinearLayout>
<com.todoroo.astrid.ui.CalendarView
android:id="@+id/calendar"
android:layout_width="fill_parent"
android:layout_height="250dip"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
</merge>

@ -63,9 +63,10 @@ public class DateAndTimePicker extends LinearLayout {
public DateAndTimePicker(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.date_time_picker, this, true);
useShortcuts = false; //Preferences.getBoolean(R.string.p_use_date_shortcuts, true);
inflater.inflate(useShortcuts ? R.layout.date_time_picker : R.layout.date_time_picker_no_shortcuts, this, true);
calendarView = (CalendarView) findViewById(R.id.calendar);
timePicker = (AstridTimePicker) findViewById(R.id.time_picker);

Loading…
Cancel
Save