All Projects → albert-lii → Autogridview

albert-lii / Autogridview

🚥AutoGridView可以更轻松实现QQ空间和微信朋友圈的九宫格、点击展开、点击加号添加照片等功能,而且采用Adapter方式,可以自定义item,更加灵活,使用起来就像ListView和BaseAdapter搭配一样简单...

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Autogridview

Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+9655.56%)
Mutual labels:  adapter
Mongo Php Adapter
🔗 Adapter to provide ext-mongo interface on top of mongo-php-library
Stars: ✭ 453 (+1158.33%)
Mutual labels:  adapter
Slimadapter
A slim & clean & typeable Adapter without# VIEWHOLDER
Stars: ✭ 939 (+2508.33%)
Mutual labels:  adapter
Design patterns in typescript
📐 Design pattern implementations in TypeScript
Stars: ✭ 4,072 (+11211.11%)
Mutual labels:  adapter
Autoinch
优雅的iPhone全尺寸/等比例精准适配工具
Stars: ✭ 395 (+997.22%)
Mutual labels:  adapter
Vue Socket.io Extended
✌️⚡️ Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
Stars: ✭ 506 (+1305.56%)
Mutual labels:  adapter
Oneadapter
A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
Stars: ✭ 321 (+791.67%)
Mutual labels:  adapter
Mnemonix
A unified interface to Elixir and Erlang key/value stores.
Stars: ✭ 31 (-13.89%)
Mutual labels:  adapter
Gimx
The GIMX software.
Stars: ✭ 421 (+1069.44%)
Mutual labels:  adapter
Bindapter
You will never build an adapter again
Stars: ✭ 19 (-47.22%)
Mutual labels:  adapter
Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (+936.11%)
Mutual labels:  adapter
Multiitem
一个优雅的实现多类型的RecyclerView类库 支持DataBinding Form表单录入 跨多个RecyclerView拖动
Stars: ✭ 381 (+958.33%)
Mutual labels:  adapter
Superadapter
[Deprecated]. 🚀 Adapter(BaseAdapter, RecyclerView.Adapter) wrapper for Android. 一个Adapter同时适用RecyclerView、ListView、GridView等。
Stars: ✭ 638 (+1672.22%)
Mutual labels:  adapter
Flexibleadapter
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Stars: ✭ 3,482 (+9572.22%)
Mutual labels:  adapter
Flutter adapter
A plugin that adapts the flutter application to different platforms, allowing your flutter application to flexibly and efficiently adapt to various platforms in the same flutter project, maximizing UI multiplexing, and sharing business logic code across different platforms. Support to select different layout styles in real time according to the screen orientation.
Stars: ✭ 27 (-25%)
Mutual labels:  adapter
Xorm Adapter
Xorm adapter for Casbin
Stars: ✭ 329 (+813.89%)
Mutual labels:  adapter
Espressif
all espressif stuff will committed here
Stars: ✭ 477 (+1225%)
Mutual labels:  adapter
Fastp
An ultra-fast all-in-one FASTQ preprocessor (QC/adapters/trimming/filtering/splitting/merging...)
Stars: ✭ 966 (+2583.33%)
Mutual labels:  adapter
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-58.33%)
Mutual labels:  adapter
Multityperecyclerviewadapter
一个专注于RecyclerView优雅刷新(接管资源和数据源)、高灵活、低耦合、健壮性以及高效性的MVP模式库,支持大多数Adapter
Stars: ✭ 763 (+2019.44%)
Mutual labels:  adapter

AutoGridView

releasesvg apisvg license  

关于

AutoGridView使用ViewGroup实现,可以如QQ空间与微信朋友圈中的照片那种九宫格方式排布(注:此处的九宫格排列不仅仅是可以按照QQ控件那种九宫格排布,只要宫格的个数达到可以开平方的要求(1x1,2x2,3x3,4x4...),都会按照正方形排列),同时AutoGridView也可以实现普通的宫格排布方式。此外AutoGridView还可以控制显示的行数和列数,这个在需要实现 点击展开更多点击收起 中还是非常有用的。AutoGridView可以设定宫格的高,也可以采用默认的高,默认的高与宫格的宽相等。

AutoGridView还采用了Adapter模式,使用方式就如同ListView和Adapter搭配一样简单,可以 自定义item ,更加灵活!对于item,也使用了简单的缓存复用,减少性能消耗...

推荐

  • ImageViewer 图片预览器,仿朋友圈和今日头条图片预览效果

演示

先来看看效果把!

演示

添加依赖

  • 使用Gradle
   // 注:如果添加依赖成功,则此句不必添加,此句作用仅为当项目在被审核时,紧急需要使用时添加
   allprojects {
       repositories {
           ...
           // 如果添加依赖时,报找不到项目时(项目正在审核),可以添加此句maven地址,如果找到项目,可不必添加
           maven { url "https://dl.bintray.com/albertlii/android-maven/" }
       }
    }
    
    dependencies {
         compile 'com.liyi.view:auto-gridview:1.1.3'
    }
  • 使用Maven
   <dependency>
      <groupId>com.liyi.view</groupId>
      <artifactId>auto-gridview</artifactId>
      <version>1.1.3</version>
      <type>pom</type>
   </dependency>

自定义属性

  • agv_mode(网格图的模式,默认为 nine)

    • nine(类似QQ空间、微信朋友圈的九宫格类型网格图)
    • normal(依次显示网格的普通类型网格图)
  • agv_row(item 的行数,默认为 3)

  • agv_column(item 的列数,默认 为3)

  • agv_item_height(item 的高度,默认与宫格图的宽相等)

  • agv_horizontal_space(网格间的横向间距,默认为 10px)

  • agv_vertical_space(网格间的纵向间距,默认为 10px)

  • agv_nines_widthper(九宫格模式下,单个 item 时,item 的宽占 parent 的可用总宽的比例(范围0-1),默认为自适应)

  • agv_nines_heightper(九宫格模式下,单个 item 时,item 的高与 parent 的可用总宽的比(范围0-1),默认为自适应)

使用方法

XML 中添加 AutoGridView

<com.liyi.grid.AutoGridView
    android:id="@+id/autoGridVi"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

代码中使用 AutoGridView

1、三种适配器

2、简单使用

例:(注:此处使用的 SimpleAutoGridAdapter
mAdapter = new SimpleAutoGridAdapter<Integer, BaseAutoGridHolder>(mImageList);
mAdapter.setImageLoader(new SimpleAutoGridAdapter.ImageLoader<Integer>() {
    @Override
    public void onLoadImage(int position, Integer item, ImageView imageView) {
        imageView.setImageResource(item);
    }
});
autoGridVi.setAdapter(mAdapter);

赞赏

如果你感觉 AutoGridView 帮助到了你,可以点右上角 "Star" 支持一下哦!😊

LICENSE

Copyright 2017 liyi

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].