package Ġcom . example . g iphy . util Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . media . Image Ċ import Ġandroid . util . Size Ċ import Ġandroidx . compose . ui . graphics . Brush Ċ import Ġandroidx . compose . ui . graphics . Color Ċ import Ġkotlin . math . ceil Ċ import Ġkotlin . math . round ToInt Ċ Ċ val Ġphotos Ġ= ĠlistOf ( ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 2 / aut umn - 8 6 5 1 5 7 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 7 / 0 6 / 0 7 / 1 0 / 4 7 / ele ph ant - 2 3 8 0 0 0 9 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 1 1 / 1 6 / 1 6 / 2 8 / bird - 1 0 4 5 9 5 4 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 1 / w heat - 8 6 5 1 5 2 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 2 0 / 0 7 / 0 9 / 0 3 / 4 1 / duck - 5 3 8 5 7 4 1 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 2 / aut umn - 8 6 5 1 5 7 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 7 / 0 6 / 0 7 / 1 0 / 4 7 / ele ph ant - 2 3 8 0 0 0 9 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 1 1 / 1 6 / 1 6 / 2 8 / bird - 1 0 4 5 9 5 4 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 1 / w heat - 8 6 5 1 5 2 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 2 0 / 0 7 / 0 9 / 0 3 / 4 1 / duck - 5 3 8 5 7 4 1 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 2 / aut umn - 8 6 5 1 5 7 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 7 / 0 6 / 0 7 / 1 0 / 4 7 / ele ph ant - 2 3 8 0 0 0 9 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 1 1 / 1 6 / 1 6 / 2 8 / bird - 1 0 4 5 9 5 4 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 1 5 / 0 7 / 2 8 / 2 2 / 1 1 / w heat - 8 6 5 1 5 2 _ 9 6 0 _ 7 2 0 . jpg ", ĊĠĠĠ Ġ" https :// cdn . pix ab ay . com / photo / 2 0 2 0 / 0 7 / 0 9 / 0 3 / 4 1 / duck - 5 3 8 5 7 4 1 _ 9 6 0 _ 7 2 0 . jpg " Ċ ) Ċ Ċ fun ĠCalculate Scaled Size ( context : ĠContext , Ġwidth : ĠDouble , Ġheight : ĠDouble ): ĠSize Ġ{ ĊĠĠĠ Ġval Ġdisplay Width Ġ= Ġcontext . resources . display Metrics . width Pixels ĊĠĠĠ Ġval Ġcolumn Width Ġ= Ġ( display Width Ġ/ Ġ 2 . toDouble ()). round ToInt () ĊĠĠĠ Ġval Ġscale Ġ= Ġcolumn Width Ġ/ Ġwidth . toDouble () ĊĠĠĠ Ġreturn ĠSize ( column Width , Ġ( scale Ġ* Ġheight ). round ToInt ()) Ċ }