Browse Source

Switched to gradle. It requires gradle version 1.10+. Please before importing the project into android studio install the "google play services" and "google repository" through the android sdk manager, otherwise the the build of the project will fail.

Alexander Brakowski 10 years ago
parent
commit
1e56455f98

+ 2 - 0
.gitignore

@@ -26,4 +26,6 @@ proguard/
 
 #Ignore some folders
 target/
+build/
+.gradle/
 gen-external-apklibs/

+ 53 - 0
build.gradle

@@ -0,0 +1,53 @@
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:0.8.+'
+    }
+}
+apply plugin: 'android'
+
+repositories {
+    mavenCentral()
+    maven {
+        url 'https://oss.sonatype.org/content/groups/public'
+    }
+}
+
+dependencies {
+    //compile fileTree(dir: 'libs', include: '*.jar')
+	compile 'com.google.android.gms:play-services:3.2.+'
+	compile 'org.roboguice:roboguice:2.0'
+    compile 'com.nineoldandroids:library:2.4.0+'
+    compile files('libs/swipelistview-1.0.jar')
+}
+
+android {
+    compileSdkVersion 19
+    buildToolsVersion "19.0.0"
+
+    sourceSets {
+        main {
+            manifest.srcFile 'AndroidManifest.xml'
+            java.srcDirs = ['src']
+            resources.srcDirs = ['src']
+            aidl.srcDirs = ['src']
+            renderscript.srcDirs = ['src']
+            res.srcDirs = ['res']
+            assets.srcDirs = ['assets']
+        }
+
+        // Move the tests to tests/java, tests/res, etc...
+        instrumentTest.setRoot('tests')
+
+        // Move the build types to build-types/<type>
+        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
+        // This moves them out of them default location under src/<type>/... which would
+        // conflict with src/ being used by the main source set.
+        // Adding new build types or product flavors should be accompanied
+        // by a similar customization.
+        debug.setRoot('build-types/debug')
+        release.setRoot('build-types/release')
+    }
+}

BIN
libs/swipelistview-1.0.jar


+ 12 - 0
pom.xml

@@ -65,6 +65,18 @@
             <version>1.0-SNAPSHOT</version>
             <type>apklib</type>
         </dependency>
+		<dependency>
+			<groupId>com.google.android.gms</groupId>
+			<artifactId>google-play-services</artifactId>
+			<version>14.0.0</version>
+			<type>apklib</type>
+		</dependency>
+		<dependency>
+			<groupId>com.google.android.gms</groupId>
+			<artifactId>google-play-services</artifactId>
+			<version>14.0.0</version>
+			<type>jar</type>
+		</dependency>
     </dependencies>
 	<build>
 		<finalName>${project.artifactId}</finalName>

+ 1 - 1
project.properties

@@ -13,4 +13,4 @@
 # Project target.
 target=android-19
 android.library=false
-android.library.reference.1=gen-external-apklibs/com.fortysevendeg.android_swipelistview_1.0-SNAPSHOT
+

+ 4 - 2
res/layout/fragment_profile_manager.xml

@@ -22,8 +22,10 @@
         android:layout_alignParentTop="true"
         android:layout_marginTop="0dp"
         android:descendantFocusability="blocksDescendants"
-        swipe:swipeFrontView="@+id/profile_manager_item_front"
-        swipe:swipeBackView="@+id/profile_manager_item_back"
+        swipeFrontView="@+id/swipelist_frontview"
+        swipeBackView="@+id/swipelist_backview"
+        swipe:swipeFrontView="@+id/swipelist_frontview"
+        swipe:swipeBackView="@+id/swipelist_backview"
         swipe:swipeMode="both"/>
 
 </RelativeLayout>

+ 2 - 2
res/layout/profile_manager_list_item.xml

@@ -5,7 +5,7 @@
               android:layout_height="wrap_content">
 
     <RelativeLayout
-        android:id="@+id/profile_manager_item_back"
+        android:id="@+id/swipelist_backview"
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
@@ -87,7 +87,7 @@
     </RelativeLayout>
 
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                    android:id="@+id/profile_manager_item_front"
+                    android:id="@+id/swipelist_frontview"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:padding="5dp"

+ 49 - 0
res/values/attrs.xml

@@ -0,0 +1,49 @@
+<!--
+  ~ Copyright (C) 2013 47 Degrees, LLC
+  ~ http://47deg.com
+  ~ hello@47deg.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>
+
+    <declare-styleable name="SwipeListView">
+        <attr name="swipeOpenOnLongPress" format="boolean"/>
+        <attr name="swipeAnimationTime" format="integer"/>
+        <attr name="swipeOffsetLeft" format="dimension"/>
+        <attr name="swipeOffsetRight" format="dimension"/>
+        <attr name="swipeCloseAllItemsWhenMoveList" format="boolean"/>
+        <attr name="swipeFrontView" format="reference"/>
+        <attr name="swipeBackView" format="reference"/>
+        <attr name="swipeMode" format="enum">
+            <enum name="none" value="0"/>
+            <enum name="both" value="1"/>
+            <enum name="right" value="2"/>
+            <enum name="left" value="3"/>
+        </attr>
+        <attr name="swipeActionLeft" format="enum">
+            <enum name="reveal" value="0"/>
+            <enum name="dismiss" value="1"/>
+            <enum name="choice" value="2"/>
+        </attr>
+        <attr name="swipeActionRight" format="enum">
+            <enum name="reveal" value="0"/>
+            <enum name="dismiss" value="1"/>
+            <enum name="choice" value="2"/>
+        </attr>
+        <attr name="swipeDrawableChecked" format="reference"/>
+        <attr name="swipeDrawableUnchecked" format="reference"/>
+    </declare-styleable>
+
+</resources>