Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Horizontal scrolling elements do not size correctly ( LogicalDensityFactor multiplied!) #13980

Open
Informate opened this issue Feb 1, 2024 · 1 comment
Labels
bug needs triage This issue hasn't been reviewed by maintainers

Comments

@Informate
Copy link

Informate commented Feb 1, 2024

Workaround to FIX: Divide Size by Ti.Platform.displayCaps.logicalDensityFactor to have correct size.

PSEUDO CODE:

var ldf = Ti.Platform.displayCaps.logicalDensityFactor;

horizontalScrolling.add(internalView);
if (!OS_ANDROID) {
internalView.width = internalView.size.width / ldf;
internalView.height = internalView.size.height / ldf;
}

@Informate Informate added bug needs triage This issue hasn't been reviewed by maintainers labels Feb 1, 2024
@Informate Informate changed the title iOS: Staus Bar and Notch overlap window content also with extentSafeArea=false remove erroneous task Feb 1, 2024
@Informate Informate changed the title remove erroneous task Android: Horizzontal scrolling elements do not size correctly ( LogicalDensityFactor multiplied!) Feb 1, 2024
@Informate Informate changed the title Android: Horizzontal scrolling elements do not size correctly ( LogicalDensityFactor multiplied!) Android: Horizontal scrolling elements do not size correctly ( LogicalDensityFactor multiplied!) Feb 1, 2024
@m1ga
Copy link
Contributor

m1ga commented Feb 1, 2024

Can you provide some demo code please?

Think the workaround you are talking about is basically this:

var pw = Ti.Platform.displayCaps.platformWidth;
var ph = Ti.Platform.displayCaps.platformHeight;
var ldi = Ti.Platform.displayCaps.logicalDensityFactor;
Alloy.Globals.WIDTH = (OS_ANDROID) ? pw / ldi : pw;
Alloy.Globals.HEIGHT = (OS_ANDROID) ? ph / ldi : ph;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage This issue hasn't been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants