dandycheung / microemu

Automatically exported from code.google.com/p/microemu
0 stars 0 forks source link

[android] ListView with small images looks bad #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create list with small (16x16) icons.

public class MainMenu extends List {
    public MainMenu() {
        super("Test", List.IMPLICIT);
        try {
        Image imgTest = Image.createImage("/test.png");
        }catch(Exception e) {}
        append("Test", imgTest);
    }
}

What is the expected output? What do you see instead?
Text is big (~26px), icons are small and aligned to left-top. It looks
better, when they are centered (vertically at least).

What version of the product are you using? On what operating system?
Irrelevant.

Please provide any additional information below.
This could be improved by changing file
/src/org/microemu/android/device/ui/AndroidListUI.java line: 170
public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                //TODO figure out a better layout - see example of different image and
text sizes.
                LinearLayout layout = new LinearLayout(activity);
+                                layout.setGravity( 0x10 | 0x07); //
center_vertical + fill_horizontal

Original issue reported on code.google.com by Kot.Zgu...@gmail.com on 1 Jun 2010 at 10:12

GoogleCodeExporter commented 8 years ago
Fixed on trunk

Original comment by bar...@gmail.com on 2 Jun 2010 at 9:50