Skip to content

Commit

Permalink
Merge pull request #2065 from owncloud/touch_image_view_source_code
Browse files Browse the repository at this point in the history
Add touchImageView source code
  • Loading branch information
davigonz authored Nov 17, 2017
2 parents d31ffe7 + af712be commit 56eba65
Show file tree
Hide file tree
Showing 8 changed files with 1,350 additions and 5 deletions.
6 changes: 3 additions & 3 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.owncloud.android"
android:versionCode="${versionCode}"
android:versionName="${versionName}">
package="com.owncloud.android"
android:versionCode="${versionCode}"
android:versionName="${versionName}">

<uses-sdk
android:minSdkVersion="14"
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ configurations.all {

dependencies {
/// dependencies for app building
compile name: 'touch-image-view'
compile project(':touchImageView')
compile project(':owncloud-android-library')
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
Expand Down Expand Up @@ -73,7 +73,6 @@ dependencies {

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

}

tasks.withType(Test) {
Expand Down
Binary file removed libs/touch-image-view.jar
Binary file not shown.
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include ':owncloud-android-library'
include ':'
include ':oc_jb_workaround'
include ':touchImageView'
25 changes: 25 additions & 0 deletions touchImageView/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

repositories {
jcenter()

maven {
url "https://maven.google.com"
}
}

dependencies {
compile 'com.android.support:support-v4:26.1.0'
}
10 changes: 10 additions & 0 deletions touchImageView/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.touch"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="26"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.ortiz.touch;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;


public class ExtendedViewPager extends ViewPager {

public ExtendedViewPager(Context context) {
super(context);
}

public ExtendedViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
if (v instanceof TouchImageView) {
//
// canScrollHorizontally is not supported for Api < 14. To get around this issue,
// ViewPager is extended and canScrollHorizontallyFroyo, a wrapper around
// canScrollHorizontally supporting Api >= 8, is called.
//
return ((TouchImageView) v).canScrollHorizontallyFroyo(-dx);

} else {
return super.canScroll(v, checkV, dx, x, y);
}
}

}
Loading

0 comments on commit 56eba65

Please sign in to comment.