Questions tagged [android-tools-namespace]

The `tools` namespace allows for showing custom `View` properties inside Android Studio view designer.

More info:

http://tools.android.com/tech-docs/tools-attributes

http://tools.android.com/tips/layout-designtime-attributes

25 questions
1026
votes
12 answers

What's "tools:context" in Android layout files?

Starting with a recent new version of ADT, I've noticed this new attribute on the layout XML files, for example:
android developer
  • 114,585
  • 152
  • 739
  • 1,270
344
votes
5 answers

Is there a way to show a preview of a RecyclerView's contents in the Android Studio editor?

When I add the RecyclerView to the layout, it shows up as a blank screen. Is there a way, such as through the tools namespace, to show a preview of the content of the RecyclerView?
181
votes
3 answers

Preview layout with merge root tag in Intellij IDEA/Android Studio

Let's imagine we are developing compound component based on LinearLayout. So, we create class like this: public class SomeView extends LinearLayout { public SomeView(Context context, AttributeSet attrs) { super(context, attrs); …
177
votes
2 answers

What is the 'app' Android XML namespace?

Here is an example of the app namespace that I've seen from a res/menu/main.xml file
53
votes
2 answers
49
votes
1 answer

What is tools:mockup, tools:mockup_crop and tools:mockup_opacity

I just updated Android Studio to the version 2.3 (canary version) and to the last build tools 'com.android.tools.build:gradle:2.3.0-alpha1' and when I open a layout and write tools: and press ctrl + space to autocomplete it I found new tools…
Aracem
  • 7,227
  • 4
  • 35
  • 72
46
votes
1 answer

Tools namespace attribute for showing layout in ViewPager in design time

The tools namespace allows for showing view properties in layout designer. For example using tools:listItem="@layout/{custom_layout} it is possible to show list with custom row layout in Android Studio designer. Question is: Is it possible to show…
35
votes
4 answers

What is the meaning of xmlns:tools in Android XML layout?

For example, in: ... Do I need to put…
Stokres
  • 685
  • 2
  • 7
  • 12
18
votes
2 answers

What's the purpose of tools:openDrawer="start" when creating a DrawerLayout (with NavigationView) from the wizard?

Creating an activity with navigation drawer in Android Studio causes this to be shown in the XML code:
15
votes
3 answers

Android XML Is there a way to use the tool namespace with custom attributes?

I've created a custom view with attributes. Is there a way to use those attributes with android tools in Android studio? for example :
14
votes
2 answers

Android: How to use tools with include layout

How do I use tools: xmlns:tools="http://schemas.android.com/tools" With ? I have a layout A that I use tools to populate all the text fields with test data. And I have layout B that use include to copy layout A in to it. How ever when I do…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
10
votes
1 answer

How to use androidx.recyclerview.widget.RecyclerView with tools:listitem?

How to use androidx.recyclerview.widget.RecyclerView with tools:listitem? I have this layout:
7
votes
1 answer

tools:text for RecyclerView items

I know that when you set tools:text="Sample text" within a TextView, you'll see the sample text in Preview mode in Android Studio, but not within the actual app. I'd like to do this for items in a RecyclerView, but I can't seem to be able to.…
6
votes
3 answers

How to change the view of Design Tab of menu layout file for Bottom Navigation Activity (tools:showIn)

I only want to see my design as bottom navigation view so I had tried the following on menu.xml file by setting tools:showIn="bottom_navigation_view" but it is not making any effect to my design view tab Image of menu view which I don't want
5
votes
0 answers

tools:context link to multiple Activities

I have read about tools:context and found it pretty useful while development, as it helps me to know which activities I have used current Xml. My Problem is: I have 2 Activities, using same Xml file(Reusing same layout.xml file), but I am unable to…
Firoz Memon
  • 4,282
  • 3
  • 22
  • 32
1
2