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


Java FreeFlowItem类代码示例

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


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

示例1: getItemProxies

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public HashMap<Object, FreeFlowItem> getItemProxies(
		int viewPortLeft, int viewPortTop) {

	Rect viewport = new Rect(viewPortLeft, 
							viewPortTop, 
							viewPortLeft + width, 
							viewPortTop + height);
	
	//Log.d(TAG, "Viewport: "+viewPortLeft+", "+viewPortTop+", "+viewport.width()+","+viewport.height());
	HashMap<Object, FreeFlowItem> ret = new HashMap<Object, FreeFlowItem>();

	Iterator<Entry<Object, FreeFlowItem>> it = map.entrySet().iterator();
	while (it.hasNext()) {
		Entry<Object, FreeFlowItem> pairs = it.next();
		FreeFlowItem p = (FreeFlowItem) pairs.getValue();
		if ( Rect.intersects(p.frame, viewport) ) {
			ret.put(pairs.getKey(), p);
		}
	}
	return ret;
	
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:ArtbookLayout.java

示例2: testGridLayoutMath

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
public void testGridLayoutMath(){
	VGridLayout vGrid = new VGridLayout();
	vGrid.setLayoutParams(new VGridLayout.LayoutParams(250, 250, 200, 500));
	DefaultSectionAdapter adapter = new DefaultSectionAdapter(getActivity(), 2, 5);
	vGrid.setAdapter(adapter);
	
	vGrid.setDimensions(600, 1000);
	vGrid.prepareLayout();
	
	Map<? extends Object , FreeFlowItem> map ;
	map = vGrid.getItemProxies(0, 0);
	
	assertEquals("VGridLayout did not generate correct number of frames", 5, map.size());
	vGrid.setDimensions(600, 1001);
	map = vGrid.getItemProxies(0, 0);
	assertEquals("VGridLayout did not generate correct number of frames (2) ", 6, map.size());
	
	FreeFlowItem proxy = map.get( adapter.getSection(0).getHeaderData() );
	
	assertNotNull("Header frame was null", proxy);
	
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:VGridLayoutTest.java

示例3: getItemsRemovedAnimation

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * The animation to run on the items being removed
 * 
 * @param removed
 *            An ArrayList of <code>FreeFlowItems</code> removed
 * @return The AnimatorSet of the removed objects
 */
protected AnimatorSet getItemsRemovedAnimation(List<FreeFlowItem> removed) {
	AnimatorSet disappearingSet = new AnimatorSet();
	ArrayList<Animator> fades = new ArrayList<Animator>();
	for (FreeFlowItem proxy : removed) {
		fades.add(ObjectAnimator.ofFloat(proxy.view, "alpha", 0));
	}
	disappearingSet.setDuration(oldCellsRemovalAnimationDuration);
	disappearingSet.setStartDelay(oldCellsRemovalAnimationStartDelay);

	if (animateIndividualCellsSequentially)
		disappearingSet.playSequentially(fades);
	else
		disappearingSet.playTogether(fades);

	return disappearingSet;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:DefaultLayoutAnimator.java

示例4: getItemsAddedAnimation

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * 
 */
protected AnimatorSet getItemsAddedAnimation(List<FreeFlowItem> added) {
	AnimatorSet appearingSet = new AnimatorSet();
	ArrayList<Animator> fadeIns = new ArrayList<Animator>();
	for (FreeFlowItem proxy : added) {
		proxy.view.setAlpha(0);
		fadeIns.add(ObjectAnimator.ofFloat(proxy.view, "alpha", 1));
	}

	if (animateIndividualCellsSequentially)
		appearingSet.playSequentially(fadeIns);
	else
		appearingSet.playTogether(fadeIns);

	appearingSet.setStartDelay(newCellsAdditionAnimationStartDelay);
	appearingSet.setDuration(newCellsAdditionAnimationDurationPerCell);
	return appearingSet;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:DefaultLayoutAnimator.java

示例5: getItemsMovedAnimation

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
protected AnimatorSet getItemsMovedAnimation(List<Pair<FreeFlowItem, Rect>> moved) {

		AnimatorSet anim = new AnimatorSet();
		ArrayList<Animator> moves = new ArrayList<Animator>();
		for (Pair<FreeFlowItem, Rect> item : moved) {
			FreeFlowItem proxy = FreeFlowItem.clone(item.first);
			View v = proxy.view;

			proxy.frame.left -= callback.getViewportLeft();
			proxy.frame.top -= callback.getViewportTop();
			proxy.frame.right -= callback.getViewportLeft();
			proxy.frame.bottom -= callback.getViewportTop();

			moves.add(transitionToFrame(item.second, proxy, v));

		}

		anim.playTogether(moves);
		return anim;
	}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:DefaultLayoutAnimator.java

示例6: getContentWidth

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public int getContentWidth() {
	if (itemsAdapter == null || itemsAdapter.getNumberOfSections() <= 0){
		return 0;
	}

	int sectionIndex = itemsAdapter.getNumberOfSections() - 1;
	Section s = itemsAdapter.getSection(sectionIndex);

	if (s.getDataCount() == 0)
		return 0;

	Object lastFrameData = s.getDataAtIndex(s.getDataCount() - 1);
	FreeFlowItem fd = proxies.get(lastFrameData);

	return (fd.frame.left + fd.frame.width());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:HLayout.java

示例7: getContentWidth

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public int getContentWidth() {
	if (itemsAdapter == null  || itemsAdapter.getNumberOfSections() <= 0){
		return 0;
	}
	
	int sectionIndex = itemsAdapter.getNumberOfSections() - 1;
	Section s = itemsAdapter.getSection(sectionIndex);

	if (s.getDataCount() == 0)
		return 0;

	Object lastFrameData = s.getDataAtIndex(s.getDataCount() - 1);
	FreeFlowItem fd = proxies.get(lastFrameData);

	return (fd.frame.left + fd.frame.width());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:HGridLayout.java

示例8: getItemProxies

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * NOTE: In this instance, we subtract/add the cellBufferSize (computed when
 * item height is set, defaulted to 1 cell) to add a buffer of
 * cellBufferSize to each end of the viewport. <br>
 * 
 * {@inheritDoc}
 * 
 */
@Override
public LinkedHashMap<Object, FreeFlowItem> getItemProxies(
		int viewPortLeft, int viewPortTop) {
	LinkedHashMap<Object, FreeFlowItem> desc = new LinkedHashMap<Object, FreeFlowItem>();


	for (FreeFlowItem fd : proxies.values()) {
		if (fd.frame.top + itemHeight > viewPortTop - cellBufferSize
				&& fd.frame.top < viewPortTop + height + cellBufferSize) {
			desc.put(fd.data, fd);
		}
	}

	return desc;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:VLayout.java

示例9: getContentHeight

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public int getContentHeight() {
	if (itemsAdapter == null || itemsAdapter.getNumberOfSections() <= 0){
		return 0;
	}
		
	int sectionIndex = itemsAdapter.getNumberOfSections() - 1;
	Section s = itemsAdapter.getSection(sectionIndex);

	if (s.getDataCount() == 0)
		return 0;

	Object lastFrameData = s.getDataAtIndex(s.getDataCount() - 1);
	FreeFlowItem fd = proxies.get(lastFrameData);

	return (fd.frame.top + fd.frame.height());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:VLayout.java

示例10: getContentHeight

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public int getContentHeight() {
	if (itemsAdapter == null || itemsAdapter.getNumberOfSections() <= 0){
		return 0;
	}

	int sectionIndex = itemsAdapter.getNumberOfSections() - 1;
	Section s = itemsAdapter.getSection(sectionIndex);

	if (s.getDataCount() == 0)
		return 0;

	Object lastFrameData = s.getDataAtIndex(s.getDataCount() - 1);
	FreeFlowItem fd = proxies.get(lastFrameData);
	if(fd==null){
		return 0;
	}
	return (fd.frame.top + fd.frame.height());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:VGridLayout.java

示例11: getItemAt

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
public static FreeFlowItem getItemAt(Map<?, FreeFlowItem> frameDescriptors, int x, int y){
       FreeFlowItem returnValue = null;

	for(FreeFlowItem item : frameDescriptors.values()) {
		if(item.frame.contains((int)x, (int)y)) {
               returnValue =  item;
           }
      
    }
	return returnValue;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:ViewUtils.java

示例12: animateChanges

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
@Override
public void animateChanges(LayoutChangeset changes,
		FreeFlowContainer callback) {
	this.changes = changes;
	for(Pair<FreeFlowItem, Rect> item : changes.getMoved()){
		Rect r = item.first.frame;
		View v = item.first.view;
		int wms = MeasureSpec.makeMeasureSpec(r.right-r.left, MeasureSpec.EXACTLY);
		int hms = MeasureSpec.makeMeasureSpec(r.bottom-r.top, MeasureSpec.EXACTLY);
		v.measure(wms,hms );
		v.layout(r.left, r.top, r.right, r.bottom);	
	}
	callback.onLayoutChangeAnimationsCompleted(this);
	
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:NoAnimationLayoutAnimator.java

示例13: getItemProxies

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * NOTE: In this instance, we subtract/add the cellBufferSize (computed when
 * item width is set, defaulted to 1 cell) to add a buffer of cellBufferSize
 * to each end of the viewport. <br>
 * 
 * {@inheritDoc}
 * 
 */
@Override
public Map<Object, FreeFlowItem> getItemProxies(int viewPortLeft, int viewPortTop) {
	LinkedHashMap<Object, FreeFlowItem> desc = new LinkedHashMap<Object, FreeFlowItem>();

	for (FreeFlowItem fd : proxies.values()) {
		if (fd.frame.left + itemWidth > viewPortLeft - cellBufferSize
				&& fd.frame.left < viewPortLeft + width + cellBufferSize) {
			desc.put(fd.data, fd);
		}
	}

	return desc;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:HLayout.java

示例14: getItemProxies

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * NOTE: In this instance, we subtract/add the cellBufferSize (computed when
 * item width is set, defaulted to 1 cell) to add a buffer of cellBufferSize
 * to each end of the viewport. <br>
 * 
 * {@inheritDoc}
 * 
 */
@Override
public LinkedHashMap<Object, FreeFlowItem> getItemProxies(int viewPortLeft, int viewPortTop) {
	LinkedHashMap<Object, FreeFlowItem> desc = new LinkedHashMap<Object, FreeFlowItem>();

	for (FreeFlowItem fd : proxies.values()) {

		if (fd.frame.left + itemWidth > viewPortLeft - cellBufferSize
				&& fd.frame.left < viewPortLeft + width + cellBufferSize) {
			desc.put(fd.data, fd);
		}
	}

	return desc;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:HGridLayout.java

示例15: getItemProxies

import com.comcast.freeflow.core.FreeFlowItem; //导入依赖的package包/类
/**
 * NOTE: In this instance, we subtract/add the cellBufferSize (computed when
 * item height is set, defaulted to 1 cell) to add a buffer of
 * cellBufferSize to each end of the viewport
 * 
 * {@inheritDoc}
 * 
 */
@Override
public Map<Object, FreeFlowItem> getItemProxies(int viewPortLeft, int viewPortTop) {
	LinkedHashMap<Object, FreeFlowItem> desc = new LinkedHashMap<Object, FreeFlowItem>();
	for (FreeFlowItem fd : proxies.values()) {
		if (fd.frame.top + itemHeight > viewPortTop - cellBufferSize
				&& fd.frame.top < viewPortTop + height + cellBufferSize) {
			
			desc.put(fd.data, fd);
		}
	}

	return desc;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:VGridLayout.java


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