• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TiMessenger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.appcelerator.kroll.common.TiMessenger的典型用法代码示例。如果您正苦于以下问题:Java TiMessenger类的具体用法?Java TiMessenger怎么用?Java TiMessenger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TiMessenger类属于org.appcelerator.kroll.common包,在下文中一共展示了TiMessenger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: scrollToItem

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public void scrollToItem(int sectionIndex, int itemIndex, @SuppressWarnings("rawtypes") @Kroll.argument(optional=true)HashMap options) {
	boolean animated = true;
	if ( (options != null) && (options instanceof HashMap<?, ?>) ) {
		@SuppressWarnings("unchecked")
		KrollDict animationargs = new KrollDict(options);
		if (animationargs.containsKeyAndNotNull(TiC.PROPERTY_ANIMATED)) {
			animated = TiConvert.toBoolean(animationargs.get(TiC.PROPERTY_ANIMATED), true);
		}
	} 
	if (TiApplication.isUIThread()) {
		handleScrollToItem(sectionIndex, itemIndex, animated);
	} else {
		KrollDict d = new KrollDict();
		d.put("itemIndex", itemIndex);
		d.put("sectionIndex", sectionIndex);
		d.put(TiC.PROPERTY_ANIMATED, Boolean.valueOf(animated));
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SCROLL_TO_ITEM), d);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:21,代码来源:CollectionViewProxy.java


示例2: setSections

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.setProperty @Kroll.method
public void setSections(Object sections)
{
	if (!(sections instanceof Object[])) {
		Log.e(TAG, "Invalid argument type to setSection(), needs to be an array", Log.DEBUG_MODE);
		return;
	}
	//Update java and javascript property
	setProperty(TiC.PROPERTY_SECTIONS, sections);

	Object[] sectionsArray = (Object[]) sections;
	TiUIView listView = peekView();
	//Preload sections if listView is not opened.
	if (listView == null) {
		preload = true;
		clearPreloadSections();
		addPreloadSections(sectionsArray, -1, true);
	} else {
		if (TiApplication.isUIThread()) {
			((CollectionView)listView).processSectionsAndNotify(sectionsArray);
		} else {
			TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_SECTIONS), sectionsArray);
		}
		
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:27,代码来源:CollectionViewProxy.java


示例3: replaceItemsAt

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public void replaceItemsAt(int index, int count, Object data) {
	if (!isIndexValid(index)) {
		return;
	}

	if (TiApplication.isUIThread()) {
		handleReplaceItemsAt(index, count, data);
	} else {
		KrollDict d = new KrollDict();
		d.put(TiC.EVENT_PROPERTY_INDEX, index);
		d.put(TiC.PROPERTY_COUNT, count);
		d.put(TiC.PROPERTY_DATA, data);
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_REPLACE_ITEMS_AT), d);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:17,代码来源:CollectionSectionProxy.java


示例4: reverse

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
/**
 * @since 1.0
 */
@Kroll.method
public void reverse() {
	buildAnimator();
	final ObjectAnimator animator = (ObjectAnimator) getAnimator();
	if (animator != null) {
		TiMessenger.postOnMain(new Runnable() {
			@Override
			public void run() {
				animator.reverse();
			}
		});
	} else {
		Log.w(TAG, WARN_ANIMATOR);
	}
}
 
开发者ID:billdawson,项目名称:ti-android-animation,代码行数:19,代码来源:ObjectAnimator_.java


示例5: getScrollHeight

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.getProperty @Kroll.method
public String getScrollHeight()
{
	if (peekView() != null) {
		if (TiApplication.isUIThread()) {
			return getWebView().getScrollHeight();
		} else {
			return (String) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_GET_SCROLL_HEIGHT));
		}
	}
	return "0";
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:13,代码来源:WebViewProxy.java


示例6: getUserAgent

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.getProperty
public String getUserAgent()
{
	TiUIWebView currWebView = getWebView();
	if (currWebView != null) {
		if (TiApplication.isUIThread()) {
			return currWebView.getUserAgentString();
		} else {
			return (String) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_GET_USER_AGENT));
		}
	}
	return "";
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:14,代码来源:WebViewProxy.java


示例7: canGoBack

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public boolean canGoBack()
{
	if (peekView() != null) {
		if (TiApplication.isUIThread()) {
			return getWebView().canGoBack();
		} else {
			return (Boolean) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_CAN_GO_BACK));
		}
	}
	return false;
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:13,代码来源:WebViewProxy.java


示例8: canGoForward

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public boolean canGoForward()
{
	if (peekView() != null) {
		if (TiApplication.isUIThread()) {
			return getWebView().canGoForward();
		} else {
			return (Boolean) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_CAN_GO_FORWARD));
		}
	}
	return false;
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:13,代码来源:WebViewProxy.java


示例9: getSectionCount

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.getProperty
public int getSectionCount() {
	if (TiApplication.isUIThread()) {
		return handleSectionCount();
	} else {
		return (Integer) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SECTION_COUNT));
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionViewProxy.java


示例10: appendSection

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public void appendSection(Object section) {
	if (TiApplication.isUIThread()) {
		handleAppendSection(section);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_APPEND_SECTION), section);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionViewProxy.java


示例11: deleteSectionAt

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public void deleteSectionAt(int index) {
	if (TiApplication.isUIThread()) {
		handleDeleteSectionAt(index);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_DELETE_SECTION_AT), index);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionViewProxy.java


示例12: getSections

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.getProperty
public CollectionSectionProxy[] getSections()
{
	if (TiApplication.isUIThread()) {
		return handleSections();
	} else {
		return (CollectionSectionProxy[]) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_GET_SECTIONS));
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:10,代码来源:CollectionViewProxy.java


示例13: setHeaderView

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setHeaderView(TiViewProxy headerView) {
	if (TiApplication.isUIThread()) {
		handleSetHeaderView(headerView);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_HEADER_VIEW), headerView);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例14: setFooterView

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setFooterView(TiViewProxy footerView) {
	if (TiApplication.isUIThread()) {
		handleSetFooterView(footerView);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_FOOTER_VIEW), footerView);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例15: setHeaderTitle

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setHeaderTitle(String headerTitle) {
	if (TiApplication.isUIThread()) {
		handleSetHeaderTitle(headerTitle);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_HEADER_TITLE), headerTitle);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例16: setFooterTitle

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setFooterTitle(String footerTitle) {
	if (TiApplication.isUIThread()) {
		handleSetFooterTitle(footerTitle);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_FOOTER_TITLE), footerTitle);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例17: getItemAt

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public KrollDict getItemAt(int index) {
	if (TiApplication.isUIThread()) {
		return handleGetItemAt(index);
	} else {
		return (KrollDict) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_GET_ITEM_AT), index);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例18: setItems

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setItems(Object data) {
	if (TiApplication.isUIThread()) {
		handleSetItems(data);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SET_ITEMS), data);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java


示例19: getItems

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method @Kroll.getProperty
public Object[] getItems() {
	if (itemProperties == null) {
		return new Object[0];
	} else if (TiApplication.isUIThread()) {
		return itemProperties.toArray();
	} else {
		return (Object[]) TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_GET_ITEMS));
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:11,代码来源:CollectionSectionProxy.java


示例20: appendItems

import org.appcelerator.kroll.common.TiMessenger; //导入依赖的package包/类
@Kroll.method
public void appendItems(Object data) {
	if (TiApplication.isUIThread()) {
		handleAppendItems(data);
	} else {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_APPEND_ITEMS), data);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionSectionProxy.java



注:本文中的org.appcelerator.kroll.common.TiMessenger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SchemaAware类代码示例发布时间:2022-05-23
下一篇:
Java BasicHeaderElement类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap