first of all I want to thank, because in this community I have found a lot of solutions to my development question. But this time I have a big one. I was looking for an answer to it in google and pdf´s and so on. But it's a complicated question and don't know how exactly ask for it in google. I new in app development. so here I go. I'm trying to do an app that shows the different recipes with photos and description like time that it takes and the difficulty and so.
explanation of the question
Apologize because the childish imagen to explain to you but you know (efficiency).
My two questions are:
1) How may I do to attach a description to an image. I mean, I want that the people can add their own recipes and of course I will make a formulary to this, but how may I do to when the people create the recipe that I suppose that it should be an object of a class, the TextView be attached to the bottom of the image automatically. in resume, that the image and the description with their elements be one unique element. I have tried to encapsulate the image and the text view in one layout, but in this case I don't know how to create a new layout once the app is running. ok the user fill the formulary but how to create a new layout on the run. I don't know how to solve this.
2) How may I do to change in the description of the image the quantity of red tomatoes. I mean. if the recipe have 3 in difficulty, 3 of 5, this is settled by the user, but how I do to show 3 red tomatoes of 5 and the other showed in gray?
I know you may say "another Newby" but I have realized that I love programming and in El Salvador (Central America) there´s almost any information about this subject. Again, thanks a lot.
one way to achieve that is by using Recycler view. and every time a user adds an item. you can add it to the list and the system will draw a new item for you.
check this tutorial
let me know if this helps or you need more explanation
Related
I added an image below to show what i am trying to achieve. I've seen similar implementations of this else where but isn't sure what it's called.
What it will do is when a box/panel/card on the left is clicked, a detailed panel on the right will be displayed, showing very detailed information. If a user simply wants to see a little more, an arrow or a "show more" hyper link will expand the panel/card to display more information.
I'm wondering if some sort of java plugin is already in existence which i can modify and utilize to fit my needs, instead of coding the entire thing from scratch.
If anyone has any idea of this, i would love to hear more! Thanks in advance!
Long post ahead...
Ok, I'm not sure how to explain it so I made a couple of screenshots. Also, I want to start off by saying I'm not looking for somebody to write code for me to copy, or links to specific articles. I just need help figuring out if what I want to make is possible and any direction on what to look at. I just haven't done something like that and so far I can't seem to word my searches well enough it seems to be able to find a solution.
TL;DR: I need to get scrn2 to either swipe left and right to prev/next card from the RecyclerView, or add buttons that do that
So. Here's the screenshot. I have already made scrn1 and scrn2, and am looking for a way to get to my mockup (that heart button there is just wishful thinking and I'm not at all concentrating on it, and the buttons on top of the cards are just a left-over from an old test I forgot to remove).
The idea behind this is just sort of a catalogue/text book to help with self-preparation for an exam on a specific topic.
What I have is a RecyclerView that I've populated with CardViews in an ArrayList. Since I'll be having a few cathegories of cards, and each will have around 40-50 in there, this seems like an efficient and quick way to load a long list like that, and it runs smoothly so far so I'm happy with it.
In order to get a "full details" screen (scrn 2) I implemented Parcelable to my single item template/class, and now when I click on a card I get that second activity that shows the full sized image, title and full description text.
I also added a search that filters the cards in real time, since there will be many of them and I want it to be easy to get to a specific item.
So far so good. Everything works, surprisingly.
Where I'm stuck now is that it will be extremely annoying for somebody to keep going in and out of the single items in order to get to the next one, so I need to be able to either make them scroll or have buttons at the bottom that go to previous and next. The thing is, the only time I've used swiping is in a tabbed activity and that requires fragments. When making those I had to have an xml for each tab, and a class to correspond to it, which is definitely not comfortable when I have 40 in 10 categories.
I assume I need something like an onClick event to add for buttons in the activity that holds the information that gets acquired from the RecyclerView to bring a specific position from my ArrayList... Like, if somebody clicks on the third card, the button brings -1 or +1. Or something like that?
Makes some sense in my head, but I can't find a way to search for that, and can't figure out if it's even possible to make. Soo any pointers would be hella useful. I'm really excited about being able to do that much from scratch, but still lack too much knowledge to be able to imagine what would work here. I'm still testing things out and am looking around for information, but will be happy if somebody has input on the situation.
I know it's not a legitimate question but I'm searching an example to this menu for Android\Java about 2.5 hours and I'm lost. Please just give me a link or write me its name so I can google it, find examples and implement it by myself.
I just saw that many people use sliding menu or dropdown menu but it's different than what I want I guess.
(source: smashingmagazine.com)
Each of those is a spinner, so I thought it might be called an expandable spinner, and got some hits for what you're trying to do : expandable-spinner : How to implement expandable spinner entry in Android
Another term for it might be "multi-level spinner" for which there are more hits similar to what you want. Best practices for implementing a multi-level Option Menu on Android?
I'm not sure this is the best approach for a menu, though. Would you consider something like this instead: https://github.com/pratikbutani/MultiSelectSpinner
I wanna start out by saying that im just starting to learn android development(and programming) just so you guys know that im not an expert or anything.
So im creating an app that has 5 fragments. the first one has a spinner, the next 3 have each of them 1 edittext, and the last one has a textview. My problem is, i want to collect the user input from the edittext's and the spinner and use it on a formula that is going to give a result to be shown on the last fragment.
And what i need to know is how do i get the user input from the edittexts and the spinner so i can use them on the formula.
For you guys to have an idea of what im aiming for here is a video that i found: http://www.youtube.com/watch?v=gcap7DUgIHg
(I have done other apps that use a basic layout with the edittexts all on one activity, but i wanted to try with the type of layout you see on the video)
I want my app to work exactly like that one, but instead of using numberpickers i use edittexts and a spinner.
This is probably a lot for anyone to explain, but i have been on this forever and i need to deliver this school project tomorrow. Hopefully anyone can give me a help with this as fast as possible.
I appreciate any help given!
Thank you
Here is the code:
MainActivity- http://snipt.org/BGaf2
ResultFragment- http://snipt.org/BGag2
One of the Fragments(Basically all the same)- http://snipt.org/BGah5
PS: SORRY FOR ALL THE COMMENTED CODE AND THE LONG POST, I COULDNT PUT MORE THEN 2 LINKS BECAUSE OF MY REPUTATION
EDIT: Thanks for the reputation! I can now post more than 2 links
Im pretty new at programming android and this is my problem:
I have a layout page that i have alot of information on, including buttons and textedits. Now i want to split it up in different parts, without having to create different layouts for every headline. So for example, if i choose to see "Information 3" i want to hide everything else on the layout except the "information 3 text/buttons/textedits".
Is it possible to do this? Because i really dont have time for making a new layout for every headline, and i dont want to show every headline at the same time. (I want to keep all information/data in the same layout file)
Maybe there is a smarter way to do it? Thanks in advance!
/Erik
You can call view.setVisibility(View.GONE) if you want to remove it from the layout. you can search some more questions like these:
hide/show on click of Button
how-to-show-hide-grouped-views
Try these and if u need more help then let me know