org.appcelerator.kroll.KrollProxy Java Examples
The following examples show how to use
org.appcelerator.kroll.KrollProxy.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RealSwitch.java From RealSwitch with MIT License | 6 votes |
@Override public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) { CompoundButton cb = (CompoundButton) getNativeView(); if (key.equals(TiC.PROPERTY_TITLE_OFF)) { ((Switch) cb).setTextOff((String) newValue); } else if (key.equals(TiC.PROPERTY_TITLE_ON)) { ((Switch) cb).setTextOff((String) newValue); } else if (key.equals(TiC.PROPERTY_VALUE)) { cb.setChecked(TiConvert.toBoolean(newValue)); } else if (key.equals(TiC.PROPERTY_COLOR)) { cb.setTextColor(TiConvert.toColor(TiConvert.toString(newValue))); } else if (key.equals(TiC.PROPERTY_FONT)) { TiUIHelper.styleText(cb, (KrollDict) newValue); } else if (key.equals(TiC.PROPERTY_TEXT_ALIGN)) { TiUIHelper.setAlignment(cb, TiConvert.toString(newValue), null); cb.requestLayout(); } else if (key.equals(TiC.PROPERTY_VERTICAL_ALIGN)) { TiUIHelper.setAlignment(cb, null, TiConvert.toString(newValue)); cb.requestLayout(); } else { super.propertyChanged(key, oldValue, newValue, proxy); } }
Example #2
Source File: ViewProxy.java From TiTouchImageView with MIT License | 6 votes |
@Override public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) { if (key.equals("zoom")) { tiv.setZoom(TiConvert.toFloat(newValue)); } if (key.equals("image")) { handleImage(newValue); } if (key.equals("maxZoom")) { tiv.setMaxZoom(TiConvert.toFloat(newValue)); } if (key.equals("minZoom")) { tiv.setMinZoom(TiConvert.toFloat(newValue)); } }
Example #3
Source File: DropdownProxy.java From actionbarextras with MIT License | 5 votes |
@Override public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) { if ((oldValue == newValue) || ((oldValue != null) && oldValue.equals(newValue))) { return; } Log.d("ABX", "propertyChanged ---> " + key + ": " + newValue); if (key.equals("activeItem")){ int activeItem = (Integer) newValue; getMainHandler().obtainMessage(MSG_ACTIVE_ITEM, activeItem).sendToTarget(); } }
Example #4
Source File: CollectionView.java From TiCollectionView with MIT License | 4 votes |
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[] ) { processSectionsAndNotify((Object[])newValue); } 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); } }
Example #5
Source File: DropdownProxy.java From actionbarextras with MIT License | 2 votes |
@Override public void listenerAdded(String type, int count, KrollProxy proxy) { }
Example #6
Source File: DropdownProxy.java From actionbarextras with MIT License | 2 votes |
@Override public void listenerRemoved(String type, int count, KrollProxy proxy) { }
Example #7
Source File: DropdownProxy.java From actionbarextras with MIT License | 2 votes |
@Override public void propertiesChanged(List<KrollPropertyChange> changes, KrollProxy proxy) { }