Blackberry App - Table layout advice - blackberry

I'm currently developing a crude, Blackberry app that keeps track of my spending and bank balance. The app will hold details of the items I have bought and how much they cost. The item price will then be subtracted from the main, overall bank balance. All item entries are made manually.
This is a mock-up of what I'm trying to achieve:
Above is the main menu. The top item is a banner that displays the bank balance. The other items are buttons.
The following is view for the items that have been added:
The table is text apart from the Remove Item field - they are buttons.
I'm looking for advice on how to implement both user interfaces (what classes, use a table or not?) I've been trying to implement a table to layout the buttons in the main screen and store the item list - I've not had much success! As I've said at the beginning, this is a crude application - I'm not looking to waste my time trying to implement any fancy GUI, just something functional.
Thanks.

I've been trying to implement a table to layout the buttons in the main screen
This is an overkill. Just use VerticalFieldManager as a buttons (use ButtonField for buttons) container.
.. store the item list
Check this: How to use Table View layout
Use LabelField for text cells.

Related

Eclipse-like layout on Vaadin

I'm looking to design a page with separate sections on Vaadin7.
Earlier, i was convinced that each section as a Panel would do-- see Vaadin menu design - which component at the top? on this.
Now, i need each of these sections be minimized/maximized at user's will. So - when the user clicks the minimize icon, that section will disappear (be minimized) until its maximize button is pressed.
The overall design will be much like Eclipse.
What's the best design for this?
I can use Vaadin Window-s for minimize/maximize. but then, how do i manage their automatic placement in the overall layout?
I want the sections be resizable with respect to one another, just as in Panel-s.
If i use HorizantalSplitPanel/VerticalSplitPanel-s, how do i manage minimize/maximize?
One thing i can think of is:
split the overall layout into Panel-s so that each section will be a
Panel,
put a Window in each panel,
when minimize is pressed, make
that window-minimize event also trigger to minimize the Panel that
Window is in shrink as well.
How to achieve this? Is there a better way?
TIA.

iOS and SQL issue

I have an app that uses an SQLite database for user choices of backgrounds, icons, fonts, etc. I didn't create it, so, I have to use what I have, as, I have a rather large installed base, and am not inclined to switch to CoreData at this point. Don't want to piss off the current users. I also am not really up to speed on SQLite or CoreData.
I was using a custom grid view to display the backgrounds and icons. All of that has been changed to UICollectionView with a UICollectionViewCell.
In the SQL file, the base set is one table of 16 items. Really two (one for icons and the other for backgrounds). These are a part of the base app. In-app purchasing unlocks other "sets". These other sets are in a second table. Yes, separate tables for icons and backgrounds.
I have changed the ID numbers in the first table to start at 0. Previously they started at 1. I can now select and change both icons and backgrounds at will without issue and get the correctly selected item.
Except... when I select an item that is in the secondary icon or background table.
I have altered the ID numbers in the second table to start at one ID higher than the ending ID in the base set table.
But... the first item in the second table is being skipped. Selection of any item in the second table is showing the icon or background directly prior to the selected item. (ie. I select ID 21, I get ID 20 displayed). The first item in the secondary table is showing the last item in the secondary table.
So, my question... should the IDs in the second table start over at 0? Should they start at 1? Or is there another way to solve the skipping and incorrect selection?
Thanks in advance.

How to Make UITableViewSections respond to a click to bring up another view controller, using NSFetchedResultsController and Core Data

I have a fairly simple but working app right now; it's my first app and I'm working through the processes.
There are 4 Tab Bars with Table View controllers with a plus button on the top right. The user clicks that button and is presented modally with a Modal View Controller. They are asked to fill in 4 sets of information in text fields and when they click save, it saves it to the Core Data database, dismisses the View and adds that information to the Table Views. Let's call the items that the user fills in:
Name
Title
Date
Amount
The 4 tab bars are just different views of the same information. For example, Tab Bar 1 has Date as the section header and name, Amount and Title in each row. Nice and easy.
Tab Bar 2 has Name in the section title with Date, Amount and Title in the row. Tab Bar 3 has Title in the section title, etc. You get the idea.
Rather than just doing this though, in Tab 2, 3 and 4, I want to actually JUST have the section headers as buttons of some form that when clicked, takes a user to that particular entry. For example, in Tab Bar 2, I have the name as the section - I want to remove the rows associated with that entry and have just sections (or buttons) with the Names; I click on a name and it takes me to another view controller which will contain all of the Title, Amount, Dates, information, etc.
My question is, what's the best way to go about this approach of removing the rows in the sections and somehow making the sections clickable buttons?
My thinking is rather than use tableViews, use buttons, etc, but is there an elegant way to do this with having already implemented NSFetchedResultsController for each of the table views in each of the Tab Bars.
Any assistance would be massively appreciated.
Thanks,
EDIT:
I have just thought of a possible way to achieve this and it would be great if anyone could validate my thoughts. Rather than create a button, have a UICollectionView in the Tab 2, 3 and 4 providing the attributes from Core Data. So the UICollectionView for tab 2 can assign the NAME attribute to the label inside the Cell and then it can act like a cell and be clicked on. This sounds like the most feasible way to achieve this.

How to create a Hierarchical menu in iOS?

In my application, I have a menu that is defined as follows. Each item on the menu is a node that has the following data attributes:
MenuText : (the text that would appear for that item)
isView : Whether this item is a leaf level item or not
subMenus : if isView is false, then there are multiple menu items under this attribute.
Thus, it is a tree structure that can go till any depth. The items in the menu can change periodically and hence the implementation has to be kept flexible. This data is stored in a plist file and read into an NSArray in the code (already implemented).
I now need to create a slide out menu on the left that will be populated by this data hierarchy. I have created the menu pane and added swipe gestures to it, all of which work fine. The menu has to be a collapsible one where clicking on one menu item expands the subViews below it. If the item clicked on is a view, then a new view is loaded on the rest of the screen with appropriate data.
The problem I am facing is the logic to populate the menu (which is a UITableView) from the NSArray data. The following are the two approaches I came up with.
Create a UITableView with as many sections as there are items at the top level of the menu. Then iterate through the menu items recursively. For each menu item that is not a view (i.e. it has subMenus), create a new section with number of rows equal to the number of subMenus under it. When I come across a menu item that is a view and has no further subMenus, add it as a row to the subsection created for the menu one level above it.
Create a menu with one section and as many rows as the number of menu items at the top level. When a menu item is clicked, insert rows under it to represent its sub-menus. When another menu item on the same level is clicked, collapse the previously expanded menu by deleting the inserted rows. When a menu item with no sub menus is clicked, the rest of the screen is populated with data.
I have tried both the approaches and not been able to go beyond the initial steps. For the first method, I understand that I need to add a UITableView as a part of UITableViewCells, which is good, but I need to do that recursively. For the second approach, I need to know the indexPath of each item clicked which can go to many levels.
I would like some suggestions here about which approach I should take and some guidance over how to go about it. Also, if there is any better way to do this, kindly advice. Thanks.
In my opinion, using UINavigationController is the easiest way. You can push as many UITableViews as you want.
If it doesn't fit your design requirement, you can try expandable UITableViews. There are few open sources:
JKExpandTableView
SDNestedTable
iOS-Tree-Component
Thanks for the responses. I ended up doing this using the following control:
Accordion for iOS
It has served my purpose beautifully and I posted it here so that someone with the same requirement may find it.
Take a look at TLIndexPathTools. It has a "Tree" extension that can do this. Try running the Outline sample project. The main task in adapting the sample project would be to write a recursive function to convert your array of nodes into an array of TLIndexPathTreeItem objects. All of the code in the controller:willChangeNode: method is examples of lazy loading and it doesn't sound like you'd need any of that.

iOS Dropdown Ajax

I’m new to the world of iOS development.
I’m creating a iPad application where I need to have three dropdown (I know there is not dropdown on iOS, i'm doing a analogy with html).
The user selects the value from the first dropdown and the second will be loaded with respective values (from an external source). Then user selects one value from the second dropdown and the other dropdown will load values so the user can choose.
My question, if this was a web application I would use 3 dropdown Ajax, but on iPad applications there is no dropdown. What is the best controller to do this on a iPad application?
You have to use UITableview for that...you can take three table view or take only one tableview and set frame according to your requirement dynamically...then once you select any row from 1st table..using that value please fetch value for another table (for another drop down value list)....All The best!!
iOS typically uses a combination of navigation controllers and table view controllers for this. When the user selects an item in the table the entire things scrolls off the screen to reveal the next table ('menu').
You see this all the time in iPhone apps and in the master view of split view controllers on the iPad.
I'd recommend that you buy a book such as 'iPhone 4 development' to get you started. There are many great books available.
Tim

Resources