Questions tagged [android-include]

33 questions
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:
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…
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…
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…
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…
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 / >…
0
votes
1 answer

Android: Data Binding: providing values in included layouts

I have the following layout - text_input_layout.xml:
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
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)…
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,…
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.
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…
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:
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:
Kim Montano
  • 1,915
  • 3
  • 19
  • 37