• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Java
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A minimalistic Android view widget for selecting multiple images

Patio

Android Arsenal

Patio is a minimalistic Android view widget for selecting multiple images.

Demo Video

Instructions

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.

To add this attributes you must add the following definition to the root view

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

Make sure the Activity or Fragment implements PatioCallbacks. In this callbacks we will handle startActivityForResult intent for adding pictures via Camera or Gallery. You can get these intents from getTakePictureIntent() or getAttachPictureIntent().

Callbacks

@Override
public void onTakePictureClick() {
    Intent intent = mPatio.getTakePictureIntent();
    startActivityForResult(intent, REQUEST_CODE_TAKE_PICTURE);
}

@Override
public void onAddPictureClick() {
    Intent intent = mPatio.getAttachPictureIntent();
    startActivityForResult(intent, REQUEST_CODE_ATTACH_PICTURE);
}

Also, make sure you register you register your Activity or Fragment to get notified when callbacks are fired.

Listener

mPatio = (Patio) findViewById(R.id.patio);
mPatio.setCallbacksListener(this);

Patio needs the following permissions in your app in order to work properly.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />

To get an ArrayList of the pictures added to Patio you can call getThumbnailsPaths() method.

ArrayList<String> thumbnails = mPatio.getThumbnailsPaths();

License

Copyright 2014 Andrés Santibáñez

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

livewire-calendar

Laravel Livewire component to show Events in a good looking monthly calendar
PHP
883
star
2

livewire-charts

Neat Livewire Charts for your Laravel projects
PHP
792
star
3

laravel-eloquent-state-machines

State Machines for your Laravel Eloquent models
PHP
523
star
4

livewire-select

Livewire component for dependant and/or searchable select inputs
PHP
499
star
5

laravel-blade-sortable

Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.
PHP
408
star
6

livewire-status-board

Livewire component to show records according to their current status
PHP
338
star
7

livewire-resource-time-grid

Laravel Livewire component to show Events by time and resource in a good looking grid
PHP
220
star
8

laravel-subscribable-notifications

Laravel Subscribable Notifications
PHP
142
star
9

livewire-charts-demo

Livewire Charts demo app
PHP
69
star
10

Ranger

Android horizontally scrolled DatePicker
Java
57
star
11

livewire-dependant-select-demo

Laravel Livewire demo of multiple selects depending on each other values
PHP
48
star
12

Quota

Quota widget for Android
Java
31
star
13

livewire-calendar-demo

livewire-calendar component demo
PHP
23
star
14

laravel-eloquent-state-machines-demo

Demo repository for Laravel Eloquent State Machines package
PHP
17
star
15

OAuthWebView

WebViews for OAuth Authentication
Java
12
star
16

laravel-blade-sortable-demo

Demos for asantibanez/laravel-blade-sortable
PHP
11
star
17

livewire-wire-model-file-demo

Livewire lifecycle hook example for wire:model in file inputs
PHP
11
star
18

livewire-select-demo

Laravel app showcasing asantibanez/livewire-select component
PHP
10
star
19

practical

Practical ActiveRecord for DynamoDB
JavaScript
10
star
20

livewire-status-board-demo

Livewire Status Board demo app
PHP
7
star
21

Miveo

Vimeo SUPER AWESOME Android App
Java
4
star
22

laravel-inertia-infinite-scroll-demo

Demo for Infinite Scroll Feed in Laravel and InertiaJs
PHP
4
star
23

udacity-spotify-streamer-stage-2

Java
3
star
24

udacity-build-it-bigger

Udacity Build It Bigger Project
Java
2
star
25

udacity-go-ubiquitous

Project 6 of Udacity's Android Nanodegree program
Java
1
star
26

udacity-make-your-app-material

Project 5 of Udacity's Android Nanodegree program.
Java
1
star
27

vue-router-example

Vue.js project that uses Vue-Router
JavaScript
1
star
28

lienzo

Lienzo is a Horizontal/Vertical RecyclerView gallery powered by Picasso
Java
1
star
29

MarkdownViewer

Android Markdown View
Java
1
star
30

android-google-maps-test

Google Maps instructions for Android project
Java
1
star
31

laravel-paypal-server-checkout-test

PHP
1
star
32

livewire-charts-demo-livewire-v3

Livewire Charts Demo in Livewire v3
PHP
1
star
33

golden-layout-vue

Example of Golden Layout + Vue and Vuex integration
Vue
1
star
34

laravel-ecuadorian-taxpayer-validation-rule

Ecuadorian Taxpayer Validation Rule for Laravel
PHP
1
star
35

whatsapp-clone

WhatsApp Web UI clone using TailwindCss
Vue
1
star