选择多张图片的控件:Patio

jopen 9年前

Patio是一个简约的Android视图控件用于选择多个图像。

Patio can be added to an Activity or Fragment using the following XML

<com.andressantibanez.android.patio.Patio    android:id="@+id/patio"    android:layout_width="match_parent"    android:layout_height="wrap_content"    app:thumbnailHeight="200dp"    app:thumbnailWidth="200dp"    app:thumbnailsContainerPadding="10dp"    app:thumbnailsContainerBackground="#ddd"    app:maxPictures="3"    app:thumbnailsMessage="@string/patio_footer"    app:actionsTextColor="#333"/>

Patio has certain customizable attributes:

  • thumbnailHeight defines the thumbnails height.
  • thumbnailWidth defines the thumbnails width.
  • thumbnailsContainerPadding defines how much padding will be used for the thumbnails container.
  • thumbnailsContainerBackground defines a background color for the thumbnails container.
  • maxPictures specifies how many pictures can the user add to the Patio view.
  • thumbnailsMessage defines a custom string for the views footer. This string can be used with %1$d and %2$d tokens to add a pictures attached / max pictures message.
  • actionsTextColor defines the text color for each action: Take Picture, Attach Picture, Remove Picture, Clear.

项目主页:http://www.open-open.com/lib/view/home/1415175967262