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