private void MoveExpandableIndicatorToRight() { var metrics = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(metrics); int width = metrics.WidthPixels; listView?.SetIndicatorBoundsRelative(width - DpToPx(60), width - DpToPx(30)); listView?.SetIndicatorBoundsRelative(width - DpToPx(60), width - DpToPx(30)); }
private void MoveIndicatorImage() { DisplayMetrics metrics = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(metrics); int width = metrics.WidthPixels; int left = (int)(IndicatorLeft * metrics.Density + 0.5f); int right = (int)(IndicatorRight * metrics.Density + 0.5f); if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.JellyBeanMr2) { expList.SetIndicatorBoundsRelative(width - left, width - right); } else { expList.SetIndicatorBounds(width - left, width - right); } }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); DisplayMetrics displaymetrics = new DisplayMetrics(); Activity.WindowManager.DefaultDisplay.GetMetrics(displaymetrics); int screenWidth = displaymetrics.WidthPixels; int leftPadding = IsRTL() ? -70 : 70; int rightPadding = IsRTL() ? 30 : -115; var width = DpToPx(302); int leftWidth = width - DpToPx(leftPadding); int rightWidth = width - DpToPx(rightPadding); if (Build.VERSION.SdkInt < BuildVersionCodes.JellyBeanMr2) { listView.SetIndicatorBounds(leftWidth, rightWidth); } else { listView.SetIndicatorBoundsRelative(leftWidth, rightWidth); } }