How to show a stock panorama activity with UI elements overlayed?

白昼怎懂夜的黑 提交于 2019-12-25 17:14:56

问题


I am successfully showing a spherical image using the Google Panorama API

I am using the same code as most tutorials do:

@Override
    public void onConnected(Bundle bundle){
        Panorama.PanoramaApi.loadPanoramaInfo(GOOGLE_CLIENT,Uri.parse(url)).setResultCallback(
                new ResultCallback<PanoramaApi.PanoramaResult>(){
                    @Override
                    public void onResult(PanoramaApi.PanoramaResult result){
                        if (result.getStatus().isSuccess()){
                            Intent intent = result.getViewerIntent();
                            if (intent != null){
                                startActivity(intent);
                            }
                        }
                    }
                });
    }

Actually, I do not only have one sphere but around 5. I would like to be able to switch between the images clicking on menu items overlayed over the images.

Since the actual activity showing the sphere is not defined by me but started through an intent received in the success callback I have no idea how I can achieve this and the API does not seem to offer much more possibilities.

I guess I can not even show a dialog on top of the sphere.

Does anybody have any ideas for me? I'd appreciate it a lot

Note: This question purposely is phrased very similarly to this SO post.


回答1:


Solution: Switch to the more recent Google API – Google VR – with which it is possible to embed spherical 360° images in a view instead of starting an activity through an intent, which one has no control of.

Note: The API is still labeled experimental but being part of the VR API this looks like the library being actively developed. Another advantage: This is open source while the older Google Panorama API is part of google play services, which is not.

PS: Before I looked into these libraries I tested PanoramaGL and OpenPanodroid. Both libraries are not maintained for years and it was no big suprise the results could not keep up with the Google libraries.



来源:https://stackoverflow.com/questions/41172495/how-to-show-a-stock-panorama-activity-with-ui-elements-overlayed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!