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

Java TiViewProxy类代码示例

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

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



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

示例1: setViews

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public void setViews(Object viewsObject)
{
	boolean changed = false;
	clearViewsList();

	if (viewsObject instanceof Object[]) {
		Object[] views = (Object[])viewsObject;
		Activity activity = this.proxy.getActivity();
		for (int i = 0; i < views.length; i++) {
			if (views[i] instanceof TiViewProxy) {
				TiViewProxy tv = (TiViewProxy)views[i];
				tv.setActivity(activity);
				tv.setParent(this.proxy);
				mViews.add(tv);
				changed = true;
			}
		}
	}
	if (changed) {
		mAdapter.notifyDataSetChanged();
	}
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:23,代码来源:TiFlipView.java


示例2: handleFireItemClick

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例3: generateChildContentViews

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例4: getOrCreateView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例5: TiUIProgressBar

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public TiUIProgressBar(final TiViewProxy proxy) {
    super(proxy);

    view = new LinearLayout(proxy.getActivity()) {
        @Override
        protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
            super.onLayout(changed, left, top, right, bottom);
            TiUIHelper.firePostLayoutEvent(proxy);
        }
    };

    view.setOrientation(LinearLayout.VERTICAL);
    label = new TextView(proxy.getActivity());
    label.setGravity(Gravity.TOP | Gravity.LEFT);
    label.setPadding(0, 0, 0, 0);
    label.setSingleLine(false);

    progress = new ProgressBar(proxy.getActivity(), null, android.R.attr.progressBarStyleHorizontal);
    progress.setIndeterminate(false);
    progress.setMax(1000);

    view.addView(label);
    view.addView(progress);

    setNativeView(view);
}
 
开发者ID:smclab,项目名称:TiAlternativeProgressBar,代码行数:27,代码来源:TiUIProgressBar.java


示例6: ViewPropertyAnimator_

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例7: toPixels

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例8: translatePropertyName

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public static String translatePropertyName(Object object,
		String tiPropertyName) {
	ObjectType objType = ObjectType.GENERAL;

	// Currently we only have property name maps for mapping from Titanium
	// views to Android native views.
	if (object instanceof TiViewProxy) {
		objType = ObjectType.VIEW;
	}

	String newName = mPropertyMap.get(objType).get(tiPropertyName);
	if (newName == null) {
		newName = tiPropertyName;
	}

	return newName;

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


示例9: ExampleView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public ExampleView(TiViewProxy proxy) {
	super(proxy);
	LayoutArrangement arrangement = LayoutArrangement.DEFAULT;

	if (proxy.hasProperty(TiC.PROPERTY_LAYOUT)) {
		String layoutProperty = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_LAYOUT));
		if (layoutProperty.equals(TiC.LAYOUT_HORIZONTAL)) {
			arrangement = LayoutArrangement.HORIZONTAL;
		} else if (layoutProperty.equals(TiC.LAYOUT_VERTICAL)) {
			arrangement = LayoutArrangement.VERTICAL;
		}
	}
	setNativeView(new TiCompositeLayout(proxy.getActivity(), arrangement));
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:15,代码来源:ExampleProxy.java


示例10: TiFlipView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public TiFlipView(TiViewProxy proxy) {
	super(proxy);
	Activity activity = proxy.getActivity();
	mViews = new ArrayList<TiViewProxy>();
	
	mAdapter = new FlipViewAdapter(activity, mViews);
	mFlipView = new FlipView(activity);
	mFlipView.setAdapter(mAdapter);
	mFlipView.setOnFlipListener(this);
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:11,代码来源:TiFlipView.java


示例11: clearViewsList

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
private void clearViewsList()
{
	if (mViews == null || mViews.size() == 0) {
		return;
	}
	for (TiViewProxy viewProxy : mViews) {
		viewProxy.releaseViews();
		viewProxy.setParent(null);
	}
	mViews.clear();
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:12,代码来源:TiFlipView.java


示例12: addView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public void addView(TiViewProxy proxy)
{
	if (!mViews.contains(proxy)) {
		proxy.setActivity(this.proxy.getActivity());
		proxy.setParent(this.proxy);
		mViews.add(proxy);
		getProxy().setProperty(TiC.PROPERTY_VIEWS, mViews.toArray());
		mAdapter.notifyDataSetChanged();
	}
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:11,代码来源:TiFlipView.java


示例13: removeView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public void removeView(TiViewProxy proxy)
{
	if (mViews.contains(proxy)) {
		mViews.remove(proxy);
		proxy.setParent(null);
		getProxy().setProperty(TiC.PROPERTY_VIEWS, mViews.toArray());
		mAdapter.notifyDataSetChanged();
	}
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:10,代码来源:TiFlipView.java


示例14: flipTo

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public void flipTo(Object view)
{
	if (view instanceof Number) {
		move(((Number) view).intValue(), true);
	} else if (view instanceof TiViewProxy) {
		move(mViews.indexOf(view), true);
	}
}
 
开发者ID:manumaticx,项目名称:TiAndroidFlip,代码行数:9,代码来源:TiFlipView.java


示例15: getView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的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


示例16: ExampleView

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

	String packageName = proxy.getActivity().getPackageName();
	Resources resources = proxy.getActivity().getResources();

	View progressBarWrapper;

	int resId_progressBarHolder = -1;
	int resId_progressBar = -1;

	resId_progressBarHolder = resources.getIdentifier(
			"progressbar_layout", "layout", packageName);
	resId_progressBar = resources.getIdentifier("progressbar_default",
			"id", packageName);

	LayoutInflater inflater = LayoutInflater.from(getActivity());
	progressBarWrapper = inflater
			.inflate(resId_progressBarHolder, null);
	progressBar = (ProgressBar) progressBarWrapper
			.findViewById(resId_progressBar);

	TiApplication appContext = TiApplication.getInstance();

	progressBar
			.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(
					appContext).sectionsCount(sectionsCount)
					.separatorLength(separatorLength).speed(speed)
					.mirrorMode(mirrorMode).reversed(reversed)
					.color(color).strokeWidth(strokeWidth)
					.interpolator(interpolator).build());

	setNativeView(progressBarWrapper);

}
 
开发者ID:artanisdesign,项目名称:ti-smoothprogressbar,代码行数:36,代码来源:SmoothProgressBarProxy.java


示例17: CameraView

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public CameraView(TiViewProxy proxy) {
	super(proxy);
	
	SurfaceView preview = new SurfaceView(proxy.getActivity());
	SurfaceHolder previewHolder = preview.getHolder();
	previewHolder.addCallback(this);
	previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
	
	FrameLayout previewLayout = new FrameLayout(proxy.getActivity());
	previewLayout.addView(preview, layoutParams);
	
	setNativeView(previewLayout);
}
 
开发者ID:brownemint,项目名称:Ti-Android-CameraView,代码行数:14,代码来源:CameraViewProxy.java


示例18: DataItem

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
public DataItem(TiViewProxy proxy, String id, DataItem parent) {
	vProxy = proxy;
	bindId = id;
	this.parent = parent;
	setProxyParent();
	children = new ArrayList<DataItem>();
	defaultProperties = new KrollDict();
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:9,代码来源:CollectionViewTemplate.java


示例19: setProxyParent

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
private void setProxyParent() {
	
	if (vProxy != null && parent != null) {
		TiViewProxy parentProxy = parent.getViewProxy();
		if (parentProxy != null) {
			vProxy.setParent(parentProxy);
		}
	}
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:10,代码来源:CollectionViewTemplate.java


示例20: bindProxiesAndProperties

import org.appcelerator.titanium.proxy.TiViewProxy; //导入依赖的package包/类
private DataItem bindProxiesAndProperties(KrollDict properties, boolean isRootTemplate, DataItem parent) {
	Object proxy = null;
	String id = null;
	Object props = null;
	DataItem item = null;
	if (properties.containsKey(TiC.PROPERTY_TI_PROXY)) {
		proxy = properties.get(TiC.PROPERTY_TI_PROXY);
	}

	//Get/generate random bind id
	if (isRootTemplate) {
		id = itemID;	
	} else if (properties.containsKey(TiC.PROPERTY_BIND_ID)) {
		id = TiConvert.toString(properties, TiC.PROPERTY_BIND_ID);
	} else {
		id = GENERATED_BINDING + Math.random();
	}
	

	if (proxy instanceof TiViewProxy) {
		TiViewProxy viewProxy = (TiViewProxy) proxy;
		if (isRootTemplate) {
			rootItem = item = new DataItem(viewProxy, TiC.PROPERTY_PROPERTIES, null);
		} else {
			item = new DataItem(viewProxy, id, parent);
			parent.addChild(item);
		}
		dataItems.put(id, item);
	}

	if (properties.containsKey(TiC.PROPERTY_PROPERTIES)) {
		props = properties.get(TiC.PROPERTY_PROPERTIES);
	}
	
	if (props instanceof HashMap) {
		item.setDefaultProperties(new KrollDict((HashMap)props));
	}

	return item;
}
 
开发者ID:nuno,项目名称:TiCollectionView,代码行数:41,代码来源:CollectionViewTemplate.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Filter类代码示例发布时间:2022-05-21
下一篇:
Java DescribeLoadBalancersResult类代码示例发布时间: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