Skip to content

Commit

Permalink
sample app demonstrating uses of GridLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
commonsguy committed Aug 27, 2012
1 parent 19aae85 commit e7b3302
Show file tree
Hide file tree
Showing 27 changed files with 752 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GridLayout/Sampler/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions GridLayout/Sampler/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GridLayoutSampler</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
32 changes: 32 additions & 0 deletions GridLayout/Sampler/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commonsware.android.gridlayout"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="11"/>

<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true"/>

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

</manifest>
20 changes: 20 additions & 0 deletions GridLayout/Sampler/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
3 changes: 3 additions & 0 deletions GridLayout/Sampler/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
android.library.reference.1=../../external/ActionBarSherlock
target=android-15
android.library.reference.2=../../../../../../../workspace/gridlayout
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions GridLayout/Sampler/res/layout-v14/column.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="1">

<Button
android:layout_column="0"
android:layout_row="0"
android:text="@string/button"/>

<Button
android:layout_column="0"
android:layout_row="1"
android:text="@string/button"/>

</GridLayout>
26 changes: 26 additions & 0 deletions GridLayout/Sampler/res/layout-v14/implicit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:columnCount="2">

<TextView
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_gravity="fill_horizontal"
android:inputType="textPersonName">

<requestFocus/>
</EditText>

<TextView
android:text="@string/address"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_gravity="fill_horizontal"
android:inputType="textPostalAddress"/>

</GridLayout>
16 changes: 16 additions & 0 deletions GridLayout/Sampler/res/layout-v14/row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="2">

<Button
android:layout_column="0"
android:layout_row="0"
android:text="@string/button"/>

<Button
android:layout_column="1"
android:layout_row="0"
android:text="@string/button"/>

</GridLayout>
105 changes: 105 additions & 0 deletions GridLayout/Sampler/res/layout-v14/spans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="9"
android:orientation="horizontal"
android:rowCount="5">

<Button
android:layout_columnSpan="2"
android:layout_gravity="fill"
android:layout_rowSpan="2"
android:text="@string/string_1"/>

<Button
android:layout_columnSpan="2"
android:layout_gravity="fill_horizontal"
android:text="@string/string_2"/>

<Button
android:layout_gravity="fill_vertical"
android:layout_rowSpan="4"
android:text="@string/string_3"/>

<Button
android:layout_columnSpan="3"
android:layout_gravity="fill"
android:layout_rowSpan="2"
android:text="@string/string_4"/>

<Button
android:layout_columnSpan="3"
android:layout_gravity="fill_horizontal"
android:text="@string/string_5"/>

<Button
android:layout_columnSpan="2"
android:layout_gravity="fill_horizontal"
android:text="@string/string_6"/>

<Space
android:layout_width="36dp"
android:layout_column="0"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="1"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="2"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="3"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="4"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="5"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="6"
android:layout_row="4"/>

<Space
android:layout_width="36dp"
android:layout_column="7"
android:layout_row="4"/>

<Space
android:layout_height="36dp"
android:layout_column="8"
android:layout_row="0"/>

<Space
android:layout_height="36dp"
android:layout_column="8"
android:layout_row="1"/>

<Space
android:layout_height="36dp"
android:layout_column="8"
android:layout_row="2"/>

<Space
android:layout_height="36dp"
android:layout_column="8"
android:layout_row="3"/>

<Space
android:layout_height="36dp"
android:layout_column="8"
android:layout_row="4"/>

</GridLayout>
31 changes: 31 additions & 0 deletions GridLayout/Sampler/res/layout-v14/table.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="2">

<TextView
android:layout_column="0"
android:layout_row="0"
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_column="1"
android:layout_row="0"
android:inputType="textPersonName">

<requestFocus/>
</EditText>

<TextView
android:layout_column="0"
android:layout_row="1"
android:text="@string/address"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_column="1"
android:layout_row="1"
android:inputType="textPostalAddress"/>

</GridLayout>
33 changes: 33 additions & 0 deletions GridLayout/Sampler/res/layout-v14/table_flex.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="2">

<TextView
android:layout_column="0"
android:layout_row="0"
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_column="1"
android:layout_row="0"
android:layout_gravity="fill_horizontal"
android:inputType="textPersonName">

<requestFocus/>
</EditText>

<TextView
android:layout_column="0"
android:layout_row="1"
android:text="@string/address"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
android:layout_column="1"
android:layout_row="1"
android:layout_gravity="fill_horizontal"
android:inputType="textPostalAddress"/>

</GridLayout>
17 changes: 17 additions & 0 deletions GridLayout/Sampler/res/layout/column.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.commonsware.android.gridlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:columnCount="1">

<Button
app:layout_column="0"
app:layout_row="0"
android:text="@string/button"/>

<Button
app:layout_column="0"
app:layout_row="1"
android:text="@string/button"/>

</android.support.v7.widget.GridLayout>
27 changes: 27 additions & 0 deletions GridLayout/Sampler/res/layout/implicit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.commonsware.android.gridlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:columnCount="2"
app:orientation="horizontal">

<TextView
android:text="@string/name"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
app:layout_gravity="fill_horizontal"
android:inputType="textPersonName">

<requestFocus/>
</EditText>

<TextView
android:text="@string/address"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<EditText
app:layout_gravity="fill_horizontal"
android:inputType="textPostalAddress"/>

</android.support.v7.widget.GridLayout>
Loading

0 comments on commit e7b3302

Please sign in to comment.