本文整理匯總了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);
}
}
}