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


Java ViewHelper.getX方法代码示例

本文整理汇总了Java中com.nineoldandroids.view.ViewHelper.getX方法的典型用法代码示例。如果您正苦于以下问题:Java ViewHelper.getX方法的具体用法?Java ViewHelper.getX怎么用?Java ViewHelper.getX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nineoldandroids.view.ViewHelper的用法示例。


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

示例1: placeBall

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
private void placeBall() {
	ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2);
	ball.xIni = ViewHelper.getX(ball);
	ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2;
	ball.xCen = getWidth() / 2 - ball.getWidth() / 2;
	placedBall = true;
	ball.animateCheck();
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:9,代码来源:Switch.java

示例2: placeBall

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
private void placeBall() {
	ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2);
	ball.xIni = ViewHelper.getX(ball);
	ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2;
	ball.xCen = getWidth() / 2 - ball.getWidth() / 2;
	placedBall = true;
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:8,代码来源:Slider.java

示例3: placeBall

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
private void placeBall() {
    ViewHelper.setX(ball, getHeight() / 2 - ball.getWidth() / 2);
    ball.xIni = ViewHelper.getX(ball);
    ball.xFin = getWidth() - getHeight() / 2 - ball.getWidth() / 2;
    ball.xCen = getWidth() / 2 - ball.getWidth() / 2;
    placedBall = true;
}
 
开发者ID:dibakarece,项目名称:DMAudioStreamer,代码行数:8,代码来源:Slider.java

示例4: move

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
/**
 * Moves the view
 *
 * @param deltaX delta
 */
public void move(float deltaX) {
    swipeListView.onMove(downPosition, deltaX);
    float posX = ViewHelper.getX(frontView);
    if (opened.get(downPosition)) {
        posX += openedRight.get(downPosition) ? -viewWidth + rightOffset : viewWidth - leftOffset;
    }
    if (posX > 0 && !swipingRight) {
        Log.d("SwipeListView", "change to right");
        swipingRight = !swipingRight;
        swipeCurrentAction = swipeActionRight;
        if (swipeCurrentAction == SwipeListView.SWIPE_ACTION_CHOICE) {
            backView.setVisibility(View.GONE);
        } else {
            backView.setVisibility(View.VISIBLE);
        }
    }
    if (posX < 0 && swipingRight) {
        Log.d("SwipeListView", "change to left");
        swipingRight = !swipingRight;
        swipeCurrentAction = swipeActionLeft;
        if (swipeCurrentAction == SwipeListView.SWIPE_ACTION_CHOICE) {
            backView.setVisibility(View.GONE);
        } else {
            backView.setVisibility(View.VISIBLE);
        }
    }
    if (swipeCurrentAction == SwipeListView.SWIPE_ACTION_DISMISS) {
        setTranslationX(parentView, deltaX);
        setAlpha(parentView, Math.max(0f, Math.min(1f,
                1f - 2f * Math.abs(deltaX) / viewWidth)));
    } else if (swipeCurrentAction == SwipeListView.SWIPE_ACTION_CHOICE) {
        if ((swipingRight && deltaX > 0 && posX < DISPLACE_CHOICE)
                || (!swipingRight && deltaX < 0 && posX > -DISPLACE_CHOICE)
                || (swipingRight && deltaX < DISPLACE_CHOICE)
                || (!swipingRight && deltaX > -DISPLACE_CHOICE)) {
            setTranslationX(frontView, deltaX);
        }
    } else {
        setTranslationX(frontView, deltaX);
    }
}
 
开发者ID:NewCasino,项目名称:browser,代码行数:47,代码来源:SwipeListViewTouchListener.java


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