Adding button below text in ExpandableTexVew - android

I would like to know if there is a way to add a button, or any element below the text of an ExpantableTextView. I'm using this library and I want it to look like this:

I think you'd chosen wrong library. You choseExpandableTextView and now you're asking for help, because you cannot add a button to this View.
Try to search for ExpandableLayout library. Maybe this you would find useful - please check: https://github.com/traex/ExpandableLayout
For more similar libraries, check: http://android-arsenal.com/search?q=expandable
Hope it help

In one line Yes, it can be done in this way.
Two approach:
Modifying the existing library to fulfill your need. For this you should have knowledge of building custom view.
This is just a work around to get the desire result. Put a Button with visibility set to as invisible and place it just below your expandableTextView. Now on click of your expandableTextView just set the visibility of your Button to visible
I hope you would be able to achieve what you want.

Related

How to increase the size of the text in suggestions in MaterialSearchView?

I've implemented MaterialSearchView in a fragment and it works fine. Now I want to increase the size of the text in suggestions. How can I do that? Thanks!
I am not sure if the developers/contributors of this lib has provided an way to do this without the need to fork and edit the lib.
Anyway, for me the easiest way to do what I want is to edit the lib. for your case, if you want edit the text attributes of the textview of suggestions, you may fork the lib and edit the layout named suggest_item as it is the layout used by the adapter that shows the suggestions.
Links this and this
if this does not suit you, you can always add new issue and/or question to the developers/contributors of the lib on the their repo's issue tracker on github, follow this link
EDIT: for your question in comments on how to handle click on suggestions:
The developers/contributors of the lib has provided a public method that you can use to add a click listener, it is named setOnItemClickListener
See this for full method code

How to drag the layout only vertical in app?

Hi everyone. I want to make a view like above. On the same screen , I have got two different layout (or it can be fragments, doesn't matter for now.). User can swipe both layout on long touch and drag/drop like above. Do you know how can we do it or is there any library for this?
Thanks
Please check DragLinearLayout libray.
Hope for help. :)
You can use Drag sort library
but i think this assumes that you use a listview.

Custom ShowcaseView

I am familiar implementing ShowCaseView as helper/walkthrough, and it's working really great. Now I want to know If I can customized the showcaseview layout like adding a button on the left side of default 'OK' button. And also I want to add a 'skip all' button in case user don't want to view all showcaseviews.
Is that possible? If so, can anyone point me how? Thanks in advance. Have a nice day!
I extended ShowcaseView and added the ability to add multiple buttons and customize them as needed. The code is here: https://github.com/vabh/ShowcaseView
So, you can add the extra buttons and position them as you want.

How to make a spinner with icons in a form of table layout dynamically?

Anyone know how can i achieve a list like this in the picture? I want to add the images in the project, and create a layout that will pick them up and put them automatically in the layout. Not manually to import all images in the layout.
So like this if i add a new image in the app then it will be picked automatically.
I didnt try anything yet as am not sure how to do it.
All i found in the web is layouts with each row having 1 icon, but thats not what i want.
Any info or a link i can use anyone?
You just can't do that with a Spinner.
You need to use a GridView.
Normally we won't use TableLayout if there are so many images, which will cause Out of Memory Error if too many images loaded. Use GridView instead, very easy and meet your requirements. Look into ApiDemos for some sample codes.
I managed to solve this. Here is the link that helped me out: http://iserveandroid.blogspot.com/2010/12/custom-gridview-in-dialog.html

Android: Need help setting view alignment in code

I basically want to have several views aligned with each other using a relative layout. I can do so using xml, but unfortunately I can't find any documentation that tells me what methods I need to call to get the same effect in code (All the examples and things just use xml). Since the imageviews are being made dynamically xml isn't an option for what I want to do. I've looked at layoutparameters which seems to let me change some options, but I'm not seeing a method that will let me change alignment relative to another view. Any help is appreciated.
After playing around with it some more found that addRule is the method I need. Couldn't find it because I was looking for something with the term alignment in it.
Check out setLayoutParams in the Android documentation:
https://developer.android.com/reference/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams)

Categories

Resources