GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - znary/AutoFitGridLayout: GridLayout that fit width automatically.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
afgridlayout
afgridlayout
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
after.png
after.png
 
 
before.png
before.png
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

AutoFitGridLayout

It is a layout like GridLayout. But children in it will fill the column.

How to Use?

If using gradle:

compile 'com.liuzhuang.opensource:afgridlayout:1.0.0'

If using Maven:

<dependency>
  <groupId>com.liuzhuang.opensource</groupId>
  <artifactId>afgridlayout</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Or just copy the class AutoFitGridLayout.java and attr.xml in afgridayout folder to your dir.

In the xml file:

<com.liuzhuang.afgridlayout.AutoFitGridLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="8dp"
    android:paddingLeft="16dp"
    android:paddingRight="24dp"
    android:paddingTop="32dp"
    android:background="#263238"
    app:columnCount="2"
    app:horizontalSpace="4.5dp"
    app:verticalSpace="4.5dp">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="1"
        android:textSize="20dp"
        android:textColor="@android:color/white"
        android:gravity="center"
        android:background="@android:color/darker_gray"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="2"
        android:textSize="20dp"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:background="@android:color/holo_blue_bright"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="3"
        android:textSize="20dp"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:background="@android:color/holo_blue_dark"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="4"
        android:textSize="20dp"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:background="@android:color/darker_gray"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="5"
        android:textSize="20dp"
        android:gravity="center"
        android:textColor="@android:color/white"
        android:background="@android:color/holo_blue_bright"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="6"
        android:gravity="center"
        android:textSize="20dp"
        android:textColor="@android:color/white"
        android:background="@android:color/holo_blue_dark"/>
</com.liuzhuang.afgridlayout.AutoFitGridLayout>

And the original effect:

before

After setting number 1 & 3 to be GONE, the effect is:

after

License

Copyright 2015 Liu Zhuang

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.

About

GridLayout that fit width automatically.

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.