public AttrDescView_widget_DatePicker_endYear_startYear(ClassDescViewBased parent, String name) {
    super(parent, name);

    Class datePickerClass1, datePickerClass2;
    if (Build.VERSION.SDK_INT < MiscUtil.LOLLIPOP) {
      datePickerClass1 = parent.getDeclaredClass();
      datePickerClass2 = datePickerClass1;
    } else // Lollipop
    {
      this.fieldDelegate = new FieldContainer<Object>(parent.getDeclaredClass(), "mDelegate");
      datePickerClass1 =
          MiscUtil.resolveClass(DatePicker.class.getName() + "$AbstractDatePickerDelegate");
      datePickerClass2 =
          MiscUtil.resolveClass(DatePicker.class.getName() + "$DatePickerSpinnerDelegate");
    }

    this.fieldCurrentLocale = new FieldContainer<Locale>(datePickerClass1, "mCurrentLocale");

    String methodName = null;
    if ("endYear".equals(name)) methodName = "setMaxDate";
    else if ("startYear".equals(name)) methodName = "setMinDate";

    this.methodMaxMinDate =
        new MethodContainer<Void>(datePickerClass2, methodName, new Class[] {long.class});
  }
示例#2
0
 @SuppressWarnings("unchecked")
 protected <TclassDesc extends ClassDesc, TattrTarget, TattrContext extends AttrContext>
     AttrDesc<TclassDesc, TattrTarget, TattrContext> getAttrDesc(
         String namespaceURI, String name) {
   if (InflatedXML.XMLNS_ANDROID.equals(namespaceURI)) return getAttrDescAN(name);
   else if (MiscUtil.isEmpty(namespaceURI)) return getAttrDescNoNS(name);
   else return null; // Namespace no gestionado aquí
 }