Skip to content

Commit

Permalink
Auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
google-automerger committed Jan 21, 2015
1 parent 8a28cd1 commit 48565bb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .google/packaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
---
status: PUBLISHED
technologies: [Android]
categories: [UI]
categories: [Widgets]
languages: [Java]
solutions: [Mobile]
github: android-CustomChoiceList
level: BEGINNER
icon: screenshots/icon-web.png
apiRefs:
- android:android.widget.Checkable
- android:android.widget.ListView
license: apache2
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This sample uses the following software:

Copyright 2014 The Android Open Source Project
Copyright 2015 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,51 @@ Android CustomChoiceList Sample
This sample demonstrates how to create custom checkable layouts, for use with ListView's choiceMode
attribute.

Introduction
------------

This sample demonstrates how to create custom single- or multi-choice [ListView][1] UIs on Android.

When a ListView has a `android:choiceMode` attribute set, it will allow users to "choose" one or more items. For
exmaple, refer to `res/layout/sample_main.xml` in this project:

```xml
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:paddingLeft="@dimen/page_margin"
android:paddingRight="@dimen/page_margin"
android:scrollbarStyle="outsideOverlay"
android:choiceMode="multipleChoice" />
```

The framework provides these default list item layouts that show standard radio buttons or check boxes next to a single
line of text:

- android.R.layout.simple_list_item_single_choice
- android.R.layout.simple_list_item_multiple_choice.

In some cases, you may want to customize this layout. When doing so, the root view must implement the Checkable
interface. For an example, see this sample's `CheckableLinearLayout` class.

Lastly, remember to use padding on your ListViews to adhere to the standard metrics described in the Android Design
guidelines. When doing so, you should set the `android:scrollbarStyle` attribute such that the scrollbar doesn't inset.

[1]: http://developer.android.com/reference/android/widget/ListView.html

Pre-requisites
--------------

- Android SDK v21
- Android Build Tools v21.1.1
- Android Support Repository

Screenshots
-------------

<img src="screenshots/1-main.png" height="400" alt="Screenshot"/> <img src="screenshots/2-settings.png" height="400" alt="Screenshot"/>

Getting Started
---------------

Expand Down
Binary file added screenshots/icon-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 48565bb

Please sign in to comment.