當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。