Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mBottomSheetBehavior = BottomSheetBehavior.from(findViewById(R.id.bottom_sheet)); mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); final float dp = mBottomSheetBehavior.getPeekHeight() / ((float) displayMetrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); ListView tableList = findViewById(R.id.related_list); mArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, mRelatedValues); tableList.setAdapter(mArrayAdapter); mMapView = findViewById(R.id.mapView); mMapView.getSelectionProperties().setColor(Color.YELLOW); mArcGISMap = new ArcGISMap(getResources().getString(R.string.webmap_url)); mMapView.setMap(mArcGISMap); mArcGISMap.addDoneLoadingListener(new Runnable() { @Override public void run() { if (mArcGISMap.getLoadStatus() == LoadStatus.LOADED) { createFeatures(mArcGISMap); } } }); mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { mArrayAdapter.clear(); mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); <START> Point clickPoint = new Point( <END> Math.round(e.getX()), Math.round(e.getY())); final FeatureLayer selectedLayer = mOperationalLayers.get(0); queryRelatedFeatures(selectedLayer, clickPoint); return super.onSingleTapConfirmed(e); } }); mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { if (newState == BottomSheetBehavior.STATE_COLLAPSED) { mMapView.setViewInsets(0, 0, 0, dp); } else { mMapView.setViewInsets(0, 0, 0, 0); } } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { } }); }</code><technical_language>screenPoint line</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mBottomSheetBehavior = BottomSheetBehavior.from(findViewById(R.id.bottom_sheet)); mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); final float dp = mBottomSheetBehavior.getPeekHeight() / ((float) displayMetrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); ListView tableList = findViewById(R.id.related_list); mArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, mRelatedValues); tableList.setAdapter(mArrayAdapter); mMapView = findViewById(R.id.mapView); mMapView.getSelectionProperties().setColor(Color.YELLOW); mArcGISMap = new ArcGISMap(getResources().getString(R.string.webmap_url)); mMapView.setMap(mArcGISMap); mArcGISMap.addDoneLoadingListener(new Runnable() { @Override public void run() { if (mArcGISMap.getLoadStatus() == LoadStatus.LOADED) { createFeatures(mArcGISMap); } } }); mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { mArrayAdapter.clear(); mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); Point screenPoint = new Point(Math.round(e.getX()), Math.round(e.getY())); final FeatureLayer selectedLayer = mOperationalLayers.get(0); queryRelatedFeatures(selectedLayer, screenPoint); return true; } }); mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { if (newState == BottomSheetBehavior.STATE_COLLAPSED) { mMapView.setViewInsets(0, 0, 0, dp); } else { mMapView.setViewInsets(0, 0, 0, 0); } } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { } }); }