Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I avoid typing "android" for every attribute?

I am new to Android development and am also a designer doubling as a front-end guy.

How can I avoid having to type android: every time I add an attribute?

In other text editors (TextMate), I can trigger snippets by typing a known trigger and tab to auto-complete the word. Is there something similar for Eclipse?

like image 926
nipponese Avatar asked Mar 07 '13 20:03

nipponese


People also ask

How do I keep my mobile keyboard from covering HTML input?

Adding a padding to the bottom of the page that is large enough for the keyboard enables content to be displayed as desired when the keyboard is visible. Using some javascript listeners and a CSS class, this padding can be added only when the keyboard is displayed.

How do you disable the input field on a mobile keyboard?

By adding the attribute readonly (or readonly="readonly" ) to the input field you should prevent anyone typing anything in it, but still be able to launch a click event on it. Hm!

Why choose input method keeps popping up?

Hi, try going to settings,-general management-language & input- on screen keyboard. then set the default keyboard you want to use. hope this helps.


2 Answers

Just begin typing the second part of the keyword (what follows after android: and by pressing Ctrl + Space, Eclipse will insert the desired keyword for you prefixed with android:.

like image 55
niculare Avatar answered Oct 02 '22 16:10

niculare


You can bring up the auto-complete dialog by pressing Ctrl+Space at the start of a new line.

Furthermore, I wanted to add a note about why you need to type android: at all (and how you can change it to whatever you want).

If you look at the first element in your layout file, there will be a line like this:

xmlns:android="http://schemas.android.com/apk/res/android"

If you change the word android here, then that will be the prefix you need to type - so if you instead set

xmlns:a="http://schemas.android.com/apk/res/android"

then all you attributes need only be preceeded by a:, such as in this example:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
    a:layout_width="fill_parent"
    a:layout_height="fill_parent"
    a:orientation="vertical" >

    <TextView
        a:layout_width="fill_parent"
        a:layout_height="wrap_content"
        a:text="@string/hello" />

</LinearLayout>
like image 36
Phil Avatar answered Oct 02 '22 15:10

Phil