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.
Related
I am new in programming , I started learning java and worked with eclipse some time and know the very basics .
Recently I started working with android studio and I have not used any other version except the 2.2.2 for very short period , and now the newest 2.2.3 .
I am watching old tutorials and they work in activity_main , so my questions are :
1.In the newest version , should I work in the activity_main or in the content_main ?
In the activity_main the drag n drop function is not working , I can't move anything from palette to the screen to where i want (it goes directly in top left on the screen ). But in the content_main i can move once , and the second time the object puts itself in top left of the screen . How can i solve this and what is the problem ?
Also I want to ask , if you can give me some new great pdf or tutorials to learn . Thanks .
You should add code in the content_main XML file of your project. Content_main is actually the file containing the most of the UI of your MainActivity,except your navigation/toolbar. If at the beginning you are uncomfortable then instead of creating project with Blank activity, use Empty Activity shown in Figure
This will give you just only one activity_main XML file to work with. With time you will eventually understand the usage of Blank Activity as well.
I would suggest to get familiar with the different Android layouts (CoordinatorLayout as in the activity_main, LinearLayout and so on). They define how you can arrange items within the layout, so whether there are some constraints on placing items depends on the layout.
There is no overall solution, whether someone should use content_main and thus, nest layouts or just put everything into one file like e.g. activity_main.
I personally use the nesting if I use a more complex layouts like an Activity with a navigation drawer. But for an app with one activity without additional navigation I would put everything into activity_main.
For learning how to use the layouts one file might be easier instead of nesting.
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!
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
Okay, So I just started Android development (I am average at VB.Net, so I understand basic code even if its not in VB). I've made a couple play around apps which used Text-To-Speech, Async Tasks and Reading/Writing files. However, I now wish to make a tabbed Android app.
I started the project in Eclipse Juno and filled in all the details. I then selected (For navigation) the Tabs/Swipe layout. I now have the default code for that layout type (Link to Tabs on developer.android.com - http://developer.android.com/design/building-blocks/tabs.html).
I understand mostly what the default code is doing. The only problem I am having, is determining the individual layout of my Tabs. I wish to have 2 Tabs, 1 in which the user selects an option, and the other, in which an image is shown depending on the selection in Tab 1.
So the question is: How do I create a .xml file in Layout to determine what is shown on the Fragment?
If you want to do this in XML the answer is simple, it can't be done just with XML, you must create a class that's implementing a ActionBar.TabListener.
Than you can override the onTabSelected method in which you can exchange the content.
A proper solution would be:
Use a LinearLayout as root container, and implement two Fragments for each of your Tabs (there you can design an individual XML-layout). Now you can add one fragment initially to the root-container and implement the exchange of the layouts inside the onTabSelected method and you are done.
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.