• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.eclipse.org/org/documents/epl-v10.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.adt.gscripts;
18
19
20/**
21 * An {@link IViewRule} for android.widget.ListView and all its derived classes.
22 * This is the "root" rule, that is used whenever there is not more specific rule to apply.
23 */
24public class AndroidWidgetListViewRule extends BaseView {
25
26    // ==== XML Creation ====
27
28    /**
29     * The default for new views is to be wrap_content on both width/height.
30     * However ListView is special in that ideally we want fill_parent width by default.
31     */
32    public Map<?, ?> getDefaultAttributes() {
33        // TODO: find a way to plug in the new value VALUE_MATCH_PARENT.
34        return [ ATTR_LAYOUT_WIDTH  : VALUE_FILL_PARENT ];
35    }
36
37}
38