<!-- This is the alarm clock in LANDSCAPE desk dock mode.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
>
<LinearLayout
android:id="@+id/desk_clock"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="25dip"
>
android:orientation="vertical"
android:layout_gravity="left"
android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_marginLeft="25dip"
android:layout_marginTop="18dip"
android:layout_marginRight="18dip"
<!-- across the top: next alarm, battery, nightmode button -->
<LinearLayout
android:orientation="horizontal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginBottom="6dip"
<LinearLayout
android:orientation="horizontal"
android:layout_weight="1"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
>
</LinearLayout>
<View android:id="@+id/window_tint"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:background="#E0000000"
android:visibility="visible"
android:clickable="false"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:gravity="center">
<LinearLayout
android:singleLine="true"
android:ellipsize="end"
android:gravity="center"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="1dip"
android:scaleType="fitXY"
android:gravity="fill_horizontal"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/base_layout"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout android:id="@+id/add_alarm"
android:clickable="true"
android:focusable="true"
android:background="@android:drawable/list_selector_background"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
<ImageView
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:gravity="fill_horizontal"
<ListView
android:id="@+id/alarms_list"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<LinearLayout
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<com.android.deskclock.DigitalClock
style="@style/ButtonStripRight"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="true">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:src="@*android:drawable/divider_vertical_dark"
android:background="?android:attr/windowBackground"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:paddingTop="4dip"
android:paddingBottom="4dip"
android:scaleType="fitXY"
and an optional line below, used for day/days of week -->
<com.android.deskclock.DigitalClock android:id="@+id/digitalClock"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingRight="16dip">
<LinearLayout
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="true">
<TextView android:id="@+id/daysOfWeek"
android:includeFontPadding="false"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/>
android:dial="@drawable/appwidget_clock_dial"
android:hand_hour="@drawable/appwidget_clock_hour"
android:hand_minute="@drawable/appwidget_clock_minute"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" />
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingBottom="9dip"
<TextView android:id="@+id/header_time"
style="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:singleLine="true"
android:gravity="center_vertical"
android:ellipsize="none"/>
<TextView android:id="@+id/header_label"
style="?android:attr/textAppearanceLarge"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_marginLeft="20dip"
android:singleLine="true"
android:gravity="right|center_vertical"
Buttons are provided to access alarms, music, and other useful functions.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
>
<!-- the top padding accounts for the status bar area -->
<LinearLayout
android:id="@+id/desk_clock"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="25dip"
>
android:orientation="vertical"
android:layout_gravity="left"
android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_marginLeft="22dip"
android:layout_marginTop="18dip"
android:layout_marginRight="18dip"
<!-- across the top: next alarm, nightmode button -->
<LinearLayout
android:orientation="horizontal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginLeft="4dip"
<include layout="@layout/desk_clock_battery"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_weight="0"
android:layout_marginLeft="4dip"
/>
</LinearLayout>
<View android:id="@+id/window_tint"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:background="#E0000000"
android:visibility="visible"
android:clickable="false"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
>
<ImageButton android:id="@+id/alarm_button"
style="@style/ButtonStripLeft"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_weight=".25"
android:src="@drawable/ic_clock_strip_alarm"
android:contentDescription="@string/alarm_button_description"
<ImageButton android:id="@+id/gallery_button"
style="@style/ButtonStripMiddle"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_weight=".25"
android:src="@drawable/ic_clock_strip_gallery"
android:contentDescription="@string/gallery_button_description"
<ImageButton android:id="@+id/music_button"
style="@style/ButtonStripMiddle"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_weight=".25"
android:src="@drawable/ic_clock_strip_music"
android:contentDescription="@string/music_button_description"
<ImageButton android:id="@+id/home_button"
style="@style/ButtonStripRight"
android:layout_height="wrap_content"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_weight=".25"
android:src="@drawable/ic_clock_strip_home"
android:contentDescription="@string/home_button_description"
<!-- Special "screen saver mode" with just the time/date on black. -->
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
>
<View
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_x="0dip"
android:layout_y="0dip"
android:background="#FF000000"
<TextView android:id="@+id/am_pm"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
+ android:layout_height="match_parent"
android:gravity="bottom"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="@android:style/ButtonBar">
<Button android:id="@+id/alarm_save"
android:focusable="true"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/done"/>
<Button android:id="@+id/alarm_cancel"
android:focusable="true"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/revert"/>
<Button android:id="@+id/alarm_delete"
android:focusable="true"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/delete"/>
<resources>
<style name="clock">
- <item name="android:layout_width">fill_parent</item>
- <item name="android:layout_height">fill_parent</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">match_parent</item>
<item name="android:layout_gravity">center_horizontal</item>
</style>
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.media.RingtoneManager;
-import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
// Have the ListView expand to fill the screen minus the save/cancel
// buttons.
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
- LayoutParams.FILL_PARENT,
+ LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
lp.weight = 1;
ll.addView(lv, lp);