package Ġcom . wu yr . hook w orm for wan android Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . ImageView Ċ import Ġandroidx . view pager . widget . Pager Adapter Ċ import Ġcom . bump tech . glide . G lide Ċ Ċ /** Ċ Ġ* Ġ@ author Ġw u yr Ċ Ġ* Ġ@ github Ġhttps :// github . com / wu yr / Hook w orm For Wan Android Test Ċ Ġ* Ġ@ since Ġ 2 0 2 1 - 0 1 - 2 5 Ġä¸ĭåįĪ 2 : 2 8 Ċ Ġ*/ Ċ class ĠImage Adapter ( context : ĠContext ) Ġ: ĠP ager Adapter () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġimage Urls Ġ= ĠarrayOf ( ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 7 0 8 / 1 3 / 2 0 1 7 0 8 1 3 0 9 5 3 0 5 _ FS Q hj . thumb . 7 0 0 _ 0 . jpeg ", ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 5 1 2 / 0 5 / 2 0 1 5 1 2 0 5 2 1 2 6 3 3 _ n Fx 3 d . thumb . 7 0 0 _ 0 . jpeg ", ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 6 0 6 / 1 2 / 2 0 1 6 0 6 1 2 2 3 5 1 0 2 _ z 3 d ja . thumb . 7 0 0 _ 0 . jpeg ", ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 7 0 7 / 2 7 / 2 0 1 7 0 7 2 7 1 2 1 8 2 8 _ Z 5 TRA . thumb . 7 0 0 _ 0 . png ", ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 7 0 7 / 2 7 / 2 0 1 7 0 7 2 7 1 2 2 2 1 3 _ 3 HB aN . thumb . 7 0 0 _ 0 . png ", ĊĠĠĠĠĠĠĠ Ġ" https :// c - ssl . duit ang . com / uploads / item / 2 0 1 5 1 2 / 0 4 / 2 0 1 5 1 2 0 4 2 0 2 1 5 3 _ n E UM t . thumb . 7 0 0 _ 0 . jpeg " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġimage Views Ġ= ĠArrayList < ImageView >(). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġimage Urls . forEach Ġ{ Ġurl Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd ( ImageView ( context ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġscale Type Ġ= ĠImageView . Scale Type . CENTER _ C ROP ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠG lide . with ( context ). load ( url ). into ( this ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinstantiate Item ( container : ĠViewGroup , Ġposition : ĠInt ) Ġ= ĊĠĠĠĠĠĠĠ Ġimage Views [ position ]. also Ġ{ Ġcontainer . addView ( it ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdestroy Item ( container : ĠViewGroup , Ġposition : ĠInt , Ġ` object `: ĠAny ) Ġ= ĊĠĠĠĠĠĠĠ Ġcontainer . remove View ( image Views [ position ]) ĊĊĠĠĠ Ġoverride Ġfun Ġget Count () Ġ= Ġimage Urls . size ĊĊĠĠĠ Ġoverride Ġfun Ġis View From Object ( view : ĠView , Ġ` object `: ĠAny ) Ġ= Ġview Ġ== Ġ` object ` Ċ }