package Ġru . surf studio . android . load state . sample . ui . base . load state . present ations . base Ċ Ċ import Ġandroid . content . res . Color State List Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroidx . annotation . Color Int Ċ import Ġandroidx . core . content . Context Compat Ċ import Ġme . zhang hai . android . material progressbar . Material ProgressBar Ċ import Ġru . surf studio . android . core . mvp . load state . Simple Load State Presentation Ċ import Ġru . surf studio . android . custom . view . placeholder . Place Holder View Container Ċ import Ġru . surf studio . android . load state . sample . R Ċ import Ġru . surf studio . android . load state . sample . ui . base . load state . states . Main Loading State Ċ Ċ /** Ċ Ġ* ĠÐŁ ÑĢÐµÐ´ ÑģÑĤÐ°Ð² Ð»ÐµÐ½Ð¸Ðµ ĠÑģ Ð¾ÑģÑĤ Ð¾Ñı Ð½Ð¸ Ñı ĠMain Loading ĠÐ² ĠÐ²Ð¸Ð´ Ðµ ĠProgress Bar Ċ Ġ*/ Ċ class ĠMain Loading State Presentation ( private Ġval Ġplace Holder : ĠPlace Holder View Container ) Ġ: ĊĠĠĠĠĠĠĠ ĠSimple Load State Presentation < Main Loading State >() Ġ{ ĊĊĠĠĠ Ġ@ Color Int ĊĠĠĠ Ġprivate Ġval ĠprogressBar Color : ĠInt Ġ= ĠContext Compat . getColor ( place Holder . context , ĠR . color . color Accent ) ĊĊĠĠĠ Ġprivate Ġval Ġview : ĠView Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġwith ( LayoutInflater . from ( place Holder . context ). inflate ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . layout . loading _ state _ presentation , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġplace Holder , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfalse )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcolor ProgressBar ( this ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ lazy Ġthis ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow State ( state : ĠMain Loading State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġplace Holder . change View To ( view ) ĊĠĠĠĠĠĠĠ Ġplace Holder . show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcolor ProgressBar ( view : ĠView ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠprogressBar : ĠMaterial ProgressBar Ġ= Ġview . findViewById ( R . id . placeholder _ loading _ pb ) ĊĠĠĠĠĠĠĠ ĠprogressBar . support In determinate Tint List Ġ= ĠColor State List . valueOf ( progress Bar Color ) ĊĠĠĠ Ġ} Ċ }