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