Esri / runtime-questions

Welcome to the 2017 Esri Developer Summit and the session called, "Everything (or Anything) You Wanted to Know About the ArcGIS Runtime SDKs but Were Afraid to Ask"
12 stars 7 forks source link

SpaceEffect.Transparent Android. #173

Closed dronematt closed 4 years ago

dronematt commented 4 years ago

According to what I am reading this should set the background to transparent. Is it broken in the 100.8 SDK? Is the app have to be a certain license level for this to work? package com.esri.arcgisruntime.basicandroidproject;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color; import android.os.Bundle; import android.transition.Scene;

import com.esri.arcgisruntime.ArcGISRuntimeEnvironment; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.ArcGISScene; import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource; import com.esri.arcgisruntime.mapping.Basemap; import com.esri.arcgisruntime.mapping.Surface; import com.esri.arcgisruntime.mapping.view.AtmosphereEffect; import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.mapping.view.SceneView; import com.esri.arcgisruntime.mapping.view.SpaceEffect; import com.esri.arcgisruntime.portal.Portal; import com.esri.arcgisruntime.portal.PortalItem;

public class MainActivity extends AppCompatActivity {

private SceneView mSceneView;

private void setupScene() {
    if (mSceneView != null) {
       // String itemID = "579f97b2f3b94d4a8e48a5f140a6639b";
        //Portal portal = new Portal("https://www.arcgis.com");
        //PortalItem portalItem = new PortalItem(portal, itemID);
        ArcGISScene scene = new ArcGISScene();
        mSceneView.setScene(scene);
        //mSceneView.setAtmosphereEffect(AtmosphereEffect.NONE);
        mSceneView.setSpaceEffect(SpaceEffect.TRANSPARENT);
        mSceneView.setAtmosphereEffect(AtmosphereEffect.NONE);

    }
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mSceneView = findViewById(R.id.scene);
    setupScene();
}

@Override
protected void onPause() {
    if (mSceneView != null) {
        mSceneView.pause();
    }
    super.onPause();
}

@Override
protected void onResume() {
    super.onResume();
    if (mSceneView != null) {
        mSceneView.resume();
    }
}

@Override
protected void onDestroy() {
    if (mSceneView != null) {
        mSceneView.dispose();
    }
    super.onDestroy();
}

}

mbcoder commented 4 years ago

@geospace12 I think the answer to your question may be here: https://community.esri.com/thread/256048-spaceeffecttransparent

I can confirm the functionality works correctly. The GeoNet post explains the purpose of the property and how it works.

dronematt commented 4 years ago

Think the problem is that it appears in a regular sceneview it would be usable apparently its only in the AR functions.

mbcoder commented 4 years ago

@geospace12 take a look at the GeoNet post. It works for things other than the AR functions as had been shown in the latest post from Gunther.