summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 02:19:27 +0000
committerbenm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 02:19:27 +0000
commitf6e71f5b70d302c9cc7e81054a9fa6e745fc10b5 (patch)
tree95e6dfdd8c76c9aa7ca5faafb78579828ceff306
parent45861e6dc240638f5bebf84fcf75f28493986017 (diff)
downloadchromium_src-f6e71f5b70d302c9cc7e81054a9fa6e745fc10b5.zip
chromium_src-f6e71f5b70d302c9cc7e81054a9fa6e745fc10b5.tar.gz
chromium_src-f6e71f5b70d302c9cc7e81054a9fa6e745fc10b5.tar.bz2
[Android] Refactor MonthPickerDialog.
Remove the wrapper month_picker_dialog layout resource and instead instantiate a MonthPicker View programmatically. This allows for greater reuse of the layout XML with Android WebView work, where we cannot reference custom classes in XML. Review URL: https://chromiumcodereview.appspot.com/12040013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178207 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/public/android/java/res/layout/month_picker_dialog.xml13
-rw-r--r--content/public/android/java/resource_map/org/chromium/content/R.java1
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/MonthPickerDialog.java8
3 files changed, 2 insertions, 20 deletions
diff --git a/content/public/android/java/res/layout/month_picker_dialog.xml b/content/public/android/java/res/layout/month_picker_dialog.xml
deleted file mode 100644
index 70ab1df..0000000
--- a/content/public/android/java/res/layout/month_picker_dialog.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
--->
-
-<org.chromium.content.browser.MonthPicker xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/date_picker"
- android:layout_gravity="center_horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
diff --git a/content/public/android/java/resource_map/org/chromium/content/R.java b/content/public/android/java/resource_map/org/chromium/content/R.java
index 987436c..195f1f8 100644
--- a/content/public/android/java/resource_map/org/chromium/content/R.java
+++ b/content/public/android/java/resource_map/org/chromium/content/R.java
@@ -37,7 +37,6 @@ public final class R {
public static final class layout {
public static int date_time_picker_dialog;
public static int month_picker;
- public static int month_picker_dialog;
}
public static final class string {
public static int accessibility_content_view;
diff --git a/content/public/android/java/src/org/chromium/content/browser/MonthPickerDialog.java b/content/public/android/java/src/org/chromium/content/browser/MonthPickerDialog.java
index 0a28007..cf8c770 100644
--- a/content/public/android/java/src/org/chromium/content/browser/MonthPickerDialog.java
+++ b/content/public/android/java/src/org/chromium/content/browser/MonthPickerDialog.java
@@ -10,7 +10,6 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Build;
import android.os.Bundle;
-import android.view.LayoutInflater;
import android.view.View;
import org.chromium.content.browser.MonthPicker.OnMonthChangedListener;
@@ -75,11 +74,8 @@ public class MonthPickerDialog extends AlertDialog implements OnClickListener,
setIcon(0);
setTitle(R.string.month_picker_dialog_title);
- LayoutInflater inflater =
- (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = inflater.inflate(R.layout.month_picker_dialog, null);
- setView(view);
- mMonthPicker = (MonthPicker) view.findViewById(R.id.date_picker);
+ mMonthPicker = new MonthPicker(context);
+ setView(mMonthPicker);
mMonthPicker.init(year, monthOfYear, this);
}