Better map view

This commit is contained in:
Doug Keen 2016-11-06 08:28:26 -08:00
parent 3c7429218a
commit ba11a82221
4 changed files with 8 additions and 16 deletions

View File

@ -8,7 +8,7 @@ dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.1' compile 'com.fasterxml.jackson.core:jackson-databind:2.6.1'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.squareup.okhttp:okhttp:2.7.5' compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.github.chrisbanes:PhotoView:1.3.1' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support:appcompat-v7:25.0.0'

View File

@ -1,19 +1,15 @@
package com.dougkeen.bart.activities; package com.dougkeen.bart.activities;
import android.graphics.drawable.Drawable;
import android.os.Bundle; 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.support.v7.app.AppCompatActivity;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ImageView;
import com.davemorrissey.labs.subscaleview.ImageSource;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import com.dougkeen.bart.R; import com.dougkeen.bart.R;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;
public class ViewMapActivity extends AppCompatActivity { public class ViewMapActivity extends AppCompatActivity {
@ -21,18 +17,14 @@ public class ViewMapActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
PhotoView photoView = new PhotoView(this); SubsamplingScaleImageView photoView = new SubsamplingScaleImageView(this);
setContentView(photoView); setContentView(photoView);
Drawable map = ResourcesCompat.getDrawable(getResources(), R.drawable.map, null); photoView.setImage(ImageSource.resource(R.drawable.map).dimensions(2279, 2075),
photoView.setImageDrawable(map); ImageSource.resource(R.drawable.map_preview));
photoView.setMinimumDpi(320);
PhotoViewAttacher attacher = new PhotoViewAttacher(photoView); photoView.setDoubleTapZoomDpi(480);
attacher.setScaleType(ImageView.ScaleType.FIT_CENTER);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 KiB

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 KiB