i am trying to design dynamic ui layout in android to present the date like the image below. i am **facing the challenges in the creating an view as clustered in the below mail **
i tried using list view!
but the each appeares in diffrent line, it dose not lookes like the image as below! is that possible to design like this. if so how to do that?
Try to create a few custom views, e.g. this circles with dates, this labels on the left and rights with xml layouts. Next, create parent view with some container layout, e.g. FrameLayout. In this parent view override it's onDraw() method, and there manually create and add every layout. It is simple, but might be not efficent, when there are many of views
Related
I want to know how is possible to achieve a arrow-based layout like this :
Any idea about what Layout is using this app in order to achieve that layout ? It seems like a kind of Staggered Grid Layout maybe ? Or maybe is using a library or a custom layout ? How can I achieve something similar ?
so here is how I would do something like this.
I make a bunch of custom views.
custom view #1:
PokemonView.
This is a regular Constraint Layout or CardView that contains all the items to show the pokemon, and its name, and all the other stuff.
custom view #2
EvolutionPokeminView.
this is a custom constraint layout that contains a PokemonView, and The Arrow ImageView (and TextView below), and helper methods to place the arrow in different directions.
for example:
setArrowDirection(int direction) \direction is some kind of enum for all directions (top, topLeft, topRight.. etc
another helper method is setArrorPosition,
setArrowPosition(int direction)
then you use the arrow direction method to set the correct arrow image into the arrowImageView, and you use the arrow position method to use ConstraintSet to programmatically set the correct position of the arrow in relation to the pokemon image.
after that, you prepare a few common layouts to use with different sets of data and populate them accordingly.
Things you'd need to know to make this approach work.
How to Make a Custom View in Android.
How to use ConstraintLayout effectively.
How to use ConstraintSet to programmatically edit ConstraintLayout constraints.
I want to create a dynamic interactive tree structure like shown in image?
All i found is it can be done using fragments can someone show me how to implement just top two nodes with their links using fragments?
Have a horizontal linearlayout for each row and put each row in a vertical linearlayout. Create one view as a base for each image and text that is included and just use ´include´ to use that base view for each image\text. If you use an id for each included view you can grab each id and configure them separately in Java if needed.
I would work with a piece of layout that isn't shown, the user must scroll to see what I have did. How can I do it? Can I join 2 different layout in one? I prefer to collocate item as I do with default layout. If it can help, I use Android studio. I prefer use elements without code, adding them from palette. An example :
You can use two different layout in main relative layout & whenever u want child layout just set visibility.
You will want to use a ScrollView for this. From the documentation:
Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display.
In android there are different type of Layouts LinearLayout will place the items Linearly(Horizontal/Vertical). Where RelativeLayout can do better and can place items relative to each other items.
By Overiding the RelaiveLayout I want to create a Layout which draw elements in circular manner (as shown in picture). I am able to do this using code snippet here http://developer.samsung.com/android/samples-4
But it is creating the whole layout from java code only, so if i need to make some complex layouts which have this circle as an element in the Layout, It will make me crazy becuase I have to write a lot of code.
I want to do it in a simpler way, so that I can use the same concept in XMLs layouts.
Can anyone who experts in Making custom layouts suggest me how can I achieve the same. I want something like, I have a layout file
And from java code i will get that CircleLayout using id and Set into an Object of CircleLayout class. Now there should be some functions written in CircleLayout class using them I can do the modification in Layout like
CircleLayout circle= (CircleLayout)findviewById(R.id.circle);
circle.setRadiusOfLargestRing(20);
circle.setNumberOfRings(6);
//Define any type of view form java
View v1 =new View(Context);
circle.setCenteralView(v1);
View v2 =new View(Context);
circle.addElementOnrings(ringNumber, v2)
..so on
I want maximum three rings, I have no problem if the rings formed from drawable resounce(like three rings already placed in drawable folder).
and then we can set listeners to each view inserted in to the ring.
My layout should be smart enough to place the views in the in ring in a way shown in picture .
I will be glad If someone can help me to develop a library so others also can take benefits of the same.
I am ready to write whole code if someone can guide me.
I am trying to design a UI as like in an iPhone app. The image of the design is as follows
In the above image all the white boxes are of a list view. In those list view i am placing an image View and two set of text view. I have placed a overall custom list view and in that custom list view using relative layout i have place the image view and two text view.
now i want to draw a line between the two text view and when i click on the second text view i am moving to a new activity. At that time i want to show that only the second text view is been clicked.
Use a RelativeLayout:
The image android:layout_alignParenLeftt="true"
the first two textViews android:layout_toRightOf="#id/myimage",
the other textviews below the previous ones (e.g. android:layout_below="#id/author" and with a layout_width="fill_parent"
Check Romain Guy's blog post for a tutorial on a similar (simpler) setup: http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html
Check this http://www.androidsnippets.com/clickable-listview-items
The ClickableListAdapter bases on the
API-Demo-Example "Efficient List
Adapter". It was refactored to provide
a better reusability. Additionally,
you can connect OnClickListener and/or
OnLongClickListener to each View of
your list item. This allows you to
create complex interactive lists, or
simply using a customized checkbox
version.
I had implemented this in a project minus the image view. Heres a screenshot.