Right now I have implemented the image I want with glide, and the image is successfully loaded. However, I can only scroll in horizontal directions-to left or right-but not in vertical directions. Is it because of the version of my emulator? Or is something else in my code amiss. Whatever it is, please have a look. The layout file:
<?xml version="1.0" encoding="utf-8"?>
<com.google.vr.sdk.widgets.pano.VrPanoramaView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/panoramaView"
tools:context=".wishlistFragment"/>
As for the java file(it is a fragment, actually)
package com.example.uaproject;
import android.app.VoiceInteractor;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.google.vr.sdk.widgets.pano.VrPanoramaView;
import java.security.cert.PKIXRevocationChecker;
public class wishlistFragment extends Fragment {
VrPanoramaView vrPanoramaView;
public wishlistFragment() {
// Required empty public constructor
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
vrPanoramaView = view.findViewById(R.id.panoramaView);
VrPanoramaView.Options option = new VrPanoramaView.Options();
option.inputType = VrPanoramaView.Options.TYPE_MONO;
String DEMO_PANORAMA_LINK = "https://i.postimg.cc/FK4ZM7NV/14-BD45-EA37-F6-A2-EF34-ADDC08-AF866952.jpg";
Glide.with(this).asBitmap().load(DEMO_PANORAMA_LINK).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
vrPanoramaView.loadImageFromBitmap(resource, option);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
super.onViewCreated(view, savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_wishlist, container, false);
}
}