style and add it to Text • How to NOT add hardcoded text and pick from strings.xml? (Hint:- stringResource attribute) • Applying click on Textview using TextButton
compiler knows, this has to be drawn/rendered on the screen!! Any composable function can be called only from other composable functions. Name of composable function is chosen as ‘Noun’ rather than verb or adjectives.
JC, we have to use third party library such as Coil or Landscapist. Steps: • Add Coil dependency implementation "io.coil-kt:coil-compose:2.2.2" • Add Internet permission in Manifest <uses-permission android:name="android.permission.INTERNET"/> • Load Image from URL
= Modifier.size(width = 50.dp, height = 50.dp), model = “https://i.ibb.co/TPMpD3f/argentina.png”, contentDescription = "Image") The above code shows loading an Image from URL using AsyncImage where width and height of Image is 50dp.
Linear Layout we would have taken one parent Linear Layout with horizontal orientation and inside it would be Imageview and a child LinearLayout with vertical orientation and two Textviews
defining observe to define width and height(or other attributes like padding, aligning) of view/viewgroups we use Modifiers We have given the Row’s width as fillMaxWidth which means match_parent and height by default is taken as wrap content And Row has padding of 16dp.
shown in the video to load flag of the FIFA country using URL(which is dynamic) Line 164 shows creating a Column with two textviews(Text components) inside it and each Column has a padding of 16dp and by default width and height as wrap_content.
fillMaxWidth (meaning match_parent) and height as wrap content L181 defines source of data which should be loaded into Recyclerview. L182 defines content of each item within recyclerview which is rendered by user defined method ImageWithTitleSubTitleComponent (Please check Github for full source code)
to try because of its ease to implement things in faster manner eg. Recyclerview, Cardview with stroke/border etc. Mostly about playing around and getting comfortable with Modifiers to see its ease and magic! GOOD LUCK!