Proper way of showing tip on a ListView element - android

I have a Fragment which contains a ListView. The elements of ListView are RecyclerViews which scroll horizontally. Each element of the RecyclerView is a CardView which contains some elements such as ImageViews and TextViews. I have to display a tip on a TextView inside that CardView.
This tip has to be displayed on the TextView in the first CardView of the first RecyclerView of the ListView. I am using ShowTipsView library to show the tips. What is the correct way of showing this tip?
Should I put some code inside the adapters of the ListView or RecyclerView or could it be done from the Fragment's code itself?
The real problem that I face is, how do I get access to the specific view(TextView) inside my Fragment's code?

I found this from your given link:
ShowTipsView showtips = new ShowTipsBuilder(this)
.setTarget(btn_test)
.setTitle("A magnific button")
.setDescription("This button do nothing so good")
.setDelay(1000)
.build();
showtips.show(this);
I see that setTarget(xxx) accepts a View. So you can do this in your fragment because it has your views.

Related

Show recycler view on a page by page basis

Im trying to achieve this recyclerview layout with arrow button that will trigger scrolling item
then, I have 2 choice to manipulate the view
Split the list inside adapter
Split the list inside viewmodel and bind it into adapter separately.
What should I choose between 2 of them. Or if you guys have any better idea please comments :)

Alternate for a listview with single row

I have a ImageView with a TextView and Button. I have it currently in a custom list view, but I noticed now that I don't need to show more as one element (object). So I actually don't need a Listview to show the row (list entry). How can I show the list entry without a Listview?
You can put the elements of your custom listview item into a Layout, e.g. LinearLayout and simply add it to your activity's layout where you needed it.
You can set an OnClickListener for that layout, so user can click the whole thing.
I think you should use ListActivity. Then you can set up empty view for list. Here some tutorial: ListActivity and ListView Tips.
Also you can implement that logic with Recycler view by yourself or use library.
Here is solution from stackoverflow

Listview inside gridview android

I want show listview as a grid items how can I?I have tried it but when I call setadapter method for populating data into listview inside gridview's getview method data is not being populated.
i dont understand why you are adding a listview to gridview....this can make your application slow...just take a linear layout with a vertical orientation as item of a gridview..and add required elements dynamically to this linear layout according to the need...it will look same as listview in gridview...but will work with a much better speed...
Let me know if you want more description or a sample code....

how to add editText in a custom list adapter

I want to add a row of 3 editTexts whenever the user removes focus from the last editText of the above row. I have tried various methods like inflating an individual linearLayout every time the user removes focus from the last editText. The problem in this method is I get a large number of linearLayouts to deal with which is not so efficient. Somebody suggested me to us custom list view but I don't know anything about it. Please help
Thanx in advance
You should create a custom list view. Look here.
In listview_item_row.xml, instead of using ImageView and TextView, you have to create a LinearLayout with 3 EditText. And finally, you have to create your own adapter like WeatherAdapter.java and inflate your 3 EditText.

Android listview with horizontal lines when empty

I have a Listview in my Android app, and I want there to be some horizontal lines when the list is empty to indicate to the user that this is a List. I know that there is the setEmptyView method on ListView, but I'm not sure what to put in that view if I want there to be list rows with horizontal lines. How would I accomplish this?
Having a bunch of horizontal lines for an empty list is an iOS convention. If you want your app to fit in with Android better you should set something else. Perhaps notify the user there was an error or that there are no items in the list. You can add this right to your layout.xml file if you're using a ListActivity. All you need to do is create a view and give it the id #android:id/empty.
put the listView in a FrameLayout and add another view in that Frame.
if you having any item in the list hide its (visiblity="gone") and show the other view.
OR
change your adapter to return multi ViewType
in your adapter if you have no item return other type of view

Categories

Resources