From 1a3f58ff104a5411f1a9dbf8d7a88ac8c1f70b9f Mon Sep 17 00:00:00 2001 From: ligi Date: Thu, 17 Jul 2014 12:58:32 +0200 Subject: [PATCH] Ticket -> Pass --- ...yTicketList.java => TheEmptyPassList.java} | 9 +++---- ...Activity.java => ThePassListActivity.java} | 8 +++--- ...Activity.java => ThePassViewActivity.java} | 8 +++--- src/main/AndroidManifest.xml | 10 +++---- src/main/java/org/ligi/passandroid/App.java | 2 +- .../model/AppleStylePassReader.java | 16 ++++++------ .../ligi/passandroid/model/PassFieldList.java | 4 +-- .../ui/FullscreenBarcodeActivity.java | 2 +- .../ligi/passandroid/ui/ImportAsyncTask.java | 8 +++--- .../passandroid/ui/InputStreamProvider.java | 4 +-- ...ViewActivity.java => PasViewActivity.java} | 6 ++--- .../org/ligi/passandroid/ui/PassAdapter.java | 10 +++---- ...tActivity.java => PassImportActivity.java} | 12 ++++----- ...istActivity.java => PassListActivity.java} | 26 +++++++++---------- .../ligi/passandroid/ui/PassMenuOptions.java | 10 +++---- ...ityBase.java => PassViewActivityBase.java} | 7 +++-- .../res/layout-land/activity_pass_view.xml | 18 +++++++++++++ .../res/layout-land/activity_ticket_view.xml | 18 ------------- src/main/res/layout/activity_pass_view.xml | 9 +++++++ ...w_base.xml => activity_pass_view_base.xml} | 0 src/main/res/layout/activity_ticket_view.xml | 9 ------- .../layout/{ticket_list.xml => pass_list.xml} | 0 ...t_view.xml => activity_pass_list_view.xml} | 0 ...ticket_view.xml => activity_pass_view.xml} | 0 src/withAnalytics/AndroidManifest.xml | 2 +- .../passandroid/FullscreenMapActivity.java | 4 +-- .../passandroid/LocationsMapFragment.java | 10 +++---- 27 files changed, 105 insertions(+), 107 deletions(-) rename src/androidTest/java/org/ligi/passandroid/{TheEmptyTicketList.java => TheEmptyPassList.java} (80%) rename src/androidTest/java/org/ligi/passandroid/{TheTicketListActivity.java => ThePassListActivity.java} (90%) rename src/androidTest/java/org/ligi/passandroid/{TheTicketViewActivity.java => ThePassViewActivity.java} (92%) rename src/main/java/org/ligi/passandroid/ui/{TicketViewActivity.java => PasViewActivity.java} (96%) rename src/main/java/org/ligi/passandroid/ui/{TicketImportActivity.java => PassImportActivity.java} (74%) rename src/main/java/org/ligi/passandroid/ui/{TicketListActivity.java => PassListActivity.java} (93%) rename src/main/java/org/ligi/passandroid/ui/{TicketViewActivityBase.java => PassViewActivityBase.java} (88%) create mode 100644 src/main/res/layout-land/activity_pass_view.xml delete mode 100644 src/main/res/layout-land/activity_ticket_view.xml create mode 100644 src/main/res/layout/activity_pass_view.xml rename src/main/res/layout/{activity_ticket_view_base.xml => activity_pass_view_base.xml} (100%) delete mode 100644 src/main/res/layout/activity_ticket_view.xml rename src/main/res/layout/{ticket_list.xml => pass_list.xml} (100%) rename src/main/res/menu/{activity_ticket_list_view.xml => activity_pass_list_view.xml} (100%) rename src/main/res/menu/{activity_ticket_view.xml => activity_pass_view.xml} (100%) diff --git a/src/androidTest/java/org/ligi/passandroid/TheEmptyTicketList.java b/src/androidTest/java/org/ligi/passandroid/TheEmptyPassList.java similarity index 80% rename from src/androidTest/java/org/ligi/passandroid/TheEmptyTicketList.java rename to src/androidTest/java/org/ligi/passandroid/TheEmptyPassList.java index a5ef79c4..6c0df77a 100644 --- a/src/androidTest/java/org/ligi/passandroid/TheEmptyTicketList.java +++ b/src/androidTest/java/org/ligi/passandroid/TheEmptyPassList.java @@ -6,20 +6,19 @@ import com.squareup.spoon.Spoon; import org.ligi.passandroid.injections.FixedPassListPassStore; import org.ligi.passandroid.model.Pass; -import org.ligi.passandroid.ui.TicketListActivity; +import org.ligi.passandroid.ui.PassListActivity; import java.util.ArrayList; 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; -public class TheEmptyTicketList extends BaseIntegration { +public class TheEmptyPassList extends BaseIntegration { - public TheEmptyTicketList() { - super(TicketListActivity.class); + public TheEmptyPassList() { + super(PassListActivity.class); } @Override diff --git a/src/androidTest/java/org/ligi/passandroid/TheTicketListActivity.java b/src/androidTest/java/org/ligi/passandroid/ThePassListActivity.java similarity index 90% rename from src/androidTest/java/org/ligi/passandroid/TheTicketListActivity.java rename to src/androidTest/java/org/ligi/passandroid/ThePassListActivity.java index d0cf700b..95cd0376 100644 --- a/src/androidTest/java/org/ligi/passandroid/TheTicketListActivity.java +++ b/src/androidTest/java/org/ligi/passandroid/ThePassListActivity.java @@ -8,7 +8,7 @@ import com.squareup.spoon.Spoon; import org.ligi.passandroid.injections.FixedPassListPassStore; import org.ligi.passandroid.model.Pass; import org.ligi.passandroid.model.PassImpl; -import org.ligi.passandroid.ui.TicketListActivity; +import org.ligi.passandroid.ui.PassListActivity; import java.util.ArrayList; @@ -20,10 +20,10 @@ import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMat import static org.hamcrest.CoreMatchers.not; @TargetApi(14) -public class TheTicketListActivity extends BaseIntegration { +public class ThePassListActivity extends BaseIntegration { - public TheTicketListActivity() { - super(TicketListActivity.class); + public ThePassListActivity() { + super(PassListActivity.class); } @Override diff --git a/src/androidTest/java/org/ligi/passandroid/TheTicketViewActivity.java b/src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java similarity index 92% rename from src/androidTest/java/org/ligi/passandroid/TheTicketViewActivity.java rename to src/androidTest/java/org/ligi/passandroid/ThePassViewActivity.java index 9493f417..47a94c30 100644 --- a/src/androidTest/java/org/ligi/passandroid/TheTicketViewActivity.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.TicketViewActivity; +import org.ligi.passandroid.ui.PasViewActivity; import java.util.ArrayList; @@ -22,12 +22,12 @@ import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMat import static org.hamcrest.CoreMatchers.not; @TargetApi(14) -public class TheTicketViewActivity extends BaseIntegration { +public class ThePassViewActivity extends BaseIntegration { private PassImpl act_pass; - public TheTicketViewActivity() { - super(TicketViewActivity.class); + public ThePassViewActivity() { + super(PasViewActivity.class); } @Override diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 971f406d..7e51995a 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -27,7 +27,7 @@ android:theme="@style/AppTheme"> @@ -37,7 +37,7 @@ @@ -130,12 +130,12 @@ + android:parentActivityName=".ui.PassListActivity"> + android:value=".ui.PassListActivity" /> { public PassFieldList() { } - public PassFieldList(JSONObject ticketJSONObject, String fieldsName) { + public PassFieldList(JSONObject passJSON, String fieldsName) { try { - final JSONArray jsonArray = ticketJSONObject.getJSONArray(fieldsName); + final JSONArray jsonArray = passJSON.getJSONArray(fieldsName); for (int i = 0; i < jsonArray.length(); i++) { try { final PassField field = new PassField(jsonArray.getJSONObject(i)); diff --git a/src/main/java/org/ligi/passandroid/ui/FullscreenBarcodeActivity.java b/src/main/java/org/ligi/passandroid/ui/FullscreenBarcodeActivity.java index d7c77bc0..e55ee1cb 100644 --- a/src/main/java/org/ligi/passandroid/ui/FullscreenBarcodeActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/FullscreenBarcodeActivity.java @@ -14,7 +14,7 @@ import org.ligi.passandroid.R; import static butterknife.ButterKnife.findById; -public class FullscreenBarcodeActivity extends TicketViewActivityBase { +public class FullscreenBarcodeActivity extends PassViewActivityBase { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/src/main/java/org/ligi/passandroid/ui/ImportAsyncTask.java b/src/main/java/org/ligi/passandroid/ui/ImportAsyncTask.java index 3d44c376..70057e94 100644 --- a/src/main/java/org/ligi/passandroid/ui/ImportAsyncTask.java +++ b/src/main/java/org/ligi/passandroid/ui/ImportAsyncTask.java @@ -10,10 +10,10 @@ import org.ligi.passandroid.model.InputStreamWithSource; class ImportAsyncTask extends AsyncTask { private final Uri uri; - protected final Activity ticketImportActivity; + protected final Activity passImportActivity; - public ImportAsyncTask(Activity ticketImportActivity, Uri uri) { - this.ticketImportActivity = ticketImportActivity; + public ImportAsyncTask(Activity passImportActivity, Uri uri) { + this.passImportActivity = passImportActivity; this.uri = uri; } @@ -24,7 +24,7 @@ class ImportAsyncTask extends AsyncTask { switch (uri.getScheme()) { case "content": - return InputStreamProvider.fromContent(ticketImportActivity, uri); + return InputStreamProvider.fromContent(passImportActivity, uri); case "http": case "https": diff --git a/src/main/java/org/ligi/passandroid/ui/InputStreamProvider.java b/src/main/java/org/ligi/passandroid/ui/InputStreamProvider.java index 9515346d..2697e62e 100644 --- a/src/main/java/org/ligi/passandroid/ui/InputStreamProvider.java +++ b/src/main/java/org/ligi/passandroid/ui/InputStreamProvider.java @@ -50,7 +50,7 @@ public class InputStreamProvider { try { return new InputStreamWithSource(uri.toString(), ctx.getContentResolver().openInputStream(uri)); } catch (FileNotFoundException e) { - Tracker.get().trackException("FileNotFoundException in ticketImportActivity/ImportAsyncTask", e, false); + Tracker.get().trackException("FileNotFoundException in passImportActivity/ImportAsyncTask", e, false); return null; } @@ -61,7 +61,7 @@ public class InputStreamProvider { try { return new InputStreamWithSource(uri.toString(), new BufferedInputStream(new URL(uri.toString()).openStream(), 4096)); } catch (IOException e) { - Tracker.get().trackException("IOException in ticketImportActivity/ImportAsyncTask", e, false); + Tracker.get().trackException("IOException in passImportActivity/ImportAsyncTask", e, false); return null; } } diff --git a/src/main/java/org/ligi/passandroid/ui/TicketViewActivity.java b/src/main/java/org/ligi/passandroid/ui/PasViewActivity.java similarity index 96% rename from src/main/java/org/ligi/passandroid/ui/TicketViewActivity.java rename to src/main/java/org/ligi/passandroid/ui/PasViewActivity.java index c9ae3a5b..78bea595 100644 --- a/src/main/java/org/ligi/passandroid/ui/TicketViewActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/PasViewActivity.java @@ -28,7 +28,7 @@ import butterknife.ButterKnife; import butterknife.InjectView; import butterknife.OnClick; -public class TicketViewActivity extends TicketViewActivityBase { +public class PasViewActivity extends PassViewActivityBase { @OnClick(R.id.barcode_img) @@ -73,14 +73,14 @@ public class TicketViewActivity extends TicketViewActivityBase { .setNeutralButton(getString(R.string.send), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - new ExportProblemPassToLigiAndFinishTask(TicketViewActivity.this, pass.getId(), App.getShareDir(), "share.pkpass").execute(); + new ExportProblemPassToLigiAndFinishTask(PasViewActivity.this, pass.getId(), App.getShareDir(), "share.pkpass").execute(); } }) .show(); return; } - final View contentView = getLayoutInflater().inflate(R.layout.activity_ticket_view, null); + final View contentView = getLayoutInflater().inflate(R.layout.activity_pass_view, null); setContentView(contentView); ButterKnife.inject(this); diff --git a/src/main/java/org/ligi/passandroid/ui/PassAdapter.java b/src/main/java/org/ligi/passandroid/ui/PassAdapter.java index f00c69e3..0d238db8 100644 --- a/src/main/java/org/ligi/passandroid/ui/PassAdapter.java +++ b/src/main/java/org/ligi/passandroid/ui/PassAdapter.java @@ -10,10 +10,10 @@ import org.ligi.passandroid.helper.PassVisualizer; class PassAdapter extends BaseAdapter { - private final TicketListActivity ticketListActivity; + private final PassListActivity passListActivity; - public PassAdapter(TicketListActivity ticketListActivity) { - this.ticketListActivity = ticketListActivity; + public PassAdapter(PassListActivity passListActivity) { + this.passListActivity = passListActivity; } @Override @@ -34,9 +34,9 @@ class PassAdapter extends BaseAdapter { @Override public View getView(int position, View convertView, ViewGroup parent) { - View res = ticketListActivity.getLayoutInflater().inflate(R.layout.pass_list_item, null); + View res = passListActivity.getLayoutInflater().inflate(R.layout.pass_list_item, null); - PassVisualizer.visualize(ticketListActivity, App.getPassStore().getPassbookAt(position), res); + PassVisualizer.visualize(passListActivity, App.getPassStore().getPassbookAt(position), res); return res; } diff --git a/src/main/java/org/ligi/passandroid/ui/TicketImportActivity.java b/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java similarity index 74% rename from src/main/java/org/ligi/passandroid/ui/TicketImportActivity.java rename to src/main/java/org/ligi/passandroid/ui/PassImportActivity.java index 04b02316..68772f2f 100644 --- a/src/main/java/org/ligi/passandroid/ui/TicketImportActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/PassImportActivity.java @@ -12,7 +12,7 @@ import org.ligi.passandroid.R; import org.ligi.passandroid.model.InputStreamWithSource; import org.ligi.passandroid.model.PassStore; -public class TicketImportActivity extends ActionBarActivity { +public class PassImportActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { @@ -22,15 +22,15 @@ public class TicketImportActivity extends ActionBarActivity { class ImportAndShowAsyncTask extends ImportAsyncTask { - public ImportAndShowAsyncTask(final Activity ticketImportActivity, final Uri intent_uri) { - super(ticketImportActivity, intent_uri); + public ImportAndShowAsyncTask(final Activity passImportActivity, final Uri intent_uri) { + super(passImportActivity, intent_uri); } @Override protected void onPostExecute(InputStreamWithSource result) { if (result != null) { - UnzipPassDialog.show(result, ticketImportActivity, new UnzipPassDialog.FinishCallback() { + UnzipPassDialog.show(result, passImportActivity, new UnzipPassDialog.FinishCallback() { @Override public Void call(String path) { @@ -40,7 +40,7 @@ public class TicketImportActivity extends ActionBarActivity { final PassStore store = App.getPassStore(); store.setCurrentPass(store.getPassbookForId(id)); - AXT.at(TicketImportActivity.this).startCommonIntent().activityFromClass(TicketViewActivity.class); + AXT.at(PassImportActivity.this).startCommonIntent().activityFromClass(PasViewActivity.class); return null; } @@ -53,7 +53,7 @@ public class TicketImportActivity extends ActionBarActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.activity_ticket_view, menu); + getMenuInflater().inflate(R.menu.activity_pass_view, menu); return true; } diff --git a/src/main/java/org/ligi/passandroid/ui/TicketListActivity.java b/src/main/java/org/ligi/passandroid/ui/PassListActivity.java similarity index 93% rename from src/main/java/org/ligi/passandroid/ui/TicketListActivity.java rename to src/main/java/org/ligi/passandroid/ui/PassListActivity.java index 2454252f..09d8938e 100644 --- a/src/main/java/org/ligi/passandroid/ui/TicketListActivity.java +++ b/src/main/java/org/ligi/passandroid/ui/PassListActivity.java @@ -54,7 +54,7 @@ import static org.ligi.passandroid.ui.UnzipPassController.SilentFail; import static org.ligi.passandroid.ui.UnzipPassController.SilentWin; import static org.ligi.passandroid.ui.UnzipPassController.processInputStream; -public class TicketListActivity extends ActionBarActivity { +public class PassListActivity extends ActionBarActivity { private PassAdapter passAdapter; private boolean scanning = false; @@ -94,7 +94,7 @@ public class TicketListActivity extends ActionBarActivity { void listItemClick(int position) { final Pass newSelectedPass = App.getPassStore().getPassbookAt(position); App.getPassStore().setCurrentPass(Optional.of(newSelectedPass)); - AXT.at(this).startCommonIntent().activityFromClass(TicketViewActivity.class); + AXT.at(this).startCommonIntent().activityFromClass(PasViewActivity.class); } public void refreshPasses() { @@ -103,7 +103,7 @@ public class TicketListActivity extends ActionBarActivity { passAdapter.notifyDataSetChanged(); } - public TicketListActivity() { + public PassListActivity() { super(); } @@ -111,7 +111,7 @@ public class TicketListActivity extends ActionBarActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - setContentView(R.layout.ticket_list); + setContentView(R.layout.pass_list); ButterKnife.inject(this); passAdapter = new PassAdapter(this); @@ -161,7 +161,7 @@ public class TicketListActivity extends ActionBarActivity { @Override public boolean onCreateActionMode(ActionMode actionMode, Menu menu) { - getMenuInflater().inflate(R.menu.activity_ticket_view, menu); + getMenuInflater().inflate(R.menu.activity_pass_view, menu); return true; } @@ -172,7 +172,7 @@ public class TicketListActivity extends ActionBarActivity { @Override public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) { - if (new PassMenuOptions(TicketListActivity.this, App.getPassStore().getPassbookAt(position)).process(menuItem)) { + if (new PassMenuOptions(PassListActivity.this, App.getPassStore().getPassbookAt(position)).process(menuItem)) { actionMode.finish(); return true; } @@ -268,7 +268,7 @@ public class TicketListActivity extends ActionBarActivity { public boolean onPrepareOptionsMenu(Menu menu) { menu.clear(); if (!scanning) { - getMenuInflater().inflate(R.menu.activity_ticket_list_view, menu); + getMenuInflater().inflate(R.menu.activity_pass_list_view, menu); } return true; } @@ -320,15 +320,15 @@ public class TicketListActivity extends ActionBarActivity { class ImportAndRefreshListAsync extends ImportAsyncTask { - public ImportAndRefreshListAsync(final Activity ticketImportActivity, final String path) { - super(ticketImportActivity, Uri.parse("file://" + path)); - new PastLocationsStore(ticketImportActivity).putLocation(path); + public ImportAndRefreshListAsync(final Activity passImportActivity, final String path) { + super(passImportActivity, Uri.parse("file://" + path)); + new PastLocationsStore(passImportActivity).putLocation(path); } @Override protected InputStreamWithSource doInBackground(Void... params) { final InputStreamWithSource ins = super.doInBackground(params); - final InputStreamUnzipControllerSpec spec = new InputStreamUnzipControllerSpec(ins, ticketImportActivity, new SilentWin(), new SilentFail()); + final InputStreamUnzipControllerSpec spec = new InputStreamUnzipControllerSpec(ins, passImportActivity, new SilentWin(), new SilentFail()); processInputStream(spec); return ins; } @@ -390,7 +390,7 @@ public class TicketListActivity extends ActionBarActivity { } else if (file.getName().endsWith(".pkpass")) { Log.i("found" + file.getAbsolutePath()); - new ImportAndRefreshListAsync(TicketListActivity.this, file.getAbsolutePath()).execute(); + new ImportAndRefreshListAsync(PassListActivity.this, file.getAbsolutePath()).execute(); } } @@ -425,7 +425,7 @@ public class TicketListActivity extends ActionBarActivity { @Override protected Void doInBackground(Void... params) { - for (String path : new PastLocationsStore(TicketListActivity.this).getLocations()) { + for (String path : new PastLocationsStore(PassListActivity.this).getLocations()) { search_in(new File(path), false); } diff --git a/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java b/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java index 2931a419..34f52dab 100644 --- a/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java +++ b/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java @@ -49,11 +49,11 @@ public class PassMenuOptions { new File(pass.getSource().get().replace("file://", "")).delete(); } App.getPassStore().deletePassWithId(pass.getId()); - if (activity instanceof TicketViewActivityBase) { - final Intent ticketListIntent = new Intent(activity, TicketListActivity.class); - NavUtils.navigateUpTo(activity, ticketListIntent); - } else if (activity instanceof TicketListActivity) { - ((TicketListActivity) activity).refreshPasses(); + if (activity instanceof PassViewActivityBase) { + final Intent passListIntent = new Intent(activity, PassListActivity.class); + NavUtils.navigateUpTo(activity, passListIntent); + } else if (activity instanceof PassListActivity) { + ((PassListActivity) activity).refreshPasses(); } } diff --git a/src/main/java/org/ligi/passandroid/ui/TicketViewActivityBase.java b/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java similarity index 88% rename from src/main/java/org/ligi/passandroid/ui/TicketViewActivityBase.java rename to src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java index 00e33aee..e519e6ee 100644 --- a/src/main/java/org/ligi/passandroid/ui/TicketViewActivityBase.java +++ b/src/main/java/org/ligi/passandroid/ui/PassViewActivityBase.java @@ -3,7 +3,6 @@ package org.ligi.passandroid.ui; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; -import android.util.Log; import android.view.Display; import android.view.Menu; import android.view.MenuItem; @@ -15,7 +14,7 @@ import org.ligi.passandroid.R; import org.ligi.passandroid.Tracker; import org.ligi.passandroid.model.Pass; -public class TicketViewActivityBase extends ActionBarActivity { +public class PassViewActivityBase extends ActionBarActivity { protected Bitmap icon_bitmap; public Optional optionalPass; @@ -30,7 +29,7 @@ public class TicketViewActivityBase extends ActionBarActivity { optionalPass = App.getPassStore().getCurrentPass(); if (!optionalPass.isPresent()) { - Tracker.get().trackException("pass not present in TicketViewActivityBase", false); + Tracker.get().trackException("pass not present in " + this, false); finish(); return; } @@ -51,7 +50,7 @@ public class TicketViewActivityBase extends ActionBarActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.activity_ticket_view, menu); + getMenuInflater().inflate(R.menu.activity_pass_view, menu); return true; } diff --git a/src/main/res/layout-land/activity_pass_view.xml b/src/main/res/layout-land/activity_pass_view.xml new file mode 100644 index 00000000..182a4895 --- /dev/null +++ b/src/main/res/layout-land/activity_pass_view.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/src/main/res/layout-land/activity_ticket_view.xml b/src/main/res/layout-land/activity_ticket_view.xml deleted file mode 100644 index 69e12b79..00000000 --- a/src/main/res/layout-land/activity_ticket_view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/src/main/res/layout/activity_pass_view.xml b/src/main/res/layout/activity_pass_view.xml new file mode 100644 index 00000000..279401ea --- /dev/null +++ b/src/main/res/layout/activity_pass_view.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/src/main/res/layout/activity_ticket_view_base.xml b/src/main/res/layout/activity_pass_view_base.xml similarity index 100% rename from src/main/res/layout/activity_ticket_view_base.xml rename to src/main/res/layout/activity_pass_view_base.xml diff --git a/src/main/res/layout/activity_ticket_view.xml b/src/main/res/layout/activity_ticket_view.xml deleted file mode 100644 index 2b3ebb0a..00000000 --- a/src/main/res/layout/activity_ticket_view.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/res/layout/ticket_list.xml b/src/main/res/layout/pass_list.xml similarity index 100% rename from src/main/res/layout/ticket_list.xml rename to src/main/res/layout/pass_list.xml diff --git a/src/main/res/menu/activity_ticket_list_view.xml b/src/main/res/menu/activity_pass_list_view.xml similarity index 100% rename from src/main/res/menu/activity_ticket_list_view.xml rename to src/main/res/menu/activity_pass_list_view.xml diff --git a/src/main/res/menu/activity_ticket_view.xml b/src/main/res/menu/activity_pass_view.xml similarity index 100% rename from src/main/res/menu/activity_ticket_view.xml rename to src/main/res/menu/activity_pass_view.xml diff --git a/src/withAnalytics/AndroidManifest.xml b/src/withAnalytics/AndroidManifest.xml index 24c8a5ea..d4b06459 100644 --- a/src/withAnalytics/AndroidManifest.xml +++ b/src/withAnalytics/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="org.ligi.passandroid"> diff --git a/src/withMaps/java/org/ligi/passandroid/FullscreenMapActivity.java b/src/withMaps/java/org/ligi/passandroid/FullscreenMapActivity.java index 4195df61..74fbafce 100644 --- a/src/withMaps/java/org/ligi/passandroid/FullscreenMapActivity.java +++ b/src/withMaps/java/org/ligi/passandroid/FullscreenMapActivity.java @@ -6,9 +6,9 @@ import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import org.ligi.passandroid.ui.NavigateToLocationsDialog; -import org.ligi.passandroid.ui.TicketViewActivityBase; +import org.ligi.passandroid.ui.PassViewActivityBase; -public class FullscreenMapActivity extends TicketViewActivityBase { +public class FullscreenMapActivity extends PassViewActivityBase { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/src/withMaps/java/org/ligi/passandroid/LocationsMapFragment.java b/src/withMaps/java/org/ligi/passandroid/LocationsMapFragment.java index cb45694d..4a3c2ca0 100644 --- a/src/withMaps/java/org/ligi/passandroid/LocationsMapFragment.java +++ b/src/withMaps/java/org/ligi/passandroid/LocationsMapFragment.java @@ -19,12 +19,12 @@ import com.google.android.gms.maps.model.MarkerOptions; import org.ligi.axt.AXT; import org.ligi.passandroid.model.PassLocation; -import org.ligi.passandroid.ui.TicketViewActivityBase; +import org.ligi.passandroid.ui.PassViewActivityBase; import java.util.List; public class LocationsMapFragment extends SupportMapFragment { - private TicketViewActivityBase base_activity; + private PassViewActivityBase base_activity; public boolean click_to_fullscreen = false; private Handler handler; @@ -32,10 +32,10 @@ public class LocationsMapFragment extends SupportMapFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateView(inflater, container, savedInstanceState); - base_activity = (TicketViewActivityBase) getActivity(); + base_activity = (PassViewActivityBase) getActivity(); - if (!(getActivity() instanceof TicketViewActivityBase)) { - throw new IllegalArgumentException("LocationsMapFragment must be used inside a TicketViewActivityBase"); + if (!(getActivity() instanceof PassViewActivityBase)) { + throw new IllegalArgumentException("LocationsMapFragment must be used inside a PassViewActivityBase"); } final MapInitRunnable mapInitRunnable = new MapInitRunnable();