Skip to main content
-1 votes
1 answer
74 views

When I say "the same layout proportions" I'm mainly referring to text sizes, but also to views in general. I've always read that sp text size units are screen independent, but that's not ...
Diego Perez's user avatar
  • 3,024
1 vote
1 answer
2k views

Suppose I have a screen in figma with 1080x1920 resolution, then I add 20px padding, when I recreate this layout with compose I need to parse 20 to dp (using some utility function like: val Int.dp: ...
Gabriel's user avatar
  • 29
2 votes
0 answers
271 views

I'm a total newbie with Jetpack Compose. I hope you may help shed some light on my issue. In the old days, if you had a PNG drawable resource, you would provide multiple versions of that drawable ...
Cosmin Radu's user avatar
2 votes
2 answers
2k views

On my Pixel 7 device, I want to know how many density-independent pixels (dp) I have. So, I use this formula: displayMetrics.widthPixels / displayMetrics.density However, I have an issue because ...
zeus's user avatar
  • 13.3k
0 votes
0 answers
43 views

i am using android studio in x.xml, i set the layout_height=400dp <RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="wrap_content" android:...
oscar's user avatar
  • 11
0 votes
1 answer
85 views

So imagine that I have an image that is 700x700 px in res folder and I want my app to support different pixel densities. So according to the documentation: ldpi -- 0.75x mdpi -- 1x hdpi -- 1.5x xhdpi -...
Eldestornillador's user avatar
0 votes
1 answer
79 views

I need the formulas to calculate any dpi to any dpi. For example: mdpi to hdpi, xdpi to xxhdpi, etc. This website exactly does what I require but I am not able to find the logic for it. Any ...
Joshua's user avatar
  • 1,463
0 votes
0 answers
94 views

i calculated the dp of a device (smallest width), in particular a google pixel 3 (440dpi 1080x2160), using the formula: px = dp*(dpi/160) the result was 392.72, so i created the file animator-sw390dp-...
Danstern's user avatar
  • 147
0 votes
0 answers
134 views

I am new to programming and I didn't quite understand the dimens, I know there are small, normal, large and xlarge screen sizes. I also know the densities: ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi. I ...
HOWDY WORLD's user avatar
14 votes
2 answers
7k views

I want to set the height of view in pixels not in dp. `Box(modifier = Modifier.height(100.dp))` In this example height of the box is set to 100 dp and modifier function accepts only dp. How to set ...
Evgeniy Rechkov's user avatar
1 vote
1 answer
806 views

This is the style I ma using to render Text TEXT_B16: { fontFamily: 'OpenSans-Bold', fontWeight: fontWeight, fontSize: 16, lineHeight: 22, }, And output is as follows, Samsung One ...
ThinkAndCode's user avatar
  • 1,747
0 votes
0 answers
127 views

I am trying to create a text sticker in android. I am creating a text sticker on one of my phones and then saving the text size in the DP. Then on another phone, I am loading the same text with the ...
Hrishita Mavani's user avatar
1 vote
0 answers
251 views

https://material.io/resources/devices/ (which is not maintained anymore) has 3.5x for xxxhdpi google pixel xl 4x for xxxhdpi galaxy s8 https://material.io/blog/device-metrics lists only 4x for ...
eugene's user avatar
  • 42.1k
1 vote
0 answers
55 views

Source code can be found at : https://github.com/AliRezaeiii/Contacts I have following layout in my Activity : <?xml version="1.0" encoding="utf-8"?> <androidx....
Ali's user avatar
  • 10k
1 vote
0 answers
32 views

I am running 2 emulators: 360x640 mdpi (1x) 1080x1920 xxhdpi (3x) Using dp values when defining attributes for views should result in covering same physical space, but as the result they look ...
ashaneen's user avatar
  • 137

15 30 50 per page
1
2 3 4 5
8