Android how can I achieve a arrow based layout? - android

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.

Related

how to design dynamic ui in android like the image below

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

Android draw outside the view

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.

Place view elements in circular manner using custom relative layout in Android

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.

how to put a vertical dotted bar in a layout

I'm designing a layout for some listview items and I would like to draw a vertical dotted line to separate the content from some button on the right of the row, like in the example I attached. What is the best way to do it? And moreover: is there a way to obtain it by setting up some widget's property (something like setting up a css property for a border)?
Thanks
What is the best way to do it?
Put the widgets, including a new View for your divider, into a horizontal LinearLayout. Use a ShapeDrawable as the background for the View, where the ShapeDrawable defines your desired dash pattern.
Note that most UIs that have this sort of divider use a solid line.
is there a way to obtain it by setting up some widget's property
You can try to use android:drawableLeft and similar properties instead of the LinearLayout, if one of the widgets in this row is a TextView or inherits from it.

How to create this Android View/Layout

I'm working on my first Android application and I have a pretty good idea of what I want my application to look like, I'm just not sure how to create the view.
I have a Listview with several items, I then want users to click on an item then get a detail page. I want my detail page to look like this.
I know how to get the background. What I'm trying to figure out is what's the best way to create that rounded, see-through table with a border. Any ideas?
The easiest way would be to create a linear layout with vertical orientation and define a drawable shape resource and set the corners to have a radius to match what you like. Then add your 2 text views and an image view and lines for the separators.

Categories

Resources