From 62818d3fcfc34b9c14179d4e9209c47fc9cce38d Mon Sep 17 00:00:00 2001 From: ligi Date: Fri, 18 Jul 2014 17:20:58 +0200 Subject: [PATCH] fix typo Pas Pass - bugfix optional pass being absent - cleanup --- .../ligi/passandroid/ThePassViewActivity.java | 7 +++---- src/main/AndroidManifest.xml | 2 +- .../ligi/passandroid/ui/PassImportActivity.java | 2 +- .../ligi/passandroid/ui/PassListActivity.java | 2 +- ...asViewActivity.java => PassViewActivity.java} | 6 +++--- .../passandroid/ui/PassViewActivityBase.java | 16 ---------------- 6 files changed, 9 insertions(+), 26 deletions(-) rename src/main/java/org/ligi/passandroid/ui/{PasViewActivity.java => PassViewActivity.java} (94%) diff --git a/src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java b/src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java index 47a94c30..b4ad0b8a 100644 --- a/src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java +++ b/src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java @@ -9,7 +9,7 @@ import org.joda.time.DateTime; import org.ligi.passandroid.injections.FixedPassListPassStore; import org.ligi.passandroid.model.Pass; import org.ligi.passandroid.model.PassImpl; -import org.ligi.passandroid.ui.PasViewActivity; +import org.ligi.passandroid.ui.PassViewActivity; import java.util.ArrayList; @@ -17,17 +17,16 @@ import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.isDisplayed; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.CoreMatchers.not; @TargetApi(14) -public class ThePassViewActivity extends BaseIntegration { +public class ThePassViewActivity extends BaseIntegration { private PassImpl act_pass; public ThePassViewActivity() { - super(PasViewActivity.class); + super(PassViewActivity.class); } @Override diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index c91523fd..9f7483c3 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -142,7 +142,7 @@ 0)); + menu.findItem(R.id.menu_map).setVisible((optionalPass.isPresent() && optionalPass.get().isValid() && optionalPass.get().getLocations().size() > 0)); return res; } diff --git a/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java b/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java index e519e6ee..c1016d49 100644 --- a/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java +++ b/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java @@ -1,9 +1,7 @@ package org.ligi.passandroid.ui; -import android.graphics.Bitmap; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; -import android.view.Display; import android.view.Menu; import android.view.MenuItem; @@ -16,7 +14,6 @@ import org.ligi.passandroid.model.Pass; public class PassViewActivityBase extends ActionBarActivity { - protected Bitmap icon_bitmap; public Optional optionalPass; @Override @@ -33,19 +30,6 @@ public class PassViewActivityBase extends ActionBarActivity { finish(); return; } - loadIcon(); - } - - private void loadIcon() { - Display display = getWindowManager().getDefaultDisplay(); - int smallestSide = Math.min(display.getHeight(), display.getWidth()); - int size = (int) (2.0f * smallestSide / 3.0f); - - icon_bitmap = optionalPass.get().getIconBitmap(); - - if (icon_bitmap != null) { - icon_bitmap = Bitmap.createScaledBitmap(icon_bitmap, size, size, true); - } } @Override