diff --git a/app/build.gradle b/app/build.gradle index c7e62d9..b2e0ad2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,8 @@ dependencies { compile 'org.apache.commons:commons-lang3:3.4' compile 'com.fasterxml.jackson.core:jackson-databind:2.6.1' compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' - compile 'com.squareup.okhttp:okhttp:2.5.0' + compile 'com.squareup.okhttp:okhttp:2.7.5' + compile 'com.github.chrisbanes:PhotoView:1.3.1' compile 'com.android.support:appcompat-v7:25.0.0' diff --git a/app/src/main/java/com/dougkeen/bart/activities/ViewMapActivity.java b/app/src/main/java/com/dougkeen/bart/activities/ViewMapActivity.java index 531d36c..2ec082b 100644 --- a/app/src/main/java/com/dougkeen/bart/activities/ViewMapActivity.java +++ b/app/src/main/java/com/dougkeen/bart/activities/ViewMapActivity.java @@ -1,27 +1,35 @@ package com.dougkeen.bart.activities; +import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.support.graphics.drawable.VectorDrawableCompat; +import android.support.v4.content.res.ResourcesCompat; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.webkit.WebView; +import android.widget.ImageView; import com.dougkeen.bart.R; +import uk.co.senab.photoview.PhotoView; +import uk.co.senab.photoview.PhotoViewAttacher; + public class ViewMapActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - WebView webview = new WebView(this); - setContentView(webview); + PhotoView photoView = new PhotoView(this); - webview.getSettings().setBuiltInZoomControls(true); - webview.getSettings().setSupportZoom(true); + setContentView(photoView); - webview.loadUrl("file:///android_res/drawable/map.png"); + Drawable map = ResourcesCompat.getDrawable(getResources(), R.drawable.map, null); + photoView.setImageDrawable(map); + + PhotoViewAttacher attacher = new PhotoViewAttacher(photoView); + attacher.setScaleType(ImageView.ScaleType.FIT_CENTER); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/res/drawable/map.png b/app/src/main/res/drawable/map.png old mode 100644 new mode 100755 index fae6a05..416be07 Binary files a/app/src/main/res/drawable/map.png and b/app/src/main/res/drawable/map.png differ diff --git a/build.gradle b/build.gradle index 5dd81e0..16f4c84 100644 --- a/build.gradle +++ b/build.gradle @@ -13,5 +13,6 @@ buildscript { allprojects { repositories { jcenter() + maven { url "https://jitpack.io" } } }