Questions tagged [android-include]

33 questions
14
votes
2 answers

Android: with RippleEffect & StateListAnimator

I have a layout, that includes another layout:
TejjD
  • 2,408
  • 1
  • 14
  • 37
12
votes
3 answers

Databinding variable inheritance with included layout

I am learning data binding and mvvm. I have an issue where I would like a BaseViewModel.kt to include some UI related variables such as an isLoading flag and loadingText. When a network request is made, I set isLoading to true and some child of my…
Daniel Wilson
  • 16,545
  • 10
  • 76
  • 108
4
votes
0 answers

Databinding layout inside include tag

I'm trying to use data binding for dynamic layout binding. For example: Assuming that item object defines…
tomrozb
  • 23,522
  • 30
  • 89
  • 110
3
votes
2 answers

Edit a View (TextView / ImageView) inside a layout used in tag using custom attribute

I'm new to Android Development. Is it possible to change a View inside an included layout using custom attribute? I mean like this: This is my_layout xml:
Hanif
  • 95
  • 1
  • 6
3
votes
5 answers

How to change the margin of an "included" layout programatically

I have a LinearLayout inside which I am including a different layout. Something like this
3
votes
1 answer

Using in android.support.v7.widget.GridLayout not displaying correctly

I'm trying to use to include ImageButtons inside a android.support.v7.widget.GridLayout. The problem is, if I don't specify all the attributes explicitly on my elements, they don't display properly. In other words, the include is…
2
votes
0 answers

Include same layout multiple times (containing recycler views)

I decided to make an e-commerce store app and I want to include two or more same layouts which contains a recycler view which takes it's data from java code (for now). I tried to add different ids for both of them but I don't see the…
Lavish
  • 21
  • 3
2
votes
1 answer

How to add onTextChanged listener to an include layout xml by databinding in android

I have an issue to add onTextChanged to a TextInputEditText in an include layout. There is a base_edittext_view.xml as below:
2
votes
1 answer

What is the difference between fragment, extending a base class, and includes?

I am new to android and I am trying to understand how to make re-usable UI pieces that I can interact with. I know there are a few techniques out there but I don't understand when one would be better than the other or if they can all be used…
CookieMonster
  • 482
  • 6
  • 17
1
vote
1 answer

Databind Includes Layout

Trying to dynamically set the layout using databinding but I can't seem to get the ternary operator to work right. Must be missing escape character or something.
JPM
  • 8,360
  • 13
  • 73
  • 124
1
vote
2 answers

Id on tag destroys layout

I have a layout in a separate xml file which gets included in other files. I want to reference the included file so I set an id. But with the id the layout gets completely unstructured. Mini example: Parent-Layout:
L3n95
  • 1,240
  • 2
  • 18
  • 40
1
vote
0 answers

ConstraintLayout too long xml

I have a constraintlayout with too many views (atleast 50+) in it. Now it is getting difficult to manage the xml code as it exceeds 1000 lines. I am trying to use tags to divide the code in multiple layouts as mentioned in this post but in tag it…
1
vote
1 answer

Toolbar gives fatal error on menu inflate in Intent/AppCompatActivity

In my app I have a toolbar which is working perfectly fine in my MainActivity.
1
vote
1 answer

Changing the TextView in included layout

I am trying to change the text in TextView during the program execution to the data sent from a different activity. The TextView id="@+id/userName" is in my nav_header_main layout file
xerex09
  • 166
  • 13
1
2 3