Removing third party cruft
@ -1,8 +0,0 @@
|
||||
ActionBarSherlock Plugins
|
||||
=========================
|
||||
|
||||
Modules provided in this folder are plugins which add functionality to the
|
||||
ActionBarSherlock library.
|
||||
|
||||
The requirements for implementing each pluging are detailed in the `README.md`
|
||||
file in each plugin folder.
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.actionbarsherlock.plugin.maps"
|
||||
android:versionCode="50"
|
||||
android:versionName="3.5.0">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="4"
|
||||
android:targetSdkVersion="13" />
|
||||
|
||||
</manifest>
|
||||
@ -1,18 +0,0 @@
|
||||
ActionBarSherlock Plugin: Maps
|
||||
==============================
|
||||
|
||||
This plugin provides support for the Google API `MapView` widget through an
|
||||
additional base activity, `FragmentMapActivity`. Your application must adhere
|
||||
to all of the regular requirements of implementing the [Google Map View][1].
|
||||
|
||||
By using `FragmentMapActivity` you are afforded the use of fragments, loaders,
|
||||
and the action bar--including support for using a `MapView` within a fragment.
|
||||
You can find examples of these implementations in the 'demos' sample.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[1]: http://developer.android.com/resources/tutorials/views/hello-mapview.html
|
||||
@ -1,115 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<!--module name="NewlineAtEndOfFile"/-->
|
||||
<module name="FileLength"/>
|
||||
<module name="FileTabCharacter"/>
|
||||
|
||||
<!-- Trailing spaces -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="message" value="Line has trailing spaces."/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<property name="cacheFile" value="${checkstyle.cache.file}"/>
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
||||
<!--module name="JavadocMethod"/-->
|
||||
<!--module name="JavadocType"/-->
|
||||
<!--module name="JavadocVariable"/-->
|
||||
<!--module name="JavadocStyle"/-->
|
||||
|
||||
|
||||
<!-- Checks for Naming Conventions. -->
|
||||
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
||||
<!--module name="ConstantName"/-->
|
||||
<!--module name="LocalFinalVariableName"/-->
|
||||
<!--module name="LocalVariableName"/-->
|
||||
<!--module name="MemberName"/-->
|
||||
<!--module name="MethodName"/-->
|
||||
<!--module name="PackageName"/-->
|
||||
<!--module name="ParameterName"/-->
|
||||
<!--module name="StaticVariableName"/-->
|
||||
<!--module name="TypeName"/-->
|
||||
|
||||
|
||||
<!-- Checks for imports -->
|
||||
<!-- See http://checkstyle.sf.net/config_import.html -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
||||
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
||||
<!--module name="LineLength"/-->
|
||||
<!--module name="MethodLength"/-->
|
||||
<!--module name="ParameterNumber"/-->
|
||||
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<!--module name="EmptyForIteratorPad"/-->
|
||||
<!--module name="MethodParamPad"/-->
|
||||
<!--module name="NoWhitespaceAfter"/-->
|
||||
<!--module name="NoWhitespaceBefore"/-->
|
||||
<!--module name="OperatorWrap"/-->
|
||||
<!--module name="ParenPad"/-->
|
||||
<!--module name="TypecastParenPad"/-->
|
||||
<!--module name="WhitespaceAfter"/-->
|
||||
<!--module name="WhitespaceAround"/-->
|
||||
|
||||
|
||||
<!-- Modifier Checks -->
|
||||
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
||||
<!--module name="ModifierOrder"/-->
|
||||
<!--module name="RedundantModifier"/-->
|
||||
|
||||
|
||||
<!-- Checks for blocks. You know, those {}'s -->
|
||||
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
||||
<!--module name="AvoidNestedBlocks"/-->
|
||||
<!--module name="EmptyBlock"/-->
|
||||
<!--module name="LeftCurly"/-->
|
||||
<!--module name="NeedBraces"/-->
|
||||
<!--module name="RightCurly"/-->
|
||||
|
||||
|
||||
<!-- Checks for common coding problems -->
|
||||
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
||||
<!--module name="AvoidInlineConditionals"/-->
|
||||
<!--module name="DoubleCheckedLocking"/--> <!-- MY FAVOURITE -->
|
||||
<!--module name="EmptyStatement"/-->
|
||||
<!--module name="EqualsHashCode"/-->
|
||||
<!--module name="HiddenField"/-->
|
||||
<!--module name="IllegalInstantiation"/-->
|
||||
<!--module name="InnerAssignment"/-->
|
||||
<!--module name="MagicNumber"/-->
|
||||
<!--module name="MissingSwitchDefault"/-->
|
||||
<!--module name="RedundantThrows"/-->
|
||||
<!--module name="SimplifyBooleanExpression"/-->
|
||||
<!--module name="SimplifyBooleanReturn"/-->
|
||||
|
||||
<!-- Checks for class design -->
|
||||
<!-- See http://checkstyle.sf.net/config_design.html -->
|
||||
<!--module name="DesignForExtension"/-->
|
||||
<!--module name="FinalClass"/-->
|
||||
<!--module name="HideUtilityClassConstructor"/-->
|
||||
<!--module name="InterfaceIsType"/-->
|
||||
<!--module name="VisibilityModifier"/-->
|
||||
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
||||
<!--module name="ArrayTypeStyle"/-->
|
||||
<!--module name="FinalParameters"/-->
|
||||
<!--module name="TodoComment"/-->
|
||||
<!--module name="UpperEll"/-->
|
||||
</module>
|
||||
</module>
|
||||
@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>plugin-maps</artifactId>
|
||||
<name>Plugin: Maps</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>parent-plugins</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.android.maps</groupId>
|
||||
<artifactId>maps</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>library</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${apk.prefix}-${project.artifactId}-${project.version}</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
||||
<artifactId>maven-android-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<configuration>
|
||||
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>checkstyle</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -1,13 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
android.library=true
|
||||
# Project target.
|
||||
target=Google Inc.:Google APIs:13
|
||||
android.library.reference.1=../../library
|
||||
@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
dir_maps_base = os.path.dirname(os.path.realpath(__file__))
|
||||
dir_repo_base = os.path.dirname(os.path.dirname(dir_maps_base))
|
||||
dir_lib_base = os.path.join(dir_repo_base, 'library')
|
||||
|
||||
path_to_source_activity = 'src/android/support/v4/app/FragmentActivity.java'.split('/')
|
||||
path_to_dest_activity = 'src/android/support/v4/app/FragmentMapActivity.java'.split('/')
|
||||
|
||||
file_source = os.path.join(dir_lib_base , *path_to_source_activity)
|
||||
file_dest = os.path.join(dir_maps_base, *path_to_dest_activity)
|
||||
|
||||
# Read in entire source file
|
||||
code = None
|
||||
with open(file_source) as f:
|
||||
code = f.read()
|
||||
|
||||
|
||||
code = code.split('\n')
|
||||
|
||||
# Add MapActivity import
|
||||
code.insert(31, 'import com.google.android.maps.MapActivity;')
|
||||
|
||||
code = '\n'.join(code)
|
||||
|
||||
# Class declaration
|
||||
code = code.replace('class FragmentActivity extends Activity', 'abstract class FragmentMapActivity extends MapActivity')
|
||||
|
||||
# TAG variable content
|
||||
code = code.replace('"FragmentActivity"', '"FragmentMapActivity"')
|
||||
|
||||
# Update inner class references
|
||||
code = code.replace('FragmentActivity.this', 'FragmentMapActivity.this')
|
||||
|
||||
# Class constructor
|
||||
code = code.replace('FragmentActivity()', 'FragmentMapActivity()')
|
||||
|
||||
# Javadoc
|
||||
code = code.replace('Fragment, and Loader APIs.', 'Fragment, Loader, and Google Map APIs.')
|
||||
|
||||
|
||||
# Exit stage left
|
||||
with open(file_dest, 'w') as f:
|
||||
f.write(code)
|
||||
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>parent-plugins</artifactId>
|
||||
<name>Plugins (Parent)</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>maps</module>
|
||||
<module>preference</module>
|
||||
</modules>
|
||||
</project>
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.actionbarsherlock.plugin.maps"
|
||||
android:versionCode="50"
|
||||
android:versionName="3.5.0">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="4"
|
||||
android:targetSdkVersion="13" />
|
||||
|
||||
</manifest>
|
||||
@ -1,5 +0,0 @@
|
||||
ActionBarSherlock Plugin: Preference
|
||||
====================================
|
||||
|
||||
This plugin provides support for an action bar enhanced preference screen
|
||||
through an additional base activity, `SherlockPreferenceActivity`.
|
||||
@ -1,115 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<!--module name="NewlineAtEndOfFile"/-->
|
||||
<module name="FileLength"/>
|
||||
<module name="FileTabCharacter"/>
|
||||
|
||||
<!-- Trailing spaces -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="message" value="Line has trailing spaces."/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<property name="cacheFile" value="${checkstyle.cache.file}"/>
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
||||
<!--module name="JavadocMethod"/-->
|
||||
<!--module name="JavadocType"/-->
|
||||
<!--module name="JavadocVariable"/-->
|
||||
<!--module name="JavadocStyle"/-->
|
||||
|
||||
|
||||
<!-- Checks for Naming Conventions. -->
|
||||
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
||||
<!--module name="ConstantName"/-->
|
||||
<!--module name="LocalFinalVariableName"/-->
|
||||
<!--module name="LocalVariableName"/-->
|
||||
<!--module name="MemberName"/-->
|
||||
<!--module name="MethodName"/-->
|
||||
<!--module name="PackageName"/-->
|
||||
<!--module name="ParameterName"/-->
|
||||
<!--module name="StaticVariableName"/-->
|
||||
<!--module name="TypeName"/-->
|
||||
|
||||
|
||||
<!-- Checks for imports -->
|
||||
<!-- See http://checkstyle.sf.net/config_import.html -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
||||
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
||||
<!--module name="LineLength"/-->
|
||||
<!--module name="MethodLength"/-->
|
||||
<!--module name="ParameterNumber"/-->
|
||||
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<!--module name="EmptyForIteratorPad"/-->
|
||||
<!--module name="MethodParamPad"/-->
|
||||
<!--module name="NoWhitespaceAfter"/-->
|
||||
<!--module name="NoWhitespaceBefore"/-->
|
||||
<!--module name="OperatorWrap"/-->
|
||||
<!--module name="ParenPad"/-->
|
||||
<!--module name="TypecastParenPad"/-->
|
||||
<!--module name="WhitespaceAfter"/-->
|
||||
<!--module name="WhitespaceAround"/-->
|
||||
|
||||
|
||||
<!-- Modifier Checks -->
|
||||
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
||||
<!--module name="ModifierOrder"/-->
|
||||
<!--module name="RedundantModifier"/-->
|
||||
|
||||
|
||||
<!-- Checks for blocks. You know, those {}'s -->
|
||||
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
||||
<!--module name="AvoidNestedBlocks"/-->
|
||||
<!--module name="EmptyBlock"/-->
|
||||
<!--module name="LeftCurly"/-->
|
||||
<!--module name="NeedBraces"/-->
|
||||
<!--module name="RightCurly"/-->
|
||||
|
||||
|
||||
<!-- Checks for common coding problems -->
|
||||
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
||||
<!--module name="AvoidInlineConditionals"/-->
|
||||
<!--module name="DoubleCheckedLocking"/--> <!-- MY FAVOURITE -->
|
||||
<!--module name="EmptyStatement"/-->
|
||||
<!--module name="EqualsHashCode"/-->
|
||||
<!--module name="HiddenField"/-->
|
||||
<!--module name="IllegalInstantiation"/-->
|
||||
<!--module name="InnerAssignment"/-->
|
||||
<!--module name="MagicNumber"/-->
|
||||
<!--module name="MissingSwitchDefault"/-->
|
||||
<!--module name="RedundantThrows"/-->
|
||||
<!--module name="SimplifyBooleanExpression"/-->
|
||||
<!--module name="SimplifyBooleanReturn"/-->
|
||||
|
||||
<!-- Checks for class design -->
|
||||
<!-- See http://checkstyle.sf.net/config_design.html -->
|
||||
<!--module name="DesignForExtension"/-->
|
||||
<!--module name="FinalClass"/-->
|
||||
<!--module name="HideUtilityClassConstructor"/-->
|
||||
<!--module name="InterfaceIsType"/-->
|
||||
<!--module name="VisibilityModifier"/-->
|
||||
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
||||
<!--module name="ArrayTypeStyle"/-->
|
||||
<!--module name="FinalParameters"/-->
|
||||
<!--module name="TodoComment"/-->
|
||||
<!--module name="UpperEll"/-->
|
||||
</module>
|
||||
</module>
|
||||
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>plugin-preference</artifactId>
|
||||
<name>Plugin: Preference</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>parent-plugins</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>android</groupId>
|
||||
<artifactId>android</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.actionbarsherlock</groupId>
|
||||
<artifactId>library</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${apk.prefix}-${project.artifactId}-${project.version}</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
||||
<artifactId>maven-android-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<configuration>
|
||||
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>checkstyle</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -1,13 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
android.library=true
|
||||
# Project target.
|
||||
target=android-13
|
||||
android.library.reference.1=../../library
|
||||
@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.cyrilmottier.android.gdcatalog"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-sdk android:minSdkVersion="4" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_gdcatalog"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.GDCatalog"
|
||||
android:name=".CatalogApplication">
|
||||
|
||||
<activity android:name=".CatalogActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".InfoTabActivity"
|
||||
android:label="@string/general_info_label"/>
|
||||
<activity android:name=".WebContentActivity" />
|
||||
<activity android:name=".AboutActivity" />
|
||||
|
||||
|
||||
<activity android:name=".BasicItemActivity" />
|
||||
<activity android:name=".XmlItemActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".TweakedItemViewActivity"
|
||||
android:theme="@style/Theme.GDCatalog.TweakedItems" />
|
||||
|
||||
<activity android:name=".SegmentedActivity" />
|
||||
<activity android:name=".ActionBarActivity" />
|
||||
<activity android:name=".TabbedActionBarActivity" />
|
||||
<activity android:name=".TabbedActionBarActivity$FakeActivity" />
|
||||
|
||||
<activity android:name=".QuickActionActivity" />
|
||||
<activity android:name=".SimpleAsyncImageViewActivity" />
|
||||
<activity android:name=".AsyncImageViewListActivity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -1,56 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
@ -1,14 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Indicates whether an apk should be generated for each density.
|
||||
split.density=false
|
||||
# Project target.
|
||||
target=android-8
|
||||
android.library.reference.1=../GreenDroid
|
||||
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:color="#f37300" />
|
||||
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:color="#ffba00" />
|
||||
|
||||
<item
|
||||
android:color="@color/gd_action_bar_tint" />
|
||||
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 996 B |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 676 B |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 550 B |
|
Before Width: | Height: | Size: 250 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 794 B |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 202 B |
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:startColor="#817f81"
|
||||
android:endColor="#ccc9cc"
|
||||
android:angle="90" />
|
||||
|
||||
</shape>
|
||||
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:drawable="@drawable/greendroid_application_logo_alt" />
|
||||
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:drawable="@drawable/greendroid_application_logo_alt" />
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/greendroid_application_logo_normal" />
|
||||
|
||||
</selector>
|
||||
@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:state_pressed="true"
|
||||
android:drawable="@drawable/ic_title_export_alt" />
|
||||
|
||||
<item
|
||||
android:state_focused="false"
|
||||
android:state_pressed="true"
|
||||
android:drawable="@drawable/ic_title_export_alt" />
|
||||
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:drawable="@drawable/ic_title_export_alt" />
|
||||
|
||||
<item
|
||||
android:state_focused="false"
|
||||
android:state_pressed="false"
|
||||
android:drawable="@drawable/ic_title_export_default" />
|
||||
|
||||
</selector>
|
||||
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="8dp"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/greendroid_logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/about"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:text="@string/about_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<com.cyrilmottier.android.gdcatalog.widget.HeadedTextItemView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/gd_separator_item_view" />
|
||||
|
||||
<include
|
||||
layout="@layout/gd_text_item_view" />
|
||||
|
||||
</com.cyrilmottier.android.gdcatalog.widget.HeadedTextItemView>
|
||||
@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:greendroid="http://schemas.android.com/apk/res/com.cyrilmottier.android.gdcatalog"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<greendroid.widget.AsyncImageView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
greendroid:defaultSrc="@drawable/ic_gdcatalog" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:drawable/bottom_bar"
|
||||
android:paddingTop="4dp">
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/show_image_1"
|
||||
android:onClick="onShowImage1" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/show_image_2"
|
||||
android:onClick="onShowImage2" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/show_image_3"
|
||||
android:onClick="onShowImage3" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:greendroid="http://schemas.android.com/apk/res/com.cyrilmottier.android.gdcatalog"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<greendroid.widget.AsyncImageView
|
||||
android:id="@+id/async_image"
|
||||
android:layout_width="@dimen/thumbnail_size"
|
||||
android:layout_height="@dimen/thumbnail_size"
|
||||
greendroid:defaultSrc="@drawable/ic_gdcatalog" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center_vertical|left" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<greendroid.widget.ActionBarHost
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@id/gd_action_bar_host"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<greendroid.widget.ActionBar
|
||||
android:id="@id/gd_action_bar"
|
||||
android:layout_height="@dimen/gd_action_bar_height"
|
||||
android:layout_width="fill_parent"
|
||||
android:background="?attr/gdActionBarBackground" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/gd_action_bar_content_view"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TabHost
|
||||
android:id="@android:id/tabhost"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingTop="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/more_info_on_greendroid"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:text="@string/app_url"
|
||||
android:textColor="@color/link"
|
||||
android:textStyle="bold"
|
||||
android:onClick="onAppUrlClicked" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TabWidget
|
||||
android:id="@android:id/tabs"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="-2dp"
|
||||
android:layout_marginRight="-2dp"
|
||||
android:background="@null" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@android:id/tabcontent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</TabHost>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</greendroid.widget.ActionBarHost>
|
||||
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:padding="5dp">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|top"
|
||||
android:text="QuickActionBar"
|
||||
android:onClick="onShowBar" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="QuickActionBar"
|
||||
android:onClick="onShowBar" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|bottom"
|
||||
android:text="QuickActionGrid"
|
||||
android:onClick="onShowGrid" />
|
||||
|
||||
</FrameLayout>
|
||||
@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<greendroid.widget.SegmentedHost
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/segmented_host"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/gd_segmented_content_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.0"
|
||||
android:foreground="@drawable/gd_shadow_bottom" />
|
||||
|
||||
<greendroid.widget.SegmentedBar
|
||||
android:id="@id/gd_segmented_bar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</greendroid.widget.SegmentedHost>
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<WebView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/web_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@android:color/white" />
|
||||
@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<string name="app_name">GDCatalog</string>
|
||||
<string name="app_url">http://github.com/cyrilmottier/GreenDroid</string>
|
||||
|
||||
<string name="more_info_on_greendroid">For more information on the GreenDroid library, go to the GitHub project\'s web page:</string>
|
||||
|
||||
<!-- Activities labels -->
|
||||
<string name="general_info_label">General information</string>
|
||||
<string name="basic_item_label">Basic items</string>
|
||||
<string name="xml_item_label">XML items</string>
|
||||
<string name="tweaked_item_view_label">Tweaked itemviews</string>
|
||||
<string name="segmented_label">SegmentedBar</string>
|
||||
<string name="action_bar_activity_label">ActionBarActivity</string>
|
||||
<string name="quick_action_label">QuickAction</string>
|
||||
<string name="simple_async_image_view_label">Simple AsyncImageView</string>
|
||||
<string name="async_image_view_list_view_label">AsyncImageView in ListView</string>
|
||||
|
||||
<string name="about">About</string>
|
||||
<string name="license">License</string>
|
||||
|
||||
<!-- String used in the SegmentedActivity -->
|
||||
<string name="segment_1">Jeff</string>
|
||||
<string name="segment_2">Romain</string>
|
||||
<string name="segment_3">Adam</string>
|
||||
<string name="segment_4">Dan</string>
|
||||
|
||||
<string name="show_image_1">Set image 1</string>
|
||||
<string name="show_image_2">Set image 2</string>
|
||||
<string name="show_image_3">Set image 3</string>
|
||||
|
||||
<string name="first_screen">First screen</string>
|
||||
|
||||
<string name="refresh_pressed">You\'ve just pressed a ActionBarItem.Type.Refresh button</string>
|
||||
<string name="custom_drawable">Custom drawable. Click on another item instead</string>
|
||||
|
||||
<string name="image_for_position">Image for position </string>
|
||||
|
||||
<string name="about_content">GreenDroid is a development library for the Android platform. It is intented to make UI developments easier and consistent through your applications.\n\nThe GreenDroid project has been initiated by <a href="http://www.cyrilmottier.com">Cyril Mottier</a></string>
|
||||
|
||||
</resources>
|
||||
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<string name="app_name">GDCatalog</string>
|
||||
<string name="app_url">http://github.com/cyrilmottier/GreenDroid</string>
|
||||
|
||||
<string name="more_info_on_greendroid">Pour obtenir plus d\'informations sur la bibliothèque GreenDroid, rendez vous sur la page GitHub du projet :</string>
|
||||
|
||||
<!-- Activities labels -->
|
||||
<string name="general_info_label">Informations générales</string>
|
||||
<string name="basic_item_label">Items basiques</string>
|
||||
<string name="xml_item_label">Items XML</string>
|
||||
<string name="tweaked_item_view_label">Itemviews personnalisées</string>
|
||||
<string name="segmented_label">Démo SegmentedBar</string>
|
||||
<string name="quick_action_label">Démo QuickAction</string>
|
||||
<string name="simple_async_image_view_label">AsyncImageView simple</string>
|
||||
<string name="async_image_view_list_view_label">AsyncImageView dans une ListView</string>
|
||||
|
||||
<string name="about">A propos</string>
|
||||
<string name="license">Licence</string>
|
||||
|
||||
<!-- String used in the SegmentedActivity -->
|
||||
<string name="segment_1">Jeff</string>
|
||||
<string name="segment_2">Romain</string>
|
||||
<string name="segment_3">Adam</string>
|
||||
<string name="segment_4">Dan</string>
|
||||
|
||||
<string name="show_image_1">Afficher l\'image 1</string>
|
||||
<string name="show_image_2">Afficher l\'image 2</string>
|
||||
<string name="show_image_3">Afficher l\'image 3</string>
|
||||
|
||||
</resources>
|
||||
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<dimen name="thumbnail_size">50dp</dimen>
|
||||
<dimen name="thumbnail_radius">5dp</dimen>
|
||||
|
||||
</resources>
|
||||
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<item type="id" name="action_bar_refresh" />
|
||||
<item type="id" name="action_bar_export" />
|
||||
<item type="id" name="action_bar_locate" />
|
||||
<item type="id" name="action_bar_view_info" />
|
||||
|
||||
</resources>
|
||||
@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<string name="app_name">GDCatalog</string>
|
||||
<string name="app_url">http://github.com/cyrilmottier/GreenDroid</string>
|
||||
|
||||
<string name="more_info_on_greendroid">For more information on the GreenDroid library, go to the GitHub project\'s web page:</string>
|
||||
|
||||
<!-- Activities labels -->
|
||||
<string name="general_info_label">General information</string>
|
||||
<string name="basic_item_label">Basic items</string>
|
||||
<string name="xml_item_label">XML items</string>
|
||||
<string name="tweaked_item_view_label">Tweaked itemviews</string>
|
||||
<string name="segmented_label">SegmentedBar</string>
|
||||
<string name="action_bar_activity_label">ActionBarActivity</string>
|
||||
<string name="quick_action_label">QuickAction</string>
|
||||
<string name="simple_async_image_view_label">Simple AsyncImageView</string>
|
||||
<string name="async_image_view_list_view_label">AsyncImageView in ListView</string>
|
||||
|
||||
<string name="about">About</string>
|
||||
<string name="license">License</string>
|
||||
|
||||
<!-- String used in the SegmentedActivity -->
|
||||
<string name="segment_1">Jeff</string>
|
||||
<string name="segment_2">Romain</string>
|
||||
<string name="segment_3">Adam</string>
|
||||
<string name="segment_4">Dan</string>
|
||||
|
||||
<string name="show_image_1">Set image 1</string>
|
||||
<string name="show_image_2">Set image 2</string>
|
||||
<string name="show_image_3">Set image 3</string>
|
||||
|
||||
<string name="first_screen">First screen</string>
|
||||
|
||||
<string name="refresh_pressed">You\'ve just pressed a ActionBarItem.Type.Refresh button</string>
|
||||
<string name="custom_drawable">Custom drawable. Click on another item instead</string>
|
||||
|
||||
<string name="image_for_position">Image for position </string>
|
||||
|
||||
<string name="about_content">GreenDroid is a development library for the Android platform. It is intented to make UI developments easier and consistent through your applications.\n\nThe GreenDroid project has been initiated by <a href="http://www.cyrilmottier.com">Cyril Mottier</a></string>
|
||||
|
||||
</resources>
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="SeparatorItemView" parent="GreenDroid.Widget.ItemView.SeparatorItemView">
|
||||
<item name="android:background">@drawable/separator_bg</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearanceLarge" parent="@style/TextAppearance.Large">
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.GDCatalog" parent="@style/Theme.GreenDroid.NoTitleBar">
|
||||
|
||||
<item name="gdActionBarTitleColor">@android:color/white</item>
|
||||
<item name="gdActionBarBackground">@drawable/action_bar_background</item>
|
||||
<item name="gdActionBarDividerDrawable">@drawable/action_bar_divider</item>
|
||||
<item name="gdActionBarDividerWidth">2px</item>
|
||||
<item name="gdActionBarApplicationDrawable">@drawable/greendroid_application_logo</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.GDCatalog.TweakedItems" parent="@style/Theme.GDCatalog">
|
||||
|
||||
<item name="gdTextAppearanceLarge">@style/TextAppearanceLarge</item>
|
||||
<item name="gdItemViewPreferredHeight">45dp</item>
|
||||
<item name="gdSeparatorItemViewStyle">@style/SeparatorItemView</item>
|
||||
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<item-array
|
||||
xmlns:greendroid="http://schemas.android.com/apk/res/com.cyrilmottier.android.gdcatalog">
|
||||
|
||||
<text-item
|
||||
greendroid:text="TextItem" />
|
||||
<text-item
|
||||
greendroid:enabled="false"
|
||||
greendroid:text="TextItem (disabled)" />
|
||||
<text-item
|
||||
greendroid:text="TextItem Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in." />
|
||||
<longtext-item
|
||||
greendroid:text="LongText Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in." />
|
||||
<description-item
|
||||
greendroid:text="DescriptionItem Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in." />
|
||||
<separator-item
|
||||
greendroid:text="SeparatorItem" />
|
||||
<progress-item
|
||||
greendroid:isInProgress="true"
|
||||
greendroid:text="ProgressItem" />
|
||||
<drawable-item
|
||||
greendroid:enabled="false"
|
||||
greendroid:text="DrawableItem (disabled)"
|
||||
greendroid:drawable="@drawable/ic_gdcatalog" />
|
||||
<drawable-item
|
||||
greendroid:text="DrawableItem (with no drawable)" />
|
||||
|
||||
<subtitle-item
|
||||
greendroid:text="SubtitleItem"
|
||||
greendroid:subtitle="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in." />
|
||||
|
||||
<subtext-item
|
||||
greendroid:text="SubtextItem"
|
||||
greendroid:subtext="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in." />
|
||||
|
||||
<thumbnail-item
|
||||
greendroid:text="ThumbnailItem"
|
||||
greendroid:subtitle="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."
|
||||
greendroid:thumbnail="@drawable/ic_gdcatalog" />
|
||||
|
||||
<thumbnail-item
|
||||
greendroid:enabled="false"
|
||||
greendroid:text="ThumbnailItem (disabled)"
|
||||
greendroid:subtitle="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."
|
||||
greendroid:thumbnail="@drawable/ic_gdcatalog" />
|
||||
|
||||
</item-array>
|
||||
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AboutActivity extends GDActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setActionBarContentView(R.layout.about);
|
||||
|
||||
final TextView aboutText = (TextView) findViewById(R.id.about);
|
||||
aboutText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import greendroid.widget.ActionBarItem;
|
||||
import greendroid.widget.LoaderActionBarItem;
|
||||
import greendroid.widget.ActionBarItem.Type;
|
||||
import greendroid.widget.NormalActionBarItem;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class ActionBarActivity extends GDActivity {
|
||||
|
||||
private final Handler mHandler = new Handler();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setActionBarContentView(R.layout.text);
|
||||
((TextView) findViewById(R.id.text)).setText(R.string.first_screen);
|
||||
|
||||
addActionBarItem(Type.Refresh, R.id.action_bar_refresh);
|
||||
addActionBarItem(getActionBar()
|
||||
.newActionBarItem(NormalActionBarItem.class)
|
||||
.setDrawable(R.drawable.ic_title_export)
|
||||
.setContentDescription(R.string.gd_export), R.id.action_bar_export);
|
||||
addActionBarItem(Type.Locate, R.id.action_bar_locate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_bar_locate:
|
||||
startActivity(new Intent(this, TabbedActionBarActivity.class));
|
||||
break;
|
||||
|
||||
case R.id.action_bar_refresh:
|
||||
final LoaderActionBarItem loaderItem = (LoaderActionBarItem) item;
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
loaderItem.setLoading(false);
|
||||
}
|
||||
}, 2000);
|
||||
Toast.makeText(this, R.string.refresh_pressed, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
case R.id.action_bar_export:
|
||||
Toast.makeText(this, R.string.custom_drawable, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
default:
|
||||
return super.onHandleActionBarItemClick(item, position);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,170 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDListActivity;
|
||||
import greendroid.image.ImageProcessor;
|
||||
import greendroid.widget.AsyncImageView;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AbsListView.OnScrollListener;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AsyncImageViewListActivity extends GDListActivity implements OnScrollListener {
|
||||
|
||||
private static final String BASE_URL_PREFIX = "http://www.cyrilmottier.com/files/greendroid/images/image";
|
||||
private static final String BASE_URL_SUFFIX = ".png";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setListAdapter(new MyAdapter(this));
|
||||
getListView().setOnScrollListener(this);
|
||||
}
|
||||
|
||||
private static class MyAdapter extends BaseAdapter implements ImageProcessor {
|
||||
|
||||
private static final StringBuilder BUILDER = new StringBuilder();
|
||||
|
||||
private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private final Rect mRectSrc = new Rect();
|
||||
private final Rect mRectDest = new Rect();
|
||||
private final String mImageForPosition;
|
||||
|
||||
static class ViewHolder {
|
||||
public AsyncImageView imageView;
|
||||
public TextView textView;
|
||||
public StringBuilder textBuilder = new StringBuilder();
|
||||
}
|
||||
|
||||
private Bitmap mMask;
|
||||
private int mThumbnailSize;
|
||||
private int mThumbnailRadius;
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public MyAdapter(Context context) {
|
||||
mInflater = LayoutInflater.from(context);
|
||||
|
||||
mImageForPosition = context.getString(R.string.image_for_position);
|
||||
|
||||
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
|
||||
|
||||
mThumbnailSize = context.getResources().getDimensionPixelSize(R.dimen.thumbnail_size);
|
||||
mThumbnailRadius = context.getResources().getDimensionPixelSize(R.dimen.thumbnail_radius);
|
||||
|
||||
prepareMask();
|
||||
}
|
||||
|
||||
private void prepareMask() {
|
||||
mMask = Bitmap.createBitmap(mThumbnailSize, mThumbnailSize, Bitmap.Config.ARGB_8888);
|
||||
|
||||
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
paint.setColor(Color.RED);
|
||||
paint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
|
||||
Canvas c = new Canvas(mMask);
|
||||
c.drawRoundRect(new RectF(0, 0, mThumbnailSize, mThumbnailSize), mThumbnailRadius, mThumbnailRadius, paint);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
public Object getItem(int position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
ViewHolder holder;
|
||||
|
||||
if (convertView == null) {
|
||||
convertView = mInflater.inflate(R.layout.image_item_view, parent, false);
|
||||
holder = new ViewHolder();
|
||||
holder.imageView = (AsyncImageView) convertView.findViewById(R.id.async_image);
|
||||
holder.imageView.setImageProcessor(this);
|
||||
holder.textView = (TextView) convertView.findViewById(R.id.text);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
BUILDER.setLength(0);
|
||||
BUILDER.append(BASE_URL_PREFIX);
|
||||
BUILDER.append(position);
|
||||
BUILDER.append(BASE_URL_SUFFIX);
|
||||
holder.imageView.setUrl(BUILDER.toString());
|
||||
|
||||
final StringBuilder textBuilder = holder.textBuilder;
|
||||
textBuilder.setLength(0);
|
||||
textBuilder.append(mImageForPosition);
|
||||
textBuilder.append(position);
|
||||
holder.textView.setText(textBuilder);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public Bitmap processImage(Bitmap bitmap) {
|
||||
Bitmap result = Bitmap.createBitmap(mThumbnailSize, mThumbnailSize, Bitmap.Config.ARGB_8888);
|
||||
Canvas c = new Canvas(result);
|
||||
|
||||
mRectSrc.set(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||
mRectDest.set(0, 0, mThumbnailSize, mThumbnailSize);
|
||||
c.drawBitmap(bitmap, mRectSrc, mRectDest, null);
|
||||
c.drawBitmap(mMask, 0, 0, mPaint);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) {
|
||||
}
|
||||
|
||||
public void onScrollStateChanged(AbsListView listView, int scrollState) {
|
||||
if (getListView() == listView) {
|
||||
searchAsyncImageViews(listView, scrollState == OnScrollListener.SCROLL_STATE_FLING);
|
||||
}
|
||||
}
|
||||
|
||||
private void searchAsyncImageViews(ViewGroup viewGroup, boolean pause) {
|
||||
final int childCount = viewGroup.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
AsyncImageView image = (AsyncImageView) viewGroup.getChildAt(i).findViewById(R.id.async_image);
|
||||
if (image != null) {
|
||||
image.setPaused(pause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDListActivity;
|
||||
import greendroid.widget.ItemAdapter;
|
||||
import greendroid.widget.item.DescriptionItem;
|
||||
import greendroid.widget.item.DrawableItem;
|
||||
import greendroid.widget.item.Item;
|
||||
import greendroid.widget.item.ProgressItem;
|
||||
import greendroid.widget.item.SeparatorItem;
|
||||
import greendroid.widget.item.TextItem;
|
||||
import greendroid.widget.item.ThumbnailItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
public class BasicItemActivity extends GDListActivity {
|
||||
|
||||
private final Handler mHandler = new Handler();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
List<Item> items = new ArrayList<Item>();
|
||||
|
||||
items.add(new SeparatorItem("Class 1"));
|
||||
items.add(new ThumbnailItem("Powered paragliding", "aka paramotoring", R.drawable.class1));
|
||||
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
|
||||
|
||||
items.add(new SeparatorItem("Class 2"));
|
||||
items.add(new DrawableItem("Trikes", R.drawable.class2));
|
||||
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
|
||||
|
||||
items.add(new SeparatorItem("Class 3"));
|
||||
items.add(new ThumbnailItem("Multi-axis", "Looks like a tiny plane", R.drawable.class3));
|
||||
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
|
||||
|
||||
items.add(new SeparatorItem("Class 4"));
|
||||
items.add(new ThumbnailItem("Auto-gyro", "A scary helicopter", R.drawable.class4));
|
||||
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
|
||||
|
||||
items.add(new SeparatorItem("Class 5"));
|
||||
items.add(new DrawableItem("Hot air baloon", R.drawable.class5));
|
||||
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
|
||||
|
||||
final Item item1 = new SeparatorItem("Class 6");
|
||||
final Item item2 = new TextItem("Airbus/Boeing planes");
|
||||
final Item item3 = new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in.");
|
||||
items.add(item1);
|
||||
items.add(item2);
|
||||
items.add(item3);
|
||||
|
||||
final ProgressItem progressItem = new ProgressItem("Removing intruders", true);
|
||||
items.add(progressItem);
|
||||
|
||||
final ItemAdapter adapter = new ItemAdapter(this, items);
|
||||
setListAdapter(adapter);
|
||||
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
adapter.remove(item1);
|
||||
adapter.remove(item2);
|
||||
adapter.remove(item3);
|
||||
adapter.remove(progressItem);
|
||||
adapter.insert(new ThumbnailItem("Ultralight aviation", "List of French 'ULM' classes", R.drawable.ic_gdcatalog), 0);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
},8000);
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDListActivity;
|
||||
import greendroid.graphics.drawable.ActionBarDrawable;
|
||||
import greendroid.widget.ActionBarItem;
|
||||
import greendroid.widget.ItemAdapter;
|
||||
import greendroid.widget.NormalActionBarItem;
|
||||
import greendroid.widget.item.TextItem;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
|
||||
public class CatalogActivity extends GDListActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ItemAdapter adapter = new ItemAdapter(this);
|
||||
adapter.add(createTextItem(R.string.basic_item_label, BasicItemActivity.class));
|
||||
adapter.add(createTextItem(R.string.xml_item_label, XmlItemActivity.class));
|
||||
adapter.add(createTextItem(R.string.tweaked_item_view_label, TweakedItemViewActivity.class));
|
||||
adapter.add(createTextItem(R.string.segmented_label, SegmentedActivity.class));
|
||||
adapter.add(createTextItem(R.string.action_bar_activity_label, ActionBarActivity.class));
|
||||
adapter.add(createTextItem(R.string.quick_action_label, QuickActionActivity.class));
|
||||
adapter.add(createTextItem(R.string.simple_async_image_view_label, SimpleAsyncImageViewActivity.class));
|
||||
adapter.add(createTextItem(R.string.async_image_view_list_view_label, AsyncImageViewListActivity.class));
|
||||
|
||||
setListAdapter(adapter);
|
||||
|
||||
addActionBarItem(getActionBar()
|
||||
.newActionBarItem(NormalActionBarItem.class)
|
||||
.setDrawable(new ActionBarDrawable(getResources(), R.drawable.ic_action_bar_info)), R.id.action_bar_view_info);
|
||||
}
|
||||
|
||||
private TextItem createTextItem(int stringId, Class<?> klass) {
|
||||
final TextItem textItem = new TextItem(getString(stringId));
|
||||
textItem.setTag(klass);
|
||||
return textItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
final TextItem textItem = (TextItem) l.getAdapter().getItem(position);
|
||||
Intent intent = new Intent(CatalogActivity.this, (Class<?>) textItem.getTag());
|
||||
intent.putExtra(ActionBarActivity.GD_ACTION_BAR_TITLE, textItem.text);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_bar_view_info:
|
||||
startActivity(new Intent(this, InfoTabActivity.class));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onHandleActionBarItemClick(item, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import greendroid.app.GDApplication;
|
||||
|
||||
public class CatalogApplication extends GDApplication {
|
||||
|
||||
@Override
|
||||
public Class<?> getHomeActivityClass() {
|
||||
return CatalogActivity.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent getMainApplicationIntent() {
|
||||
return new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_url)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import greendroid.app.ActionBarActivity;
|
||||
import greendroid.app.GDTabActivity;
|
||||
|
||||
public class InfoTabActivity extends GDTabActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.info);
|
||||
|
||||
final String aboutText = getString(R.string.about);
|
||||
final Intent aboutIntent = new Intent(this, AboutActivity.class);
|
||||
aboutIntent.putExtra(ActionBarActivity.GD_ACTION_BAR_VISIBILITY, View.GONE);
|
||||
addTab(aboutText, aboutText, aboutIntent);
|
||||
|
||||
final String licenseText = getString(R.string.license);
|
||||
final Intent licenseIntent = new Intent(this, WebContentActivity.class);
|
||||
licenseIntent.putExtra(ActionBarActivity.GD_ACTION_BAR_VISIBILITY, View.GONE);
|
||||
licenseIntent.putExtra(WebContentActivity.EXTRA_CONTENT_URL, "file:///android_asset/LICENSE.txt");
|
||||
addTab(licenseText, licenseText, licenseIntent);
|
||||
}
|
||||
|
||||
public void onAppUrlClicked(View v) {
|
||||
final Uri appUri = Uri.parse(getString(R.string.app_url));
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, appUri));
|
||||
}
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import greendroid.widget.ActionBarItem;
|
||||
import greendroid.widget.ActionBarItem.Type;
|
||||
import greendroid.widget.QuickAction;
|
||||
import greendroid.widget.QuickActionBar;
|
||||
import greendroid.widget.QuickActionGrid;
|
||||
import greendroid.widget.QuickActionWidget;
|
||||
import greendroid.widget.QuickActionWidget.OnQuickActionClickListener;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class QuickActionActivity extends GDActivity {
|
||||
|
||||
private QuickActionWidget mBar;
|
||||
private QuickActionWidget mGrid;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setActionBarContentView(R.layout.quick_action);
|
||||
|
||||
prepareQuickActionBar();
|
||||
prepareQuickActionGrid();
|
||||
|
||||
addActionBarItem(Type.Edit);
|
||||
}
|
||||
|
||||
public void onShowGrid(View v) {
|
||||
mGrid.show(v);
|
||||
}
|
||||
|
||||
public void onShowBar(View v) {
|
||||
mBar.show(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
|
||||
|
||||
switch (position) {
|
||||
case 0:
|
||||
onShowGrid(item.getItemView());
|
||||
break;
|
||||
|
||||
default:
|
||||
return super.onHandleActionBarItemClick(item, position);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void prepareQuickActionBar() {
|
||||
mBar = new QuickActionBar(this);
|
||||
mBar.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_compose, R.string.gd_compose));
|
||||
mBar.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_export, R.string.gd_export));
|
||||
mBar.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_share, R.string.gd_share));
|
||||
|
||||
mBar.setOnQuickActionClickListener(mActionListener);
|
||||
}
|
||||
|
||||
private void prepareQuickActionGrid() {
|
||||
mGrid = new QuickActionGrid(this);
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_compose, R.string.gd_compose));
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_export, R.string.gd_export));
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_share, R.string.gd_share));
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_search, R.string.gd_search));
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_edit, R.string.gd_edit));
|
||||
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_locate, R.string.gd_locate));
|
||||
|
||||
mGrid.setOnQuickActionClickListener(mActionListener);
|
||||
}
|
||||
|
||||
private OnQuickActionClickListener mActionListener = new OnQuickActionClickListener() {
|
||||
public void onQuickActionClicked(QuickActionWidget widget, int position) {
|
||||
Toast.makeText(QuickActionActivity.this, "Item " + position + " clicked", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
};
|
||||
|
||||
private static class MyQuickAction extends QuickAction {
|
||||
|
||||
private static final ColorFilter BLACK_CF = new LightingColorFilter(Color.BLACK, Color.BLACK);
|
||||
|
||||
public MyQuickAction(Context ctx, int drawableId, int titleId) {
|
||||
super(ctx, buildDrawable(ctx, drawableId), titleId);
|
||||
}
|
||||
|
||||
private static Drawable buildDrawable(Context ctx, int drawableId) {
|
||||
Drawable d = ctx.getResources().getDrawable(drawableId);
|
||||
d.setColorFilter(BLACK_CF);
|
||||
return d;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import greendroid.widget.SegmentedAdapter;
|
||||
import greendroid.widget.SegmentedHost;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class SegmentedActivity extends GDActivity {
|
||||
|
||||
private final Handler mHandler = new Handler();
|
||||
private PeopleSegmentedAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setActionBarContentView(R.layout.segmented_controls);
|
||||
|
||||
SegmentedHost segmentedHost = (SegmentedHost) findViewById(R.id.segmented_host);
|
||||
|
||||
mAdapter = new PeopleSegmentedAdapter();
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
mAdapter.mReverse = true;
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}, 4000);
|
||||
|
||||
segmentedHost.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
private class PeopleSegmentedAdapter extends SegmentedAdapter {
|
||||
|
||||
public boolean mReverse = false;
|
||||
|
||||
@Override
|
||||
public View getView(int position, ViewGroup parent) {
|
||||
TextView textView = (TextView) getLayoutInflater().inflate(R.layout.text, parent, false);
|
||||
textView.setText(getSegmentTitle(position));
|
||||
return textView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSegmentTitle(int position) {
|
||||
|
||||
switch (mReverse ? ((getCount() - 1) - position) : position) {
|
||||
case 0:
|
||||
return getString(R.string.segment_1);
|
||||
case 1:
|
||||
return getString(R.string.segment_2);
|
||||
case 2:
|
||||
return getString(R.string.segment_3);
|
||||
case 3:
|
||||
return getString(R.string.segment_4);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import greendroid.widget.AsyncImageView;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
public class SimpleAsyncImageViewActivity extends GDActivity {
|
||||
|
||||
private static final String URLS_1 = "https://lh3.googleusercontent.com/_OHO4y8YcQbs/SoWDYIhFrjI/AAAAAAAAKX4/ETS4JGuUYX0/s400/P1080412.JPG";
|
||||
private static final String URLS_2 = "https://lh6.googleusercontent.com/_OHO4y8YcQbs/So4a6aWih3I/AAAAAAAAKts/hGFcqaHsCuI/s400/P1080809.JPG";
|
||||
private static final String URLS_3 = "https://lh4.googleusercontent.com/_OHO4y8YcQbs/SSYGHclokDI/AAAAAAAAFUs/qNyvU-4o5eI/s400/P1040275.JPG";
|
||||
|
||||
private AsyncImageView mImageView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setActionBarContentView(R.layout.image);
|
||||
mImageView = (AsyncImageView) findViewById(R.id.image_view);
|
||||
}
|
||||
|
||||
public void onShowImage1(View v) {
|
||||
mImageView.setUrl(URLS_1);
|
||||
}
|
||||
|
||||
public void onShowImage2(View v) {
|
||||
mImageView.setUrl(URLS_2);
|
||||
}
|
||||
|
||||
public void onShowImage3(View v) {
|
||||
mImageView.setUrl(URLS_3);
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDTabActivity;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class TabbedActionBarActivity extends GDTabActivity {
|
||||
|
||||
private static final String TAB1 = "tab_one";
|
||||
private static final String TAB2 = "tab_two";
|
||||
private static final String TAB3 = "tab_three";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTitle("Screen 2");
|
||||
|
||||
addTab(TAB1, "Tab One", Color.BLACK, "Content of tab #1");
|
||||
addTab(TAB2, "Tab Two", Color.rgb(20, 20, 20), "Content of tab #2");
|
||||
addTab(TAB3, "Tab Three", Color.rgb(40, 40, 40), "Content of tab #3");
|
||||
}
|
||||
|
||||
private void addTab(String tag, CharSequence label, int color, String text) {
|
||||
final Intent intent = new Intent(this, FakeActivity.class);
|
||||
intent.putExtra(FakeActivity.EXTRA_COLOR, color);
|
||||
intent.putExtra(FakeActivity.EXTRA_TEXT, text);
|
||||
addTab(tag, label, intent);
|
||||
}
|
||||
|
||||
public static class FakeActivity extends Activity {
|
||||
|
||||
public static final String EXTRA_COLOR = "com.cyrilmottier.android.gdcatalog.TabbedActionBarActivity$FakeActivity.extraColor";
|
||||
public static final String EXTRA_TEXT = "com.cyrilmottier.android.gdcatalog.TabbedActionBarActivity$FakeActivity.extraText";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final Intent intent = getIntent();
|
||||
|
||||
if (intent != null) {
|
||||
setContentView(R.layout.text);
|
||||
|
||||
TextView textView = (TextView) findViewById(R.id.text);
|
||||
textView.setText(intent.getStringExtra(EXTRA_TEXT));
|
||||
textView.setBackgroundColor(intent.getIntExtra(EXTRA_COLOR, Color.WHITE));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,523 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDListActivity;
|
||||
import greendroid.widget.ItemAdapter;
|
||||
import greendroid.widget.item.Item;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.CharArrayBuffer;
|
||||
import android.database.ContentObserver;
|
||||
import android.database.Cursor;
|
||||
import android.database.DataSetObserver;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AlphabetIndexer;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.SectionIndexer;
|
||||
|
||||
import com.cyrilmottier.android.gdcatalog.widget.HeadedTextItem;
|
||||
|
||||
public class TweakedItemViewActivity extends GDListActivity {
|
||||
|
||||
private static final String SECTIONS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
private static final HeadedTextItem CHEESES[] = {
|
||||
new HeadedTextItem("Abbaye de Belloc"), new HeadedTextItem("Abbaye du Mont des Cats"),
|
||||
new HeadedTextItem("Abertam"), new HeadedTextItem("Abondance"), new HeadedTextItem("Ackawi"),
|
||||
new HeadedTextItem("Acorn"), new HeadedTextItem("Adelost"), new HeadedTextItem("Affidelice au Chablis"),
|
||||
new HeadedTextItem("Afuega'l Pitu"), new HeadedTextItem("Airag"), new HeadedTextItem("Airedale"),
|
||||
new HeadedTextItem("Aisy Cendre"), new HeadedTextItem("Allgauer Emmentaler"),
|
||||
new HeadedTextItem("Alverca"), new HeadedTextItem("Ambert"), new HeadedTextItem("American Cheese"),
|
||||
new HeadedTextItem("Ami du Chambertin"), new HeadedTextItem("Anejo Enchilado"),
|
||||
new HeadedTextItem("Anneau du Vic-Bilh"), new HeadedTextItem("Anthoriro"), new HeadedTextItem("Appenzell"),
|
||||
new HeadedTextItem("Aragon"), new HeadedTextItem("Ardi Gasna"), new HeadedTextItem("Ardrahan"),
|
||||
new HeadedTextItem("Armenian String"), new HeadedTextItem("Aromes au Gene de Marc"),
|
||||
new HeadedTextItem("Asadero"), new HeadedTextItem("Asiago"), new HeadedTextItem("Aubisque Pyrenees"),
|
||||
new HeadedTextItem("Autun"), new HeadedTextItem("Avaxtskyr"), new HeadedTextItem("Baby Swiss"),
|
||||
new HeadedTextItem("Babybel"), new HeadedTextItem("Baguette Laonnaise"), new HeadedTextItem("Bakers"),
|
||||
new HeadedTextItem("Baladi"), new HeadedTextItem("Balaton"), new HeadedTextItem("Bandal"),
|
||||
new HeadedTextItem("Banon"), new HeadedTextItem("Barry's Bay Cheddar"), new HeadedTextItem("Basing"),
|
||||
new HeadedTextItem("Basket Cheese"), new HeadedTextItem("Bath Cheese"),
|
||||
new HeadedTextItem("Bavarian Bergkase"), new HeadedTextItem("Baylough"), new HeadedTextItem("Beaufort"),
|
||||
new HeadedTextItem("Beauvoorde"), new HeadedTextItem("Beenleigh Blue"), new HeadedTextItem("Beer Cheese"),
|
||||
new HeadedTextItem("Bel Paese"), new HeadedTextItem("Bergader"), new HeadedTextItem("Bergere Bleue"),
|
||||
new HeadedTextItem("Berkswell"), new HeadedTextItem("Beyaz Peynir"), new HeadedTextItem("Bierkase"),
|
||||
new HeadedTextItem("Bishop Kennedy"), new HeadedTextItem("Blarney"), new HeadedTextItem("Bleu d'Auvergne"),
|
||||
new HeadedTextItem("Bleu de Gex"), new HeadedTextItem("Bleu de Laqueuille"),
|
||||
new HeadedTextItem("Bleu de Septmoncel"), new HeadedTextItem("Bleu Des Causses"),
|
||||
new HeadedTextItem("Blue"), new HeadedTextItem("Blue Castello"), new HeadedTextItem("Blue Rathgore"),
|
||||
new HeadedTextItem("Blue Vein (Australian)"), new HeadedTextItem("Blue Vein Cheeses"),
|
||||
new HeadedTextItem("Bocconcini"), new HeadedTextItem("Bocconcini (Australian)"),
|
||||
new HeadedTextItem("Boeren Leidenkaas"), new HeadedTextItem("Bonchester"), new HeadedTextItem("Bosworth"),
|
||||
new HeadedTextItem("Bougon"), new HeadedTextItem("Boule Du Roves"),
|
||||
new HeadedTextItem("Boulette d'Avesnes"), new HeadedTextItem("Boursault"), new HeadedTextItem("Boursin"),
|
||||
new HeadedTextItem("Bouyssou"), new HeadedTextItem("Bra"), new HeadedTextItem("Braudostur"),
|
||||
new HeadedTextItem("Breakfast Cheese"), new HeadedTextItem("Brebis du Lavort"),
|
||||
new HeadedTextItem("Brebis du Lochois"), new HeadedTextItem("Brebis du Puyfaucon"),
|
||||
new HeadedTextItem("Bresse Bleu"), new HeadedTextItem("Brick"), new HeadedTextItem("Brie"),
|
||||
new HeadedTextItem("Brie de Meaux"), new HeadedTextItem("Brie de Melun"),
|
||||
new HeadedTextItem("Brillat-Savarin"), new HeadedTextItem("Brin"), new HeadedTextItem("Brin d' Amour"),
|
||||
new HeadedTextItem("Brin d'Amour"), new HeadedTextItem("Brinza (Burduf Brinza)"),
|
||||
new HeadedTextItem("Briquette de Brebis"), new HeadedTextItem("Briquette du Forez"),
|
||||
new HeadedTextItem("Broccio"), new HeadedTextItem("Broccio Demi-Affine"),
|
||||
new HeadedTextItem("Brousse du Rove"), new HeadedTextItem("Bruder Basil"),
|
||||
new HeadedTextItem("Brusselae Kaas (Fromage de Bruxelles)"), new HeadedTextItem("Bryndza"),
|
||||
new HeadedTextItem("Buchette d'Anjou"), new HeadedTextItem("Buffalo"), new HeadedTextItem("Burgos"),
|
||||
new HeadedTextItem("Butte"), new HeadedTextItem("Butterkase"), new HeadedTextItem("Button (Innes)"),
|
||||
new HeadedTextItem("Buxton Blue"), new HeadedTextItem("Cabecou"), new HeadedTextItem("Caboc"),
|
||||
new HeadedTextItem("Cabrales"), new HeadedTextItem("Cachaille"), new HeadedTextItem("Caciocavallo"),
|
||||
new HeadedTextItem("Caciotta"), new HeadedTextItem("Caerphilly"), new HeadedTextItem("Cairnsmore"),
|
||||
new HeadedTextItem("Calenzana"), new HeadedTextItem("Cambazola"),
|
||||
new HeadedTextItem("Camembert de Normandie"), new HeadedTextItem("Canadian Cheddar"),
|
||||
new HeadedTextItem("Canestrato"), new HeadedTextItem("Cantal"), new HeadedTextItem("Caprice des Dieux"),
|
||||
new HeadedTextItem("Capricorn Goat"), new HeadedTextItem("Capriole Banon"),
|
||||
new HeadedTextItem("Carre de l'Est"), new HeadedTextItem("Casciotta di Urbino"),
|
||||
new HeadedTextItem("Cashel Blue"), new HeadedTextItem("Castellano"), new HeadedTextItem("Castelleno"),
|
||||
new HeadedTextItem("Castelmagno"), new HeadedTextItem("Castelo Branco"), new HeadedTextItem("Castigliano"),
|
||||
new HeadedTextItem("Cathelain"), new HeadedTextItem("Celtic Promise"),
|
||||
new HeadedTextItem("Cendre d'Olivet"), new HeadedTextItem("Cerney"), new HeadedTextItem("Chabichou"),
|
||||
new HeadedTextItem("Chabichou du Poitou"), new HeadedTextItem("Chabis de Gatine"),
|
||||
new HeadedTextItem("Chaource"), new HeadedTextItem("Charolais"), new HeadedTextItem("Chaumes"),
|
||||
new HeadedTextItem("Cheddar"), new HeadedTextItem("Cheddar Clothbound"), new HeadedTextItem("Cheshire"),
|
||||
new HeadedTextItem("Chevres"), new HeadedTextItem("Chevrotin des Aravis"),
|
||||
new HeadedTextItem("Chontaleno"), new HeadedTextItem("Civray"),
|
||||
new HeadedTextItem("Coeur de Camembert au Calvados"), new HeadedTextItem("Coeur de Chevre"),
|
||||
new HeadedTextItem("Colby"), new HeadedTextItem("Cold Pack"), new HeadedTextItem("Comte"),
|
||||
new HeadedTextItem("Coolea"), new HeadedTextItem("Cooleney"), new HeadedTextItem("Coquetdale"),
|
||||
new HeadedTextItem("Corleggy"), new HeadedTextItem("Cornish Pepper"), new HeadedTextItem("Cotherstone"),
|
||||
new HeadedTextItem("Cotija"), new HeadedTextItem("Cottage Cheese"),
|
||||
new HeadedTextItem("Cottage Cheese (Australian)"), new HeadedTextItem("Cougar Gold"),
|
||||
new HeadedTextItem("Coulommiers"), new HeadedTextItem("Coverdale"), new HeadedTextItem("Crayeux de Roncq"),
|
||||
new HeadedTextItem("Cream Cheese"), new HeadedTextItem("Cream Havarti"), new HeadedTextItem("Crema Agria"),
|
||||
new HeadedTextItem("Crema Mexicana"), new HeadedTextItem("Creme Fraiche"), new HeadedTextItem("Crescenza"),
|
||||
new HeadedTextItem("Croghan"), new HeadedTextItem("Crottin de Chavignol"),
|
||||
new HeadedTextItem("Crottin du Chavignol"), new HeadedTextItem("Crowdie"), new HeadedTextItem("Crowley"),
|
||||
new HeadedTextItem("Cuajada"), new HeadedTextItem("Curd"), new HeadedTextItem("Cure Nantais"),
|
||||
new HeadedTextItem("Curworthy"), new HeadedTextItem("Cwmtawe Pecorino"),
|
||||
new HeadedTextItem("Cypress Grove Chevre"), new HeadedTextItem("Danablu (Danish Blue)"),
|
||||
new HeadedTextItem("Danbo"), new HeadedTextItem("Danish Fontina"), new HeadedTextItem("Daralagjazsky"),
|
||||
new HeadedTextItem("Dauphin"), new HeadedTextItem("Delice des Fiouves"),
|
||||
new HeadedTextItem("Denhany Dorset Drum"), new HeadedTextItem("Derby"),
|
||||
new HeadedTextItem("Dessertnyj Belyj"), new HeadedTextItem("Devon Blue"),
|
||||
new HeadedTextItem("Devon Garland"), new HeadedTextItem("Dolcelatte"), new HeadedTextItem("Doolin"),
|
||||
new HeadedTextItem("Doppelrhamstufel"), new HeadedTextItem("Dorset Blue Vinney"),
|
||||
new HeadedTextItem("Double Gloucester"), new HeadedTextItem("Double Worcester"),
|
||||
new HeadedTextItem("Dreux a la Feuille"), new HeadedTextItem("Dry Jack"),
|
||||
new HeadedTextItem("Duddleswell"), new HeadedTextItem("Dunbarra"), new HeadedTextItem("Dunlop"),
|
||||
new HeadedTextItem("Dunsyre Blue"), new HeadedTextItem("Duroblando"), new HeadedTextItem("Durrus"),
|
||||
new HeadedTextItem("Dutch Mimolette (Commissiekaas)"), new HeadedTextItem("Edam"),
|
||||
new HeadedTextItem("Edelpilz"), new HeadedTextItem("Emental Grand Cru"), new HeadedTextItem("Emlett"),
|
||||
new HeadedTextItem("Emmental"), new HeadedTextItem("Epoisses de Bourgogne"),
|
||||
new HeadedTextItem("Esbareich"), new HeadedTextItem("Esrom"), new HeadedTextItem("Etorki"),
|
||||
new HeadedTextItem("Evansdale Farmhouse Brie"), new HeadedTextItem("Evora De L'Alentejo"),
|
||||
new HeadedTextItem("Exmoor Blue"), new HeadedTextItem("Explorateur"), new HeadedTextItem("Feta"),
|
||||
new HeadedTextItem("Feta (Australian)"), new HeadedTextItem("Figue"), new HeadedTextItem("Filetta"),
|
||||
new HeadedTextItem("Fin-de-Siecle"), new HeadedTextItem("Finlandia Swiss"), new HeadedTextItem("Finn"),
|
||||
new HeadedTextItem("Fiore Sardo"), new HeadedTextItem("Fleur du Maquis"),
|
||||
new HeadedTextItem("Flor de Guia"), new HeadedTextItem("Flower Marie"), new HeadedTextItem("Folded"),
|
||||
new HeadedTextItem("Folded cheese with mint"), new HeadedTextItem("Fondant de Brebis"),
|
||||
new HeadedTextItem("Fontainebleau"), new HeadedTextItem("Fontal"),
|
||||
new HeadedTextItem("Fontina Val d'Aosta"), new HeadedTextItem("Formaggio di capra"),
|
||||
new HeadedTextItem("Fougerus"), new HeadedTextItem("Four Herb Gouda"),
|
||||
new HeadedTextItem("Fourme d' Ambert"), new HeadedTextItem("Fourme de Haute Loire"),
|
||||
new HeadedTextItem("Fourme de Montbrison"), new HeadedTextItem("Fresh Jack"),
|
||||
new HeadedTextItem("Fresh Mozzarella"), new HeadedTextItem("Fresh Ricotta"),
|
||||
new HeadedTextItem("Fresh Truffles"), new HeadedTextItem("Fribourgeois"), new HeadedTextItem("Friesekaas"),
|
||||
new HeadedTextItem("Friesian"), new HeadedTextItem("Friesla"), new HeadedTextItem("Frinault"),
|
||||
new HeadedTextItem("Fromage a Raclette"), new HeadedTextItem("Fromage Corse"),
|
||||
new HeadedTextItem("Fromage de Montagne de Savoie"), new HeadedTextItem("Fromage Frais"),
|
||||
new HeadedTextItem("Fruit Cream Cheese"), new HeadedTextItem("Frying Cheese"), new HeadedTextItem("Fynbo"),
|
||||
new HeadedTextItem("Gabriel"), new HeadedTextItem("Galette du Paludier"),
|
||||
new HeadedTextItem("Galette Lyonnaise"), new HeadedTextItem("Galloway Goat's Milk Gems"),
|
||||
new HeadedTextItem("Gammelost"), new HeadedTextItem("Gaperon a l'Ail"), new HeadedTextItem("Garrotxa"),
|
||||
new HeadedTextItem("Gastanberra"), new HeadedTextItem("Geitost"), new HeadedTextItem("Gippsland Blue"),
|
||||
new HeadedTextItem("Gjetost"), new HeadedTextItem("Gloucester"), new HeadedTextItem("Golden Cross"),
|
||||
new HeadedTextItem("Gorgonzola"), new HeadedTextItem("Gornyaltajski"), new HeadedTextItem("Gospel Green"),
|
||||
new HeadedTextItem("Gouda"), new HeadedTextItem("Goutu"), new HeadedTextItem("Gowrie"),
|
||||
new HeadedTextItem("Grabetto"), new HeadedTextItem("Graddost"),
|
||||
new HeadedTextItem("Grafton Village Cheddar"), new HeadedTextItem("Grana"),
|
||||
new HeadedTextItem("Grana Padano"), new HeadedTextItem("Grand Vatel"),
|
||||
new HeadedTextItem("Grataron d' Areches"), new HeadedTextItem("Gratte-Paille"),
|
||||
new HeadedTextItem("Graviera"), new HeadedTextItem("Greuilh"), new HeadedTextItem("Greve"),
|
||||
new HeadedTextItem("Gris de Lille"), new HeadedTextItem("Gruyere"), new HeadedTextItem("Gubbeen"),
|
||||
new HeadedTextItem("Guerbigny"), new HeadedTextItem("Halloumi"),
|
||||
new HeadedTextItem("Halloumy (Australian)"), new HeadedTextItem("Haloumi-Style Cheese"),
|
||||
new HeadedTextItem("Harbourne Blue"), new HeadedTextItem("Havarti"), new HeadedTextItem("Heidi Gruyere"),
|
||||
new HeadedTextItem("Hereford Hop"), new HeadedTextItem("Herrgardsost"),
|
||||
new HeadedTextItem("Herriot Farmhouse"), new HeadedTextItem("Herve"), new HeadedTextItem("Hipi Iti"),
|
||||
new HeadedTextItem("Hubbardston Blue Cow"), new HeadedTextItem("Hushallsost"),
|
||||
new HeadedTextItem("Iberico"), new HeadedTextItem("Idaho Goatster"), new HeadedTextItem("Idiazabal"),
|
||||
new HeadedTextItem("Il Boschetto al Tartufo"), new HeadedTextItem("Ile d'Yeu"),
|
||||
new HeadedTextItem("Isle of Mull"), new HeadedTextItem("Jarlsberg"), new HeadedTextItem("Jermi Tortes"),
|
||||
new HeadedTextItem("Jibneh Arabieh"), new HeadedTextItem("Jindi Brie"), new HeadedTextItem("Jubilee Blue"),
|
||||
new HeadedTextItem("Juustoleipa"), new HeadedTextItem("Kadchgall"), new HeadedTextItem("Kaseri"),
|
||||
new HeadedTextItem("Kashta"), new HeadedTextItem("Kefalotyri"), new HeadedTextItem("Kenafa"),
|
||||
new HeadedTextItem("Kernhem"), new HeadedTextItem("Kervella Affine"), new HeadedTextItem("Kikorangi"),
|
||||
new HeadedTextItem("King Island Cape Wickham Brie"), new HeadedTextItem("King River Gold"),
|
||||
new HeadedTextItem("Klosterkaese"), new HeadedTextItem("Knockalara"), new HeadedTextItem("Kugelkase"),
|
||||
new HeadedTextItem("L'Aveyronnais"), new HeadedTextItem("L'Ecir de l'Aubrac"),
|
||||
new HeadedTextItem("La Taupiniere"), new HeadedTextItem("La Vache Qui Rit"),
|
||||
new HeadedTextItem("Laguiole"), new HeadedTextItem("Lairobell"), new HeadedTextItem("Lajta"),
|
||||
new HeadedTextItem("Lanark Blue"), new HeadedTextItem("Lancashire"), new HeadedTextItem("Langres"),
|
||||
new HeadedTextItem("Lappi"), new HeadedTextItem("Laruns"), new HeadedTextItem("Lavistown"),
|
||||
new HeadedTextItem("Le Brin"), new HeadedTextItem("Le Fium Orbo"), new HeadedTextItem("Le Lacandou"),
|
||||
new HeadedTextItem("Le Roule"), new HeadedTextItem("Leafield"), new HeadedTextItem("Lebbene"),
|
||||
new HeadedTextItem("Leerdammer"), new HeadedTextItem("Leicester"), new HeadedTextItem("Leyden"),
|
||||
new HeadedTextItem("Limburger"), new HeadedTextItem("Lincolnshire Poacher"),
|
||||
new HeadedTextItem("Lingot Saint Bousquet d'Orb"), new HeadedTextItem("Liptauer"),
|
||||
new HeadedTextItem("Little Rydings"), new HeadedTextItem("Livarot"), new HeadedTextItem("Llanboidy"),
|
||||
new HeadedTextItem("Llanglofan Farmhouse"), new HeadedTextItem("Loch Arthur Farmhouse"),
|
||||
new HeadedTextItem("Loddiswell Avondale"), new HeadedTextItem("Longhorn"), new HeadedTextItem("Lou Palou"),
|
||||
new HeadedTextItem("Lou Pevre"), new HeadedTextItem("Lyonnais"), new HeadedTextItem("Maasdam"),
|
||||
new HeadedTextItem("Macconais"), new HeadedTextItem("Mahoe Aged Gouda"), new HeadedTextItem("Mahon"),
|
||||
new HeadedTextItem("Malvern"), new HeadedTextItem("Mamirolle"), new HeadedTextItem("Manchego"),
|
||||
new HeadedTextItem("Manouri"), new HeadedTextItem("Manur"), new HeadedTextItem("Marble Cheddar"),
|
||||
new HeadedTextItem("Marbled Cheeses"), new HeadedTextItem("Maredsous"), new HeadedTextItem("Margotin"),
|
||||
new HeadedTextItem("Maribo"), new HeadedTextItem("Maroilles"), new HeadedTextItem("Mascares"),
|
||||
new HeadedTextItem("Mascarpone"), new HeadedTextItem("Mascarpone (Australian)"),
|
||||
new HeadedTextItem("Mascarpone Torta"), new HeadedTextItem("Matocq"), new HeadedTextItem("Maytag Blue"),
|
||||
new HeadedTextItem("Meira"), new HeadedTextItem("Menallack Farmhouse"), new HeadedTextItem("Menonita"),
|
||||
new HeadedTextItem("Meredith Blue"), new HeadedTextItem("Mesost"),
|
||||
new HeadedTextItem("Metton (Cancoillotte)"), new HeadedTextItem("Meyer Vintage Gouda"),
|
||||
new HeadedTextItem("Mihalic Peynir"), new HeadedTextItem("Milleens"), new HeadedTextItem("Mimolette"),
|
||||
new HeadedTextItem("Mine-Gabhar"), new HeadedTextItem("Mini Baby Bells"), new HeadedTextItem("Mixte"),
|
||||
new HeadedTextItem("Molbo"), new HeadedTextItem("Monastery Cheeses"), new HeadedTextItem("Mondseer"),
|
||||
new HeadedTextItem("Mont D'or Lyonnais"), new HeadedTextItem("Montasio"),
|
||||
new HeadedTextItem("Monterey Jack"), new HeadedTextItem("Monterey Jack Dry"),
|
||||
new HeadedTextItem("Morbier"), new HeadedTextItem("Morbier Cru de Montagne"),
|
||||
new HeadedTextItem("Mothais a la Feuille"), new HeadedTextItem("Mozzarella"),
|
||||
new HeadedTextItem("Mozzarella (Australian)"), new HeadedTextItem("Mozzarella di Bufala"),
|
||||
new HeadedTextItem("Mozzarella Fresh, in water"), new HeadedTextItem("Mozzarella Rolls"),
|
||||
new HeadedTextItem("Munster"), new HeadedTextItem("Murol"), new HeadedTextItem("Mycella"),
|
||||
new HeadedTextItem("Myzithra"), new HeadedTextItem("Naboulsi"), new HeadedTextItem("Nantais"),
|
||||
new HeadedTextItem("Neufchatel"), new HeadedTextItem("Neufchatel (Australian)"),
|
||||
new HeadedTextItem("Niolo"), new HeadedTextItem("Nokkelost"), new HeadedTextItem("Northumberland"),
|
||||
new HeadedTextItem("Oaxaca"), new HeadedTextItem("Olde York"), new HeadedTextItem("Olivet au Foin"),
|
||||
new HeadedTextItem("Olivet Bleu"), new HeadedTextItem("Olivet Cendre"),
|
||||
new HeadedTextItem("Orkney Extra Mature Cheddar"), new HeadedTextItem("Orla"),
|
||||
new HeadedTextItem("Oschtjepka"), new HeadedTextItem("Ossau Fermier"), new HeadedTextItem("Ossau-Iraty"),
|
||||
new HeadedTextItem("Oszczypek"), new HeadedTextItem("Oxford Blue"), new HeadedTextItem("P'tit Berrichon"),
|
||||
new HeadedTextItem("Palet de Babligny"), new HeadedTextItem("Paneer"), new HeadedTextItem("Panela"),
|
||||
new HeadedTextItem("Pannerone"), new HeadedTextItem("Pant ys Gawn"),
|
||||
new HeadedTextItem("Parmesan (Parmigiano)"), new HeadedTextItem("Parmigiano Reggiano"),
|
||||
new HeadedTextItem("Pas de l'Escalette"), new HeadedTextItem("Passendale"),
|
||||
new HeadedTextItem("Pasteurized Processed"), new HeadedTextItem("Pate de Fromage"),
|
||||
new HeadedTextItem("Patefine Fort"), new HeadedTextItem("Pave d'Affinois"),
|
||||
new HeadedTextItem("Pave d'Auge"), new HeadedTextItem("Pave de Chirac"),
|
||||
new HeadedTextItem("Pave du Berry"), new HeadedTextItem("Pecorino"),
|
||||
new HeadedTextItem("Pecorino in Walnut Leaves"), new HeadedTextItem("Pecorino Romano"),
|
||||
new HeadedTextItem("Peekskill Pyramid"), new HeadedTextItem("Pelardon des Cevennes"),
|
||||
new HeadedTextItem("Pelardon des Corbieres"), new HeadedTextItem("Penamellera"),
|
||||
new HeadedTextItem("Penbryn"), new HeadedTextItem("Pencarreg"), new HeadedTextItem("Perail de Brebis"),
|
||||
new HeadedTextItem("Petit Morin"), new HeadedTextItem("Petit Pardou"), new HeadedTextItem("Petit-Suisse"),
|
||||
new HeadedTextItem("Picodon de Chevre"), new HeadedTextItem("Picos de Europa"),
|
||||
new HeadedTextItem("Piora"), new HeadedTextItem("Pithtviers au Foin"),
|
||||
new HeadedTextItem("Plateau de Herve"), new HeadedTextItem("Plymouth Cheese"),
|
||||
new HeadedTextItem("Podhalanski"), new HeadedTextItem("Poivre d'Ane"), new HeadedTextItem("Polkolbin"),
|
||||
new HeadedTextItem("Pont l'Eveque"), new HeadedTextItem("Port Nicholson"),
|
||||
new HeadedTextItem("Port-Salut"), new HeadedTextItem("Postel"),
|
||||
new HeadedTextItem("Pouligny-Saint-Pierre"), new HeadedTextItem("Pourly"), new HeadedTextItem("Prastost"),
|
||||
new HeadedTextItem("Pressato"), new HeadedTextItem("Prince-Jean"), new HeadedTextItem("Processed Cheddar"),
|
||||
new HeadedTextItem("Provolone"), new HeadedTextItem("Provolone (Australian)"),
|
||||
new HeadedTextItem("Pyengana Cheddar"), new HeadedTextItem("Pyramide"), new HeadedTextItem("Quark"),
|
||||
new HeadedTextItem("Quark (Australian)"), new HeadedTextItem("Quartirolo Lombardo"),
|
||||
new HeadedTextItem("Quatre-Vents"), new HeadedTextItem("Quercy Petit"), new HeadedTextItem("Queso Blanco"),
|
||||
new HeadedTextItem("Queso Blanco con Frutas --Pina y Mango"), new HeadedTextItem("Queso de Murcia"),
|
||||
new HeadedTextItem("Queso del Montsec"), new HeadedTextItem("Queso del Tietar"),
|
||||
new HeadedTextItem("Queso Fresco"), new HeadedTextItem("Queso Fresco (Adobera)"),
|
||||
new HeadedTextItem("Queso Iberico"), new HeadedTextItem("Queso Jalapeno"),
|
||||
new HeadedTextItem("Queso Majorero"), new HeadedTextItem("Queso Media Luna"),
|
||||
new HeadedTextItem("Queso Para Frier"), new HeadedTextItem("Queso Quesadilla"),
|
||||
new HeadedTextItem("Rabacal"), new HeadedTextItem("Raclette"), new HeadedTextItem("Ragusano"),
|
||||
new HeadedTextItem("Raschera"), new HeadedTextItem("Reblochon"), new HeadedTextItem("Red Leicester"),
|
||||
new HeadedTextItem("Regal de la Dombes"), new HeadedTextItem("Reggianito"), new HeadedTextItem("Remedou"),
|
||||
new HeadedTextItem("Requeson"), new HeadedTextItem("Richelieu"), new HeadedTextItem("Ricotta"),
|
||||
new HeadedTextItem("Ricotta (Australian)"), new HeadedTextItem("Ricotta Salata"),
|
||||
new HeadedTextItem("Ridder"), new HeadedTextItem("Rigotte"), new HeadedTextItem("Rocamadour"),
|
||||
new HeadedTextItem("Rollot"), new HeadedTextItem("Romano"), new HeadedTextItem("Romans Part Dieu"),
|
||||
new HeadedTextItem("Roncal"), new HeadedTextItem("Roquefort"), new HeadedTextItem("Roule"),
|
||||
new HeadedTextItem("Rouleau De Beaulieu"), new HeadedTextItem("Royalp Tilsit"),
|
||||
new HeadedTextItem("Rubens"), new HeadedTextItem("Rustinu"), new HeadedTextItem("Saaland Pfarr"),
|
||||
new HeadedTextItem("Saanenkaese"), new HeadedTextItem("Saga"), new HeadedTextItem("Sage Derby"),
|
||||
new HeadedTextItem("Sainte Maure"), new HeadedTextItem("Saint-Marcellin"),
|
||||
new HeadedTextItem("Saint-Nectaire"), new HeadedTextItem("Saint-Paulin"), new HeadedTextItem("Salers"),
|
||||
new HeadedTextItem("Samso"), new HeadedTextItem("San Simon"), new HeadedTextItem("Sancerre"),
|
||||
new HeadedTextItem("Sap Sago"), new HeadedTextItem("Sardo"), new HeadedTextItem("Sardo Egyptian"),
|
||||
new HeadedTextItem("Sbrinz"), new HeadedTextItem("Scamorza"), new HeadedTextItem("Schabzieger"),
|
||||
new HeadedTextItem("Schloss"), new HeadedTextItem("Selles sur Cher"), new HeadedTextItem("Selva"),
|
||||
new HeadedTextItem("Serat"), new HeadedTextItem("Seriously Strong Cheddar"),
|
||||
new HeadedTextItem("Serra da Estrela"), new HeadedTextItem("Sharpam"),
|
||||
new HeadedTextItem("Shelburne Cheddar"), new HeadedTextItem("Shropshire Blue"),
|
||||
new HeadedTextItem("Siraz"), new HeadedTextItem("Sirene"), new HeadedTextItem("Smoked Gouda"),
|
||||
new HeadedTextItem("Somerset Brie"), new HeadedTextItem("Sonoma Jack"),
|
||||
new HeadedTextItem("Sottocenare al Tartufo"), new HeadedTextItem("Soumaintrain"),
|
||||
new HeadedTextItem("Sourire Lozerien"), new HeadedTextItem("Spenwood"),
|
||||
new HeadedTextItem("Sraffordshire Organic"), new HeadedTextItem("St. Agur Blue Cheese"),
|
||||
new HeadedTextItem("Stilton"), new HeadedTextItem("Stinking Bishop"), new HeadedTextItem("String"),
|
||||
new HeadedTextItem("Sussex Slipcote"), new HeadedTextItem("Sveciaost"), new HeadedTextItem("Swaledale"),
|
||||
new HeadedTextItem("Sweet Style Swiss"), new HeadedTextItem("Swiss"),
|
||||
new HeadedTextItem("Syrian (Armenian String)"), new HeadedTextItem("Tala"), new HeadedTextItem("Taleggio"),
|
||||
new HeadedTextItem("Tamie"), new HeadedTextItem("Tasmania Highland Chevre Log"),
|
||||
new HeadedTextItem("Taupiniere"), new HeadedTextItem("Teifi"), new HeadedTextItem("Telemea"),
|
||||
new HeadedTextItem("Testouri"), new HeadedTextItem("Tete de Moine"), new HeadedTextItem("Tetilla"),
|
||||
new HeadedTextItem("Texas Goat Cheese"), new HeadedTextItem("Tibet"),
|
||||
new HeadedTextItem("Tillamook Cheddar"), new HeadedTextItem("Tilsit"), new HeadedTextItem("Timboon Brie"),
|
||||
new HeadedTextItem("Toma"), new HeadedTextItem("Tomme Brulee"), new HeadedTextItem("Tomme d'Abondance"),
|
||||
new HeadedTextItem("Tomme de Chevre"), new HeadedTextItem("Tomme de Romans"),
|
||||
new HeadedTextItem("Tomme de Savoie"), new HeadedTextItem("Tomme des Chouans"),
|
||||
new HeadedTextItem("Tommes"), new HeadedTextItem("Torta del Casar"), new HeadedTextItem("Toscanello"),
|
||||
new HeadedTextItem("Touree de L'Aubier"), new HeadedTextItem("Tourmalet"),
|
||||
new HeadedTextItem("Trappe (Veritable)"), new HeadedTextItem("Trois Cornes De Vendee"),
|
||||
new HeadedTextItem("Tronchon"), new HeadedTextItem("Trou du Cru"), new HeadedTextItem("Truffe"),
|
||||
new HeadedTextItem("Tupi"), new HeadedTextItem("Turunmaa"), new HeadedTextItem("Tymsboro"),
|
||||
new HeadedTextItem("Tyn Grug"), new HeadedTextItem("Tyning"), new HeadedTextItem("Ubriaco"),
|
||||
new HeadedTextItem("Ulloa"), new HeadedTextItem("Vacherin-Fribourgeois"), new HeadedTextItem("Valencay"),
|
||||
new HeadedTextItem("Vasterbottenost"), new HeadedTextItem("Venaco"), new HeadedTextItem("Vendomois"),
|
||||
new HeadedTextItem("Vieux Corse"), new HeadedTextItem("Vignotte"), new HeadedTextItem("Vulscombe"),
|
||||
new HeadedTextItem("Waimata Farmhouse Blue"), new HeadedTextItem("Washed Rind Cheese (Australian)"),
|
||||
new HeadedTextItem("Waterloo"), new HeadedTextItem("Weichkaese"), new HeadedTextItem("Wellington"),
|
||||
new HeadedTextItem("Wensleydale"), new HeadedTextItem("White Stilton"),
|
||||
new HeadedTextItem("Whitestone Farmhouse"), new HeadedTextItem("Wigmore"),
|
||||
new HeadedTextItem("Woodside Cabecou"), new HeadedTextItem("Xanadu"), new HeadedTextItem("Xynotyro"),
|
||||
new HeadedTextItem("Yarg Cornish"), new HeadedTextItem("Yarra Valley Pyramid"),
|
||||
new HeadedTextItem("Yorkshire Blue"), new HeadedTextItem("Zamorano"),
|
||||
new HeadedTextItem("Zanetti Grana Padano"), new HeadedTextItem("Zanetti Parmigiano Reggiano")
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ItemAdapter adapter = new SectionedItemAdapter(this, CHEESES, SECTIONS);
|
||||
getListView().setFastScrollEnabled(true);
|
||||
setListAdapter(adapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* A SectionedItemAdapter is an extension of an ItemAdapter that implements
|
||||
* SectionIndexer. Thanks to it, the fast scroller will act like the one in
|
||||
* the contact app.
|
||||
*
|
||||
* @author Cyril Mottier
|
||||
*/
|
||||
private class SectionedItemAdapter extends ItemAdapter implements SectionIndexer {
|
||||
|
||||
private AlphabetIndexer mIndexer;
|
||||
|
||||
public SectionedItemAdapter(Context context, Item[] items, String sections) {
|
||||
super(context, items);
|
||||
mIndexer = new AlphabetIndexer(new FakeCursor(this), 0, sections);
|
||||
}
|
||||
|
||||
public int getPositionForSection(int sectionIndex) {
|
||||
return mIndexer.getPositionForSection(sectionIndex);
|
||||
}
|
||||
|
||||
public int getSectionForPosition(int position) {
|
||||
return mIndexer.getSectionForPosition(position);
|
||||
}
|
||||
|
||||
public Object[] getSections() {
|
||||
return mIndexer.getSections();
|
||||
}
|
||||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
final HeadedTextItem item = (HeadedTextItem) getItem(position);
|
||||
final int section = getSectionForPosition(position);
|
||||
|
||||
if (getPositionForSection(section) == position) {
|
||||
String title = mIndexer.getSections()[section].toString().trim();
|
||||
item.headerText = title;
|
||||
} else {
|
||||
item.headerText = null;
|
||||
}
|
||||
|
||||
return super.getView(position, convertView, parent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of a Cursor that is almost useless. It is simply used
|
||||
* for the SectionIndexer to browse our underlying data.
|
||||
*
|
||||
* @author Cyril Mottier
|
||||
*/
|
||||
private class FakeCursor implements Cursor {
|
||||
|
||||
private ListAdapter mAdapter;
|
||||
private int mPosition;
|
||||
|
||||
public FakeCursor(ListAdapter adapter) {
|
||||
mAdapter = adapter;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
|
||||
}
|
||||
|
||||
public void deactivate() {
|
||||
}
|
||||
|
||||
public byte[] getBlob(int columnIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getColumnIndex(String columnName) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getColumnIndexOrThrow(String columnName) throws IllegalArgumentException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getColumnName(int columnIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getColumnNames() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return mAdapter.getCount();
|
||||
}
|
||||
|
||||
public double getDouble(int columnIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public float getFloat(int columnIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getInt(int columnIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getLong(int columnIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public short getShort(int columnIndex) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getString(int columnIndex) {
|
||||
final HeadedTextItem item = (HeadedTextItem) mAdapter.getItem(mPosition);
|
||||
return (String) item.text.substring(0, 1);
|
||||
}
|
||||
|
||||
public boolean getWantsAllOnMoveCalls() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isAfterLast() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isBeforeFirst() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFirst() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isLast() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isNull(int columnIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean move(int offset) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean moveToFirst() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean moveToLast() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean moveToNext() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean moveToPosition(int position) {
|
||||
if (position < -1 || position > getCount()) {
|
||||
return false;
|
||||
}
|
||||
mPosition = position;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean moveToPrevious() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void registerContentObserver(ContentObserver observer) {
|
||||
}
|
||||
|
||||
public void registerDataSetObserver(DataSetObserver observer) {
|
||||
}
|
||||
|
||||
public boolean requery() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Bundle respond(Bundle extras) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setNotificationUri(ContentResolver cr, Uri uri) {
|
||||
}
|
||||
|
||||
public void unregisterContentObserver(ContentObserver observer) {
|
||||
}
|
||||
|
||||
public void unregisterDataSetObserver(DataSetObserver observer) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDActivity;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.WebView;
|
||||
|
||||
public class WebContentActivity extends GDActivity {
|
||||
|
||||
public static final String EXTRA_CONTENT_URL = "com.cyrilmottier.android.gdcatalog.extra.CONTENT_URL";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final String contentUrl = getIntent().getStringExtra(EXTRA_CONTENT_URL);
|
||||
if (!TextUtils.isEmpty(contentUrl)) {
|
||||
setActionBarContentView(R.layout.web_view);
|
||||
final WebView webView = (WebView) findViewById(R.id.web_view);
|
||||
webView.loadUrl(contentUrl);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog;
|
||||
|
||||
import greendroid.app.GDListActivity;
|
||||
import greendroid.widget.ItemAdapter;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class XmlItemActivity extends GDListActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ItemAdapter adapter;
|
||||
try {
|
||||
adapter = ItemAdapter.createFromXml(this, R.xml.items);
|
||||
setListAdapter(adapter);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog.widget;
|
||||
|
||||
import greendroid.widget.item.TextItem;
|
||||
import greendroid.widget.itemview.ItemView;
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.cyrilmottier.android.gdcatalog.R;
|
||||
|
||||
public class HeadedTextItem extends TextItem {
|
||||
|
||||
public String headerText;
|
||||
|
||||
public HeadedTextItem(String text) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemView newView(Context context, ViewGroup parent) {
|
||||
return createCellFromXml(context, R.layout.headed_text_item_view, parent);
|
||||
}
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cyrilmottier.android.gdcatalog.widget;
|
||||
|
||||
import greendroid.widget.item.Item;
|
||||
import greendroid.widget.itemview.ItemView;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.cyrilmottier.android.gdcatalog.R;
|
||||
|
||||
public class HeadedTextItemView extends LinearLayout implements ItemView {
|
||||
|
||||
private TextView mHeaderView;
|
||||
private TextView mTextView;
|
||||
|
||||
public HeadedTextItemView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public HeadedTextItemView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public void prepareItemView() {
|
||||
mHeaderView = (TextView) findViewById(R.id.gd_separator_text);
|
||||
mTextView = (TextView) findViewById(R.id.gd_text);
|
||||
}
|
||||
|
||||
public void setObject(Item object) {
|
||||
|
||||
final HeadedTextItem item = (HeadedTextItem) object;
|
||||
final String headerText = item.headerText;
|
||||
|
||||
if (!TextUtils.isEmpty(headerText)) {
|
||||
mHeaderView.setText(headerText);
|
||||
mHeaderView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mHeaderView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mTextView.setText(item.text);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
**
|
||||
** 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.cyrilmottier.android.greendroid"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" />
|
||||
@ -1,13 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=Google Inc.:Google APIs:8
|
||||
android.library=true
|
||||
android.library.reference.1=../GreenDroid/
|
||||
@ -1,256 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package greendroid.app;
|
||||
|
||||
import greendroid.app.ActionBarActivity;
|
||||
import greendroid.app.GDApplication;
|
||||
import greendroid.util.Config;
|
||||
import greendroid.widget.ActionBar;
|
||||
import greendroid.widget.ActionBar.OnActionBarListener;
|
||||
import greendroid.widget.ActionBar.Type;
|
||||
import greendroid.widget.ActionBarHost;
|
||||
import greendroid.widget.ActionBarItem;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.cyrilmottier.android.greendroid.R;
|
||||
import com.google.android.maps.MapActivity;
|
||||
|
||||
/**
|
||||
* A special {@link MapActivity} that manages an ActionBar. See
|
||||
* {@link GDActivity} for a complete documentation of all available features.
|
||||
*
|
||||
* @see GDActivity
|
||||
* @author Cyril Mottier
|
||||
*/
|
||||
public abstract class GDMapActivity extends MapActivity implements ActionBarActivity {
|
||||
|
||||
private static final String LOG_TAG = GDMapActivity.class.getSimpleName();
|
||||
|
||||
private boolean mDefaultConstructorUsed = false;
|
||||
|
||||
private Type mActionBarType;
|
||||
private ActionBarHost mActionBarHost;
|
||||
|
||||
public GDMapActivity() {
|
||||
this(Type.Normal);
|
||||
mDefaultConstructorUsed = true;
|
||||
}
|
||||
|
||||
public GDMapActivity(ActionBar.Type actionBarType) {
|
||||
super();
|
||||
mActionBarType = actionBarType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
ensureLayout();
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (mDefaultConstructorUsed) {
|
||||
// HACK cyril: This should have been done is the default
|
||||
// constructor. Unfortunately, the getApplication() method returns
|
||||
// null there. Hence, this has to be done here.
|
||||
if (getClass().equals(getGDApplication().getHomeActivityClass())) {
|
||||
mActionBarType = Type.Dashboard;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
ensureLayout();
|
||||
}
|
||||
|
||||
public ActionBar.Type getActionBarType() {
|
||||
return mActionBarType;
|
||||
}
|
||||
|
||||
public int createLayout() {
|
||||
switch (mActionBarType) {
|
||||
case Dashboard:
|
||||
return R.layout.gd_content_dashboard;
|
||||
case Normal:
|
||||
default:
|
||||
return R.layout.gd_content_normal;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ensureLayout() {
|
||||
if (!verifyLayout()) {
|
||||
setContentView(createLayout());
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean verifyLayout() {
|
||||
return mActionBarHost != null;
|
||||
}
|
||||
|
||||
public GDApplication getGDApplication() {
|
||||
return (GDApplication) getApplication();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContentChanged() {
|
||||
super.onContentChanged();
|
||||
|
||||
onPreContentChanged();
|
||||
onPostContentChanged();
|
||||
}
|
||||
|
||||
public void onPreContentChanged() {
|
||||
mActionBarHost = (ActionBarHost) findViewById(R.id.gd_action_bar_host);
|
||||
if (mActionBarHost == null) {
|
||||
throw new RuntimeException(
|
||||
"Your content must have an ActionBarHost whose id attribute is R.id.gd_action_bar_host");
|
||||
}
|
||||
mActionBarHost.getActionBar().setOnActionBarListener(mActionBarListener);
|
||||
}
|
||||
|
||||
public void onPostContentChanged() {
|
||||
|
||||
boolean titleSet = false;
|
||||
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
String title = intent.getStringExtra(ActionBarActivity.GD_ACTION_BAR_TITLE);
|
||||
if (title != null) {
|
||||
titleSet = true;
|
||||
setTitle(title);
|
||||
}
|
||||
}
|
||||
|
||||
if (!titleSet) {
|
||||
// No title has been set via the Intent. Let's look in the
|
||||
// ActivityInfo
|
||||
try {
|
||||
final ActivityInfo activityInfo = getPackageManager().getActivityInfo(getComponentName(), 0);
|
||||
if (activityInfo.labelRes != 0) {
|
||||
setTitle(activityInfo.labelRes);
|
||||
}
|
||||
} catch (NameNotFoundException e) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
final int visibility = intent.getIntExtra(ActionBarActivity.GD_ACTION_BAR_VISIBILITY, View.VISIBLE);
|
||||
getActionBar().setVisibility(visibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
getActionBar().setTitle(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(int titleId) {
|
||||
setTitle(getString(titleId));
|
||||
}
|
||||
|
||||
public ActionBar getActionBar() {
|
||||
ensureLayout();
|
||||
return mActionBarHost.getActionBar();
|
||||
}
|
||||
|
||||
public ActionBarItem addActionBarItem(ActionBarItem item) {
|
||||
return getActionBar().addItem(item);
|
||||
}
|
||||
|
||||
public ActionBarItem addActionBarItem(ActionBarItem item, int itemId) {
|
||||
return getActionBar().addItem(item, itemId);
|
||||
}
|
||||
|
||||
public ActionBarItem addActionBarItem(ActionBarItem.Type actionBarItemType) {
|
||||
return getActionBar().addItem(actionBarItemType);
|
||||
}
|
||||
|
||||
public ActionBarItem addActionBarItem(ActionBarItem.Type actionBarItemType, int itemId) {
|
||||
return getActionBar().addItem(actionBarItemType, itemId);
|
||||
}
|
||||
|
||||
public FrameLayout getContentView() {
|
||||
ensureLayout();
|
||||
return mActionBarHost.getContentView();
|
||||
}
|
||||
|
||||
public void setActionBarContentView(int resID) {
|
||||
LayoutInflater.from(this).inflate(resID, getContentView());
|
||||
}
|
||||
|
||||
public void setActionBarContentView(View view, LayoutParams params) {
|
||||
getContentView().addView(view, params);
|
||||
}
|
||||
|
||||
public void setActionBarContentView(View view) {
|
||||
getContentView().addView(view);
|
||||
}
|
||||
|
||||
public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private OnActionBarListener mActionBarListener = new OnActionBarListener() {
|
||||
public void onActionBarItemClicked(int position) {
|
||||
if (position == OnActionBarListener.HOME_ITEM) {
|
||||
|
||||
final GDApplication app = getGDApplication();
|
||||
switch (mActionBarType) {
|
||||
case Normal:
|
||||
final Class<?> klass = app.getHomeActivityClass();
|
||||
if (klass != null && !klass.equals(GDMapActivity.this.getClass())) {
|
||||
if (Config.GD_INFO_LOGS_ENABLED) {
|
||||
Log.i(LOG_TAG, "Going back to the home activity");
|
||||
}
|
||||
Intent homeIntent = new Intent(GDMapActivity.this, klass);
|
||||
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(homeIntent);
|
||||
}
|
||||
break;
|
||||
case Dashboard:
|
||||
final Intent appIntent = app.getMainApplicationIntent();
|
||||
if (appIntent != null) {
|
||||
if (Config.GD_INFO_LOGS_ENABLED) {
|
||||
Log.i(LOG_TAG, "Launching the main application Intent");
|
||||
}
|
||||
startActivity(appIntent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!onHandleActionBarItemClick(getActionBar().getItem(position), position)) {
|
||||
if (Config.GD_WARNING_LOGS_ENABLED) {
|
||||
Log.w(LOG_TAG, "Click on item at position " + position + " dropped down to the floor");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||