本文整理汇总了Java中com.google.vr.ndk.base.GvrApi类的典型用法代码示例。如果您正苦于以下问题:Java GvrApi类的具体用法?Java GvrApi怎么用?Java GvrApi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GvrApi类属于com.google.vr.ndk.base包,在下文中一共展示了GvrApi类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDaydreamCurrentViewer
import com.google.vr.ndk.base.GvrApi; //导入依赖的package包/类
@Override
public Boolean isDaydreamCurrentViewer() {
DaydreamApi daydreamApi = DaydreamApi.create(mContext);
if (daydreamApi == null) return false;
// If this is the first time any app reads the daydream config file, daydream may create its
// config directory... crbug.com/686104
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
int type = GvrApi.ViewerType.CARDBOARD;
try {
type = daydreamApi.getCurrentViewerType();
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
daydreamApi.close();
return type == GvrApi.ViewerType.DAYDREAM;
}
示例2: isDaydreamCurrentViewer
import com.google.vr.ndk.base.GvrApi; //导入依赖的package包/类
@Override
public Boolean isDaydreamCurrentViewer() {
DaydreamApi daydreamApi = DaydreamApi.create(mActivity);
if (daydreamApi == null) return false;
int type = daydreamApi.getCurrentViewerType();
daydreamApi.close();
return type == GvrApi.ViewerType.DAYDREAM;
}