Deprecate fill_parent and introduce match_parent.

Bug: #2361749.
This commit is contained in:
Romain Guy
2010-01-08 15:05:33 -08:00
parent b4e39aebf6
commit 74192eafec
243 changed files with 1003 additions and 1015 deletions

View File

@@ -21,7 +21,6 @@ package com.example.android.apis.graphics;
import com.example.android.apis.R;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
@@ -34,8 +33,6 @@ import android.widget.ScrollView;
import android.view.LayoutInflater;
import android.view.View;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -117,20 +114,20 @@ public class DensityActivity extends Activity {
private View scrollWrap(View view) {
ScrollView scroller = new ScrollView(this);
scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.FILL_PARENT,
ScrollView.LayoutParams.FILL_PARENT));
scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT,
ScrollView.LayoutParams.MATCH_PARENT));
return scroller;
}
private void addLabelToRoot(LinearLayout root, String text) {
TextView label = new TextView(this);
label.setText(text);
root.addView(label, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
root.addView(label, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
}
private void addChildToRoot(LinearLayout root, LinearLayout layout) {
root.addView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
root.addView(layout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
}

View File

@@ -76,7 +76,7 @@ public class PictureLayout extends ViewGroup {
@Override
protected LayoutParams generateDefaultLayoutParams() {
return new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
}
@Override