sujithkanna / SmileyRating

SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
Apache License 2.0
1.09k stars 184 forks source link

Selecting BaseRating.GREAT progammatically makes the view only partially visible on the left #11

Closed muigukenneth closed 4 years ago

muigukenneth commented 7 years ago

When i use smileRating.setSelectedSmile(BaseRating.GREAT); it makes the view invisible(only partially visible on the left) but the rest of the rating work okay during the initialization of the view .When you tap on any rating it reverts to the normal state.Cheers.

sujithkanna commented 7 years ago

Can you attach the screenshot, So that I can clearly see the problem. Thank you :)

muigukenneth commented 7 years ago

screenshot_2017-04-18-18-22-20 screenshot_2017-04-18-18-22-06 You can check out the first one(great) then the second (good) is okay :)

sujithkanna commented 7 years ago

Really sorry for this, can you tell me the device model and if possible can you share the xml layout you created?

muigukenneth commented 7 years ago

Here is the model and the xml file.Thanks :

Android build version: G900HXXS1CPJ9 Android release version: 6.0.1 Android SDK version: 23 Android build ID: MMB29K.G900HXXS1CPJ9 Device brand: samsung Device manufacturer: samsung Device name: k3g fragment_about.txt

DemidovIlya commented 7 years ago

I have the same problem

sujithkanna commented 7 years ago

Really sorry for the delay, came back after a long vacation. I couldn't find the problem. You are saying it is only happening on setting GREAT. Let's try one thing, try to set some size for the rating bar. Just set the width of the ratingbar. Height will be automatically taken care of. Let me know the output.

DemidovIlya commented 7 years ago

Yep, this helped me make it work correct. The problem appears when view width equals to display width. At first I just set width in layout file and this solve problem, so I tried to change width programmaticaly and when I set view width equals to display width it stop working again. For normal work, view width just should't equals to display width.

Point size=new Point();
Display display=getWindowManager().getDefaultDisplay();
display.getSize(size);
mSmileRating.setLayoutParams(new LinearLayout.LayoutParams(size.x-1, ViewGroup.LayoutParams.WRAP_CONTENT));

Thanks a lot.