• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

jacobmoncur/QuiltViewLibrary: Android Quilt View Library

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jacobmoncur/QuiltViewLibrary

开源软件地址(OpenSource Url):

https://github.com/jacobmoncur/QuiltViewLibrary

开源编程语言(OpenSource Language):

Java 93.7%

开源软件介绍(OpenSource Introduction):

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



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap