OSDN Git Service

Deprecate fill_parent and introduce match_parent.
authorRomain Guy <romainguy@android.com>
Fri, 8 Jan 2010 23:06:50 +0000 (15:06 -0800)
committerRomain Guy <romainguy@android.com>
Fri, 8 Jan 2010 23:11:46 +0000 (15:11 -0800)
Bug: #2361749.

13 files changed:
res/layout-land/desk_clock.xml
res/layout/alarm_alert.xml
res/layout/alarm_clock.xml
res/layout/alarm_time.xml
res/layout/analog_appwidget.xml
res/layout/context_menu_header.xml
res/layout/desk_clock.xml
res/layout/desk_clock_buttons.xml
res/layout/desk_clock_saver.xml
res/layout/desk_clock_time_date.xml
res/layout/save_cancel_alarm.xml
res/values/styles.xml
src/com/android/deskclock/SetAlarm.java

index 0cbaccf..3c58098 100644 (file)
 <!-- 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"
         >
@@ -36,8 +36,8 @@
             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"
@@ -47,7 +47,7 @@
             <!-- 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"
@@ -89,7 +89,7 @@
             <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"
index 57588c3..cefc3e4 100644 (file)
@@ -16,8 +16,8 @@
 
 <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"
index a66fd59..e4d1ff9 100644 (file)
 
 <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">
 
@@ -46,7 +46,7 @@
     </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">
 
index 5c3b19b..9c4fb7b 100644 (file)
@@ -16,7 +16,7 @@
 
 <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">
 
@@ -54,7 +54,7 @@
         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"
@@ -64,7 +64,7 @@
          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"
@@ -72,7 +72,7 @@
         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"/>
index 6a10611..d2becb3 100644 (file)
@@ -19,5 +19,5 @@
     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" />
index 6ac4dc5..55846f5 100644 (file)
@@ -16,7 +16,7 @@
 
 <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"
index 271dc65..cbc55d3 100644 (file)
      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"
         >
@@ -40,8 +40,8 @@
             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"
@@ -51,7 +51,7 @@
             <!-- 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"
@@ -98,7 +98,7 @@
 
             <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"
index 9d72282..b9e9129 100644 (file)
 
 <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"
@@ -31,7 +31,7 @@
     <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"
@@ -39,7 +39,7 @@
     <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"
@@ -47,7 +47,7 @@
     <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"
index fcde362..6d72e8d 100644 (file)
 
 <!-- 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"
index 5b2af22..e5869a7 100644 (file)
@@ -48,7 +48,7 @@
 
         <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"
index 837d951..7c5612f 100644 (file)
 -->
 
 <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"/>
 
index edacfea..8de806b 100644 (file)
@@ -16,8 +16,8 @@
 
 <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>
 
index 2a14448..3db6545 100644 (file)
@@ -21,8 +21,6 @@ import android.app.TimePickerDialog;
 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;
@@ -131,7 +129,7 @@ public class SetAlarm extends PreferenceActivity
         // 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);