Android Quilt View Library

Overview

QuiltViewLibrary

QuiltView displays views of different sizes in a scrollable grid.

quilt quilt

Dependencies

This library depends on gridlayout_v7 ([email protected]:jacobmoncur/gridlayout_v7.git)

Setup

The QuiltView can be defined by XML:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res/com.jake.quiltviewsample"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.jake.quiltview.QuiltView
        android:id="@+id/quilt"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="5dip"
        app:scrollOrientation="horizontal|vertical" >
    </com.jake.quiltview.QuiltView>

</FrameLayout>

Or programmatically

boolean isVertical = true|false; //defines which direction the QuiltView will scroll: true = Vertical, false = Horizontal
QuiltView quiltView = new QuiltView(context, isVertical); //(QuiltView) findViewById(R.id.quilt);

Adding Children

Children must be added to the QuiltView programmatically as an ArrayList of ImageViews:

ArrayList<ImageView> images = new ArrayList<ImageView>();
for(int i = 0; i < num; i++){
	ImageView image = new ImageView(this.getApplicationContext());
	image.setScaleType(ScaleType.CENTER_CROP);
	image.setImageResource(R.drawable.bg);
	images.add(image);
}
quiltView.addPatchImages(images);

Or an ArrayList of Views

ArrayList<View> views = new ArrayList<View>();
for(int i = 0; i < num; i++){
    FrameLayout patch = new FrameLayout(this.getApplicationContext());
	views.add(patch);
}
quiltView.addPatchViews(views);

Goals for this view

  • Have no empty patches
  • Be sudo-random (lays out the children differently each time)
  • Looks awesome!

TODO

  • Custom Adapter to allow view recycling
  • Be able to define children in XML
  • Adapt better to different screen sizes
Comments
  • Cannot run the sample

    Cannot run the sample

    I got this exception when try to import and run your sample 01-20 10:17:46.351: E/AndroidRuntime(9934): FATAL EXCEPTION: main 01-20 10:17:46.351: E/AndroidRuntime(9934): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jake.quiltviewsample/com.jake.quiltviewsample.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.jake.quiltview.QuiltView 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2185) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2210) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread.access$600(ActivityThread.java:142) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.os.Handler.dispatchMessage(Handler.java:99) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.os.Looper.loop(Looper.java:137) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread.main(ActivityThread.java:4931) 01-20 10:17:46.351: E/AndroidRuntime(9934): at java.lang.reflect.Method.invokeNative(Native Method) 01-20 10:17:46.351: E/AndroidRuntime(9934): at java.lang.reflect.Method.invoke(Method.java:511) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558) 01-20 10:17:46.351: E/AndroidRuntime(9934): at dalvik.system.NativeStart.main(Native Method) 01-20 10:17:46.351: E/AndroidRuntime(9934): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.jake.quiltview.QuiltView 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.createView(LayoutInflater.java:613) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:275) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.Activity.setContentView(Activity.java:1867) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.jake.quiltviewsample.MainActivity.onCreate(MainActivity.java:19) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.Activity.performCreate(Activity.java:5008) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2139) 01-20 10:17:46.351: E/AndroidRuntime(9934): ... 11 more 01-20 10:17:46.351: E/AndroidRuntime(9934): Caused by: java.lang.reflect.InvocationTargetException 01-20 10:17:46.351: E/AndroidRuntime(9934): at java.lang.reflect.Constructor.constructNative(Native Method) 01-20 10:17:46.351: E/AndroidRuntime(9934): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.view.LayoutInflater.createView(LayoutInflater.java:587) 01-20 10:17:46.351: E/AndroidRuntime(9934): ... 22 more 01-20 10:17:46.351: E/AndroidRuntime(9934): Caused by: java.lang.NoClassDefFoundError: android.support.v7.gridlayout.R$dimen 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.support.v7.widget.GridLayout.<init>(GridLayout.java:255) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.support.v7.widget.GridLayout.<init>(GridLayout.java:274) 01-20 10:17:46.351: E/AndroidRuntime(9934): at android.support.v7.widget.GridLayout.<init>(GridLayout.java:282) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.jake.quiltview.QuiltViewBase.<init>(QuiltViewBase.java:26) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.jake.quiltview.QuiltView.setup(QuiltView.java:62) 01-20 10:17:46.351: E/AndroidRuntime(9934): at com.jake.quiltview.QuiltView.<init>(QuiltView.java:51) 01-20 10:17:46.351: E/AndroidRuntime(9934): ... 25 more Can you please provide a runnable APK so that I can enjoy QuiltView UI.

    opened by anticafe 6
  • Gradle support

    Gradle support

    Added gradle files to enable gradle support in Android Studio.

    Tested the library itself and not the sample project.

    Request can be found here: https://github.com/jacobmoncur/QuiltViewLibrary/issues/10

    opened by matthiasbruns 2
  • Re-add views

    Re-add views

    I am using a SwipeRefreshLayout wrapping the QuiltView. But I did not find an API to re-bind the views. If I use removeAllViews() for the ViewGroup class, and add views again. The QuiltView is empty. Any idea for a way out?

    Thanks!

    opened by hy9be 0
  • setRowCount(int) and setColumnCount(int) shouldn't receive -1 as undefined value

    setRowCount(int) and setColumnCount(int) shouldn't receive -1 as undefined value

    setupVertical() and setupHorizontal() methods on QuiltViewBase class, call setColumnCount(int) and setRowCount(int) passing -1 as undefined value, this makes GridLayout throw an IllegalArgumentException. Instead, these methods should pass UNDEFINED constant as undefined value.

    opened by Rafhack 2
  • Have empty patches

    Have empty patches

    the grid have empty patches after I loaded several images. What I need to do is arrange different sized images into a fixed rectangular grid without having any empty patches

    opened by isuruch 0
  • Display a defaul Image when the image is loading

    Display a defaul Image when the image is loading

    I need to display an indication that the image is onLoading so my solution is to setImageDrawable but didn't work.

    This is what i had tried :

    ArrayList images = new ArrayList(); for(final Photos photo : MainApplication.getPhotos()){ ImageView image = new ImageView(getActivity()); image.setImageDrawable(getActivity().getResources().getDrawable(R.drawable.default_image)); image.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(getActivity(), ImageDisplayerActivity.class);
                    intent.putExtra("url",photo.getUrl() );
                    getActivity().startActivity(intent);
                }
            });
    
    opened by selmanon 5
Owner
Jacob Moncur
Jacob Moncur
FloatingView can make the target view floating above the anchor view with cool animation

FloatingView FloatingView can make the target view floating above the anchor view with cool animation Links 中文版 README Blog about FloatingView demo.ap

UFreedom 1.8k Dec 27, 2022
用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View.

PathAnimView 用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View. 现已经找到图片->SVG->PATH的正确姿势, Now i have a pic.I have a view. Oh~,Path(A

张旭童 1.1k Oct 28, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
A horizontal view scroller library for Android

View Flow for Android ViewFlow is an Android UI widget providing a horizontally scrollable ViewGroup with items populated from an Adapter. Scroll down

Patrik Åkerfeldt 1.8k Dec 29, 2022
Android library to create chat message view easily

ChatMessageView ChatMessageView helps you to create chat message view quickly like a typical chatting application. Its a container view, so you can ad

Himanshu Soni 641 Dec 24, 2022
Android library implementing a poppy view on scroll, similar to the one found in the Google Plus app

PoppyView PoppyView is a library which implements view on the bottom which come and go relative to the user scroll. It can be seen in the Google plus

Flavien Laurent 409 Nov 23, 2022
Android library for creating an expandable to full screen view inside a viewgroup composition.

Expandable Panel Android Library Check ExpandablePanel Demo application on GooglePlay: Details This Android library implements the expand by sliding l

Jorge Castillo 422 Nov 10, 2022
A simple library to let you sign (or draw lines) smoothly with your finger into a view and save it.

FingerSignView Introduction FingerSignView is a simple library that lets you finger, or draw lines, smoothly with your finger into a View and save it

Agnaldo Pereira 25 Nov 20, 2022
:star2:A cool dynamic view library

ENViews ENViews, A cool dynamic view library.All designed by Nick Buturishvili ENViews, 一个华丽丽的动效控件库,所有控件原型取自Nick Buturishvili的设计作品 Preview Original de

Est 1.8k Jan 3, 2023
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)

RippleView View that imitates Ripple Effect on click which was introduced in Android L. Usage For a working implementation, Have a look at the Sample

Muthuramakrishnan Viswanathan 1.2k Dec 30, 2022
Snake View is a simple and animated linear chart for Android.

Snake View Snake library is a simple and animation line chart for Android. Latest Version How to use Configuring your project dependencies Add the lib

Txus Ballesteros 339 Dec 14, 2022
[] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout. Note: If your aim is to replica

Jeff Gilfelt 3k Nov 28, 2022
Android view with both path from constructed path or from svg.

android-pathview You want to animate svg or normal Paths?<br> Change the color, pathWidth or add svg.<br> Animate the "procentage" property to make th

Georgi Eftimov 2.9k Dec 27, 2022
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.

This project isn't maintained anymore. It is now recommended to use https://github.com/peterLaurence/MapView. MapView is maintained by Peter, one of o

Mike Dunn 1.5k Dec 29, 2022
A cool Open Source CoverFlow view for Android with several fancy effects.

FancyCoverFlow THIS PROJECT IS NO LONGER MAINTAINED! What is FancyCoverFlow? FancyCoverFlow is a flexible Android widget providing out of the box view

David Schreiber-Ranner 1.1k Nov 10, 2022
A simple, customizable and easy to use swipeable view stack for Android.

SwipeStack A simple, customizable and easy to use swipeable view stack for Android. QuickStart Include the Gradle dependency dependencies { compil

Frederik Schweiger 1.5k Dec 30, 2022
Custom android music player view.

InteractivePlayerView Custom android music player view. Screen Check it on youtube Usage(XML) Define it in your xml file. <co.mobiwise.library.Intera

Mert Şimşek 744 Dec 25, 2022
Shadow layout, shadow view for android.

ShadowViewHelper Shadow layout, shadow view for android. How to use: It's very simple to use. Gradle(Check newest version): compile 'com.github.wangji

WangJie 777 Dec 30, 2022
A velocimeter View for Android

Velocimeter A velocimeter View for Android Sample video: Youtube Velocimeter video Sample app: How to use Default colors <com.github.glomadrian.veloci

Adrián Lomas 614 Dec 4, 2022