git clone of logicmail with some fixes/features added
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial screen factory and tree field sizing support for the Bold 9900 (refs #347)

git-svn-id: https://logicmail.svn.sourceforge.net/svnroot/logicmail/trunk@942 5c734088-3d25-0410-9155-b3c3832efda5

octorian 05a0b58d e84a41da

+43 -6
+7
LogicMail/src/org/logicprobe/LogicMail/PlatformInfo.java
··· 89 89 public abstract boolean hasTouchscreen(); 90 90 91 91 /** 92 + * Checks for whether the platform supports a virtual keyboard. 93 + * 94 + * @return true, if this is a virtual keyboard device 95 + */ 96 + public abstract boolean hasVirtualKeyboard(); 97 + 98 + /** 92 99 * Gets the filesystem roots that the application can write to. 93 100 * 94 101 * @return the filesystem roots
+4
LogicMail/src/org/logicprobe/LogicMail/PlatformInfoBB45.java
··· 62 62 return false; 63 63 } 64 64 65 + public boolean hasVirtualKeyboard() { 66 + return false; 67 + } 68 + 65 69 public String[] getFilesystemRoots() { 66 70 Vector validRoots = new Vector(); 67 71 StringBuffer buf = new StringBuffer(FILE_URL_PREFIX);
+5
LogicMail_BB47/src/org/logicprobe/LogicMail/PlatformInfoBB47.java
··· 31 31 package org.logicprobe.LogicMail; 32 32 33 33 import net.rim.device.api.ui.Touchscreen; 34 + import net.rim.device.api.ui.VirtualKeyboard; 34 35 35 36 public class PlatformInfoBB47 extends PlatformInfoBB46 { 36 37 public boolean hasTouchscreen() { 37 38 return Touchscreen.isSupported(); 39 + } 40 + 41 + public boolean hasVirtualKeyboard() { 42 + return VirtualKeyboard.isSupported(); 38 43 } 39 44 }
+11 -4
LogicMail_BB47/src/org/logicprobe/LogicMail/ui/ScreenFactoryBB47.java
··· 40 40 41 41 public class ScreenFactoryBB47 extends ScreenFactoryBB45 { 42 42 protected boolean hasTouchscreen; 43 + protected boolean hasVirtualKeyboard; 43 44 44 45 public ScreenFactoryBB47() { 45 46 hasTouchscreen = Touchscreen.isSupported(); 47 + hasVirtualKeyboard = VirtualKeyboard.isSupported(); 46 48 } 47 49 48 50 public StandardScreen getMailHomeScreen(NavigationController navigationController, MailRootNode mailRootNode) { 49 51 if(hasTouchscreen) { 50 - return getStandardTouchScreen(navigationController, new TouchMailHomeScreen(mailRootNode)); 52 + if(hasVirtualKeyboard) { 53 + return getStandardTouchScreen(navigationController, new TouchMailHomeScreen(mailRootNode)); 54 + } 55 + else { 56 + return getStandardScreen(navigationController, new TouchMailHomeScreen(mailRootNode)); 57 + } 51 58 } 52 59 else { 53 60 return getStandardScreen(navigationController, new MailHomeScreen(mailRootNode)); ··· 55 62 } 56 63 57 64 public StandardScreen getMailboxScreen(NavigationController navigationController, MailboxNode mailboxNode) { 58 - if(hasTouchscreen) { 65 + if(hasTouchscreen && hasVirtualKeyboard) { 59 66 return getStandardTouchScreen(navigationController, new MailboxScreen(mailboxNode)); 60 67 } 61 68 else { ··· 64 71 } 65 72 66 73 public StandardScreen getMessageScreen(NavigationController navigationController, MessageNode messageNode) { 67 - if(hasTouchscreen) { 74 + if(hasTouchscreen && hasVirtualKeyboard) { 68 75 return getStandardTouchScreen(navigationController, new MessageScreen(messageNode)); 69 76 } 70 77 else { ··· 74 81 75 82 public String showFilePicker() { 76 83 FilePickerDialog dialog = new FilePickerDialog(); 77 - if(hasTouchscreen) { 84 + if(hasTouchscreen && hasVirtualKeyboard) { 78 85 dialog.getVirtualKeyboard().setVisibility(VirtualKeyboard.HIDE_FORCE); 79 86 } 80 87 if(dialog.doModal() == Dialog.OK) {
+15 -1
LogicMail_BB47/src/org/logicprobe/LogicMail/ui/TouchScreenTreeField.java
··· 33 33 import net.rim.device.api.system.Bitmap; 34 34 import net.rim.device.api.ui.Graphics; 35 35 import net.rim.device.api.ui.TouchEvent; 36 + import net.rim.device.api.ui.VirtualKeyboard; 36 37 import net.rim.device.api.ui.component.TreeField; 37 38 import net.rim.device.api.ui.component.TreeFieldCallback; 38 39 ··· 61 62 super(new TreeFieldCallbackProxy(), style); 62 63 this.callback = callback; 63 64 this.navigation = navigation; 65 + 66 + // If this device lacks a virtual keyboard, then we assume touch 67 + // interaction is secondary and we should size the rows so vertical 68 + // space isn't wasted for it. 69 + if(!VirtualKeyboard.isSupported()) { 70 + int rowHeight = Math.max(getFont().getHeight() + 18, 45); 71 + this.setRowHeight(rowHeight); 72 + } 64 73 } 65 74 66 75 private static class TreeFieldCallbackProxy implements TreeFieldCallback { ··· 74 83 TreeField treeField, Graphics graphics, 75 84 int node, int y, int width, int indent) { 76 85 int drawWidth = width; 86 + 87 + if(!VirtualKeyboard.isSupported()) { 88 + y += (getRowHeight() >>> 1) - (getFont().getHeight() >>> 1) - 1; 89 + } 90 + 77 91 if(navigation && isNodeSelectable(node)) { 78 92 int rowWidth = width + indent; 79 93 int xPos = rowWidth - (chevronIconWidth * 2); 80 - int yPos = y + (graphics.getFont().getHeight() / 2) - 11; 94 + int yPos = y + (graphics.getFont().getHeight() >>> 1) - 11; 81 95 82 96 if(getCurrentNode() == node) { 83 97 graphics.drawBitmap(xPos, yPos, chevronIconWidth, chevronIconHeight, chevronIconHighlighted, 0, 0);
+1 -1
LogicMail_BB60/src/org/logicprobe/LogicMail/ui/ScreenFactoryBB60.java
··· 39 39 } 40 40 41 41 public StandardScreen getMailboxScreen(NavigationController navigationController, MailboxNode mailboxNode) { 42 - if(hasTouchscreen) { 42 + if(hasTouchscreen && hasVirtualKeyboard) { 43 43 return getStandardTouchScreen(navigationController, new MailboxScreenBB60(mailboxNode)); 44 44 } 45 45 else {