Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ FluidLayout是一个Android平台上的开源控件,提供了流布局的布

`在 Gradle 项目中添加依赖:`
```
compile 'com.fynn.fluidlayout:fluidlayout:1.0'
compile 'com.fynn.fluidlayout:fluidlayout:1.1'
```

`支持的布局属性:`

> gravity="center" 单行垂直居中对齐
> fl_gravity="center" 单行垂直居中对齐

> gravity="bottom" 单行底部对其
> fl_gravity="bottom" 单行底部对其

> gravity="top" 单行顶部对其
> fl_gravity="top" 单行顶部对其

该控件支持 `ScrollView` 嵌套。

Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:3.2.0'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
google()
jcenter()
}
}
Expand Down
9 changes: 4 additions & 5 deletions fluidlayout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ apply plugin: 'com.jfrog.bintray'
def siteUrl = 'https://github.com/ifynn/FluidLayout'
def gitUrl = 'https://github.com/ifynn/FluidLayout.git'
group = "com.fynn.fluidlayout"
version = "1.0"
version = "1.1"

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 26

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
minSdkVersion 14
targetSdkVersion 26
versionCode 20160521
versionName "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public FluidLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);

TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.FluidLayout);
int index = a.getInt(R.styleable.FluidLayout_gravity, -1);
int index = a.getInt(R.styleable.FluidLayout_fl_gravity, -1);
if (index >= 0) {
setGravity(index);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public LayoutParams(Context c, AttributeSet attrs) {

TypedArray a =
c.obtainStyledAttributes(attrs, R.styleable.FluidLayout_Layout);
gravity = a.getInt(R.styleable.FluidLayout_Layout_layout_gravity, -1);
gravity = a.getInt(R.styleable.FluidLayout_Layout_layout_fl_gravity, -1);
a.recycle();
}

Expand Down
4 changes: 2 additions & 2 deletions fluidlayout/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="FluidLayout">
<attr name="gravity" >
<attr name="fl_gravity" >
<flag name="top" value="0x30" />
<flag name="bottom" value="0x50" />
<flag name="center" value="0x11" />
</attr>
</declare-styleable>

<declare-styleable name="FluidLayout_Layout">
<attr name="layout_gravity">
<attr name="layout_fl_gravity">
<flag name="top" value="0x30" />
<flag name="bottom" value="0x50" />
<flag name="center" value="0x11" />
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

15 changes: 7 additions & 8 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 26

defaultConfig {
applicationId "com.fynn.fluidlayout.sample"
minSdkVersion 9
targetSdkVersion 23
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Expand All @@ -20,8 +19,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.1'
compile project(':fluidlayout')
compile 'com.android.support:design:23.2.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation project(':fluidlayout')
implementation 'com.android.support:design:26.1.0'
}