Permalink
Browse files

@emir-hasanbegovicv [#67614622] Moved Parchment to Open Source Reposi…

…tory
  • Loading branch information...
emir-hasanbegovic committed Mar 16, 2014
0 parents commit 19c9d6b2ed681113f9b99425dffaad7683b65b7c
Showing with 7,249 additions and 0 deletions.
  1. +15 −0 .gitignore
  2. +14 −0 .travis.yml
  3. +3 −0 CONTRIBUTING.md
  4. +13 −0 LICENSE.md
  5. +62 −0 README.md
  6. +12 −0 integration/AndroidManifest.xml
  7. +95 −0 integration/pom.xml
  8. +23 −0 integration/res/layout/basic.xml
  9. +20 −0 integration/res/layout/on_screen_cell_spacing.xml
  10. +13 −0 integration/res/layout/text_view.xml
  11. +5 −0 integration/res/values/dimens.xml
  12. +137 −0 integration/src/test/java/com/parchment/HorizontalListViewTest.java
  13. +11 −0 library/AndroidManifest.xml
  14. +81 −0 library/pom.xml
  15. +41 −0 library/res/values/attrs.xml
  16. +173 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterAnimator.java
  17. +268 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterView.java
  18. +37 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterViewDataSetObserver.java
  19. +62 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterViewGestureDetector.java
  20. +24 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterViewHandler.java
  21. +39 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterViewInitializer.java
  22. +149 −0 library/src/main/java/com/parchment/widget/adapterview/AdapterViewManager.java
  23. +37 −0 library/src/main/java/com/parchment/widget/adapterview/Animation.java
  24. +8 −0 library/src/main/java/com/parchment/widget/adapterview/AnimationStoppedListener.java
  25. +132 −0 library/src/main/java/com/parchment/widget/adapterview/Attributes.java
  26. +124 −0 library/src/main/java/com/parchment/widget/adapterview/ChildTouchGestureListener.java
  27. +57 −0 library/src/main/java/com/parchment/widget/adapterview/DataSetObserverManager.java
  28. +772 −0 library/src/main/java/com/parchment/widget/adapterview/LayoutManager.java
  29. +83 −0 library/src/main/java/com/parchment/widget/adapterview/LayoutManagerAttributes.java
  30. +77 −0 library/src/main/java/com/parchment/widget/adapterview/LayoutManagerBridge.java
  31. +8 −0 library/src/main/java/com/parchment/widget/adapterview/Move.java
  32. +10 −0 library/src/main/java/com/parchment/widget/adapterview/OnSelectedListener.java
  33. +8 −0 library/src/main/java/com/parchment/widget/adapterview/Orientation.java
  34. +52 −0 library/src/main/java/com/parchment/widget/adapterview/ScrollAnimator.java
  35. +68 −0 library/src/main/java/com/parchment/widget/adapterview/ScrollDirectionManager.java
  36. +57 −0 library/src/main/java/com/parchment/widget/adapterview/SelectedPositionManager.java
  37. +8 −0 library/src/main/java/com/parchment/widget/adapterview/SnapPosition.java
  38. +110 −0 library/src/main/java/com/parchment/widget/adapterview/griddefinitionview/DefinitionGroup.java
  39. +42 −0 ...y/src/main/java/com/parchment/widget/adapterview/griddefinitionview/GridDefinitionAttributes.java
  40. +384 −0 ...rc/main/java/com/parchment/widget/adapterview/griddefinitionview/GridDefinitionLayoutManager.java
  41. +20 −0 ...va/com/parchment/widget/adapterview/griddefinitionview/GridDefinitionLayoutManagerAttributes.java
  42. +67 −0 library/src/main/java/com/parchment/widget/adapterview/griddefinitionview/GridDefinitionView.java
  43. +193 −0 library/src/main/java/com/parchment/widget/adapterview/griddefinitionview/GridGroupDefinition.java
  44. +36 −0 library/src/main/java/com/parchment/widget/adapterview/griddefinitionview/GridItemDefinition.java
  45. +11 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/Gravity.java
  46. +74 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/GridAttributes.java
  47. +262 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/GridLayoutManager.java
  48. +60 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/GridLayoutManagerAttributes.java
  49. +60 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/GridView.java
  50. +192 −0 library/src/main/java/com/parchment/widget/adapterview/gridview/Group.java
  51. +146 −0 library/src/main/java/com/parchment/widget/adapterview/listview/ListLayoutManager.java
  52. +57 −0 library/src/main/java/com/parchment/widget/adapterview/listview/ListView.java
  53. +50 −0 library/src/main/java/com/parchment/widget/adapterview/snapposition/CenterSnapPosition.java
  54. +48 −0 library/src/main/java/com/parchment/widget/adapterview/snapposition/EndSnapPosition.java
  55. +48 −0 ...y/src/main/java/com/parchment/widget/adapterview/snapposition/EndWithCellSapcingSnapPosition.java
  56. +76 −0 library/src/main/java/com/parchment/widget/adapterview/snapposition/OnScreenSnapPosition.java
  57. +75 −0 .../main/java/com/parchment/widget/adapterview/snapposition/OnScreenWithCellSpacingSnapPosition.java
  58. +24 −0 library/src/main/java/com/parchment/widget/adapterview/snapposition/SnapPositionInterface.java
  59. +44 −0 library/src/main/java/com/parchment/widget/adapterview/snapposition/StartSnapPosition.java
  60. +43 −0 ...src/main/java/com/parchment/widget/adapterview/snapposition/StartWithCellSpacingSnapPosition.java
  61. +385 −0 library/src/test/java/com/parchment/widget/adapterview/GridDefinitionLayoutManagerTest.java
  62. +163 −0 library/src/test/java/com/parchment/widget/adapterview/GridLayoutManagerCircularScrollTest.java
  63. +502 −0 library/src/test/java/com/parchment/widget/adapterview/GridLayoutManagerTest.java
  64. +255 −0 library/src/test/java/com/parchment/widget/adapterview/ListLayoutManagerTest.java
  65. +148 −0 library/src/test/java/com/parchment/widget/adapterview/OnItemSelectedListenerTest.java
  66. +188 −0 library/src/test/java/com/parchment/widget/adapterview/StableIdsTest.java
  67. +42 −0 sample/AndroidManifest.xml
  68. +48 −0 sample/pom.xml
  69. BIN sample/res/drawable-hdpi/ic_launcher.png
  70. BIN sample/res/drawable-mdpi/ic_launcher.png
  71. BIN sample/res/drawable-xhdpi/ic_launcher.png
  72. BIN sample/res/drawable-xxhdpi/ic_launcher.png
  73. +10 −0 sample/res/drawable/background.xml
  74. +9 −0 sample/res/drawable/item_simple_background.xml
  75. +40 −0 sample/res/layout/activity_menu.xml
  76. +27 −0 sample/res/layout/activity_simple_grid_definition_view.xml
  77. +30 −0 sample/res/layout/activity_simple_gridview.xml
  78. +31 −0 sample/res/layout/activity_simple_horizontal.xml
  79. +32 −0 sample/res/layout/activity_simple_view_pager.xml
  80. +15 −0 sample/res/layout/item_simple.xml
  81. +15 −0 sample/res/layout/item_simple_larger.xml
  82. +54 −0 sample/res/layout/merge_control_buttons.xml
  83. +5 −0 sample/res/values-v11/styles.xml
  84. +5 −0 sample/res/values-v14/styles.xml
  85. +4 −0 sample/res/values/strings.xml
  86. +6 −0 sample/res/values/styles.xml
  87. +40 −0 sample/src/main/java/com/parchment/BaseActivity.java
  88. +98 −0 sample/src/main/java/com/parchment/CountBaseAdapter.java
  89. +39 −0 sample/src/main/java/com/parchment/MenuActivity.java
  90. +7 −0 sample/src/main/java/com/parchment/SimpleApplication.java
  91. +48 −0 sample/src/main/java/com/parchment/SimpleGridDefinitionViewActivity.java
  92. +28 −0 sample/src/main/java/com/parchment/SimpleGridViewActivity.java
  93. +27 −0 sample/src/main/java/com/parchment/SimpleListViewActivity.java
  94. +28 −0 sample/src/main/java/com/parchment/SimpleViewPagerActivity.java
@@ -0,0 +1,15 @@
# Platform files
.DS_Store

# IDE directories
bin/
out/
gen/
gen-external-apklibs/
target/
build/
classes/
.idea/

# IDE files
*.iml
@@ -0,0 +1,14 @@
language: java
jdk: oraclejdk7
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libstdc++6:i386 lib32z1
- export COMPONENTS=build-tools-19.0.0,android-18,addon-google_apis-google-18
- curl -L https://raw.github.com/embarkmobile/android-sdk-installer/version-1/android-sdk-installer | bash /dev/stdin --install=$COMPONENTS
- source ~/.android-sdk-installer/env
- git clone https://github.com/mosabua/maven-android-sdk-deployer.git
- ( cd maven-android-sdk-deployer ; mvn install -P 4.3 )

script:
- (cd library && mvn clean install)

@@ -0,0 +1,3 @@
[Emir Hasanbegovic](https://github.com/emir-hasanbegovic)

[Anthony Tarantini](https://github.com/anthony-tarantini)
@@ -0,0 +1,13 @@
Copyright 2014 Emir Hasanbegovic

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.
@@ -0,0 +1,62 @@
Parchment
===============================

## Horizontal/Veritcal List View, GridView, ViewPager and CustomGrid GridvIew

The Parchment Library attempts to add the functionality that developers want to their AdapterViews, by providing horizontal and vertical scrolling to all of the AdapterViews. Gives developers more control of how their views layout, choose from a simple horizontal List View, a GridView that wraps heights or a GridDefinitionView that lets a user specify the grid pattern.

## Requires
Android 2.2 +

# Getting Started

## Step 1: Set up
Set parchment up as an Android library project. Include it in your main android application.

## Step 2: XML
Add one of the AdapterView classes (GridView, ListView, GridDefinitionView), don't forget to choose an orientation:

```xml
<com.parchment.widget.listview.ListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:parchment="http://schemas.android.com/apk/res/<YOUR PACKAGE NAME>"
android:id="@+id/horizontal_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
parchment:isViewPager="< true | false >"
parchment:orientation="< horizontal | vertical >"
parchment:cellSpacing="10dp"
parchment:isCircularScroll="< true | false >"
parchment:snapPosition="< center | floatLeft | floatLeftWithCellSpacing | floatRight | floatRightWithCellSpacing | onScreen | onScreenWithCellSpacing>"
parchment:snapToPosition="< true | false >" />
```

## Step 3: Java
Set Adapters and go:

```java
mListView.setAdapter(mAdapter);
```



## Story Tracking Tool:

https://www.pivotaltracker.com/s/projects/1000984#


### License:

Copyright 2014 Emir Hasanbegovic

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.
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parchment"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"/>


</manifest>
@@ -0,0 +1,95 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.parchment</groupId>
<version>1.0.0</version>
<artifactId>IntegrationTest</artifactId>
<packaging>apk</packaging>


<repositories>
<repository>
<id>maven-central</id>
<name>MavenCentral</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>

</repositories>

<dependencies>

<!-- JUnit must be first dependency -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>com.parchment</groupId>
<artifactId>parchment</artifactId>
<version>1.5.1</version>
<optional>true</optional>
<type>apklib</type>
</dependency>

<dependency>
<groupId>com.squareup</groupId>
<artifactId>fest-android</artifactId>
<version>1.0.7</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<excludes>
<exclude>**/Test*.java</exclude>
</excludes>
<argLine>-Xmx1024m</argLine>
<trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>

<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.0</version>

<extensions>true</extensions>

<configuration>
<sdk>
<platform>18</platform>
</sdk>
</configuration>

</plugin>
</plugins>


</build>
</project>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.parchment.widget.adapterview.listview.ListView
xmlns:horizontalListView="http://schemas.android.com/apk/res/com.parchment"
android:id="@+id/horizontal_list_view"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#00FF00"
horizontalListView:isCircularScroll="false"
horizontalListView:cellSpacing="10dp"
horizontalListView:isViewPager="false"
horizontalListView:selectOnSnap="false"
horizontalListView:selectWhileScrolling="false"
horizontalListView:snapPosition="center"
horizontalListView:snapToPosition="true"/>
</LinearLayout>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">


<com.parchment.widget.adapterview.listview.ListView
xmlns:horizontalListView="http://schemas.android.com/apk/res/com.parchment"
android:id="@+id/horizontal_list_view"
horizontalListView:cellSpacing="@dimen/horizontal_list_view_test_margin"
horizontalListView:snapPosition="onScreenWithCellSpacing"
horizontalListView:snapToPosition="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="@android:color/transparent"
android:listSelector="@android:color/transparent"/>

</LinearLayout>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<LinearLayout
android:orientation="horizontal"
android:layout_width="@dimen/list_item_test_width"
android:layout_height="@dimen/list_item_test_height"/>

</LinearLayout>
@@ -0,0 +1,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<dimen name="horizontal_list_view_test_margin">10px</dimen>
<dimen name="list_item_test_width">100px</dimen>
<dimen name="list_item_test_height">100px</dimen>
</resources>
Oops, something went wrong.

0 comments on commit 19c9d6b

Please sign in to comment.