当前位置: 首页>>代码示例>>Java>>正文


Java TiMessenger.sendBlockingMainMessage方法代码示例

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


在下文中一共展示了TiMessenger.sendBlockingMainMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例5: 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

示例6: 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

示例7: 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

示例8: scrollTo

import org.appcelerator.kroll.common.TiMessenger; //导入方法依赖的package包/类
@Kroll.method
public void scrollTo(int x, int y) {
	if (!TiApplication.isUIThread()) {
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_SCROLL_TO, x, y), getActivity());
	} else {
		handleScrollTo(x,y);
	}
}
 
开发者ID:iotashan,项目名称:TiTouchImageView,代码行数:9,代码来源:ViewProxy.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: updateItemAt

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

	if (TiApplication.isUIThread()) {
		handleUpdateItemAt(index,  new Object[]{data});
	} else {
		KrollDict d = new KrollDict();
		d.put(TiC.EVENT_PROPERTY_INDEX, index);
		d.put(TiC.PROPERTY_DATA, new Object[]{data});
		TiMessenger.sendBlockingMainMessage(getMainHandler().obtainMessage(MSG_UPDATE_ITEM_AT), d);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:16,代码来源:CollectionSectionProxy.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: 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

示例14: 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

示例15: deleteItemsAt

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

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


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