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

Load custom bitmap #1

Open
taimur97 opened this issue Feb 17, 2016 · 5 comments
Open

Load custom bitmap #1

taimur97 opened this issue Feb 17, 2016 · 5 comments

Comments

@taimur97
Copy link

When I load a bitmap it resizes it How can I load a resized sticker say like 150px by 180px? I tried changing the layout params from match_parent to different sizes but it didn't work and I also tried scalling the bitmap before loading it in StickerView but StickerView resizes it
Please help...

@kencheung4
Copy link
Collaborator

Hi taimur97,

You may use getMainView() to get the imageView in your stickerView and try to set the scale type of it. Default is fitXY. Maybe set it to fitCenter solve your problem.

@taimur97
Copy link
Author

I am trying to do it will it work if I change the layout params in StckerImageView file?

And after adding the text on screen when I resize it it resizes just like an image How can I change that behavior.. It should change the length but the height should remain half so it doesn't look like a square

@kencheung4
Copy link
Collaborator

The layout params you mention in StickerImageView actually only affect how the imageView behave when the parent container (I.E the Framelayout) change it size. But if you want to make, say, a 150x180 photo to show on a square imageView, it's the scaleType that we should change. And I don't recommend you make change on the original file.

But for your second question, it may be a good request for the new feature, but to solve your problem fast, you can consider change not to use "AutoResizeTextView" in the StickerTextView class. AutoResizeTextView make the text behave like image, when you resize your container, the text will also become larger. So changing from AutoResizeTextView to normal TextView can make your container larger but the text size remain unchanged.

Hope it helps :)

@taimur97
Copy link
Author

I have solved the image issue but the text issue is still present. I tried changing from AutoresizeTextView to simple Textview but it didn't help. One way to solve it is if we change ratio at which the height of the text is resized. If it resizes half the length of width when size is changed the problem will be solved.
I tried to do it but didn’t understand much how the code was working Can you please try to implement it and see if it works?

@cnkcheung3
Copy link

Hi taimur97,

I am sorry that currently it would always be a square border but changing to normal textview can help to show all the text in a single line instead of resizing the text.

I appreciate if you can push a new feature branch regarding your issue, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants