├── settings.gradle.kts ├── .gitmodules ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── icon.png │ │ │ ├── drawable │ │ │ │ ├── nature_1.jpg │ │ │ │ ├── nature_2.jpg │ │ │ │ ├── nature_3.jpg │ │ │ │ ├── nature_4.jpg │ │ │ │ ├── nature_5.jpg │ │ │ │ ├── nature_6.jpg │ │ │ │ ├── nature_7.jpg │ │ │ │ ├── nature_8.jpg │ │ │ │ └── numbers.png │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── activity_shaped_example.xml │ │ │ │ ├── activity_recyclerview.xml │ │ │ │ ├── activity_viewpager2_example.xml │ │ │ │ ├── activity_switch_image_example.xml │ │ │ │ ├── activity_glide.xml │ │ │ │ ├── activity_viewpager_example.xml │ │ │ │ ├── activity_switch_scaletype_example.xml │ │ │ │ ├── activity_mirroring_example.xml │ │ │ │ ├── activity_single_touchimageview.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_change_size.xml │ │ ├── java │ │ │ └── info │ │ │ │ └── touchimage │ │ │ │ └── demo │ │ │ │ ├── custom │ │ │ │ ├── ExtendedViewPager.kt │ │ │ │ └── AdapterImages.kt │ │ │ │ ├── ViewPager2ExampleActivity.kt │ │ │ │ ├── RecyclerExampleActivity.kt │ │ │ │ ├── ShapedExampleActivity.kt │ │ │ │ ├── MirroringExampleActivity.kt │ │ │ │ ├── SwitchScaleTypeExampleActivity.kt │ │ │ │ ├── SwitchImageExampleActivity.kt │ │ │ │ ├── AnimateZoomActivity.kt │ │ │ │ ├── GlideExampleActivity.kt │ │ │ │ ├── ViewPagerExampleActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── SingleTouchImageViewActivity.kt │ │ │ │ └── ChangeSizeExampleActivity.kt │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── info │ │ └── touchimage │ │ └── demo │ │ ├── utils │ │ ├── TouchAction.kt │ │ └── MultiTouchDownEvent.kt │ │ ├── ZoomTest.kt │ │ ├── TouchTest.kt │ │ └── MainSmokeTest.kt └── build.gradle ├── jitpack.yml ├── screenshotsToCompare ├── ZoomTest_zoom-4-end.png ├── ZoomTest_zoom-1-init.png ├── ZoomTest_zoom-2-reset.png ├── ZoomTest_zoom-3-zoom.png ├── MainSmokeTest_testGlide.png ├── MainSmokeTest_testRecycler.png ├── MainSmokeTest_testAnimateZoom.png ├── MainSmokeTest_testChangeSize.png ├── MainSmokeTest_testMirroring.png ├── MainSmokeTest_testSingleTouch.png ├── MainSmokeTest_testSwitchImage.png ├── MainSmokeTest_testSwitchScale.png ├── MainSmokeTest_testView2Pager.png ├── MainSmokeTest_testViewPager.png ├── MainSmokeTest_smokeTestSimplyStart.png ├── TouchTest_testSingleTouch-touch1.png ├── TouchTest_testSingleTouch-touch2.png └── MainSmokeTest_makeScreenshotOfShapedImage.png ├── touchview ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── ortiz │ │ │ └── touchview │ │ │ ├── FixedPixel.kt │ │ │ ├── OnTouchImageViewListener.kt │ │ │ ├── OnZoomFinishedListener.kt │ │ │ ├── ImageActionState.kt │ │ │ ├── ZoomVariables.kt │ │ │ ├── OnTouchCoordinatesListener.kt │ │ │ └── TouchImageView.kt │ │ ├── AndroidManifest.xml │ │ └── res │ │ └── values │ │ └── attrs_touchimageview.xml ├── proguard-rules.pro └── build.gradle ├── gradle.properties ├── .idea └── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── screenShotCompare.sh ├── .github ├── release.yml ├── workflows │ ├── update-gradle-wrapper.yml │ ├── Android-CI-release.yml │ └── Android-CI.yml ├── dependabot.yml └── stale.yml ├── .gitignore ├── LICENSE.txt ├── gradlew.bat ├── README.md └── gradlew /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | include(":app") 2 | include(":touchview") 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "git-diff-image"] 2 | path = git-diff-image 3 | url = git@github.com:ewanmellor/git-diff-image.git 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_5.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_6.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_7.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/nature_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/nature_8.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/app/src/main/res/drawable/numbers.png -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk17 3 | install: 4 | - ./gradlew :touchview:build :touchview:publishToMavenLocal -x :touchview:test 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | -------------------------------------------------------------------------------- /screenshotsToCompare/ZoomTest_zoom-4-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/ZoomTest_zoom-4-end.png -------------------------------------------------------------------------------- /screenshotsToCompare/ZoomTest_zoom-1-init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/ZoomTest_zoom-1-init.png -------------------------------------------------------------------------------- /screenshotsToCompare/ZoomTest_zoom-2-reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/ZoomTest_zoom-2-reset.png -------------------------------------------------------------------------------- /screenshotsToCompare/ZoomTest_zoom-3-zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/ZoomTest_zoom-3-zoom.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testGlide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testGlide.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testRecycler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testRecycler.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testAnimateZoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testAnimateZoom.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testChangeSize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testChangeSize.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testMirroring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testMirroring.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testSingleTouch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testSingleTouch.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testSwitchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testSwitchImage.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testSwitchScale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testSwitchScale.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testView2Pager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testView2Pager.png -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_testViewPager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_testViewPager.png -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/FixedPixel.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | enum class FixedPixel { 4 | CENTER, TOP_LEFT, BOTTOM_RIGHT 5 | } 6 | -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_smokeTestSimplyStart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_smokeTestSimplyStart.png -------------------------------------------------------------------------------- /screenshotsToCompare/TouchTest_testSingleTouch-touch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/TouchTest_testSingleTouch-touch1.png -------------------------------------------------------------------------------- /screenshotsToCompare/TouchTest_testSingleTouch-touch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/TouchTest_testSingleTouch-touch2.png -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/OnTouchImageViewListener.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | fun interface OnTouchImageViewListener { 4 | fun onMove() 5 | } -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/OnZoomFinishedListener.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | fun interface OnZoomFinishedListener { 4 | fun onZoomFinished() 5 | } 6 | -------------------------------------------------------------------------------- /screenshotsToCompare/MainSmokeTest_makeScreenshotOfShapedImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeOrtiz/TouchImageView/HEAD/screenshotsToCompare/MainSmokeTest_makeScreenshotOfShapedImage.png -------------------------------------------------------------------------------- /touchview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/ImageActionState.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | internal enum class ImageActionState { 4 | NONE, DRAG, ZOOM, FLING, ANIMATE_ZOOM 5 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | 4 | android.defaults.buildfeatures.buildconfig=true 5 | android.nonTransitiveRClass=false 6 | android.nonFinalResIds=false 7 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/ZoomVariables.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | import android.widget.ImageView 4 | 5 | internal data class ZoomVariables(var scale: Float, var focusX: Float, var focusY: Float, var scaleType: ImageView.ScaleType?) -------------------------------------------------------------------------------- /touchview/src/main/res/values/attrs_touchimageview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /touchview/src/main/java/com/ortiz/touchview/OnTouchCoordinatesListener.kt: -------------------------------------------------------------------------------- 1 | package com.ortiz.touchview 2 | 3 | import android.graphics.PointF 4 | import android.view.MotionEvent 5 | import android.view.View 6 | 7 | fun interface OnTouchCoordinatesListener { 8 | fun onTouchCoordinate(view: View, event: MotionEvent, bitmapPoint: PointF) 9 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @color/brown_light 4 | @color/brown 5 | #FF4081 6 | #cc7b35 7 | #945824 8 | 9 | -------------------------------------------------------------------------------- /screenShotCompare.sh: -------------------------------------------------------------------------------- 1 | diffFiles=./screenshotDiffs 2 | mkdir $diffFiles 3 | #cp app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator\(AVD\)\ -\ 9/* screenshotsToCompare 4 | set -x 5 | ./git-diff-image/install.sh 6 | GIT_DIFF_IMAGE_OUTPUT_DIR=$diffFiles git diff-image 7 | 8 | ls -la $diffFiles 9 | 10 | # set error when diffs are there 11 | [ "$(ls -A $diffFiles)" ] && exit 1 || exit 0 12 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | labels: 4 | - ignore-for-release 5 | authors: 6 | - someuser 7 | categories: 8 | - title: Breaking Changes 🛠 9 | labels: 10 | - breaking-change 11 | - title: Exciting New Features 🎉 12 | labels: 13 | - enhancement 14 | - title: Dependencies 15 | labels: 16 | - dependencies 17 | - title: Espresso test 18 | labels: 19 | - Espresso 20 | - title: Other Changes 21 | labels: 22 | - "*" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OSX 2 | .DS_Store 3 | 4 | # Built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # Files for the Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # Generated files 15 | bin/ 16 | gen/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio 32 | .idea/* 33 | !.idea/codeStyles/ 34 | *.iml 35 | 36 | screenshots 37 | -------------------------------------------------------------------------------- /.github/workflows/update-gradle-wrapper.yml: -------------------------------------------------------------------------------- 1 | name: Update Gradle Wrapper 2 | 3 | on: 4 | schedule: 5 | - cron: "36 6 * * MON" 6 | 7 | jobs: 8 | update-gradle-wrapper: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v6 13 | - name: Install JDK 14 | uses: actions/setup-java@v5 15 | with: 16 | distribution: 'adopt' 17 | java-version: 17 18 | - name: Update Gradle Wrapper 19 | uses: gradle-update/update-gradle-wrapper-action@v2 20 | with: 21 | repo-token: ${{ secrets.GITHUB_TOKEN }} 22 | set-distribution-checksum: false 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_shaped_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gradle" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | - package-ecosystem: "github-actions" 13 | directory: "/" # Location of package manifests 14 | schedule: 15 | interval: "weekly" -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 |