Hiding individual views inside a group in constraint layout - android

Is it possible to hide individual views inside a group of a constraint layout.
I tried and failed & ultimately moved that view outside the group.
I did not find any document mentioning this behaviour.
Any one who can confirm?

whats you used for hide a view means INVSIBLE that take space of component and visiblity GONE not take any space of component .. so other component will effect.
can you show me your current code that i can understand properly.
thanks

Related

Make constraint layout untouchable

I have two layouts, manageLayout and mainLayout. They have constraints to the parent on all sides. I need in a one time have manageLayout on the top of mainLayout, and on the other time mainLayout on the top of manageLayout. Of course, there is sense in using visibility=gone on one of them, but i need one layout on the background of another. Problem: layout on the background handle events from top layout. How to make lower layout(and his elements) untouchable when another layout is risen?
Layout tree image:
LayoutTreeImg
Code sample, where i want to disable communications with lower layout: https://pastebin.com/PeL7u3YD (not only isSaveEnabled=false had no effect, also isEnabled=false had no effects too)
If you just need an explanation.
Once you've initialized both your views for mainLayout and manageLayout, you will need to set an empty onClickListener on both of them. Basically, layouts should get the click but do nothing. This way you can block the layout and widgets underneath the view on Front from getting clicked.
Now for for switching view to front maintain a boolean to know which view is on the front and on your button click set the other view bringToFront() (Or try some other ways mentioned here if you want) and don't forget to switch the boolean value.
Let me know if this works for you or you have any issues regarding this.
According to my perception, you can make lower layout setEnable(false). I hope it will work.

Creating custom "instruction tips"

I would like to create a view which i could place beside a specific function on the screen as instruction. This "instructiontip" thing will show automatically according to some rules.
The advice I'm seeking is about the way to put such a view anywhere on the screen above all else and not affected by parent type, fx. if added dynamically to a view which root layout is LinearLayout (vertical), I of course don't want it to be places under the last element. I'll place it using coordinates on screen and would expect it to show exactly there.
Here is a design shot for impression:
I keep thinking that there must be a better way of doing that then just adding it and hoping it will show in place.
Activity.AddContentView is a good way of adding such a view above everything else without affecting whatever is beneath.
The only downside is that you can't remove this view after you added it.. but you can hide it if you need to.

Android draw outside the view

I would work with a piece of layout that isn't shown, the user must scroll to see what I have did. How can I do it? Can I join 2 different layout in one? I prefer to collocate item as I do with default layout. If it can help, I use Android studio. I prefer use elements without code, adding them from palette. An example :
You can use two different layout in main relative layout & whenever u want child layout just set visibility.
You will want to use a ScrollView for this. From the documentation:
Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display.

Removing Dividers and Adding Space between Expandable List Groups Android

I'm working on my theme in android and am having a heck of a time getting my Expandable List Views to look right. Here is my desired effect.
Collapsed
Expanded
So I primarily want the space between each List Group. And since android also adds those dividers I want to get rid of all of them.
Here is what I'm getting without trying any trickery.
Collapsed
Expanded
I assumed the best way to get my desired look would be to put a margin on the list group layout xml file but I get end up getting this. It does not put a spacer on my group indicator and also puts the space between the group and the child which I don't want.
Collapsed
Expanded
Any help or a push in the right direction would be greatly appreciated. Thank You!
You can use these properties of listview dont know if it will solve your problem though:
android:divider="#FFF" // same as your background
android:dividerHeight="0dp"//for not showing one
android:divider="#android:color/transparent" //setting divider to transparent
android:dividerHeight="-1dp"//setting negative height also works but only on relative and linear layout according to google engineers but I have tested it to work in many scenarios use this with care

Nested text view in android,with dynamic content

I want to display a recursive or nested text view at depth of 3 in Android.The text to be displayed is, dynamic coming from web service.
for example:
If I Click on Help(Level 1)
it'll show topics under Help
If I Click on Help_Topic_1(Level 2)
it'll show questions under Help_Topic_1
If I click on this question, say HT_Question_1(Level 3)
it'll show Answer of that question(Level 3)
how to accomplish with this? please guide me.
You should use ExpandableListView. Reference http://developer.android.com/reference/android/widget/ExpandableListView.html
You can call expandGroup and collapseGroup methods for expanding and collapsing on clicks.
the simplest way to do this is to have a nested layout structure. Your root view will contain the button to show level 1 and a child layout and initially be visible. The children's layout visibility will initially be set to "GONE". In the onclick listener for each button you change the visibility of the layout below it to view to "VISIBLE".
This of course is a very simple way of doing it. If you require to have open and close animations you'll need to use a more complex method.

Categories

Resources