Parse different data through the activity in the same activity - java

I am building an E-Commerce App and I have an activity showing image slider, description and related items, and in image slider I have put an arrow to change the product on the arrow click I want to be in the same activity but data should be different.How should I do that need your help guys.

You should try doing it by urself in one of the many ways its possible to. Then we could provide some help with your idea or show you better solution. I think you are looking for RecyclerView (https://developer.android.com/guide/topics/ui/layout/recyclerview). It lets you show some similar views but with different data inside. Also as an item inside RecyclerView you can try CardView.
Using only RecyclerView you can also use:
https://stackoverflow.com/a/46084182/8713068
You can also search for a library that has everything you want inside already implemented. For example the first library that came out after i typed it in google : https://github.com/Ramotion/cardslider-android.

Related

How to put diffrent values depending on the item clicked in the recyclerview

when I click on each item of the recyclerview I want to go to another activity but the values in the activity will be different depending on the item clicked in the recyclerview.
For example : If I have a list of TV shows and when I click on each item it will go to the same activity and show me different episodes list.
Anyone can help how to achieve this?
Android Studio provides you with various project templates when creating a new project, If you have a look at the one described as Master/Detail Flow.
This will give you some working code that should cover your use case, which when comfortable that you understand it, you can then begin to implement into your own project.

how to reuse single activity infinite times?

My app has an album style feature that users can pick/take photos from device and load it in every page in this album.
Now the number of this album pages is up to user and should be unlimited. On the Other hand the codes that is being used in activities as you could imagine are exactly same. I have wrote code once and I just want to reuse this activity for each page of album. how should I achieve this?
Since there are thousands of apps that are provide this kind of functions I know there is a good way but i'm unable to find that. Just a trick or a link to a tutorial or even a small explanation is good enough.
Thanks in Advance.
You can create a next() method, and change every layout view in the page with this function, so that you are in same activity but only views are being changed.
One solution is to add the data to be displayed to the "extras" of the Intent which you use to start the activity.
Alternatively, you might want to look at using a Fragment instead of an Activity. You might also want to look at using ViewPager to be able to swipe through the fragments which display the album data.

checkable spinner for android app

I am working on a mapView app and I would like to have a button much like the layer button in google maps that allows someone to show or hide an option from a spinner. I have searched to try and find how to accomplish this but have been unsuccessful. Can someone point me in the right direction of what to search for or what to implement?
you can just make a custom view that has bunch of checkboxes and textviews (stacked horizontally as a bunch of relativelayouts stacked in a linearlayout). this is probably easy enough to do if you don't have a ton of items. (I'm assuming you don't because you referred to the maps options)

How can i change the List XML via a swipe gesture

at the moment i'm trying to write an app which has a listview, and if i swipe especially left the listitem switches to another xml like it's used in the twitter app.
Especially i have a list of items only with some text and when i swipe left on a single item it changes to an other item (via a xml-file) especially with some buttons or anything else.
I hope anyone, has an idea how i can do this?
Thanks.
I have seen this done using a Gallery set to fill_parent. Care has to be taken to allow child views to pass on touch events appropriately for swiping to work. Note that Gallery is a subclass of ViewGroup.
EDIT: see comment below, i should've checked the twitter app first!

Trigger Textview when clicked on ListView

I'm a noob Android developer. I learned of the basic UI controls and different types of views that I can utilize.
Now my problem is, I need to show list of items using the ListView that is being shown full screen. when I click on an item it should load a TextView full screen. when I click the back button it should go back to ListView again..
Can someone point me where I can learn such stuff?? any support or even external link is greatly appreciated.
Thanks in advance.
Write your text view in a different activity. And when ever you click on a list item start that activity putting your text in the intent. Fetch the text in that text view activity in onCreate() from the intent and set it to text view. Obviously when ever you click back you 'll come back to list view activity.
Check out this website... http://www.xtensivearts.com/topics/tutorials/
He's no longer updating but what you've asked is covered in the video tutorials he did create. It's not answered directly but by watching them, you should have a solid enough understanding to piece it together yourself.
Best of luck!

Categories

Resources