Changeset 576


Ignore:
Timestamp:
12/29/09 17:56:17 (2 years ago)
Author:
octorian
Message:

UI updates with unloaded icons

Location:
trunk
Files:
11 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/BorderedFieldManager.java

    r367 r576  
    9595        int backgroundColor = graphics.getBackgroundColor(); 
    9696 
     97        paintBorder(graphics, width, height, backgroundColor); 
     98 
     99        paintSeparator(graphics, width, height); 
     100         
     101        // Resume normal painting of the contents 
     102        graphics.setColor(foregroundColor); 
     103        super.paint(graphics); 
     104    } 
     105 
     106    protected void paintBorder(Graphics graphics, int width, int height, int backgroundColor) { 
    97107        // Paint the fill for the field 
    98108        graphics.setColor(Color.LIGHTGREY); 
     
    106116        graphics.setColor(Color.DARKGRAY); 
    107117        graphics.drawRoundRect(borderWidth, borderWidth, width - (borderWidth * 2), height - (bottomBorderNone ? borderWidth : (borderWidth * 2)), 10, 10); 
    108  
     118    } 
     119     
     120    protected void paintSeparator(Graphics graphics, int width, int height) { 
    109121        if(bottomBorderLine) { 
    110                 graphics.drawLine(0, height - 1, width - 1, height - 1); 
     122            graphics.drawLine(0, height - 1, width - 1, height - 1); 
    111123        } 
    112          
    113         // Resume normal painting of the contents 
    114         graphics.setColor(foregroundColor); 
    115         super.paint(graphics); 
    116124    } 
    117125     
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/CompositionScreen.java

    r502 r576  
    244244     
    245245    public void initFields(Screen screen) { 
    246         recipientsFieldManager = new BorderedFieldManager( 
     246        FieldFactory fieldFactory = FieldFactory.getInstance(); 
     247        recipientsFieldManager = fieldFactory.getBorderedFieldManager( 
    247248                        Manager.NO_HORIZONTAL_SCROLL 
    248249                        | Manager.NO_VERTICAL_SCROLL 
     
    253254                EmailAddressBookEditField.ADDRESS_CC, "")); 
    254255 
    255         subjectFieldManager = new BorderedFieldManager( 
     256        subjectFieldManager = fieldFactory.getBorderedFieldManager( 
    256257                        Manager.NO_HORIZONTAL_SCROLL 
    257258                        | Manager.NO_VERTICAL_SCROLL 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/FieldFactory.java

    r560 r576  
    4747        "org.logicprobe.LogicMail.ui.FieldFactoryBB50", 
    4848        "org.logicprobe.LogicMail.ui.FieldFactoryBB47", 
     49        "org.logicprobe.LogicMail.ui.FieldFactoryBB46", 
    4950        "org.logicprobe.LogicMail.ui.FieldFactoryBB42" 
    5051    }; 
     
    7273 
    7374    public abstract TreeField getScreenTreeField(TreeFieldCallback callback, long style); 
     75     
     76    public abstract BorderedFieldManager getBorderedFieldManager(); 
     77     
     78    public abstract BorderedFieldManager getBorderedFieldManager(long style); 
    7479} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/FieldFactoryBB42.java

    r501 r576  
    4545                return treeField; 
    4646        } 
     47 
     48    public BorderedFieldManager getBorderedFieldManager() { 
     49        return new BorderedFieldManager(); 
     50    } 
     51 
     52    public BorderedFieldManager getBorderedFieldManager(long style) { 
     53        return new BorderedFieldManager(style); 
     54    } 
    4755} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MailboxMessageField.java

    r573 r576  
    155155        // Draw the message icon 
    156156        Bitmap messageIcon = NodeIcons.getIcon(messageNode); 
    157         int messageIconY = (lineHeight / 2) - (messageIcon.getHeight() / 2); 
    158         int messageIconW = messageIcon.getWidth(); 
    159         int messageIconH = messageIcon.getHeight(); 
    160         graphics.drawBitmap(1, messageIconY, messageIconW, messageIconH, messageIcon, 0, 0); 
    161          
    162         if(!messageNode.hasCachedContent() && !messageNode.hasMessageContent()) { 
    163             graphics.setColor(graphics.getBackgroundColor()); 
    164             graphics.drawFilledPath( 
    165                     new int[] { 1, 11, 1 }, 
    166                     new int[] { 1, 1, messageIconY + messageIconH }, 
    167                     null, 
    168                     null); 
    169             graphics.setColor(originalColor); 
    170         } 
     157        graphics.drawBitmap( 
     158                1, 
     159                (lineHeight / 2) - (messageIcon.getHeight() / 2), 
     160                messageIcon.getWidth(), 
     161                messageIcon.getHeight(), 
     162                messageIcon, 0, 0); 
    171163         
    172164        if(attachmentIcon != null) { 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/MessageScreen.java

    r562 r576  
    123123    public void initFields(Screen screen) { 
    124124        // Create screen elements 
    125         addressFieldManager = new BorderedFieldManager( 
     125        FieldFactory fieldFactory = FieldFactory.getInstance(); 
     126        addressFieldManager = fieldFactory.getBorderedFieldManager( 
    126127                        Manager.NO_HORIZONTAL_SCROLL 
    127128                        | Manager.NO_VERTICAL_SCROLL 
    128129                        | BorderedFieldManager.BOTTOM_BORDER_NONE); 
    129         subjectFieldManager = new BorderedFieldManager( 
     130        subjectFieldManager = fieldFactory.getBorderedFieldManager( 
    130131                        Manager.NO_HORIZONTAL_SCROLL 
    131132                        | Manager.NO_VERTICAL_SCROLL 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/ui/NodeIcons.java

    r405 r576  
    6868    private Bitmap unknownMessageIcon; 
    6969    private Bitmap junkMessageIcon; 
     70    private Bitmap openedUnloadedMessageIcon; 
     71    private Bitmap unopenedUnloadedMessageIcon; 
     72    private Bitmap repliedUnloadedMessageIcon; 
     73    private Bitmap flaggedUnloadedMessageIcon; 
     74    private Bitmap draftUnloadedMessageIcon; 
     75    private Bitmap deletedUnloadedMessageIcon; 
     76    private Bitmap unknownUnloadedMessageIcon; 
     77    private Bitmap junkUnloadedMessageIcon; 
    7078         
    7179    public final static int ICON_FOLDER = 0; 
     
    97105                unknownMessageIcon  = Bitmap.getBitmapResource("mail_unknown.png"); 
    98106                junkMessageIcon     = Bitmap.getBitmapResource("mail_junk.png"); 
     107        openedUnloadedMessageIcon   = Bitmap.getBitmapResource("mail_opened_unloaded.png"); 
     108        unopenedUnloadedMessageIcon = Bitmap.getBitmapResource("mail_unopened_unloaded.png"); 
     109        repliedUnloadedMessageIcon  = Bitmap.getBitmapResource("mail_replied_unloaded.png"); 
     110        flaggedUnloadedMessageIcon  = Bitmap.getBitmapResource("mail_flagged_unloaded.png"); 
     111        draftUnloadedMessageIcon    = Bitmap.getBitmapResource("mail_draft_unloaded.png"); 
     112        deletedUnloadedMessageIcon  = Bitmap.getBitmapResource("mail_deleted_unloaded.png"); 
     113        unknownUnloadedMessageIcon  = Bitmap.getBitmapResource("mail_unknown_unloaded.png"); 
     114        junkUnloadedMessageIcon     = Bitmap.getBitmapResource("mail_junk_unloaded.png"); 
    99115        } 
    100116         
     
    184200 
    185201                public void visit(MessageNode node) { 
     202                    boolean unloaded = !node.hasCachedContent() && !node.hasMessageContent(); 
    186203                        int flags = node.getFlags(); 
    187204                if((flags & MessageNode.Flag.DELETED) != 0) 
    188                     this.icon = deletedMessageIcon; 
     205                    this.icon = unloaded ? deletedUnloadedMessageIcon : deletedMessageIcon; 
    189206                else if((flags & MessageNode.Flag.JUNK) != 0) 
    190                         this.icon = junkMessageIcon; 
     207                        this.icon = unloaded ? junkUnloadedMessageIcon : junkMessageIcon; 
    191208                else if((flags & MessageNode.Flag.ANSWERED) != 0) 
    192                         this.icon = repliedMessageIcon; 
     209                        this.icon = unloaded ? repliedUnloadedMessageIcon: repliedMessageIcon; 
    193210                else if((flags & MessageNode.Flag.FLAGGED) != 0) 
    194                         this.icon = flaggedMessageIcon; 
     211                        this.icon = unloaded ? flaggedUnloadedMessageIcon : flaggedMessageIcon; 
    195212                else if((flags & MessageNode.Flag.DRAFT) != 0) 
    196                         this.icon = draftMessageIcon; 
     213                        this.icon = unloaded ? draftUnloadedMessageIcon: draftMessageIcon; 
    197214                else if((flags & MessageNode.Flag.RECENT) != 0) 
    198                         this.icon = unopenedMessageIcon; 
     215                        this.icon = unloaded ? unopenedUnloadedMessageIcon: unopenedMessageIcon; 
    199216                else if((flags & MessageNode.Flag.SEEN) != 0) 
    200                         this.icon = openedMessageIcon; 
     217                        this.icon = unloaded ? openedUnloadedMessageIcon : openedMessageIcon; 
    201218                else 
    202                         this.icon = unknownMessageIcon; 
     219                        this.icon = unloaded ? unknownUnloadedMessageIcon: unknownMessageIcon; 
    203220                } 
    204221                 
  • trunk/LogicMail_BB47T/src/org/logicprobe/LogicMail/ui/FieldFactoryBB47T.java

    r549 r576  
    3535import net.rim.device.api.ui.component.TreeFieldCallback; 
    3636 
    37 public class FieldFactoryBB47T extends FieldFactory { 
     37public class FieldFactoryBB47T extends FieldFactoryBB46 { 
    3838        private boolean hasTouchscreen; 
    3939        private FieldFactory oldFieldFactory; 
Note: See TracChangeset for help on using the changeset viewer.