From cc6828c676c0bfabbcbefa27f4be9183352f5fee Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 8 Jan 2010 15:06:37 -0800 Subject: [PATCH] Deprecate fill_parent and introduce match_parent. Bug: #2361749. --- .../internal/policy/impl/KeyguardViewManager.java | 6 +++--- .../android/internal/policy/impl/PhoneWindow.java | 13 +++++-------- .../internal/policy/impl/PhoneWindowManager.java | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/policy/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/com/android/internal/policy/impl/KeyguardViewManager.java index d4dc429d08b07..ba1d7f5302946 100644 --- a/policy/com/android/internal/policy/impl/KeyguardViewManager.java +++ b/policy/com/android/internal/policy/impl/KeyguardViewManager.java @@ -99,7 +99,7 @@ public class KeyguardViewManager implements KeyguardWindowController { mKeyguardHost = new KeyguardViewHost(mContext, mCallback); - final int stretch = ViewGroup.LayoutParams.FILL_PARENT; + final int stretch = ViewGroup.LayoutParams.MATCH_PARENT; int flags = WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN | WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER | WindowManager.LayoutParams.FLAG_KEEP_SURFACE_WHILE_ANIMATING @@ -127,8 +127,8 @@ public class KeyguardViewManager implements KeyguardWindowController { mKeyguardView.setCallback(mCallback); final ViewGroup.LayoutParams lp = new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.FILL_PARENT, - ViewGroup.LayoutParams.FILL_PARENT); + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT); mKeyguardHost.addView(mKeyguardView, lp); diff --git a/policy/com/android/internal/policy/impl/PhoneWindow.java b/policy/com/android/internal/policy/impl/PhoneWindow.java index 6dd5d934b7134..55772b2ae7345 100644 --- a/policy/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/com/android/internal/policy/impl/PhoneWindow.java @@ -15,7 +15,7 @@ package com.android.internal.policy.impl; -import static android.view.ViewGroup.LayoutParams.FILL_PARENT; +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR; @@ -41,8 +41,6 @@ import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.net.Uri; import android.os.Bundle; -import android.os.Handler; -import android.os.Message; import android.os.Parcel; import android.os.Parcelable; import android.os.SystemClock; @@ -61,7 +59,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; -import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewManager; import android.view.VolumePanel; @@ -204,7 +201,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public void setContentView(View view) { - setContentView(view, new ViewGroup.LayoutParams(FILL_PARENT, FILL_PARENT)); + setContentView(view, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); } @Override @@ -424,7 +421,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } int backgroundResId; - if (lp.width == ViewGroup.LayoutParams.FILL_PARENT) { + if (lp.width == ViewGroup.LayoutParams.MATCH_PARENT) { // If the contents is fill parent for the width, set the // corresponding background backgroundResId = st.fullBackground; @@ -1811,7 +1808,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (SWEEP_OPEN_MENU) { if (mMenuBackground == null && mFeatureId < 0 && getAttributes().height - == WindowManager.LayoutParams.FILL_PARENT) { + == WindowManager.LayoutParams.MATCH_PARENT) { mMenuBackground = getContext().getResources().getDrawable( com.android.internal.R.drawable.menu_background); } @@ -2151,7 +2148,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mDecor.startChanging(); View in = mLayoutInflater.inflate(layoutResource, null); - decor.addView(in, new ViewGroup.LayoutParams(FILL_PARENT, FILL_PARENT)); + decor.addView(in, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); ViewGroup contentParent = (ViewGroup)findViewById(ID_ANDROID_CONTENT); if (contentParent == null) { diff --git a/policy/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/com/android/internal/policy/impl/PhoneWindowManager.java index d692a1d2e70f1..659b2bb3dabac 100755 --- a/policy/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/com/android/internal/policy/impl/PhoneWindowManager.java @@ -805,8 +805,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); - win.setLayout(WindowManager.LayoutParams.FILL_PARENT, - WindowManager.LayoutParams.FILL_PARENT); + win.setLayout(WindowManager.LayoutParams.MATCH_PARENT, + WindowManager.LayoutParams.MATCH_PARENT); final WindowManager.LayoutParams params = win.getAttributes(); params.token = appToken;