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

Java TiUIView类代码示例

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

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



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

示例1: setHtml

import org.appcelerator.titanium.view.TiUIView; //导入依赖的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: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity) {
	TiUIView view = new TiView(this);
	view.getLayoutParams().autoFillsHeight = true;
	view.getLayoutParams().autoFillsWidth = true;
	TiUIWebView webView = getWebView();
	view.add(webView);
	webView.getWebView().requestFocus(View.FOCUS_DOWN);
	webView.getWebView().setOnTouchListener(new View.OnTouchListener() {
		@Override
		public boolean onTouch(View v, MotionEvent e) {
			switch (e.getAction()) {
			case MotionEvent.ACTION_DOWN:
			case MotionEvent.ACTION_UP:
				if (!v.hasFocus())
					v.requestFocus();
				break;
			}
			return false;
		}
	});
	add(getProgressBar());
	return view;
}
 
开发者ID:appcelerator-archive,项目名称:ti.box,代码行数:25,代码来源:LoginViewProxy.java


示例3: setSections

import org.appcelerator.titanium.view.TiUIView; //导入依赖的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: handleFireItemClick

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
protected void handleFireItemClick (KrollDict data) {
	TiViewProxy listViewProxy = ((CollectionItemProxy)proxy).getListProxy();
	if (listViewProxy != null) {
		TiUIView listView = listViewProxy.peekView();
		if (listView != null) {
			KrollDict d = listView.getAdditionalEventData();
			if (d == null) {
				listView.setAdditionalEventData(new KrollDict((HashMap) additionalEventData));
			} else {
				d.clear();
				d.putAll(additionalEventData);
			}
			listView.fireEvent(TiC.EVENT_ITEM_CLICK, data);
		}
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:17,代码来源:CollectionItem.java


示例5: generateChildContentViews

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
public void generateChildContentViews(DataItem item, TiUIView parentContent, BaseCollectionViewItem rootItem, boolean root) {

		ArrayList<DataItem> childrenItem = item.getChildren();
		for (int i = 0; i < childrenItem.size(); i++) {
			DataItem child = childrenItem.get(i);
			TiViewProxy proxy = child.getViewProxy();
			TiUIView view = proxy.createView(proxy.getActivity());
			view.registerForTouch();
			proxy.setView(view);
			generateChildContentViews(child, view, rootItem, false);
			//Bind view to root.
			
			ViewItem viewItem = new ViewItem(view, new KrollDict());
			rootItem.bindView(child.getBindingId(), viewItem);
			//Add it to view hierarchy
			if (root) {
				rootItem.addView(view.getNativeView(), view.getLayoutParams());
			} else {
				parentContent.add(view);
			}

		}
	}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:24,代码来源:CollectionSectionProxy.java


示例6: getOrCreateView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
private TiUIView getOrCreateView(TiViewProxy viewProxy) {
	if (viewProxy == null) {
		return null;
	}
	TiUIView view = viewProxy.getOrCreateView();
	if (view != null) {
		return view;
	}
	Log.w(TAG, "getOrCreateView failed. Returned value is null");
	TiBaseActivity originalActivity = (TiBaseActivity) viewProxy.getActivity();
	if (originalActivity.isDestroyed()) {
		Log.w(TAG, "Original viewProxy activity is destroyed.");
	}
	Activity thisActivity = this.proxy.getActivity();
	if (thisActivity != originalActivity) {
			viewProxy.attachActivityLifecycle(thisActivity);
	}
	return viewProxy.getOrCreateView();
}
 
开发者ID:manumaticx,项目名称:Ti.DrawerLayout,代码行数:20,代码来源:Drawer.java


示例7: ViewPropertyAnimator_

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
public ViewPropertyAnimator_(TiViewProxy view) {
	super();

	if (view == null) {
		throw new IllegalStateException(ERR_VIEW_UNAVAILABLE);
	}

	TiUIView tiView = view.peekView();
	if (tiView == null) {
		throw new IllegalStateException(ERR_VIEW_UNAVAILABLE);
	}

	View nativeView = tiView.getNativeView();
	if (nativeView == null) {
		throw new IllegalStateException(ERR_VIEW_UNAVAILABLE);
	}

	mDisplayMetrics = AnimationUtils.getDisplayMetrics(nativeView);

	mAnimator = ViewPropertyAnimator.animate(nativeView);
	mAnimator.setListener(this);
}
 
开发者ID:billdawson,项目名称:ti-android-animation,代码行数:23,代码来源:ViewPropertyAnimator_.java


示例8: toPixels

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
/**
 * Converts dips, sips, etc. into pixels, taking density into account.
 * Useful when animating using the [ObjectAnimator](@ref ObjectAnimator_],
 * which does *not* perform such calculations automatically for you.
 * (The [ViewPropertyAnimator](@ref views.ViewPropertyAnimator_), however,
 * will do these calculations for you, so when using it you will likely
 * not need to be using this function.)
 * 
 * @param view			The view you will eventually be animating, or any view on
 * 						the same window. This is needed to determine the density
 * 						of the hosting screen.
 * @param originalValue A number with a unit specifier, such as "12dp" if you wished
 * 						to convert 12dp to pixels.
 * @param direction		(Optional) "horizontal" (default) or "vertical". Only relevant
 * 						if converting from inches, centimeters or millimeters.
 * @return 				Number of pixels
 * @since				1.0
 */
@Kroll.method
public float toPixels(TiViewProxy view, Object originalValue,
		@Kroll.argument(optional = true) String direction) {
	Axis axis = Axis.X;
	if (direction != null && direction.toLowerCase() == "vertical") {
		axis = Axis.Y;
	}

	TiUIView tiView = view.peekView();
	if (tiView == null) {
		throw new IllegalStateException(
				"The view must be rendered before toPixels() can be called because the density of its host screen must be determined.");
	}

	View nativeView = tiView.getNativeView();
	if (nativeView == null) {
		throw new IllegalStateException(
				"The view must be rendered before toPixels() can be called because the density of its host screen must be determined.");
	}

	return AnimationUtils.toPixels(
			AnimationUtils.getDisplayMetrics(nativeView), originalValue,
			axis);

}
 
开发者ID:billdawson,项目名称:ti-android-animation,代码行数:44,代码来源:AndroidAnimation.java


示例9: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity)
{
	((TiBaseActivity)activity).addOnLifecycleEventListener(this);
	((TiBaseActivity)activity).addInterceptOnBackPressedEventListener(this);
	TiUIWebView webView = new TiUIWebView(this);

	if (postCreateMessage != null) {
		sendPostCreateMessage(webView.getWebView(), postCreateMessage);
		postCreateMessage = null;
	}

	return webView;
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:15,代码来源:WebViewProxy.java


示例10: onCheckIsTextEditor

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public boolean onCheckIsTextEditor()
{
	if (proxy.hasProperty(TiC.PROPERTY_SOFT_KEYBOARD_ON_FOCUS)) {
		int value = TiConvert.toInt(proxy.getProperty(TiC.PROPERTY_SOFT_KEYBOARD_ON_FOCUS), TiUIView.SOFT_KEYBOARD_DEFAULT_ON_FOCUS);
		
		if (value == TiUIView.SOFT_KEYBOARD_HIDE_ON_FOCUS) {
			return false;
		} else if (value == TiUIView.SOFT_KEYBOARD_SHOW_ON_FOCUS) {
			return true;
		}
	}
	return super.onCheckIsTextEditor();
}
 
开发者ID:chreck,项目名称:movento-webview,代码行数:15,代码来源:TiUIWebView.java


示例11: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity)
{
	TiUIView view = new ExampleView(this);
	view.getLayoutParams().autoFillsHeight = true;
	view.getLayoutParams().autoFillsWidth = true;
	return view;
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:9,代码来源:ExampleProxy.java


示例12: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity) {
	
	TiUIView flipview = new TiFlipView(this);
	flipview.getLayoutParams().autoFillsHeight = true;
	flipview.getLayoutParams().autoFillsWidth = true;
	return flipview;
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:9,代码来源:FlipViewProxy.java


示例13: getView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {
	
	TiViewProxy tiProxy = mViewProxies.get(position);
	TiUIView tiView = tiProxy.getOrCreateView();
	View view = tiView.getOuterView();
	
	return view;
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:9,代码来源:FlipViewAdapter.java


示例14: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity) {
	TiUIView view = new ExampleView(this);
	// view.getLayoutParams().autoFillsHeight = true;
	// view.getLayoutParams().autoFillsWidth = true;
	return view;
}
 
开发者ID:artanisdesign,项目名称:ti-smoothprogressbar,代码行数:8,代码来源:SmoothProgressBarProxy.java


示例15: createView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Override
public TiUIView createView(Activity activity)
{
	view = new CameraView(this);
	act = activity;
	view.getLayoutParams().autoFillsHeight = true;
	view.getLayoutParams().autoFillsWidth = true;
	return view;
}
 
开发者ID:brownemint,项目名称:Ti-Android-CameraView,代码行数:10,代码来源:CameraViewProxy.java


示例16: layoutSearchView

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
private void layoutSearchView(TiViewProxy searchView) {
	TiUIView search = searchView.getOrCreateView();
	RelativeLayout layout = new RelativeLayout(proxy.getActivity());
	layout.setGravity(Gravity.NO_GRAVITY);
	layout.setPadding(0, 0, 0, 0);
	addSearchLayout(layout, searchView, search);
	setNativeView(layout);	
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionView.java


示例17: addSearchLayout

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
private void addSearchLayout(RelativeLayout layout, TiViewProxy searchView, TiUIView search) {
	RelativeLayout.LayoutParams p = createBasicSearchLayout();
	p.addRule(RelativeLayout.ALIGN_PARENT_TOP);

	TiDimension rawHeight;
	if (searchView.hasProperty(TiC.PROPERTY_HEIGHT)) {
		rawHeight = TiConvert.toTiDimension(searchView.getProperty(TiC.PROPERTY_HEIGHT), 0);
	} else {
		rawHeight = TiConvert.toTiDimension(MIN_SEARCH_HEIGHT, 0);
	}
	p.height = rawHeight.getAsPixels(layout);

	View nativeView = search.getNativeView();
	layout.addView(nativeView, p);

	p = createBasicSearchLayout();
	p.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
	p.addRule(RelativeLayout.BELOW, nativeView.getId());
	ViewParent parentWrapper = wrapper.getParent();
	if (parentWrapper != null && parentWrapper instanceof ViewGroup) {
		//get the previous layout params so we can reset with new layout
		ViewGroup.LayoutParams lp = wrapper.getLayoutParams();
		ViewGroup parentView = (ViewGroup) parentWrapper;
		//remove view from parent
		parentView.removeView(wrapper);
		//add new layout
		layout.addView(wrapper, p);
		parentView.addView(layout, lp);
		
	} else {
		layout.addView(wrapper, p);
	}
	this.searchLayout = layout;
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:35,代码来源:CollectionView.java


示例18: setSearchListener

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
private void setSearchListener(TiViewProxy searchView, TiUIView search) 
{
	if (searchView instanceof SearchBarProxy) {
		((TiUISearchBar)search).setOnSearchChangeListener(this);
	} else if (searchView instanceof SearchViewProxy) {
		((TiUISearchView)search).setOnSearchChangeListener(this);
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionView.java


示例19: handleSectionCount

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
public int handleSectionCount () {
	TiUIView listView = peekView();
	if (listView != null) {
		return ((CollectionView) listView).getSectionCount();
	}
	return 0;
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:8,代码来源:CollectionViewProxy.java


示例20: setMarker

import org.appcelerator.titanium.view.TiUIView; //导入依赖的package包/类
@Kroll.method
public void setMarker(Object marker) {
	if (marker instanceof HashMap) {
		HashMap<String, Integer> m = (HashMap<String, Integer>) marker;
		TiUIView listView = peekView();
		if (listView != null) {
			((CollectionView)listView).setMarker(m);
		} else {
			preloadMarker = m;
		}
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:13,代码来源:CollectionViewProxy.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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