Giter VIP home page Giter VIP logo

android-support-v7-gridlayout-r23-2-1's Introduction

Library Project including compatibility GridLayout.

This can be used by an Android project to provide
access to GridLayout on applications running on API 7+.

There is technically no source, but the src folder is necessary
to ensure that the build system works.  The content is actually
located in libs/android-support-v7-gridlayout.jar.
The accompanying resources must also be included in the application.


USAGE:

Make sure you use <android.support.v7.widget.GridLayout> in your
layouts instead of <GridLayout>.
Same for <android.support.v7.widget.Space> instead of <Space>.

Additionally, all of GridLayout's attributes should be put in the
namespace of the app, as those attributes have been redefined in
the library so that it can run on older platforms that don't offer
those attributes in their namespace.

To know which attributes need the application namespace, look at
the two declare-styleable declared in res/values/attrs.xml



For instance:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.GridLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"  <==== the namespace used for the library project
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:columnCount="6" >                                <===== notice how we're using app:columnCount here, not android:columnCount!

    <Button
        android:id="@+id/button1"
        app:layout_column="1"                            <=== again, note the app: namespace
        app:layout_columnSpan="2"
        app:layout_gravity="left"
        app:layout_row="1"
        android:text="Button" />

    <CheckBox
        android:id="@+id/checkBox1"
        app:layout_column="4"
        app:layout_gravity="left"
        app:layout_row="2"
        android:text="CheckBox" />

    <Button
        android:id="@+id/button2"
        app:layout_column="5"
        app:layout_gravity="left"
        app:layout_row="3"
        android:text="Button" />

    <android.support.v7.widget.Space                    <=== space widgets also need the full support package path
        android:layout_width="21dp"                     <=== use the android namespace for width, height etc -- only use app: for the grid layout library's new resources
        android:layout_height="1dp"
        app:layout_column="0"
        app:layout_gravity="fill_horizontal"
        app:layout_row="0" />

android-support-v7-gridlayout-r23-2-1's People

Contributors

hewaiming avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.