|
| 1 | +LinearListView |
| 2 | +================= |
| 3 | + |
| 4 | +Android library that allows you to bind a `LinearLayout` with a `ListAdapter`. |
| 5 | + |
| 6 | + |
| 7 | +Download |
| 8 | +-------- |
| 9 | + |
| 10 | +Gradle: |
| 11 | + |
| 12 | +``` |
| 13 | +dependencies { |
| 14 | + compile 'com.github.frankiesardo:linearlistview:1.0.1' |
| 15 | +} |
| 16 | +``` |
| 17 | + |
| 18 | +Maven: |
| 19 | + |
| 20 | +```xml |
| 21 | +<dependency> |
| 22 | + <groupId>com.github.frankiesardo</groupId> |
| 23 | + <artifactId>linearlistview</artifactId> |
| 24 | + <version>1.0.1</version> |
| 25 | +</dependency> |
| 26 | +``` |
| 27 | + |
| 28 | + |
| 29 | +Usage |
| 30 | +===== |
| 31 | + |
| 32 | +A simple example of the xml attributes that you can use |
| 33 | + |
| 34 | +```xml |
| 35 | +<com.linearlistview.LinearListView |
| 36 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 37 | + android:id="@+id/list" |
| 38 | + android:layout_width="match_parent" |
| 39 | + android:layout_height="match_parent" |
| 40 | + android:orientation="horizontal" |
| 41 | + android:showDividers="none|middle|beginning|end" |
| 42 | + android:divider="@drawable/your_divider" |
| 43 | + android:dividerPadding="2dp" |
| 44 | + app:dividerThickness="2dp" |
| 45 | + android:entries="@array/your_array" /> |
| 46 | +``` |
| 47 | + |
| 48 | +Where: `showDividers`, `divider` and `dividerPadding` have the same meaning of a `LinearLayout` (API 11) attributes, `entries` is the same as a `ListView` attribute and `dividerThickness` controls how thick is the divider (namely its height or width depending on its orientation). |
| 49 | + |
| 50 | +In your `Activity` you can call `myLinearListView.setAdapter(myAdapter)` and each view from your `ListAdapter` will be inflated and kept in sync with its data. |
| 51 | + |
| 52 | + |
| 53 | +Why you want to use a LinearListVew: |
| 54 | + |
| 55 | +* You need an horizontal scrollable list (since `Gallery` is deprecated): Just embed this layout with an `horizontal` orientation in an `HorizontalScrollView`. |
| 56 | +* You need two or more lists in a vertical scrollable view. |
| 57 | +* You need to inflate several views in a `LinearLayout` from an `Adapter` and you want to keep them synchronized with its data. This is especially useful when working with a `CursorAdapter`. |
| 58 | +* You need a list with a fixed height (the total height of its children). Or, you have a complex, scrollable layout and don't want to use a `ListView` with footers and headers. |
| 59 | +* You simply want to use a `LinearLayout` with dividers (API 11) with the added benefit of a `dividerThickness` attribute. |
| 60 | + |
| 61 | + |
| 62 | +Roadmap |
| 63 | +------------------------- |
| 64 | + |
| 65 | +* Adding a drawSelectorOnTop attribute. |
| 66 | + |
| 67 | +Developed By |
| 68 | +============ |
| 69 | + |
| 70 | +* Frankie Sardo |
| 71 | + |
| 72 | + |
| 73 | +License |
| 74 | +======= |
| 75 | + |
| 76 | + Copyright 2012 Francesco Sardo |
| 77 | + |
| 78 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 79 | + you may not use this file except in compliance with the License. |
| 80 | + You may obtain a copy of the License at |
| 81 | + |
| 82 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 83 | + |
| 84 | + Unless required by applicable law or agreed to in writing, software |
| 85 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 86 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 87 | + See the License for the specific language governing permissions and |
| 88 | + limitations under the License. |
0 commit comments