Protect Pass model from proguard & fix a bug when creating pass when there is no pass yet
This commit is contained in:
parent
9a54758065
commit
6a608e878c
62 changed files with 149 additions and 158 deletions
|
@ -108,10 +108,30 @@
|
|||
-keep public class com.google.android.gms.**
|
||||
-dontwarn com.google.android.gms.**
|
||||
|
||||
##### for otto
|
||||
|
||||
## New rules for EventBus 3.0.x ##
|
||||
# http://greenrobot.org/eventbus/documentation/proguard/
|
||||
|
||||
-keepattributes *Annotation*
|
||||
-keepclassmembers class ** {
|
||||
@com.squareup.otto.Subscribe public *;
|
||||
@com.squareup.otto.Produce public *;
|
||||
@org.greenrobot.eventbus.Subscribe <methods>;
|
||||
}
|
||||
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
|
||||
|
||||
# Only required if you use AsyncExecutor
|
||||
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
|
||||
<init>(java.lang.Throwable);
|
||||
}
|
||||
|
||||
### for moshi
|
||||
|
||||
-keepclassmembers class ** {
|
||||
@com.squareup.moshi.FromJson *;
|
||||
@com.squareup.moshi.ToJson *;
|
||||
}
|
||||
|
||||
|
||||
# Application classes that will be serialized/deserialized via Moshi, keepclassmembers
|
||||
|
||||
-keep class org.ligi.passandroid.model.** { *; }
|
||||
-keepclassmembers class org.ligi.passandroid.model.** { *; }
|
||||
|
|
|
@ -10,12 +10,12 @@ import java.util.UUID;
|
|||
import javax.inject.Singleton;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.ligi.passandroid.injections.FixedPassListPassStore;
|
||||
import org.ligi.passandroid.model.BarCode;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.comparator.PassSortOrder;
|
||||
import org.ligi.passandroid.model.pass.BarCode;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import android.test.InstrumentationTestCase;
|
|||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import org.ligi.passandroid.model.InputStreamWithSource;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.reader.AppleStylePassReader;
|
||||
import org.ligi.passandroid.ui.UnzipPassController;
|
||||
import org.mockito.Mock;
|
||||
|
|
|
@ -2,16 +2,12 @@ package org.ligi.passandroid;
|
|||
|
||||
import android.annotation.TargetApi;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.squareup.spoon.Spoon;
|
||||
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.ui.PassEditActivity;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.ui.PassEditActivity;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.clearText;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
|
|
|
@ -3,14 +3,11 @@ package org.ligi.passandroid;
|
|||
|
||||
import android.test.InstrumentationTestCase;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import org.ligi.passandroid.helper.CategoryHelper;
|
||||
import org.ligi.passandroid.model.PassDefinitions;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.ligi.passandroid.helper.CategoryHelper;
|
||||
import org.ligi.passandroid.model.PassDefinitions;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TheCategoryHelper extends InstrumentationTestCase {
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package org.ligi.passandroid;
|
||||
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
|
||||
import com.squareup.spoon.Spoon;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.ui.PassListActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.ui.PassListActivity;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
|
|
|
@ -4,23 +4,17 @@ import android.graphics.Bitmap;
|
|||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.squareup.spoon.Spoon;
|
||||
|
||||
import java.util.UUID;
|
||||
import javax.inject.Inject;
|
||||
import org.ligi.passandroid.helper.BarcodeDecoder;
|
||||
import org.ligi.passandroid.model.BarCode;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.BarCode;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.ui.FullscreenBarcodeActivity;
|
||||
import org.ligi.tracedroid.TraceDroid;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
|
|
|
@ -2,15 +2,11 @@ package org.ligi.passandroid;
|
|||
|
||||
import android.annotation.TargetApi;
|
||||
import android.test.suitebuilder.annotation.MediumTest;
|
||||
|
||||
import com.squareup.spoon.Spoon;
|
||||
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
import org.ligi.passandroid.ui.PassEditActivity;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
import org.ligi.passandroid.ui.PassEditActivity;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.clearText;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
|
|
|
@ -5,9 +5,9 @@ import android.test.suitebuilder.annotation.MediumTest;
|
|||
import com.google.zxing.BarcodeFormat;
|
||||
import java.util.ArrayList;
|
||||
import javax.inject.Inject;
|
||||
import org.ligi.passandroid.model.BarCode;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.BarCode;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.ui.PassViewActivity;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
|
@ -17,7 +17,6 @@ import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
|||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
|
||||
@TargetApi(14)
|
||||
public class ThePassViewActivity extends BaseIntegration<PassViewActivity> {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package org.ligi.passandroid;
|
||||
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TheQuirkCorrector extends TheAppleStyleBarcodeReaderBase {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.ligi.passandroid.injections
|
||||
|
||||
import org.ligi.passandroid.model.Pass
|
||||
import org.ligi.passandroid.model.PassClassifier
|
||||
import org.ligi.passandroid.model.PassStore
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
|
|
|
@ -7,9 +7,8 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.provider.CalendarContract;
|
||||
import android.support.design.widget.Snackbar;
|
||||
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
|
||||
public class AddToCalendar {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.ligi.passandroid.events;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassRefreshEvent {
|
||||
public final Pass pass;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package org.ligi.passandroid.events
|
||||
|
||||
import org.ligi.passandroid.model.Pass
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
|
||||
class ScanFinishedEvent(val foundPasses: List<Pass>)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package org.ligi.passandroid.helper;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
|
||||
public class CategoryHelper {
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import android.app.Activity;
|
|||
import android.support.design.widget.Snackbar;
|
||||
import android.view.View;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassClassifier;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class MoveHelper {
|
||||
public static void moveWithUndoSnackbar(final PassClassifier passClassifier, final Pass pass, String topic, final Activity activity) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.ligi.passandroid.helper;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
|
||||
public class PassUtil {
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package org.ligi.passandroid.json_adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.squareup.moshi.FromJson;
|
||||
import com.squareup.moshi.ToJson;
|
||||
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
|
||||
public class ColorAdapter {
|
||||
@ToJson
|
||||
|
|
|
@ -6,6 +6,8 @@ import okio.Okio
|
|||
import org.greenrobot.eventbus.EventBus
|
||||
import org.ligi.axt.AXT
|
||||
import org.ligi.passandroid.events.PassStoreChangeEvent
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import org.ligi.passandroid.model.pass.PassImpl
|
||||
import org.ligi.passandroid.reader.AppleStylePassReader
|
||||
import org.ligi.passandroid.reader.PassReader
|
||||
import java.io.File
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.ligi.passandroid.model
|
|||
|
||||
import org.ligi.passandroid.App
|
||||
import org.ligi.passandroid.helper.Strings
|
||||
import org.ligi.passandroid.model.pass.PassField
|
||||
import org.ligi.passandroid.model.pass.PassImpl
|
||||
|
||||
object ApplePassbookQuirkCorrector {
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.ligi.passandroid.model
|
||||
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
|
||||
open class PassClassifier(val topicByIdMap: MutableMap<String, String>, private val passStore: PassStore) {
|
||||
|
||||
open fun processDataChange() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.ligi.passandroid.model
|
||||
|
||||
import org.ligi.passandroid.model.PassType.*
|
||||
import org.ligi.passandroid.model.pass.PassType
|
||||
import org.ligi.passandroid.model.pass.PassType.*
|
||||
|
||||
object PassDefinitions {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.ligi.passandroid.model
|
||||
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import java.io.File
|
||||
|
||||
interface PassStore {
|
||||
|
@ -14,7 +15,7 @@ interface PassStore {
|
|||
|
||||
fun getPathForID(id: String): File
|
||||
|
||||
val passMap: Map<String,Pass>
|
||||
val passMap: Map<String, Pass>
|
||||
|
||||
var currentPass: Pass?
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.ligi.passandroid.model
|
||||
|
||||
import org.ligi.passandroid.model.comparator.PassSortOrder
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import java.util.*
|
||||
|
||||
class PassStoreProjection(private val passStore: PassStore, val topic: String, private val passSortOrder: PassSortOrder? = null) {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package org.ligi.passandroid.model.comparator;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
|
||||
import java.util.Comparator;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassByTimeComparator implements Comparator<Pass> {
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package org.ligi.passandroid.model.comparator;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import static org.ligi.passandroid.model.comparator.PassByTimeComparator.DIRECTION_ASC;
|
||||
|
||||
public class PassByTypeFirstAndTimeSecondComparator implements Comparator<Pass> {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package org.ligi.passandroid.model.comparator;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
|
||||
import java.util.Comparator;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public enum PassSortOrder {
|
||||
DATE_DESC(-1),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.ligi.passandroid.model
|
||||
package org.ligi.passandroid.model.pass
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.graphics.drawable.BitmapDrawable
|
|
@ -1,8 +1,9 @@
|
|||
package org.ligi.passandroid.model
|
||||
package org.ligi.passandroid.model.pass
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.support.annotation.StringDef
|
||||
import org.ligi.passandroid.model.PassBitmapDefinitions.*
|
||||
import org.ligi.passandroid.model.PassStore
|
||||
|
||||
|
||||
interface Pass {
|
|
@ -1,4 +1,4 @@
|
|||
package org.ligi.passandroid.model
|
||||
package org.ligi.passandroid.model.pass
|
||||
|
||||
class PassField(var key: String?, var label: String?, var value: String?,var hide:Boolean) {
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
package org.ligi.passandroid.model
|
||||
package org.ligi.passandroid.model.pass
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import com.squareup.moshi.JsonQualifier
|
||||
import org.ligi.axt.AXT
|
||||
import org.ligi.passandroid.model.PassStore
|
||||
import org.ligi.tracedroid.logging.Log
|
||||
import org.threeten.bp.ZonedDateTime
|
||||
import java.io.File
|
||||
|
@ -62,7 +63,7 @@ class PassImpl(override val id: String) : Pass {
|
|||
|
||||
override fun getBitmap(passStore: PassStore, @Pass.PassBitmap passBitmap: String): Bitmap? {
|
||||
try {
|
||||
val file = File(passStore.getPathForID(id), passBitmap + PassImpl.FILETYPE_IMAGES)
|
||||
val file = File(passStore.getPathForID(id), passBitmap + FILETYPE_IMAGES)
|
||||
return BitmapFactory.decodeStream(FileInputStream(file))
|
||||
} catch (expectedInSomeCases_willJustReturnNull: FileNotFoundException) {
|
||||
return null
|
|
@ -1,4 +1,4 @@
|
|||
package org.ligi.passandroid.model;
|
||||
package org.ligi.passandroid.model.pass;
|
||||
|
||||
public class PassLocation {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.ligi.passandroid.model;
|
||||
package org.ligi.passandroid.model.pass;
|
||||
|
||||
public enum PassType {
|
||||
GENERIC,
|
|
@ -7,7 +7,11 @@ import org.json.JSONObject
|
|||
import org.ligi.axt.AXT
|
||||
import org.ligi.passandroid.App
|
||||
import org.ligi.passandroid.helper.SafeJSONReader
|
||||
import org.ligi.passandroid.model.*
|
||||
import org.ligi.passandroid.model.ApplePassbookQuirkCorrector
|
||||
import org.ligi.passandroid.model.AppleStylePassTranslation
|
||||
import org.ligi.passandroid.model.PassBitmapDefinitions
|
||||
import org.ligi.passandroid.model.PassDefinitions
|
||||
import org.ligi.passandroid.model.pass.*
|
||||
import org.ligi.tracedroid.logging.Log
|
||||
import org.threeten.bp.DateTimeException
|
||||
import org.threeten.bp.ZonedDateTime
|
||||
|
|
|
@ -3,10 +3,10 @@ package org.ligi.passandroid.reader
|
|||
import android.graphics.Color
|
||||
import org.ligi.axt.AXT
|
||||
import org.ligi.passandroid.helper.SafeJSONReader
|
||||
import org.ligi.passandroid.model.BarCode
|
||||
import org.ligi.passandroid.model.Pass
|
||||
import org.ligi.passandroid.model.PassDefinitions
|
||||
import org.ligi.passandroid.model.PassImpl
|
||||
import org.ligi.passandroid.model.pass.BarCode
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import org.ligi.passandroid.model.pass.PassImpl
|
||||
import org.ligi.tracedroid.logging.Log
|
||||
import org.threeten.bp.ZonedDateTime
|
||||
import java.io.File
|
||||
|
|
|
@ -4,9 +4,8 @@ import android.content.res.Resources;
|
|||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import org.ligi.passandroid.helper.BarcodeHelper;
|
||||
import org.ligi.passandroid.model.BarCode;
|
||||
import org.ligi.passandroid.model.pass.BarCode;
|
||||
|
||||
public class AsyncSetBarCodeImageTask extends AsyncTask<BarCode, Void, BitmapDrawable> {
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ import butterknife.ButterKnife;
|
|||
import butterknife.OnClick;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.helper.MoveHelper;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
class MoveToNewTopicUI {
|
||||
|
||||
|
|
|
@ -6,16 +6,13 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassLocation;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassLocation;
|
||||
|
||||
public class NavigateToLocationsDialog {
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ import javax.inject.Inject;
|
|||
import org.ligi.axt.AXT;
|
||||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.PassStoreProjection;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.ui.pass_view_holder.CondensedPassViewHolder;
|
||||
import org.ligi.passandroid.ui.pass_view_holder.PassViewHolder;
|
||||
import org.ligi.passandroid.ui.pass_view_holder.VerbosePassViewHolder;
|
||||
|
|
|
@ -18,10 +18,10 @@ import org.ligi.axt.AXT;
|
|||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.events.PassRefreshEvent;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.ui.edit_fragments.BarcodeEditFragment;
|
||||
import org.ligi.passandroid.ui.edit_fragments.CategoryPickFragment;
|
||||
import org.ligi.passandroid.ui.edit_fragments.ColorPickFragment;
|
||||
|
|
|
@ -12,8 +12,8 @@ import org.ligi.axt.AXT;
|
|||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.InputStreamWithSource;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassImportActivity extends AppCompatActivity {
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ import org.ligi.passandroid.events.PassStoreChangeEvent;
|
|||
import org.ligi.passandroid.events.ScanFinishedEvent;
|
||||
import org.ligi.passandroid.events.ScanProgressEvent;
|
||||
import org.ligi.passandroid.helper.PassUtil;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassClassifier;
|
||||
import org.ligi.passandroid.model.PassStoreProjection;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.snackengage.SnackEngage;
|
||||
import org.ligi.snackengage.snacks.DefaultRateSnack;
|
||||
import org.ligi.tracedroid.TraceDroid;
|
||||
|
@ -82,7 +82,15 @@ public class PassListActivity extends PassAndroidActivity {
|
|||
passStore.save(pass);
|
||||
floatingActionsMenu.collapse();
|
||||
AXT.at(this).startCommonIntent().activityFromClass(PassEditActivity.class);
|
||||
passStore.getClassifier().moveToTopic(pass, adapter.getPageTitle(tabLayout.getSelectedTabPosition()).toString());
|
||||
|
||||
final String newTitle;
|
||||
if (tabLayout.getSelectedTabPosition() < 0) {
|
||||
newTitle = getString(R.string.topic_new);
|
||||
} else {
|
||||
newTitle = adapter.getPageTitle(tabLayout.getSelectedTabPosition()).toString();
|
||||
}
|
||||
|
||||
passStore.getClassifier().moveToTopic(pass, newTitle);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
@ -267,7 +275,8 @@ public class PassListActivity extends PassAndroidActivity {
|
|||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
menu.findItem(R.id.menu_emptytrash).setVisible((adapter.getCount()>0) && adapter.getPageTitle(viewPager.getCurrentItem()).equals(getString(R.string.topic_trash)));
|
||||
menu.findItem(R.id.menu_emptytrash)
|
||||
.setVisible((adapter.getCount() > 0) && adapter.getPageTitle(viewPager.getCurrentItem()).equals(getString(R.string.topic_trash)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ import org.ligi.passandroid.R;
|
|||
import org.ligi.passandroid.events.PassStoreChangeEvent;
|
||||
import org.ligi.passandroid.events.ScanFinishedEvent;
|
||||
import org.ligi.passandroid.helper.MoveHelper;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.PassStoreProjection;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import static android.support.v7.widget.helper.ItemTouchHelper.LEFT;
|
||||
import static android.support.v7.widget.helper.ItemTouchHelper.RIGHT;
|
||||
import static android.support.v7.widget.helper.ItemTouchHelper.SimpleCallback;
|
||||
|
|
|
@ -15,9 +15,9 @@ import org.ligi.passandroid.App;
|
|||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.Tracker;
|
||||
import org.ligi.passandroid.maps.PassbookMapsFacade;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassMenuOptions {
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@ import org.ligi.axt.AXT;
|
|||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.helper.BarcodeHelper;
|
||||
import org.ligi.passandroid.maps.PassbookMapsFacade;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassBitmapDefinitions;
|
||||
import org.ligi.passandroid.model.PassField;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassField;
|
||||
import org.ligi.passandroid.ui.pass_view_holder.PassViewHolder;
|
||||
import org.ligi.passandroid.ui.pass_view_holder.VerbosePassViewHolder;
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import javax.inject.Inject;
|
|||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.InputStreamWithSource;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.Settings;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.ui.UnzipPassController.InputStreamUnzipControllerSpec;
|
||||
|
||||
public class PassViewActivityBase extends PassAndroidActivity {
|
||||
|
|
|
@ -21,9 +21,9 @@ import org.ligi.passandroid.Tracker;
|
|||
import org.ligi.passandroid.events.ScanFinishedEvent;
|
||||
import org.ligi.passandroid.events.ScanProgressEvent;
|
||||
import org.ligi.passandroid.model.InputStreamWithSource;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.PastLocationsStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.tracedroid.logging.Log;
|
||||
import static org.ligi.passandroid.ui.UnzipPassController.InputStreamUnzipControllerSpec;
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ import android.content.Intent
|
|||
import android.graphics.Bitmap
|
||||
import android.support.v4.app.NotificationCompat
|
||||
import org.ligi.passandroid.R
|
||||
import org.ligi.passandroid.model.Pass
|
||||
import org.ligi.passandroid.model.PassBitmapDefinitions
|
||||
import org.ligi.passandroid.model.PassStore
|
||||
import org.ligi.passandroid.model.pass.Pass
|
||||
import java.io.File
|
||||
|
||||
internal class SearchSuccessCallback(private val context: Context, private val passStore: PassStore, private val foundList: MutableList<Pass>, private val findNotificationBuilder: NotificationCompat.Builder, private val file: File, private val notifyManager: NotificationManager) : UnzipPassController.SuccessCallback {
|
||||
|
|
|
@ -11,22 +11,17 @@ import android.widget.EditText;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
|
||||
import org.ligi.axt.simplifications.SimpleTextWatcher;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.helper.Strings;
|
||||
import org.ligi.passandroid.model.BarCode;
|
||||
import org.ligi.passandroid.ui.AsyncSetBarCodeImageTask;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
import org.ligi.axt.simplifications.SimpleTextWatcher;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.helper.Strings;
|
||||
import org.ligi.passandroid.model.pass.BarCode;
|
||||
import org.ligi.passandroid.ui.AsyncSetBarCodeImageTask;
|
||||
import static android.text.TextUtils.isEmpty;
|
||||
|
||||
public class BarcodeEditFragment extends PassandroidFragment {
|
||||
|
|
|
@ -15,9 +15,9 @@ import org.ligi.passandroid.App;
|
|||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.events.PassRefreshEvent;
|
||||
import org.ligi.passandroid.helper.CategoryHelper;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
import org.ligi.passandroid.ui.views.CategoryIndicatorView;
|
||||
|
||||
public class CategoryPickFragment extends ListFragment {
|
||||
|
|
|
@ -16,7 +16,7 @@ import butterknife.OnClick;
|
|||
import java.util.List;
|
||||
import org.ligi.axt.simplifications.SimpleTextWatcher;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.PassField;
|
||||
import org.ligi.passandroid.model.pass.PassField;
|
||||
|
||||
public class FieldsEditFragment extends PassandroidFragment {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.ligi.axt.AXT;
|
|||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.events.PassRefreshEvent;
|
||||
import org.ligi.passandroid.helper.Files;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
public class ImageEditFragment extends PassandroidFragment {
|
||||
|
|
|
@ -11,16 +11,14 @@ import android.view.ViewGroup;
|
|||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import org.ligi.axt.simplifications.SimpleTextWatcher;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.events.PassRefreshEvent;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import org.ligi.axt.simplifications.SimpleTextWatcher;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.events.PassRefreshEvent;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
|
||||
public class MetaDataFragment extends PassandroidFragment implements TimePickerDialog.OnTimeSetListener, DatePickerDialog.OnDateSetListener {
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import android.support.v4.app.Fragment;
|
|||
import javax.inject.Inject;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.ligi.passandroid.App;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
|
||||
public class PassandroidFragment extends Fragment {
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package org.ligi.passandroid.ui.pass_view_holder;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@ import butterknife.ButterKnife;
|
|||
import butterknife.OnClick;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.actions.AddToCalendar;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassBitmapDefinitions;
|
||||
import org.ligi.passandroid.model.PassField;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassField;
|
||||
import org.ligi.passandroid.ui.NavigateToLocationsDialog;
|
||||
import org.ligi.passandroid.ui.Visibility;
|
||||
import org.ligi.passandroid.ui.views.CategoryIndicatorView;
|
||||
|
|
|
@ -2,8 +2,8 @@ package org.ligi.passandroid.ui.pass_view_holder;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
public class VerbosePassViewHolder extends PassViewHolder {
|
||||
|
|
|
@ -6,12 +6,10 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.helper.CategoryHelper;
|
||||
import org.ligi.passandroid.model.PassType;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
import org.ligi.passandroid.model.pass.PassType;
|
||||
|
||||
public class CategoryIndicatorView extends LinearLayout {
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package org.ligi.passandroid.maps;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassbookMapsFacade {
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package org.ligi.passandroid.unittest;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.PassClassifier;
|
||||
import org.ligi.passandroid.model.PassImpl;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.ligi.passandroid.model.PassClassifier;
|
||||
import org.ligi.passandroid.model.PassStore;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
import org.ligi.passandroid.model.pass.PassImpl;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.os.Handler;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.SupportMapFragment;
|
||||
|
@ -16,12 +15,10 @@ import com.google.android.gms.maps.model.LatLng;
|
|||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
import com.google.android.gms.maps.model.Marker;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
|
||||
import org.ligi.axt.AXT;
|
||||
import org.ligi.passandroid.model.PassLocation;
|
||||
import org.ligi.passandroid.ui.PassViewActivityBase;
|
||||
|
||||
import java.util.List;
|
||||
import org.ligi.axt.AXT;
|
||||
import org.ligi.passandroid.model.pass.PassLocation;
|
||||
import org.ligi.passandroid.ui.PassViewActivityBase;
|
||||
|
||||
public class LocationsMapFragment extends SupportMapFragment {
|
||||
private PassViewActivityBase base_activity;
|
||||
|
|
|
@ -4,15 +4,13 @@ package org.ligi.passandroid.maps;
|
|||
import android.content.Context;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
|
||||
import org.ligi.axt.AXT;
|
||||
import org.ligi.passandroid.FullscreenMapActivity;
|
||||
import org.ligi.passandroid.LocationsMapFragment;
|
||||
import org.ligi.passandroid.R;
|
||||
import org.ligi.passandroid.model.Pass;
|
||||
import org.ligi.passandroid.model.pass.Pass;
|
||||
|
||||
public class PassbookMapsFacade {
|
||||
|
||||
|
|
Loading…
Reference in a new issue