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


Java View.setCameraDistance方法代码示例

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


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

示例1: tiltOnStartOvershoot

import android.view.View; //导入方法依赖的package包/类
/**
 * Tilts the tabs, when overshooting at the start.
 *
 * @param angle
 *         The angle, the tabs should be rotated by, in degrees as a {@link Float} value
 */
private void tiltOnStartOvershoot(final float angle) {
    ItemIterator iterator =
            new ItemIterator.Builder(getTabSwitcher(), tabViewRecycler).create();
    AbstractItem item;

    while ((item = iterator.next()) != null) {
        View view = item.getView();

        if (item.getIndex() == 0) {
            view.setCameraDistance(maxCameraDistance);
            getArithmetics().setPivot(Axis.DRAGGING_AXIS, item, getArithmetics()
                    .getPivot(Axis.DRAGGING_AXIS, item, DragState.OVERSHOOT_START));
            getArithmetics().setPivot(Axis.ORTHOGONAL_AXIS, item, getArithmetics()
                    .getPivot(Axis.ORTHOGONAL_AXIS, item, DragState.OVERSHOOT_START));
            getArithmetics().setRotation(Axis.ORTHOGONAL_AXIS, item, angle);
        } else if (item.isInflated()) {
            item.getView().setVisibility(View.INVISIBLE);
        }
    }
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:27,代码来源:PhoneTabSwitcherLayout.java

示例2: resetTransformProperty

import android.view.View; //导入方法依赖的package包/类
private static void resetTransformProperty(View view) {
  view.setTranslationX(PixelUtil.toPixelFromDIP(0));
  view.setTranslationY(PixelUtil.toPixelFromDIP(0));
  view.setRotation(0);
  view.setRotationX(0);
  view.setRotationY(0);
  view.setScaleX(1);
  view.setScaleY(1);
  view.setCameraDistance(0);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:11,代码来源:BaseViewManager.java

示例3: tiltOnStartOvershoot

import android.view.View; //导入方法依赖的package包/类
/**
 * Tilts the tabs, when overshooting at the start.
 *
 * @param angle
 *         The angle, the tabs should be rotated by, in degrees as a {@link Float} value
 */
private void tiltOnStartOvershoot(final float angle) {
    TabItemIterator iterator =
            new TabItemIterator.Builder(getTabSwitcher(), viewRecycler).create();
    TabItem tabItem;

    while ((tabItem = iterator.next()) != null) {
        View view = tabItem.getView();

        if (tabItem.getIndex() == 0) {
            view.setCameraDistance(maxCameraDistance);
            getArithmetics().setPivot(Axis.DRAGGING_AXIS, view, getArithmetics()
                    .getPivot(Axis.DRAGGING_AXIS, view, DragState.OVERSHOOT_START));
            getArithmetics().setPivot(Axis.ORTHOGONAL_AXIS, view, getArithmetics()
                    .getPivot(Axis.ORTHOGONAL_AXIS, view, DragState.OVERSHOOT_START));
            getArithmetics().setRotation(Axis.ORTHOGONAL_AXIS, view, angle);
        } else if (tabItem.isInflated()) {
            tabItem.getView().setVisibility(View.INVISIBLE);
        }
    }
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:27,代码来源:PhoneTabSwitcherLayout.java

示例4: transformPageFlip

import android.view.View; //导入方法依赖的package包/类
private void transformPageFlip(View view, float position) {
    float percentage = 1 - Math.abs(position);
    view.setCameraDistance(12000);
    setVisibility(view, position);
    setTranslation(view);
    setSize(view, position, percentage);
    setRotation(view, position, percentage);
}
 
开发者ID:homeii,项目名称:GxIconDIY,代码行数:9,代码来源:SimplePageTransformer.java

示例5: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
    float percentage = 1 - Math.abs(position);
    if(Build.VERSION.SDK_INT >= 13){
        view.setCameraDistance(12000);
    }
    setVisibility(view, position);
    setTranslation(view);
    setSize(view, position, percentage);
    setRotation(view, position, percentage);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:12,代码来源:FlipPageViewTransformer.java

示例6: tiltOnEndOvershoot

import android.view.View; //导入方法依赖的package包/类
/**
 * Tilts the tabs, when overshooting at the end.
 *
 * @param angle
 *         The angle, the tabs should be rotated by, in degrees as a {@link Float} value
 */
private void tiltOnEndOvershoot(final float angle) {
    float minCameraDistance = maxCameraDistance / 2f;
    int firstVisibleIndex = -1;
    ItemIterator iterator =
            new ItemIterator.Builder(getTabSwitcher(), tabViewRecycler).create();
    AbstractItem item;

    while ((item = iterator.next()) != null) {
        if (item.isInflated()) {
            View view = item.getView();

            if (!iterator.hasNext()) {
                view.setCameraDistance(maxCameraDistance);
            } else if (firstVisibleIndex == -1) {
                view.setCameraDistance(minCameraDistance);

                if (item.getTag().getState() == State.FLOATING) {
                    firstVisibleIndex = item.getIndex();
                }
            } else {
                int diff = item.getIndex() - firstVisibleIndex;
                float ratio =
                        (float) diff / (float) (getModel().getCount() - firstVisibleIndex);
                view.setCameraDistance(
                        minCameraDistance + (maxCameraDistance - minCameraDistance) * ratio);
            }

            getArithmetics().setPivot(Axis.DRAGGING_AXIS, item, getArithmetics()
                    .getPivot(Axis.DRAGGING_AXIS, item, DragState.OVERSHOOT_END));
            getArithmetics().setPivot(Axis.ORTHOGONAL_AXIS, item, getArithmetics()
                    .getPivot(Axis.ORTHOGONAL_AXIS, item, DragState.OVERSHOOT_END));
            getArithmetics().setRotation(Axis.ORTHOGONAL_AXIS, item, angle);
        }
    }
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:42,代码来源:PhoneTabSwitcherLayout.java

示例7: tiltOnEndOvershoot

import android.view.View; //导入方法依赖的package包/类
/**
 * Tilts the tabs, when overshooting at the end.
 *
 * @param angle
 *         The angle, the tabs should be rotated by, in degrees as a {@link Float} value
 */
private void tiltOnEndOvershoot(final float angle) {
    float minCameraDistance = maxCameraDistance / 2f;
    int firstVisibleIndex = -1;
    TabItemIterator iterator =
            new TabItemIterator.Builder(getTabSwitcher(), viewRecycler).create();
    TabItem tabItem;

    while ((tabItem = iterator.next()) != null) {
        if (tabItem.isInflated()) {
            View view = tabItem.getView();

            if (!iterator.hasNext()) {
                view.setCameraDistance(maxCameraDistance);
            } else if (firstVisibleIndex == -1) {
                view.setCameraDistance(minCameraDistance);

                if (tabItem.getTag().getState() == State.FLOATING) {
                    firstVisibleIndex = tabItem.getIndex();
                }
            } else {
                int diff = tabItem.getIndex() - firstVisibleIndex;
                float ratio =
                        (float) diff / (float) (getModel().getCount() - firstVisibleIndex);
                view.setCameraDistance(
                        minCameraDistance + (maxCameraDistance - minCameraDistance) * ratio);
            }

            getArithmetics().setPivot(Axis.DRAGGING_AXIS, view, getArithmetics()
                    .getPivot(Axis.DRAGGING_AXIS, view, DragState.OVERSHOOT_END));
            getArithmetics().setPivot(Axis.ORTHOGONAL_AXIS, view, getArithmetics()
                    .getPivot(Axis.ORTHOGONAL_AXIS, view, DragState.OVERSHOOT_END));
            getArithmetics().setRotation(Axis.ORTHOGONAL_AXIS, view, angle);
        }
    }
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:42,代码来源:PhoneTabSwitcherLayout.java


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