All Projects → LRH1993 → Autoflowlayout

LRH1993 / Autoflowlayout

自定义ViewGroup,实现多功能流式布局与网格布局

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Autoflowlayout

EZAnchor
An easier and faster way to code Autolayout
Stars: ✭ 25 (-96.21%)
Mutual labels:  autolayout
Snapkit
A Swift Autolayout DSL for iOS & OS X
Stars: ✭ 18,091 (+2641.06%)
Mutual labels:  autolayout
Easyanchor
⚓️ Declarative, extensible, powerful Auto Layout
Stars: ✭ 432 (-34.55%)
Mutual labels:  autolayout
Restaurant-Viewing-App
Build A Restaurant Viewing App in Swift 4.2
Stars: ✭ 43 (-93.48%)
Mutual labels:  autolayout
Misterfusion
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class.
Stars: ✭ 314 (-52.42%)
Mutual labels:  autolayout
Uitableviewdynamiclayoutcacheheight
🖖高性能的自动计算采用 Autolayout 布局的 UITableViewCell 和 UITableViewHeaderFooterView 的高度,内部自动管理高度缓存。
Stars: ✭ 360 (-45.45%)
Mutual labels:  autolayout
wwlayout
Swifty DSL for programmatic Auto Layout in iOS
Stars: ✭ 46 (-93.03%)
Mutual labels:  autolayout
Markupkit
Declarative UI for iOS and tvOS
Stars: ✭ 508 (-23.03%)
Mutual labels:  autolayout
Layoutframeworkbenchmark
Benchmark the performances of various Swift layout frameworks (autolayout, UIStackView, PinLayout, LayoutKit, FlexLayout, Yoga, ...)
Stars: ✭ 316 (-52.12%)
Mutual labels:  autolayout
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+529.09%)
Mutual labels:  autolayout
DailyNews
Daily News is a news app with good looking user interface ! Apps architecture is MVVM and used RxSwift for binding.
Stars: ✭ 31 (-95.3%)
Mutual labels:  autolayout
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+382.12%)
Mutual labels:  autolayout
Autoinch
优雅的iPhone全尺寸/等比例精准适配工具
Stars: ✭ 395 (-40.15%)
Mutual labels:  autolayout
RangeUISlider
📱 🔵➖🔵 An iOS range selection slider compatible with UIKit and SwiftUI. Developed using autolayout and highly customizable using IBDesignabled and IBInspectable or programmatically. It support also RTL (right to left) languages automatically out of the box.
Stars: ✭ 98 (-85.15%)
Mutual labels:  autolayout
Toolbar
Awesome autolayout Toolbar. Toolbar is a library for iOS. You can easily create chat InputBar.
Stars: ✭ 458 (-30.61%)
Mutual labels:  autolayout
FormationLayout
Yet Another Swift Auto Layout DSL
Stars: ✭ 53 (-91.97%)
Mutual labels:  autolayout
Easyswiftlayout
Lightweight Swift framework for Apple's Auto-Layout
Stars: ✭ 345 (-47.73%)
Mutual labels:  autolayout
Tablekit
Type-safe declarative table views.
Stars: ✭ 567 (-14.09%)
Mutual labels:  autolayout
Android Ratiolayout
This is a specified proportion to the size of the Layout or View support library, with which you can easily set a fixed ratio of the size of the Layout or View, internal adaptive size calculation, completely abandon the code to calculate the size! If you have any questions in the course or suggestions, please send an e-mail to the following e-mail, thank you!
Stars: ✭ 462 (-30%)
Mutual labels:  autolayout
Uicollectionview Layouts Kit
📐 A set of custom layouts for UICollectionView with examples [Swift 5.3, iOS 12].
Stars: ✭ 410 (-37.88%)
Mutual labels:  autolayout

AutoFlowLayout

一、AutoFlowLayout应用场景

流式布局,在很多标签类的场景中可以用的;而网格布局在分类中以及自拍九宫格等场景很常见。如下所示: 如此使用频繁而又实现简单的控件,怎能不自己撸一个呢?控件,还是定制的好啊。

二、AutoFlowLayout实现效果

先介绍下自己撸的这个控件的功能及效果。

1.功能

流式布局

  • 自动换行
  • 行数自定:单行/多行
  • 支持单选/多选
  • 支持行居中/靠左显示
  • 支持添加/删除子View
  • 支持子View点击/长按事件

网格布局

  • 行数/列数自定
  • 支持单选/多选
  • 支持添加/删除子View
  • 支持子View点击/长按事件
  • 支持添加多样式分割线及横竖间隔

2.效果

下面以gif图的形式展现下实现的效果,样式简单了些,不过依然能展示出这个简单控件的多功能实用性。

流式布局

网格布局

最后一个是带间隔以及分割线的,由于录屏原因,只在跳过去的一瞬间显示了粉红色的一条线。真实如下图所示,可以定义横竖间距的大小,以及分割线的颜色,宽度。

三、AutoFlowLayout使用

1.添加依赖

①.在项目的 build.gradle 文件中添加

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

②.在 module 的 build.gradle 文件中添加依赖

dependencies {
	        compile 'com.github.LRH1993:AutoFlowLayout:1.0.5'
	}

2.属性说明

下表是自定义的属性说明,可在xml中声明,同时有对应的get/set方法,可在代码中动态添加。

3.使用示例

布局

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">
    <com.example.library.AutoFlowLayout
        android:id="@+id/afl_cotent"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</RelativeLayout>

代码设置数据

mFlowLayout.setAdapter(new FlowAdapter(Arrays.asList(mData)) {
            @Override
            public View getView(int position) {
                View item = mLayoutInflater.inflate(R.layout.special_item, null);
                TextView tvAttrTag = (TextView) item.findViewById(R.id.tv_attr_tag);
                tvAttrTag.setText(mData[position]);
                return item;
            }
        });

与ListView,GridView使用方式一样,实现FlowAdapter即可。

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].