Bug 708394: Remove unwanted LayoutInflater [r=mfinkle]

This commit is contained in:
Sriram Ramasubramanian
2011-12-07 15:12:51 -08:00
parent 3400c4cb51
commit 68532fad1d
11 changed files with 97 additions and 52 deletions

View File

@@ -56,11 +56,13 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
private LinearLayout mChoicesLayout;
private TextView mTextView;
private Button mButton;
private LayoutParams mLayoutParams;
static private LayoutParams mLayoutParams;
public Tab mTab;
// value used to identify the notification
private String mValue;
static private LayoutInflater mInflater;
private int mPersistence = 0;
private long mTimeout = 0;
@@ -73,18 +75,19 @@ public class DoorHanger extends LinearLayout implements Button.OnClickListener {
setOrientation(VERTICAL);
setBackgroundResource(R.drawable.doorhanger_shadow_bg);
// Load layout into the custom view
LayoutInflater inflater =
(LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.doorhanger, this);
if (mInflater == null)
mInflater = LayoutInflater.from(mContext);
mInflater.inflate(R.layout.doorhanger, this);
hide();
mTextView = (TextView) findViewById(R.id.doorhanger_title);
mChoicesLayout = (LinearLayout) findViewById(R.id.doorhanger_choices);
mLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT,
1.0f);
if (mLayoutParams == null)
mLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT,
1.0f);
}
public void addButton(String aText, int aCallback) {