How to make an Advanced user interface in Android? - java

i wonder how you can make an advanced Android User interface where you can add for example a drag drop and more graphics options? is that by using OpenGl ?!
this is example of UI in iPhone Apps.
example 1
example 2
Thanks

Your examples just seem to be composed of a lot of nice images. Your first example looks pretty static and could probably be made from buttons with custom images and setting lots of backgrounds on your layout items. The second looks like you would need to make a custom Gallery and do a little more manipulation and composition of images so it might be worth your time to go a little lower level for performance.
Basically, you're looking at using a lot of images. You can make them work with existing widgets and components and get the functionality more easily, or you can use OpenGL ect. To get some more flexibility and performance at the cost of having to code all the functionality in yourself.
If you're looking at drag and drop this post points to the source for a ListView with some rudimentary drag and drop functionality.

Related

Interactive UI with dynamic areas

Going to make a pretty statistic part for my app and saw a pretty good looking UI (see below). What I'm asking is what's the approach? I have a few ideas, for example drawing multiple ImageButtons (one for every text field) and paint the background the same color as the ImageButtons.
This if i want each of the texts to be clickable, in the example picture for example pressing 18c fires one action and pressing Cambridge another action.
How would you approach this?
What components to use?
Want to do as much as possible in xml, but I'll take suggestions in code too. Whatever is better for you.
EDIT:
Found a good example about how to solve the listView part:
http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/

Java - Image Opacity

I have been making a video using pure Java. I would like to put in a pop-up menu for players when every they hit ESC. I have the menu setup but it looks really quite ugly. I would like to make the menu blur the image behind it.
For example on the new iOS 7 on Apple devises a lot of the things like the dock blur to whatever is behind it. There is an example of what I am trying to achieve below!
The simplest solution would be to use something JXLayer, as it will allow you to apply filter effects to the components that it covers.
For example.

Java, Swing, Netbeans: how to create an interface similar to the iPhone's SMS screen?

I'm looking to create an interface similar to that of the iPhone's SMS screen. More specifically I'm looking to replicate the "bubbles" coming from each side of the page which contain the messages, as shown here http://www.bidslammer.com/images/iphone_shot1.png .
I do also want to recreate the date and time above the bubbles like you can see in that image. I need to be able to do this by code because its use will be to display the messages that it receives over my socket connection, and show the messages I send over the socket.
I'm really new to Java, and even newer to Swing, so I'm looking for some pointers on how I should go about this.
Can anyone offer my any suggestions about how I would go about doing this? I'm not looking for someone to do the work for me, just a few pointers, perhaps some things I should learn how to use/do and perhaps a helpful tutorial or two.
Google for "swing tutorial" gives a lot of tutorial links, so just pick one. When I was learning Swing I used original Java Swing tutorial.
As for some pointers, I think good idea is to use images to represent the bubbles - that will be the easiest. Inherit some basic component like JLabel or JPanel and override a drawing method - do a custom drawing. First draw the bubble image and then the text over it. This may help with image drawing.
Generally with custom component drawing you use Graphics class, which provides a lot of useful drawing methods.
The sticky notes demo might get you started in the right direction.
Even though that demo is a NetBeans platform module, the sticky note itself is a pure Swing component and should be usable without the platform.

How to make iGoogle like UI using java swing

I am developing desktop GUI application using java swing. And I want to show several "subwindow" on the same window(JFrame). And I want the layout is similar to iGoogle such that user can add and remove new subwindow. To be simple, I assume all the "subwindows" have the same size and similar content(all are showing chart). By the way, the maximum number of "subwindow" would not be a huge number. I think it is less than 8.
if there is no drag and drop, can I just use grid layout to
implement it?
if there is drag and drop, what is the easy way to
do it?
Thank You very much.
FYI: iGoogle http://www.google.com.hk/ig
I don't know what iGoogle is, but it sounds like you should be using internal frames. See the section from the Swing tutorial on How to Use Internal Frames.
If all the "sub windows" will be equal size and not draggable, I'd just use a simple layout. seems like a good case to use TableLayout. In a simple case where you know the max amount of slots, you could have 8 corresponding JPanels and add them to Container using the table layout (making sure to revalidate()) as the user requests them. if a user closes one, you just remove it from the container and revalidate. Hope that helps. if you don't need docking functionality, don't even go down that road is my advice.
EDIT:
you could also still implement drag and drop by using your own mouse handlers.

Custom Swing component: questions on approach

I'm trying to build a new java swing component, I realise that I might be able to find one that does what I need on the web, but this is partly an exercise for me to learn ow to do this.
I want to build a swing component that represents a Gantt chart. it would be good (though not essential for people to be able to interact with it (e.g slide the the tasks around to adjust timings)
it feels like the best approach for this is to subclass JComponent, and override PaintComponent() to 'draw a picture' of what the chart should look like, as opposed to doing something like trying to jam everything into a custom JTable.
I've read a couple of books on the subject, and also looked at a few examples (most notably things like JXGraph) - but I'm curious about a few things
When do I have to switch to using UI delegates, and when can I stick to just fiddling around in paintcomponent() to render what I want?
if I want other swing components as sub-elements of my component (e.g I wanted a text box on my gantt chart)
can I no longer use paintComponent()?
can I arbitrarily position them within my Gantt chart, or do I have to use a normal swing layout manager
many thanks in advance.
-Ace
I think that the article i wrote a few years ago for java.net is still correct today. Doing everything in one monolithic class gets you going faster in the beginning, but becomes a mess quite fast. I highly recommend doing the separation between the model (in your main class) and the view (UI delegate). The view is responsible for:
interaction with the user - mouse, keyboard etc.
painting
creating "worker" subcomponents as necessary
In the medium and long run this is the approach that has been validated over and over again in the Flamingo component suite, which you can use as an extra reference point (in addition to how core Swing components are implemented).
Using UI delegates is a good idea if you think that your component should look different for different Look And Feels. Also it is generally a good idea from design point of view to separate you presentation from your component
Even when overrding paintComponent you can still put any sub components on it.
Using null layout you arbitrarey position your components. Alternatively you can use layouts too.
Here is a very good starting point for you.

Categories