how to create android re sizable split pane ( to display two fragments )? - android

I want to create an android split pane which has a draggable vertical bar to resize both layouts on each side, what I thought to do is, change the weight of layouts dynamically with onTouch Listener, if anyone can suggest another method or a suitable library for this purpose. it'll be a huge help.

you can use this third party library
https://github.com/MobiDevelop/android-split-pane-layout

Related

Android change layout by sliding left/right

I tried many times to create a layout that contain multiple layouts and switch between these layouts by sliding left or right like on WhatsApp or Facebook apps.
I have used some LinearLayout, TableLayout and ScrollView but I didn't found the way to achieve it.
Do you have any solution please ?
What do you want to do is a Material Design Sliding Tabs ? I implemented that functionality in my app following this guide
You probably want to use Androids ViewPager and set up your views as fragments, it has built in swipe gestures to transition through pages so should cover what you need.
Check out this example, it's also got a sample app you can download and test out:
http://developer.android.com/training/animation/screen-slide.html

keeping tabs fixed on all screen of android development

I am new on android i am making an app having few tabs using fragment. Is there any way to keep tabs fixed on all screens or will I have to copy the code for tabs in all activities?
Simple way to do this is
Take linear layout at top & take relative layout for rest of the screen
Add number of tabs/buttons/imagebuttons you want
Apply listener for each button according to that button you can change the things which are in relative layout.
I think, this will be the simple & efficient way to handle the things.

Android: how to create application frame controls

We have an Android application made of menu of modules and each module has the same layout as on this picture:
You have a header with module name and two buttons on the bottom. The module itself is behind those three transparent elements. Left button allows the user to move to the previous screen and right button gets him back to the menu with modules. Text in header changes based on current screen action.
My question is how to build the module transparent frame. Is it possible to have one layout in Android on top of the other? Should we design the code as a parent class that would be inherited by all the modules? I am interested in some best practice. I have experience with Java but only theoretical knowledge of Android.
Prepare a separate common layout and use to add that layout to as many layouts you want.
for more details check this
What you are looking for are so called Fragments. These Fragments are sort of like Activities, with their own layouts and lifecycles, but you are able to use multiple Fragments at once. This means you'll be able to use one Fragment for your navigation and header, and one for the module behind it.

How to Draw custom Bar charts in Android

I am developing an application, in which there is a requirement for showing results in a Bar charts. I have tried developing charts using AChartEngine and Google api and many other apis. But my Requirement is to draw multiple charts in one Activity. I followed this.Its working fine. But when i try to set the background image for the whole screen, Its not working
Can Anybody help me please
Just check this Bar Chart in Android With out any Built in jars. Here you can draw charts without any built in jars. Its just simple Graph creation using the concept of setting the height for the textview in a ListView.
I implemented this by using the Horizontal ListView. Here you have the two double arrays with equal size of elements. And the graph will adjust according to the orientation(Portrait and landscape).
If you want more charts in one activity, you can implement another Horizontal Listview in the layout.
I hope this will help you....
i can help you with paid Library which is nice
is called aiCharts (Bar Charts)
or you should refer GraphViewDemo it is also anice and free libraray to make bar graph
GraphViewDemo
I am writing a blog post on the subject. For one of my clients I created a compound view with an embedded bar chart. I did not find a simple and flexible library to achieve this, so I decided to go with custom views. To my surprise, it was simpler than I had expected: create a custom view that takes a colour and a percentage as attributes and use linear layouts to contain its instances, using layout_weight or a fixed layout_width to maintain proportions. I am very happy with the results.

Tips on how to build a layout like this one

Could anyone give me a tip on how to build a layout like in the following picture?
The application i'm working on has absolutely nothing to do with VoIP but I'm trying to build something like this. One fixed toolbar at the bottom, an interchangeable middle pane with listviews, scrollviews or other, and another toolbar at the top which would change depending on the button selected on the bottom bar.
Also, would it be possible and good practice to keep all of this within a single activity?
You should NOT build an interface like this. Don't use bottom bars! Don't use labelled back buttons on action views!
You should read the Android design guidelines and then work with tab views... and other stuff referenced there and build an Android app.
Also, would it be possible and good practice to keep all of this within a single activity?
-Yes for sure, and yes with a slight catch, depending on what you mean.
One approach would be to create your top and bottom bars inside their own XML. Then in your activity onCreate() inflate and add at the top and bottom of your Layout.
If the bottom bar will not change ever, then you could actually add that into the layouts you already have. If you do it that way, to handle the listeners you could create an Activity that contains just the bottom bar click listeners and then extend that with all of your other activities.
Since the top bar can change though you'll probably have to inflate and add the views to that at run time, that way you can react to what is going on to add / remove / present the appropriate views in the top bar.
Also just because it is somewhat of a pet peeve of mine:
When designing your bottom bar please seriously consider the fact that some devices have soft buttons directly underneath the touch screen. And they are rather close to the screen on some devices. Applications with a bottom bar that is not tall enough create an opportunity for the user to hit one of the system buttons instead of one of the bottom bar buttons as they are intending (or vice versa). Which from a users perspective I must say is VERY aggravating.
Do not use bottom bars. To give a more familiar UI, put all of those functions into the top bar. Start by looking at the source code for the ActionBarCompat project in your android sdk sample folder.
The Android developer site is a good place to start. See
UI Guide
I also agree with the poster who recommended against this specific layout. It seems to have been developed for an iPhone and shouldn't be used "as is".

Categories

Resources