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

24 questions
980
votes
9 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
  • 106,412
  • 122
  • 641
  • 1,128
316
votes
4 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?
171
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
168
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); …
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
  • 6,928
  • 3
  • 35
  • 71
48
votes
2 answers
38
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…
30
votes
3 answers

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

For example, in: ... Do I need to put…
Stokres
  • 615
  • 2
  • 7
  • 12
17
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:
14
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 :
13
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
  • 27,805
  • 19
  • 119
  • 190
8
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:
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
6
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.…
5
votes
2 answers

Tools namespace android listitem

I'm trying to use the "tools" namespace feature in Android Studio. I'm trying to populate the ListView with dummy list items, for design purposes. The link here says the tools:listitem="@android:layout/" should do. But for some reason,…
Rijul
  • 466
  • 6
  • 18
1
2