本文整理汇总了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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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";
}
示例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 "";
}
示例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;
}
示例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;
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}