Colton Idle
08/29/2020, 4:28 AMColton Idle
08/29/2020, 4:29 AMColton Idle
08/29/2020, 4:30 AMColton Idle
08/29/2020, 4:32 AMmodifier = Modifier.padding(16.dp)
into Column()
and I still had to import Modifier AND padding. Weird!
Then I went into the column to add
Image(image)
and I had to manually alt enter and select the import again. It should just knowColton Idle
08/29/2020, 4:33 AMColton Idle
08/29/2020, 4:34 AMColton Idle
08/29/2020, 4:42 AMContentScale.Crop
was the next step. This seems to be a center_crop. One thing that was never supported in xml land was cropping strategies. Like crop_top, or crop_bottom. Is that possible in compose? Sometimes from my designers I get requirements of ("This should be a 16:9 image, cropped, starting from the top") and I always had to use a third party imageView in android xml land.Colton Idle
08/29/2020, 4:44 AMcontentScale = ContentScale.Crop
why is this set on the Image as a param, and it's not a modifier?Colton Idle
08/29/2020, 4:47 AM.clip(shape = RoundedCornerShape(4.dp))
Up to this step. The clip portion was red and wanted me to import. I waited like 10 seconds and it seemed to auto import? Maybe the auto import does work, but it's just suppppper slow? maybe a fluke?Colton Idle
08/29/2020, 4:49 AM.clip(shape = RoundedCornerShape(4.dp))
does not reflect in the editor preview... it does in the emulator. edit: wait maybe it does its just super tiny? I think actually the border around the image just hides the corner radius. Leaving me to maybe recommend to not have the border there? Or maybe make it toggleable?Colton Idle
08/29/2020, 4:53 AMMaterialTheme {
` to the entire column. Same as #1, it'd be nice to wrap quickly with a list of optionsColton Idle
08/29/2020, 4:55 AMromainguy
08/29/2020, 4:59 AM-nodpi
if you want to avoid density aware rescalingColton Idle
08/29/2020, 5:00 AMColton Idle
08/29/2020, 5:01 AMmaxLines = 2,
overflow = TextOverflow.Ellipsis
Again, new to compose so bear with me. Why aren't these modifiers?romainguy
08/29/2020, 5:03 AMColton Idle
08/29/2020, 5:04 AMromainguy
08/29/2020, 5:04 AMdrawable/
is equivalent to `drawable-mdp/`` which will cause your images to be scaled by a large amoutromainguy
08/29/2020, 5:04 AMdrawable/
for your XML files, etc.romainguy
08/29/2020, 5:04 AM-*dpi
variantsromainguy
08/29/2020, 5:04 AMromainguy
08/29/2020, 5:05 AMromainguy
08/29/2020, 5:05 AMColton Idle
08/29/2020, 5:05 AMYou don’t want to avoid that noOh no. I think I followed an old tutorial from google a while back and they put a full bleed image in drawable-nodpi and I always basically followed that convention.
romainguy
08/29/2020, 5:05 AMnodpi
is useful but you need to have a good reason to use it 🙂Colton Idle
08/29/2020, 5:17 AMgit clone <https://github.com/google/search-samples.git>
Maybe this was one of those cases where we needed nodpi? 🤷♂️
EDIT: Glad I actually was able to find this and know I wasn't going crazy