當前位置: 首頁>>代碼示例>>Java>>正文


Java TiApplication.isUIThread方法代碼示例

本文整理匯總了Java中org.appcelerator.titanium.TiApplication.isUIThread方法的典型用法代碼示例。如果您正苦於以下問題:Java TiApplication.isUIThread方法的具體用法?Java TiApplication.isUIThread怎麽用?Java TiApplication.isUIThread使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.appcelerator.titanium.TiApplication的用法示例。


在下文中一共展示了TiApplication.isUIThread方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setHtml

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void setHtml(String html, @Kroll.argument(optional = true) KrollDict d)
{
	setProperty(TiC.PROPERTY_HTML, html);
	setProperty(OPTIONS_IN_SETHTML, d);

	// If the web view has not been created yet, don't set html here. It will be set in processProperties() when the
	// view is created.
	TiUIView v = peekView();
	if (v != null) {
		if (TiApplication.isUIThread()) {
			((TiUIWebView) v).setHtml(html, d);
		} else {
			getMainHandler().sendEmptyMessage(MSG_SET_HTML);
		}
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:18,代碼來源:WebViewProxy.java

示例2: scrollToItem

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例3: setSections

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例4: replaceItemsAt

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例5: setRequestHeaders

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void setRequestHeaders(HashMap d)
{
	TiUIWebView currWebView = getWebView();
 		if (currWebView != null) {
 			if (TiApplication.isUIThread()) {
 				currWebView.setRequestHeaders(d);
 			} else {
 				//
 				Message message = getMainHandler().obtainMessage(MSG_SET_HEADER);
 				message.obj = d;
 				message.sendToTarget();
 			}
 		}
 	}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:16,代碼來源:WebViewProxy.java

示例6: getScrollHeight

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例7: setUserAgent

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method @Kroll.setProperty
public void setUserAgent(String userAgent)
{
	TiUIWebView currWebView = getWebView();
	if (currWebView != null) {
		if (TiApplication.isUIThread()) {
			currWebView.setUserAgentString(userAgent);
		} else {
			Message message = getMainHandler().obtainMessage(MSG_SET_USER_AGENT);
			message.obj = userAgent;
			message.sendToTarget();
		}
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:15,代碼來源:WebViewProxy.java

示例8: getUserAgent

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例9: canGoBack

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例10: canGoForward

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例11: pause

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void pause() 
{
	if (peekView() != null) {
		if (TiApplication.isUIThread()) {
			getWebView().pauseWebView();
		} else {
			getMainHandler().sendEmptyMessage(MSG_PAUSE);
		}
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:12,代碼來源:WebViewProxy.java

示例12: resume

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void resume()
{
	if (peekView() != null) {
		if (TiApplication.isUIThread()) {
			getWebView().resumeWebView();
		} else {
			getMainHandler().sendEmptyMessage(MSG_RESUME);
		}
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:12,代碼來源:WebViewProxy.java

示例13: release

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void release()
{
	if (TiApplication.isUIThread()) {
		super.releaseViews();
	} else {
		getMainHandler().sendEmptyMessage(MSG_RELEASE);
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:10,代碼來源:WebViewProxy.java

示例14: getSectionCount

import org.appcelerator.titanium.TiApplication; //導入方法依賴的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

示例15: closeRightWindow

import org.appcelerator.titanium.TiApplication; //導入方法依賴的package包/類
@Kroll.method
public void closeRightWindow() {
	if (TiApplication.isUIThread()) {
		handleCloseRightView();
		return;
	}
	Message message = getMainHandler().obtainMessage(MSG_CLOSE_RIGHT_VIEW);
	message.sendToTarget();
}
 
開發者ID:manumaticx,項目名稱:Ti.DrawerLayout,代碼行數:10,代碼來源:DrawerProxy.java


注:本文中的org.appcelerator.titanium.TiApplication.isUIThread方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。