Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 全景API-全景视图顶部的充气布局_Android_Google Play Services_Google Street View_Panorama Control - Fatal编程技术网

Android 全景API-全景视图顶部的充气布局

Android 全景API-全景视图顶部的充气布局,android,google-play-services,google-street-view,panorama-control,Android,Google Play Services,Google Street View,Panorama Control,我正在使用google play services panorama api显示全景图像。 一切正常,但我想添加一个布局的顶部,以便该图像将被用作活动背景 以下是我显示全景视图的代码: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mClient = new GoogleApiClient.Builder(this, this, th

我正在使用google play services panorama api显示全景图像。 一切正常,但我想添加一个布局的顶部,以便该图像将被用作活动背景

以下是我显示全景视图的代码:

@Override
protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   mClient = new GoogleApiClient.Builder(this, this, this)
       .addApi(Panorama.API)
       .build();
 }

 @Override
    public void onConnected(Bundle bundle) {
        Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.pano1);
        Panorama.PanoramaApi.loadPanoramaInfo(mClient, uri).setResultCallback(
                new ResultCallback<PanoramaApi.PanoramaResult>() {
                    @Override
                    public void onResult(PanoramaApi.PanoramaResult result) {
                        if (result.getStatus().isSuccess()) {
                            Intent viewerIntent = result.getViewerIntent();
                            Log.i(TAG, "found viewerIntent: " + viewerIntent);
                            if (viewerIntent != null) {
                                startActivity(viewerIntent);
                            }
                        } else {
                            Log.e(TAG, "error: " + result);
                        }
                    }
                });
    }
@覆盖
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
mClient=new GoogleApiClient.Builder(这个,这个,这个)
.addApi(Panorama.API)
.build();
}
@凌驾
未连接的公共空间(捆绑包){
Uri=Uri.parse(“android.resource://”+getPackageName()+“/”+R.raw.pano1);
Panorama.PanoramaApi.loadPanoramaInfo(mClient,uri).setResultCallback(
新的ResultCallback(){
@凌驾
公共void onResult(panoramapi.PanoramaResult){
if(result.getStatus().issucess()){
Intent viewerinent=result.getviewerinent();
Log.i(标记“找到的viewerIntent:+ViewerInt”);
if(viewerinent!=null){
星触觉(视景);
}
}否则{
Log.e(标记“错误:+结果”);
}
}
});
}
工作流程是,我用viewerinent启动新活动,我没有布局控制,所以它只显示全景视图

我正在搜索以下内容之一:

  • 获取对“打开查看器”活动的控制
  • 通过bundle将布局传递给下一个活动
  • 覆盖全景视图活动,并填充我自己的布局
谷歌街景全景活动示例:


谷歌API中的Panorama API似乎没有您想要的那么多功能。基于全景结果的返回描述(
getviewerinent

如果图像是全景图,则该值不为空,并将在启动时启动查看器。如果图像不是全景图,则为空


您可能需要搜索第三方库或根据需要创建自己的实现。

google street view应用程序在panorama活动的顶部有一个布局,它们甚至在顶部有一个透明工具栏,从底部有一个可滚动的面板。这正是我要寻找的,但我找不到任何相关的参考资料。您是否熟悉任何可能符合此要求的库?谢谢您提出的问题。这有助于我制作全景的演示。