navasmdc / MaterialDesignLibrary

This is a library with components of Android L to you use in android 2.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem with mark position of checkbox in android L

rexi1r opened this issue · comments

hi. CheckBox work fine in some android L but in LG G3 i got a wrong position for Checkmark.
screenshot_2015-06-06-17-08-46

The problem is in the below code

Rect src = new Rect(40 * step, 0, (40 * step) + 40, 40);


Rect dst = new Rect(0, 0, this.getWidth() - 2, this.getHeight());

wrong size and wrong position.
how can i solve this?

Same here. Need help ;)

no solution???????

This library uses drawable to provide this type of checkBox. This problem happens because the resolution of G3 is too big and the file at resource can't handle this resolution.

I had the same problem in a LG G4. Simple workaround (not the best temporary helps):

int slice = sprite.getWidth() / 12;
int height = sprite.getHeight();
Rect src = new Rect(slice * step, 0, (slice * step) + slice, height);
Rect dst = new Rect(0, 0, this.getWidth() - 2, this.getHeight());