@Override
 public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
   TiImageView view = getView();
   if (view == null) {
     return;
   }
   if (key.equals(TiC.PROPERTY_CAN_SCALE)) {
     view.setCanScaleImage(TiConvert.toBoolean(newValue));
   } else if (key.equals(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)) {
     view.setEnableZoomControls(TiConvert.toBoolean(newValue));
   } else if (key.equals(TiC.PROPERTY_URL)) {
     Log.w(LCAT, "The url property of ImageView is deprecated, use image instead.");
     setImageSource(newValue);
     firedLoad = false;
     setImage(true);
   } else if (key.equals(TiC.PROPERTY_IMAGE)) {
     setImageSource(newValue);
     firedLoad = false;
     setImage(true);
   } else if (key.equals(TiC.PROPERTY_IMAGES)) {
     if (newValue instanceof Object[]) {
       setImageSource(newValue);
       setImages();
     }
   } else {
     super.propertyChanged(key, oldValue, newValue, proxy);
   }
 }
 @Override
 public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
   if (DBG) {
     Log.d(LCAT, "Property: " + key + " old: " + oldValue + " new: " + newValue);
   }
   if (key.equals(TiC.PROPERTY_SEPARATOR_COLOR)) {
     tableView.setSeparatorColor(TiConvert.toString(newValue));
   } else {
     super.propertyChanged(key, oldValue, newValue, proxy);
   }
 }
 @Override
 public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
   if (key.equals("value")) {
     Date date = (Date) newValue;
     setValue(date.getTime());
   }
   if (key.equals(TiC.PROPERTY_CALENDAR_VIEW_SHOWN)) {
     setCalendarView(TiConvert.toBoolean(newValue));
   }
   super.propertyChanged(key, oldValue, newValue, proxy);
 }
  @Override
  public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
    TiImageView view = getView();
    if (view == null) {
      return;
    }
    if (key.equals(TiC.PROPERTY_CAN_SCALE)) {
      view.setCanScaleImage(TiConvert.toBoolean(newValue));
    } else if (key.equals(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)) {
      view.setEnableZoomControls(TiConvert.toBoolean(newValue));
    } else if (key.equals(TiC.PROPERTY_URL)) {
      Log.w(TAG, "The url property of ImageView is deprecated, use image instead.");
      setImageSource(newValue);
      firedLoad = false;
      setImage(true);
    } else if (key.equals(TiC.PROPERTY_IMAGE)) {
      setImageSource(newValue);
      firedLoad = false;
      setImage(true);
    } else if (key.equals(TiC.PROPERTY_IMAGES)) {
      if (newValue instanceof Object[]) {
        setImageSource(newValue);
        setImages();
      }
    } else {
      // Update requestedWidth / requestedHeight when width / height is changed.
      if (key.equals(TiC.PROPERTY_WIDTH)) {
        View parentView = getParentView();
        if (TiC.LAYOUT_FILL.equals(TiConvert.toString(newValue)) && parentView != null) {
          // Use the parent's width when it's fill
          requestedWidth =
              TiConvert.toTiDimension(parentView.getMeasuredWidth(), TiDimension.TYPE_WIDTH);
        } else {
          requestedWidth = TiConvert.toTiDimension(newValue, TiDimension.TYPE_WIDTH);
        }
      } else if (key.equals(TiC.PROPERTY_HEIGHT)) {
        View parentView = getParentView();
        // Use the parent's height when it's fill
        if (TiC.LAYOUT_FILL.equals(TiConvert.toString(newValue)) && parentView != null) {
          requestedHeight =
              TiConvert.toTiDimension(parentView.getMeasuredHeight(), TiDimension.TYPE_HEIGHT);
        } else {
          requestedHeight = TiConvert.toTiDimension(newValue, TiDimension.TYPE_HEIGHT);
        }
      }

      super.propertyChanged(key, oldValue, newValue, proxy);
    }
  }
  public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {

    if (key.equals(TiC.PROPERTY_HEADER_TITLE)) {
      setHeaderTitle(TiConvert.toString(newValue));
    } else if (key.equals(TiC.PROPERTY_FOOTER_TITLE)) {
      setFooterTitle(TiConvert.toString(newValue));
    } else if (key.equals(TiC.PROPERTY_SECTIONS) && newValue instanceof Object[]) {
      processSections((Object[]) newValue);
      if (adapter != null) {
        adapter.notifyDataSetChanged();
      }
    } else if (key.equals(TiC.PROPERTY_SEARCH_TEXT)) {
      this.searchText = TiConvert.toString(newValue);
      if (this.searchText != null) {
        reFilter(this.searchText);
      }
    } else if (key.equals(TiC.PROPERTY_CASE_INSENSITIVE_SEARCH)) {
      this.caseInsensitive = TiConvert.toBoolean(newValue, true);
      if (this.searchText != null) {
        reFilter(this.searchText);
      }
    } else if (key.equals(TiC.PROPERTY_SEARCH_VIEW)) {
      TiViewProxy searchView = (TiViewProxy) newValue;
      if (isSearchViewValid(searchView)) {
        TiUIView search = searchView.getOrCreateView();
        setSearchListener(searchView, search);
        if (searchLayout != null) {
          searchLayout.removeAllViews();
          addSearchLayout(searchLayout, searchView, search);
        } else {
          layoutSearchView(searchView);
        }
      } else {
        Log.e(TAG, "Searchview type is invalid");
      }

    } else if (key.equals(TiC.PROPERTY_SHOW_VERTICAL_SCROLL_INDICATOR) && newValue != null) {
      listView.setVerticalScrollBarEnabled(TiConvert.toBoolean(newValue));
    } else if (key.equals(TiC.PROPERTY_DEFAULT_ITEM_TEMPLATE) && newValue != null) {
      defaultTemplateBinding = TiConvert.toString(newValue);
      refreshItems();
    } else if (key.equals(TiC.PROPERTY_SEPARATOR_COLOR)) {
      String color = TiConvert.toString(newValue);
      setSeparatorColor(color);
    } else {
      super.propertyChanged(key, oldValue, newValue, proxy);
    }
  }
  @Override
  public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
    super.propertyChanged(key, oldValue, newValue, proxy);

    if (key.equals(TiC.PROPERTY_VALUE) || key.equals("min") || key.equals("max")) {
      updateProgress();
    } else if (key.equals(TiC.PROPERTY_MESSAGE)) {
      String message = TiConvert.toString(newValue);
      if (message != null) {
        handleSetMessage(message);
      }
    } else if (key.equals(TiC.PROPERTY_COLOR)) {
      final int color = TiConvert.toColor(TiConvert.toString(newValue));
      progress.getProgressDrawable().setColorFilter(color, Mode.SRC_IN);
      handleSetMessageColor(color);
    }
  }
Example #7
0
  @Override
  public void propertyChanged(String key, Object oldValue, Object newValue, TiProxy proxy) {
    TiImageView view = getView();

    if (key.equals("canScale")) {
      view.setCanScaleImage(TiConvert.toBoolean(newValue));
    } else if (key.equals("enableZoomControls")) {
      view.setEnableZoomControls(TiConvert.toBoolean(newValue));
    } else if (key.equals("url")) {

      synchronized (imageTokenGenerator) {
        token = imageTokenGenerator.incrementAndGet();
        getView().setImageDrawable(null);
        new BgImageLoader(getProxy().getTiContext(), null, null, token)
            .load(TiConvert.toString(newValue));
      }
    } else if (key.equals("image")) {
      Object image = newValue;
      if (image instanceof String) {
        String imageURL = TiConvert.toString(newValue);
        if (URLUtil.isNetworkUrl(imageURL)) {
          synchronized (imageTokenGenerator) {
            token = imageTokenGenerator.incrementAndGet();
            getView().setImageDrawable(null);
            new BgImageLoader(getProxy().getTiContext(), null, null, token).load(imageURL);
          }
        } else {
          setImage(createBitmap(imageURL));
        }
      } else {
        setImage(createBitmap(image));
      }
    } else if (key.equals("images")) {
      if (newValue instanceof Object[]) {
        setImages((Object[]) newValue);
      }
    } else {
      super.propertyChanged(key, oldValue, newValue, proxy);
    }
  }
Example #8
0
 @Override
 public void propertyChanged(String key, Object oldValue, Object newValue, TiProxy proxy) {
   if (DBG) {
     Log.d(LCAT, "Property: " + key + " old: " + oldValue + " new: " + newValue);
   }
   TextView tv = (TextView) getNativeView();
   if (key.equals("text")) {
     tv.setText(TiConvert.toString(newValue));
     tv.requestLayout();
   } else if (key.equals("color")) {
     tv.setTextColor(TiConvert.toColor((String) newValue));
   } else if (key.equals("highlightedColor")) {
     tv.setHighlightColor(TiConvert.toColor((String) newValue));
   } else if (key.equals("textAlign")) {
     setAlignment(tv, TiConvert.toString(newValue));
     tv.requestLayout();
   } else if (key.equals("font")) {
     TiUIHelper.styleText(tv, (TiDict) newValue);
     tv.requestLayout();
   } else {
     super.propertyChanged(key, oldValue, newValue, proxy);
   }
 }
 @Override
 public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
   if (TiC.PROPERTY_CURRENT_PAGE.equals(key)) {
     setCurrentPage(TiConvert.toInt(newValue));
   } else if (TiC.PROPERTY_SHOW_PAGING_CONTROL.equals(key)) {
     boolean show = TiConvert.toBoolean(newValue);
     if (show) {
       showPager();
     } else {
       hidePager();
     }
   } else if (TiC.PROPERTY_SCROLLING_ENABLED.equals(key)) {
     mEnabled = TiConvert.toBoolean(newValue);
   } else if (TiC.PROPERTY_OVER_SCROLL_MODE.equals(key)) {
     if (Build.VERSION.SDK_INT >= 9) {
       mPager.setOverScrollMode(TiConvert.toInt(newValue, View.OVER_SCROLL_ALWAYS));
     }
   } else if (TiC.PROPERTY_CACHE_SIZE.equals(key)) {
     cacheSize = TiConvert.toInt(newValue);
     if (cacheSize < 3) {
       // WHAT.  Let's make it something sensible.
       cacheSize = 3;
     }
     updateCacheSize();
   } else if (TiC.PROPERTY_PAGE_WIDTH.equals(key)) {
     setPageWidth(newValue);
   } else if (TiC.PROPERTY_PAGE_OFFSET.equals(key)) {
     setPageOffset(newValue);
   } else if (TiC.PROPERTY_TRANSITION.equals(key)) {
     transition = TransitionHelper.transitionFromObject((HashMap) newValue, null, null);
     mPager.updatePageTransformer();
     nativeView.invalidate();
   } else {
     super.propertyChanged(key, oldValue, newValue, proxy);
   }
 }
 @Override
 public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
   if (Log.isDebugModeEnabled()) {
     Log.d(TAG, "Property: " + key + " old: " + oldValue + " new: " + newValue, Log.DEBUG_MODE);
   }
   if (key.equals(TiC.PROPERTY_ENABLED)) {
     tv.setEnabled(TiConvert.toBoolean(newValue));
   } else if (key.equals(TiC.PROPERTY_VALUE)) {
     tv.setText(TiConvert.toString(newValue));
   } else if (key.equals(TiC.PROPERTY_MAX_LENGTH)) {
     maxLength = TiConvert.toInt(newValue);
     // truncate if current text exceeds max length
     Editable currentText = tv.getText();
     if (maxLength >= 0 && currentText.length() > maxLength) {
       CharSequence truncateText = currentText.subSequence(0, maxLength);
       int cursor = tv.getSelectionStart() - 1;
       if (cursor > maxLength) {
         cursor = maxLength;
       }
       tv.setText(truncateText);
       tv.setSelection(cursor);
     }
   } else if (key.equals(TiC.PROPERTY_COLOR)) {
     tv.setTextColor(TiConvert.toColor((String) newValue));
   } else if (key.equals(TiC.PROPERTY_HINT_TEXT)) {
     tv.setHint((String) newValue);
   } else if (key.equals(TiC.PROPERTY_ELLIPSIZE)) {
     if (TiConvert.toBoolean(newValue)) {
       tv.setEllipsize(TruncateAt.END);
     } else {
       tv.setEllipsize(null);
     }
   } else if (key.equals(TiC.PROPERTY_TEXT_ALIGN) || key.equals(TiC.PROPERTY_VERTICAL_ALIGN)) {
     String textAlign = null;
     String verticalAlign = null;
     if (key.equals(TiC.PROPERTY_TEXT_ALIGN)) {
       textAlign = TiConvert.toString(newValue);
     } else if (proxy.hasProperty(TiC.PROPERTY_TEXT_ALIGN)) {
       textAlign = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_TEXT_ALIGN));
     }
     if (key.equals(TiC.PROPERTY_VERTICAL_ALIGN)) {
       verticalAlign = TiConvert.toString(newValue);
     } else if (proxy.hasProperty(TiC.PROPERTY_VERTICAL_ALIGN)) {
       verticalAlign = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_VERTICAL_ALIGN));
     }
     handleTextAlign(textAlign, verticalAlign);
   } else if (key.equals(TiC.PROPERTY_KEYBOARD_TYPE)
       || (key.equals(TiC.PROPERTY_AUTOCORRECT)
           || key.equals(TiC.PROPERTY_AUTOCAPITALIZATION)
           || key.equals(TiC.PROPERTY_PASSWORD_MASK)
           || key.equals(TiC.PROPERTY_EDITABLE))) {
     KrollDict d = proxy.getProperties();
     handleKeyboard(d);
   } else if (key.equals(TiC.PROPERTY_RETURN_KEY_TYPE)) {
     handleReturnKeyType(TiConvert.toInt(newValue));
   } else if (key.equals(TiC.PROPERTY_FONT)) {
     TiUIHelper.styleText(tv, (HashMap) newValue);
   } else if (key.equals(TiC.PROPERTY_AUTO_LINK)) {
     TiUIHelper.linkifyIfEnabled(tv, newValue);
   } else {
     super.propertyChanged(key, oldValue, newValue, proxy);
   }
 }
Example #11
0
 // TODO @Override
 public void propertiesChanged(List<KrollPropertyChange> changes, KrollProxy proxy) {
   for (KrollPropertyChange change : changes) {
     propertyChanged(change.getName(), change.getOldValue(), change.getNewValue(), proxy);
   }
 }
Example #12
0
  public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {
    if (key.equals(TiC.PROPERTY_LEFT)) {
      if (newValue != null) {
        layoutParams.optionLeft =
            TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_LEFT);
      } else {
        layoutParams.optionLeft = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_TOP)) {
      if (newValue != null) {
        layoutParams.optionTop =
            TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_TOP);
      } else {
        layoutParams.optionTop = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_CENTER)) {
      TiConvert.updateLayoutCenter(newValue, layoutParams);
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_RIGHT)) {
      if (newValue != null) {
        layoutParams.optionRight =
            TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_RIGHT);
      } else {
        layoutParams.optionRight = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_BOTTOM)) {
      if (newValue != null) {
        layoutParams.optionBottom =
            TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_BOTTOM);
      } else {
        layoutParams.optionBottom = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_SIZE)) {
      if (newValue instanceof HashMap) {
        HashMap<String, Object> d = (HashMap) newValue;
        propertyChanged(TiC.PROPERTY_WIDTH, oldValue, d.get(TiC.PROPERTY_WIDTH), proxy);
        propertyChanged(TiC.PROPERTY_HEIGHT, oldValue, d.get(TiC.PROPERTY_HEIGHT), proxy);
      } else if (newValue != null) {
        Log.w(
            LCAT,
            "Unsupported property type ("
                + (newValue.getClass().getSimpleName())
                + ") for key: "
                + key
                + ". Must be an object/dictionary");
      }
    } else if (key.equals(TiC.PROPERTY_HEIGHT)) {
      if (newValue != null) {
        if (!newValue.equals(TiC.SIZE_AUTO)) {
          layoutParams.optionHeight =
              TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_HEIGHT);
          layoutParams.autoHeight = false;
        } else {
          layoutParams.optionHeight = null;
          layoutParams.autoHeight = true;
        }
      } else {
        layoutParams.optionHeight = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_WIDTH)) {
      if (newValue != null) {
        if (!newValue.equals(TiC.SIZE_AUTO)) {
          layoutParams.optionWidth =
              TiConvert.toTiDimension(TiConvert.toString(newValue), TiDimension.TYPE_WIDTH);
          layoutParams.autoWidth = false;
        } else {
          layoutParams.optionWidth = null;
          layoutParams.autoWidth = true;
        }
      } else {
        layoutParams.optionWidth = null;
      }
      layoutNativeView();
    } else if (key.equals(TiC.PROPERTY_ZINDEX)) {
      if (newValue != null) {
        layoutParams.optionZIndex = TiConvert.toInt(newValue);
      } else {
        layoutParams.optionZIndex = 0;
      }
      layoutNativeView(true);
    } else if (key.equals(TiC.PROPERTY_FOCUSABLE)) {
      boolean focusable = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_FOCUSABLE));
      nativeView.setFocusable(focusable);
      if (focusable) {
        registerForKeyClick(nativeView);
      } else {
        // nativeView.setOnClickListener(null); // ? mistake? I assume OnKeyListener was meant
        nativeView.setOnKeyListener(null);
      }
    } else if (key.equals(TiC.PROPERTY_TOUCH_ENABLED)) {
      doSetClickable(TiConvert.toBoolean(newValue));
    } else if (key.equals(TiC.PROPERTY_VISIBLE)) {
      nativeView.setVisibility(TiConvert.toBoolean(newValue) ? View.VISIBLE : View.INVISIBLE);
    } else if (key.equals(TiC.PROPERTY_ENABLED)) {
      nativeView.setEnabled(TiConvert.toBoolean(newValue));
    } else if (key.startsWith(TiC.PROPERTY_BACKGROUND_PADDING)) {
      Log.i(LCAT, key + " not yet implemented.");
    } else if (key.equals(TiC.PROPERTY_OPACITY)
        || key.startsWith(TiC.PROPERTY_BACKGROUND_PREFIX)
        || key.startsWith(TiC.PROPERTY_BORDER_PREFIX)) {
      // Update first before querying.
      proxy.setProperty(key, newValue);

      KrollDict d = proxy.getProperties();

      boolean hasImage = hasImage(d);
      boolean hasColorState = hasColorState(d);
      boolean hasBorder = hasBorder(d);

      boolean requiresCustomBackground = hasImage || hasColorState || hasBorder;

      if (!requiresCustomBackground) {
        if (background != null) {
          background.releaseDelegate();
          background.setCallback(null);
          background = null;
        }

        if (d.containsKeyAndNotNull(TiC.PROPERTY_BACKGROUND_COLOR)) {
          Integer bgColor = TiConvert.toColor(d, TiC.PROPERTY_BACKGROUND_COLOR);
          if (nativeView != null) {
            nativeView.setBackgroundColor(bgColor);
            nativeView.postInvalidate();
          }
        } else {
          if (key.equals(TiC.PROPERTY_OPACITY)) {
            setOpacity(TiConvert.toFloat(newValue));
          }
          if (nativeView != null) {
            nativeView.setBackgroundDrawable(null);
            nativeView.postInvalidate();
          }
        }
      } else {
        boolean newBackground = background == null;
        if (newBackground) {
          background = new TiBackgroundDrawable();
        }

        Integer bgColor = null;

        if (!hasColorState) {
          if (d.get(TiC.PROPERTY_BACKGROUND_COLOR) != null) {
            bgColor = TiConvert.toColor(d, TiC.PROPERTY_BACKGROUND_COLOR);
            if (newBackground
                || (key.equals(TiC.PROPERTY_OPACITY)
                    || key.equals(TiC.PROPERTY_BACKGROUND_COLOR))) {
              background.setBackgroundColor(bgColor);
            }
          }
        }

        if (hasImage || hasColorState) {
          if (newBackground || key.startsWith(TiC.PROPERTY_BACKGROUND_PREFIX)) {
            handleBackgroundImage(d);
          }
        }

        if (hasBorder) {
          if (newBackground) {
            initializeBorder(d, bgColor);
          } else if (key.startsWith(TiC.PROPERTY_BORDER_PREFIX)) {
            handleBorderProperty(key, newValue);
          }
        }
        applyCustomBackground();
      }
      if (nativeView != null) {
        nativeView.postInvalidate();
      }
    } else if (key.equals(TiC.PROPERTY_SOFT_KEYBOARD_ON_FOCUS)) {
      Log.w(
          LCAT,
          "Focus state changed to "
              + TiConvert.toString(newValue)
              + " not honored until next focus event.");
    } else if (key.equals(TiC.PROPERTY_TRANSFORM)) {
      if (nativeView != null) {
        applyTransform((Ti2DMatrix) newValue);
      }
    } else if (key.equals(TiC.PROPERTY_KEEP_SCREEN_ON)) {
      if (nativeView != null) {
        nativeView.setKeepScreenOn(TiConvert.toBoolean(newValue));
      }
    } else {
      TiViewProxy viewProxy = getProxy();
      if (viewProxy != null && viewProxy.isLocalizedTextId(key)) {
        viewProxy.setLocalizedText(key, TiConvert.toString(newValue));
      } else {
        if (DBG) {
          Log.d(LCAT, "Unhandled property key: " + key);
        }
      }
    }
  }
Example #13
0
  @Override
  public void propertyChanged(String key, Object oldValue, Object newValue, TiProxy proxy) {
    if (DBG) {
      Log.d(LCAT, "Property: " + key + " old: " + oldValue + " new: " + newValue);
    }
    if (key.equals("enabled")) {
      tv.setEnabled(TiConvert.toBoolean(newValue));
    } else if (key.equals("value")) {
      tv.setText((String) newValue);
    } else if (key.equals("color")) {
      tv.setTextColor(TiConvert.toColor((String) newValue));
    } else if (key.equals("passwordMask")) {
      if (TiConvert.toBoolean(newValue) == true) {
        // This shouldn't be needed but it's belts & braces
        tv.setKeyListener(TextKeyListener.getInstance(false, Capitalize.NONE));
        // Both setTransform & keyboard type are required
        tv.setTransformationMethod(PasswordTransformationMethod.getInstance());
        // We also need to set the keyboard type - otherwise the password mask won't be applied
        handleKeyboardType(KEYBOARD_PASSWORD, false);
      } else {
        handleKeyboardType(KEYBOARD_DEFAULT, false);
      }
    } else if (key.equals("hintText")) {
      tv.setHint((String) newValue);
    } else if (key.equals("textAlign") || key.equals("verticalAlign")) {
      String textAlign = null;
      String verticalAlign = null;
      if (key.equals("textAlign")) {
        textAlign = TiConvert.toString(newValue);
      }
      if (key.equals("verticalAlign")) {
        verticalAlign = TiConvert.toString(newValue);
      }
      handleTextAlign(textAlign, verticalAlign);
    } else if (key.equals("autocapitalization")) {

      // TODO Missing
      Capitalize autoCapValue = null;

      switch (TiConvert.toInt(newValue)) {
        case TEXT_AUTOCAPITALIZATION_NONE:
          autoCapValue = Capitalize.NONE;
          break;

        case TEXT_AUTOCAPITALIZATION_ALL:
          autoCapValue = Capitalize.CHARACTERS;
          break;

        case TEXT_AUTOCAPITALIZATION_SENTENCES:
          autoCapValue = Capitalize.SENTENCES;
          break;

        case TEXT_AUTOCAPITALIZATION_WORDS:
          autoCapValue = Capitalize.WORDS;
          break;

        default:
          Log.w(LCAT, "Unknown AutoCapitalization Value [" + TiConvert.toString(newValue) + "]");
          break;
      }

      if (null != autoCapValue) {
        tv.setKeyListener(TextKeyListener.getInstance(false, autoCapValue));
      }

    } else if (key.equals("keyboardType") || (key.equals("autocorrect"))) {
      TiDict d = proxy.getDynamicProperties();
      boolean autocorrect = false;
      if (d.containsKey("autocorrect")) {
        autocorrect = d.getBoolean("autocorrect");
      }

      handleKeyboardType(TiConvert.toInt(d, "keyboardType"), autocorrect);
    } else if (key.equals("returnKeyType")) {
      handleReturnKeyType(TiConvert.toInt(newValue));
    } else if (key.equals("font")) {
      TiUIHelper.styleText(tv, (TiDict) newValue);
    } else {
      super.propertyChanged(key, oldValue, newValue, proxy);
    }
  }