Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
zahidalinaqvi
Posts: 445
Registered: ‎10-14-2008
My Device: Blackberry Bold 9000
My Carrier: SingTel

UI Issue

Hello,

 

I am making a list of friends in my app. but when i scroll that list its giving some UI issues like not showing all the images.

 

Have a look on below images.

 

THIS IS THE SCREEN

 

2119iC1E0E899CF94CAEE

 

 

WHEN I SCROLL IT DOWN THEN

 

2120i5B189EFCE892ACB9

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks & Regards
Zahid Naqvi | Senior Software Engineer
Please use plain text.
Developer
arkadyz
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: UI Issue

Could you please make images publicly available somewhere?  I can see nothing...

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Please use plain text.
Trusted Contributor
swapnil_gadkari
Posts: 200
Registered: ‎02-22-2010
My Device: BlackBerry 9550
My Carrier: Airtel

Re: UI Issue

i think you are not setting the rowheight of the list properly. use

 

_list1.setrowheight(40); //like this

 

also the bitmap you are trying to use, see whether you are giving the proper image size while drawing.

 

if poss can you provide the snippet in which you are trying to draw the list. since i am not able to change the color of the list.(means by default it is coming blue).

Swapnil G.
Please use plain text.
Developer
zahidalinaqvi
Posts: 445
Registered: ‎10-14-2008
My Device: Blackberry Bold 9000
My Carrier: SingTel

Re: UI Issue

[ Edited ]

thanks swapnil,

 

actually i m using horizontalfiledmanager here and adding components into that like images, labels, but as i have seen on the blog that we cant change the background color of managers. thats why here i m using the arrow image.

the image is proper and i m not resizing it. but i dont know why this blurring is cmng.

 

 

Code :

 

public class CustomVertical extends VerticalFieldManager{

 

public CustomVertical() {
        super(VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.USE_ALL_HEIGHT | Field.FIELD_HCENTER | VerticalFieldManager.FOCUSABLE);
    }

 

protected void sublayout(int maxWidth, int maxHeight){
         Field field;
       //get total number of fields within this manager
       int numberOfFields = getFieldCount();
       int x = 60;
       int y = 2;
       for (int i = 0;i < numberOfFields;i++) {
           field = getField(i); //get the field
           setPositionChild(field,x,y); //set the position for the field
           layoutChild(field, maxWidth, maxHeight); //lay out the field
           y += 30;
       }
       
     maxWidth = Graphics.getScreenWidth();
     maxHeight = 50;
       
     setExtent(maxWidth, maxHeight);
    }
    
     protected void paintBackground(Graphics graphics)
        {        
            // Sets the BackgroundColor
            graphics.setBackgroundColor(Color.LIGHTGREY);
            
            // Clears the entire graphic area to the current background
            graphics.clear();
        }
    
    public void paint(Graphics graphics) {        
        graphics.setBackgroundColor(Color.RED);
        super.paint(graphics);
        
        graphics.drawBitmap(5, 5, 100, 100, Bitmap.getBitmapResource("girl.jpeg"), 0, 0);
        // Clears the entire graphic area to the current background
       // graphics.clear();    
    }

 

 

 

public VerticalFieldManager getFriendsList(String friendName, String status) {

        Bitmap arrow = Bitmap.getBitmapResource("chevron_right_black_15x22.png");

        CustomVertical customVerticalList = new CustomVertical();

        FontFamily fontfam[] = FontFamily.getFontFamilies();
        Font fon[] = new Font[2];
        fon[0] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 18);
        fon[1] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 13);

        LabelField User = new LabelField(friendName);
        LabelField Status = new LabelField(status);

        User.setFont(fon[0]);
        Status.setFont(fon[1]);

        // CustomVertical2 c2 = new CustomVertical2();
        customVerticalList.add(User);
        customVerticalList.add(Status);

        BitmapField add = new BitmapField(arrow, BitmapField.FOCUSABLE){
            
            protected boolean navigationClick(int status, int time) {
                // This is method will invoke when you click on your bitmapfield and you can write your piece of code here
                UiApplication.getUiApplication().pushScreen(new FriendProfileScreen());
                return true;
                }
            
        };

        DualFieldManager dualFieldmanager = new DualFieldManager(customVerticalList, add);

        return dualFieldmanager;
    }

 

 

 

Using like

 

// Dummy Data
        add(getFriendsList("Kristen", "On Call"));
        add(new SeparatorField());
        add(getFriendsList("Priya", "Available"));
        add(new SeparatorField());
        add(getFriendsList("Ayesha", "Available"));
        add(new SeparatorField());
        add(getFriendsList("Somya", "Available"));
        add(new SeparatorField());
        add(getFriendsList("Mapet", "On Call"));
        add(new SeparatorField());
        add(getFriendsList("Vonz", "Available"));
        add(new SeparatorField());

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks & Regards
Zahid Naqvi | Senior Software Engineer
Please use plain text.
Developer
simon_hain
Posts: 16,111
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: UI Issue

why don't you use a listfield? it would be the exact usecase of it imo.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
zahidalinaqvi
Posts: 445
Registered: ‎10-14-2008
My Device: Blackberry Bold 9000
My Carrier: SingTel

Re: UI Issue

plz find attachment than you will clear my problem.

 

Thanks

Zahid

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks & Regards
Zahid Naqvi | Senior Software Engineer
Please use plain text.