For my app, I'm trying to have a section listing the tags in an article but I wasn't able to find an Android Layout that can achieve this.
Basically, I have an array of strings which contains anywhere from 1 to 5 elements. I want to be able to list them in an manner in which they're sort of staggered. Similar to what a Horizontal LinearLayout would do except it goes to the next line if the next view is too large. I'd have to do this programatically and without a ListView/GridView since it's inside a ScrollView.
Is there any way to achieve this?
Here is an edited image of what I mean...
http://i.stack.imgur.com/Hhpry.png
Related
This activity has a fixed Toolbar on the bottom and the mid section (rest of the screen) is split in 2 equal parts (LinearLayout with weight 50). This mid section is handled by a fragment. Each sub part has exactly the same views in it. Of course while running the content is different.
On double tap I want BOTH (1 and 2 marked on the picture) to display new content. I do not want to be able to go back on previous Views. I also do not want a list-effect to display new content, I'd like a stacked effect but without CardViews, because you can't remove the space around the cards totally. Also, the next 2 views should appear instantly (I have the data stored locally).
How can I achieve that? Obviously I'm quite new to Android. It seems to me none of the ListView/GridView/StaggeredView does that, although what I need is easier since I basically just want to replace my content using an adapter to avoid recoding.
i want to make a program. I have 16 textviews that includes letters. And i want to add small text to every textview -programmatically-. Please refer to the pictures..
firstly --> picture
after adding --> picture
You may do this:
Instead of getting textviews into the program, you can create a layout file which contains 2 text views. You may need to use "layers" to do this. One for big text, other one for the little text which contains the reduced size texts. Then inflate the layout file to a view by an inflater. Then use that view instead of textview. So you have little numbers on you table now.
I don't know about RecyclerView, may be that can be a better solution but as i said i dont know it so here is my answer, good luck at your project!
What is the difference between a listview layout xml and a Listview Java class? I am trying to make it when a user inputs text and presses enter it comes on a set position on the right but when the user receives a reply it would show up on the left side of the list view. Like text messaging on android phones. Does anyone know how i can do this? With a java class or an xml layout? I want animations and dynamic content on the listview as well. Any ideas?
ListActivity provides you all the built-in features of and methods of ListView but only ListView can be added into the whole Activity. By using ListView in xml, you add multiple Views such as Buttons, EditText on the same Activity.
Basically, the xml is for seperating the design (the visuals) from the code (functionality).
Although you can do some funcationality via xml, it's usually better to do it in Java code in your class.
I guess you can create a ListView that will iterate through 2 different list enteries:
The first will show the data (the text in your case) on left and the second entry will show on the right. For each list entery you will create a different xml layout with widgets aligned to the left and right as needed.
i'm making an app that requires indefinite textviews and images. i'm trying to implement a Pulse News app UI but having a hard time implementing one. so i thought of an idea to make a UI like that with the use of textviews, imageview and horizontal scroll view.
textview string values are from parsed xml online and images or the imageviews will be images from a specific directory in the sdcard that my app is using.
can anyone give me ideas how can i do it without using an xml layout or is there any or other options or ways for doing this? thanks...
You can create a viewgroup with one textview and an image. Then it can be added dynamically to your layout many times. This can be done by creating objects in a loop. You can change the content in each viewgroup at the time of inflation.
though i dont know what exactly how pulse new app looks like, but by going through your question (horizontal scroll view in particular) I guess you want to implement a "Gallery" type implementation where in you can swipe left/right on page basis.
If my assumption is correct then you will like to see to ViewPager of android backward compatiblity pkg.
hi i am a new app developer. i am trying out a new app working by flip.
I have an xml file of the following format
gcsgacghascgh
abdvdb
At first look it must shows the question and when flipped it must show the answer. this must be done for arount 40 questions.
pls help me by giving any example codes or idea....
You can use FrameLayout. In the framelayout you have to keep 2 layouts. In the first layout you have to keep the question and in the second layout you have to keep the view for showing the answer.
Here Android 3d Flip Animation is a nice example for the flip animation using FrameLayout. The example is shown with 2 images. You have to just use your layout instead of images.