Google cardBoard Android API (一):CardboardActivity
2016-03-21 14:33
573 查看
public class CardboardActivityBase activity that provides easy integration with Cardboard devices.Exposes events to interact with Cardboards and handles many of the details commonly required when creating an Activity for VR rendering.
Public Constructors
CardboardActivity() |
Public Methods
CardboardView | getCardboardView() |
synchronized boolean | getConvertTapIntoTrigger() |
void | onCardboardTrigger() |
void | setCardboardView(CardboardView cardboardView) |
synchronized void | setConvertTapIntoTrigger(booleanenabled) |
Protected Methods
void | updateCardboardDeviceParams(CardboardDeviceParams newParams) |
Inherited Methods
▸From class java.lang.Object▸From interface com.google.vrtoolkit.cardboard.VolumeKeyState.Handler▸From interface com.google.vrtoolkit.cardboard.sensors.SensorConnection.SensorListenerPublic Constructors
public CardboardActivity ()
Public Methods
public CardboardView getCardboardView ()
Returns theCardboard viewassociated with this activity.ReturnsThe
CardboardViewobjectassociated with this activity. Can be null.
public synchronized boolean getConvertTapIntoTrigger ()
Returns whether single screen taps are converted to Cardboard trigger events.Returnswhether single screen taps are converted to Cardboard trigger events.public void onCardboardTrigger ()
Override to detect when the Cardboard trigger was pulled and released.Provides click-like events when the device is inside a Cardboard.public void setCardboardView (CardboardView cardboardView)
Associates a Cardboard view with this activity.This method does not set or change the content view, but associates the activity with aCardboardViewandensures it receives any required activity lifecycle notifications.This is automatically done if
setContentViewis used to directly set a
CardboardViewobject.Should be called if the
CardboardViewisset in any other way (e.g. from a layout resource).Parameters
cardboardView | The Cardboard viewto associatewith. Can be null. |
---|
public synchronized void setConvertTapIntoTrigger (boolean enabled)
Sets whether single screen taps should be converted to Cardboard trigger events.If this is true, a single tap on the phone screen will result in a call toonCardboardTrigger.This is enabled by default.Parameters
enabled | whether screen taps should be converted to Cardboard trigger events. |
---|
Protected Methods
protected void updateCardboardDeviceParams (CardboardDeviceParams newParams)
Requests an update of the parameters for the current Cardboard device.Compares against existing configuration and updates if the new parameters differ.This method requires aCardboardViewtobe already set. See
setCardboardView.Parameters
newParams | New Cardboard device params to set. |
---|
相关文章推荐
- Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚
- android:padding和android:margin的区别
- Android AutoLayout全新的适配方式 堪称适配终结者
- Android初试--Android中的Service简介(2)
- Android Studio中checkout在git上面的项目后无法运行
- android sdk 兼容低版本的处理方法
- (转)Android自定义属性时format选项( <attr format="reference" name="background" /> )
- 为Android添加一个开机完成后执行的脚本
- android 打印调用栈的代码
- 3. Android Framework - View
- Android定时服务
- Android 延时执行操作方法
- Android中如何检测重力感应变化:Sensor和SensorManager
- 自定义闪烁的TextView
- Android 圆角边框的实现方式汇总
- [better practice系列]Android中自定义全局变量、常量并采用高效的维护管理(一)
- Android——支付宝
- 你应该知道的那些Android小经验 (转载)
- android ViewPager适配器
- 【入门篇】Android学习笔记——常用布局