private void SetMarginRight(int marginRight, bool convertToDp) { try { LayoutParams layoutParams = (LayoutParams)SlideToCancelLayout.LayoutParameters; if (layoutParams != null) { if (convertToDp) { layoutParams.RightMargin = (int)DpUtil.ToPixel(marginRight, Context); } else { layoutParams.RightMargin = marginRight; } SlideToCancelLayout.LayoutParameters = layoutParams; } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void SetCancelBounds(float cancelBounds, bool convertDpToPixel) { float bounds = convertDpToPixel ? DpUtil.ToPixel(cancelBounds, Context) : cancelBounds; CancelBounds = bounds; }