package Ġdemo . android . common . util Ċ Ċ import Ġandroid . view . View Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Dialog Ċ import Ġjava . lang . reflect . Method Ċ Ċ /** Ċ Ġ* ĠTo Ġfix Ġissues Ġwith Ġwrong Ġedge - to - edge Ġbottom Ġsheet Ġtop Ġpadding Ġand Ġstatus Ġbar Ġicon Ġcolor âĢ¦ Ċ Ġ* ĠâĢ¦ we Ġneed Ġto Ġcall Ġ[ Bottom Sheet Dialog . Edge To Edge Callback . set Padding For Position ] Ġwhich Ġis Ġa Ġprivate Ġfunction Ġfrom Ġa Ġprivate Ġclass . Ċ Ġ* ĠSee : Ġhttps :// github . com / material - components / material - components - android / issues / 2 1 6 5 Ċ Ġ*/ Ċ fun Ġadjust Bottom Sheet ( a Dialog Ġ: ĠBottom Sheet Dialog ) Ġ{ ĊĠĠĠ Ġ// ĠGet Ġour Ġprivate Ġclass ĊĠĠĠ Ġval Ġclass Edge To Edge Callback Ġ= ĠClass . forName (" com . google . android . material . bottom sheet . Bottom Sheet Dialog \$ Edge To Edge Callback ") ĊĠĠĠ Ġ// ĠGet Ġour Ġprivate Ġmethod ĊĠĠĠ Ġval Ġmethod Set Padding For Position : ĠMethod Ġ= Ġclass Edge To Edge Callback . getDeclared Method (" set Padding For Position ", ĠView :: class . java ) ĊĠĠĠ Ġmethod Set Padding For Position . is Accessible Ġ= Ġtrue ĊĠĠĠ Ġ// ĠGet Ġprivate Ġfield Ġcontaining Ġour ĠEdge To Edge Callback Ġinstance ĊĠĠĠ Ġval Ġfield Edge To Edge Callback Ġ= ĠBottom Sheet Dialog :: class . java . getDeclared Field (" edge To Edge Callback ") ĊĠĠĠ Ġfield Edge To Edge Callback . is Accessible Ġ= Ġtrue ĊĠĠĠ Ġ// ĠGet Ġour Ġbottom Ġsheet Ġview Ġfield ĊĠĠĠ Ġval Ġfield Bottom Field Ġ= ĠBottom Sheet Dialog :: class . java . getDeclared Field (" bottom Sheet ") ĊĠĠĠ Ġfield Bottom Field . is Accessible Ġ= Ġtrue ĊĠĠĠ Ġ// ĠEvent ually Ġcall Ġset Padding For Position Ġfrom ĠEdge To Edge Callback Ġinstance Ġpassing Ġbottom Ġsheet Ġview Ġas Ġparameter ĊĠĠĠ Ġmethod Set Padding For Position . invoke ( field Edge To Edge Callback . get ( a Dialog ), field Bottom Field . get ( a Dialog )) Ċ } Ċ