Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 56eba65

Browse files
authoredNov 17, 2017
Merge pull request #2065 from owncloud/touch_image_view_source_code
Add touchImageView source code
2 parents d31ffe7 + af712be commit 56eba65

File tree

8 files changed

+1350
-5
lines changed

8 files changed

+1350
-5
lines changed
 

‎AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
-->
1919
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
20-
package="com.owncloud.android"
21-
android:versionCode="${versionCode}"
22-
android:versionName="${versionName}">
20+
package="com.owncloud.android"
21+
android:versionCode="${versionCode}"
22+
android:versionName="${versionName}">
2323

2424
<uses-sdk
2525
android:minSdkVersion="14"

‎build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ configurations.all {
4040

4141
dependencies {
4242
/// dependencies for app building
43-
compile name: 'touch-image-view'
43+
compile project(':touchImageView')
4444
compile project(':owncloud-android-library')
4545
compile "com.android.support:support-v4:${supportLibraryVersion}"
4646
compile "com.android.support:design:${supportLibraryVersion}"
@@ -73,7 +73,6 @@ dependencies {
7373

7474
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
7575
androidTestCompile "com.android.support:support-annotations:${supportLibraryVersion}"
76-
7776
}
7877

7978
tasks.withType(Test) {

‎libs/touch-image-view.jar

-21.1 KB
Binary file not shown.

‎settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include ':owncloud-android-library'
22
include ':'
33
include ':oc_jb_workaround'
4+
include ':touchImageView'

‎touchImageView/build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 26
5+
buildToolsVersion "26.0.2"
6+
7+
buildTypes {
8+
release {
9+
minifyEnabled false
10+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
11+
}
12+
}
13+
}
14+
15+
repositories {
16+
jcenter()
17+
18+
maven {
19+
url "https://maven.google.com"
20+
}
21+
}
22+
23+
dependencies {
24+
compile 'com.android.support:support-v4:26.1.0'
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.touch"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="26"/>
10+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.ortiz.touch;
2+
3+
import android.content.Context;
4+
import android.support.v4.view.ViewPager;
5+
import android.util.AttributeSet;
6+
import android.view.View;
7+
8+
9+
public class ExtendedViewPager extends ViewPager {
10+
11+
public ExtendedViewPager(Context context) {
12+
super(context);
13+
}
14+
15+
public ExtendedViewPager(Context context, AttributeSet attrs) {
16+
super(context, attrs);
17+
}
18+
19+
@Override
20+
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
21+
if (v instanceof TouchImageView) {
22+
//
23+
// canScrollHorizontally is not supported for Api < 14. To get around this issue,
24+
// ViewPager is extended and canScrollHorizontallyFroyo, a wrapper around
25+
// canScrollHorizontally supporting Api >= 8, is called.
26+
//
27+
return ((TouchImageView) v).canScrollHorizontallyFroyo(-dx);
28+
29+
} else {
30+
return super.canScroll(v, checkV, dx, x, y);
31+
}
32+
}
33+
34+
}

‎touchImageView/src/main/java/com/ortiz/touch/TouchImageView.java

+1,276
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.