Questions tagged [android-include]
33 questions
0
votes
1 answer
ViewBinding not working for layout included inside RecyclerView item
This is my RecyclerView Item Layout
![](../../users/profiles/10770729.webp)
Vishak A Kamath
- 57
- 9
0
votes
2 answers
layout does not have the right size
I'm creating a layout_banner.xml that is referenced by multiple other layouts, and has a height of 80dp.
layout_banner.xml:
![](../../users/profiles/2967079.webp)
PM4
- 426
- 3
- 13
0
votes
0 answers
ViewBinding shared or common Activity
Trying to have a single BaseActivity whose layout is is generally made of three includes
Where body can be a number of different layouts.
Then have different Activities which basically extend…
![](../../users/profiles/3670177.webp)
TheBearF8
- 303
- 1
- 3
- 11
0
votes
2 answers
Android -tag adds extra margin to CardView
I'm in the middle of doing a design-focused school project in Android studio (Java code is not the priority) where I wanted to design a workout app of sorts.
However I'm currently having issues with my XML-layouts not displaying as the same way in…
![](../../users/profiles/13877395.webp)
William Larsson
- 25
- 4
0
votes
1 answer
Can't add Buttons with their own layouts to another layout
I need to accomplish the following tasks:
1) each of four buttons is held inside its own Relative or Frame
layout
2) these four layouts with buttons inside them are added to
another bigger layout thru include
tag
3) this bigger layout is…
![](../../users/profiles/12689757.webp)
goran rakitovic
- 9
- 1
0
votes
1 answer
programmatically check if view includes specific layout?
I have a layout section.xml and some other layouts that may include section.xml.
Now suppose I have an inflated layout, for example layout.xml, and I want to know does it include section.xml or not?
I can loop through all children of layout.xml, but…
![](../../users/profiles/1043882.webp)
hasanghaforian
- 13,142
- 8
- 71
- 144
0
votes
1 answer
CoordinatorLayout scrolling does not work while Toolbar is added via
So i have been learning a tutorial to hide tool bar in CoordinatorLayout while i scroll up my view pagers first fragment but toolbar is not moving up or hiding while i scroll up.
The toolbar is added in Coordinator layout using < include layout / >…
![](../../users/profiles/5852521.webp)
Mr.PooP
- 15
- 4
0
votes
1 answer
Android: Data Binding: providing values in included layouts
I have the following layout - text_input_layout.xml:
…
![](../../users/profiles/966739.webp)
Sunny
- 6,720
- 19
- 56
- 92
0
votes
0 answers
How can I dynamically change the background of the toolbar?
I have a toolbar and I want to change the background image when switching between this toolbar in activity. In addition, the toolbar is fixed and contained in an < include >.
layout_toolbar.xml
![](../../users/profiles/9127044.webp)
fatih
- 47
- 9
0
votes
1 answer
Android: Pass different content from viewmodel to different include-tags
In my task app I want to use databinding for the task overview. I've grouped tasks in three categories: overdue, today and future.
My task_overview.xml defines the following viewmodel (which contains three arraylists with the different tasks)…
![](../../users/profiles/1526028.webp)
jennymo
- 1,240
- 1
- 16
- 42
0
votes
0 answers
Android passing a enum variable from one xml to an included xml file that consequently sends it to code
I'm trying to reuse a xml file wich I include in my main_layout.xml. In the code of my activity, I check for a variable "positionType" and depending on that variable I run different codes.
PositionType.java
public enum PositionType {
play_top,…
![](../../users/profiles/255160.webp)
while true
- 1,959
- 1
- 24
- 33
0
votes
0 answers
child view in percent relative layout visibility change
my aim is to change the visibility of the included layouts in each tablerow
based on a single if condition.
i changed the code onResume() method. but the second tablerow is not visible to me. even i printed the logs. i got View.Visible only.
![](../../users/profiles/5856751.webp)
Sriram Balaji
- 3
- 2
0
votes
0 answers
android - using different ids for 'include' tag and the included toolbar does not work
I am just trying to use the android.support.v7.widget.Toolbar in a very simple app. The Activity file contains:
package com.example.istiaqueahmed.toolbarapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import…
![](../../users/profiles/998537.webp)
Istiaque Ahmed
- 4,977
- 17
- 59
- 117
0
votes
1 answer
Access all children elements of included layouts from main layout
I have a activity_main layout which looks like the following layout:
![](../../users/profiles/2051133.webp)
Heisenberg
- 1,412
- 3
- 15
- 33
0
votes
2 answers
What is Phone Window Decor View?
I tried getting the root view of a layout I'm including (include tag). Instead of the initial Relative Layout that I used, it returned Phone Window Decor View. What is it? How come it's not under the relative layout?
Structure below:
![](../../users/profiles/2601957.webp)
Kim Montano
- 1,915
- 3
- 19
- 37