-
Notifications
You must be signed in to change notification settings - Fork 123
Allow long-pressing on VOR Locations #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
023c740
e9be30f
a150ece
95e6c34
024cfe4
a466d91
d416647
9460c9a
ddffc23
a54638e
99219e0
38e79b2
090b24a
5e25cc8
49215d8
a69d248
f813826
588b8b7
14aa738
7f7a596
1f190e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ | |
| import com.ds.avare.utils.OptionButton; | ||
| import com.ds.avare.utils.Tips; | ||
| import com.ds.avare.views.LocationView; | ||
| import com.ds.avare.views.LongPressedDestination; | ||
| import com.ds.avare.webinfc.WebAppMapInterface; | ||
|
|
||
| import java.io.File; | ||
|
|
@@ -144,7 +145,7 @@ public class LocationActivity extends Activity implements Observer { | |
| private AnimateButton mAnimateHelp; | ||
| private AnimateButton mAnimateDownload; | ||
| private AnimateButton mAnimatePref; | ||
| private String mAirportPressed; | ||
| private LongPressedDestination mDestinationPressed; | ||
| private AlertDialog mAlertDialogDestination; | ||
| private WebAppMapInterface mInfc; | ||
|
|
||
|
|
@@ -492,7 +493,7 @@ public void gestureCallBack(int event, LongTouchDestination data) { | |
| * Show the popout | ||
| * Now populate the pop out weather etc. | ||
| */ | ||
| mAirportPressed = data.airport; | ||
| mDestinationPressed = new LongPressedDestination(data.destinationName, data.destinationType) ; | ||
|
|
||
| } | ||
| } | ||
|
|
@@ -896,7 +897,7 @@ public Object callback(Object o, Object o1) { | |
|
|
||
| mAlertDialogDestination.dismiss(); | ||
|
|
||
| if (null == mAirportPressed) { | ||
| if (null == mDestinationPressed) { | ||
| return null; | ||
| } | ||
| if (mService == null) { | ||
|
|
@@ -907,41 +908,32 @@ public Object callback(Object o, Object o1) { | |
| /* | ||
| * A/FD | ||
| */ | ||
| if (!mAirportPressed.contains("&")) { | ||
| mService.setLastAfdAirport(mAirportPressed); | ||
| if (mDestinationPressed.getType() == Destination.BASE) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. having type of a destination pressed is nice here as we select various actions base on type; this also gets rid of checking hard-coded & character |
||
| mService.setLastAfdAirport(mDestinationPressed.getName()); | ||
| ((MainActivity) LocationActivity.this.getParent()).showAfdTab(); | ||
| } | ||
| mAirportPressed = null; | ||
| mDestinationPressed = null; | ||
| } else if (param.equals("Plate")) { | ||
| /* | ||
| * Plate | ||
| */ | ||
| if (!mAirportPressed.contains("&")) { | ||
| mService.setLastPlateAirport(mAirportPressed); | ||
| if (mDestinationPressed.getType() == Destination.BASE) { | ||
| mService.setLastPlateAirport(mDestinationPressed.getName()); | ||
| mService.setLastPlateIndex(0); | ||
| ((MainActivity) LocationActivity.this.getParent()).showPlatesTab(); | ||
| } | ||
| mAirportPressed = null; | ||
| mDestinationPressed = null; | ||
| } else if (param.equals("+Plan")) { | ||
| String type = Destination.BASE; | ||
| if (mAirportPressed.contains("&")) { | ||
| type = Destination.GPS; | ||
| } | ||
| planTo(mAirportPressed, type); | ||
| mAirportPressed = null; | ||
| planTo(mDestinationPressed.getName(), mDestinationPressed.getType()); | ||
| mDestinationPressed = null; | ||
| } else if (param.equals("->D")) { | ||
|
|
||
| /* | ||
| * On click, find destination that was pressed on in view | ||
| * If button pressed was a destination go there, otherwise if none, then delete current dest | ||
| */ | ||
| String dest = mAirportPressed; | ||
| mAirportPressed = null; | ||
| String type = Destination.BASE; | ||
| if (dest.contains("&")) { | ||
| type = Destination.GPS; | ||
| } | ||
| goTo(dest, type); | ||
| goTo(mDestinationPressed.getName(), mDestinationPressed.getType()); | ||
| mDestinationPressed = null; | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,8 @@ | |
| */ | ||
| public class LongTouchDestination { | ||
|
|
||
| public String airport; | ||
| public String destinationName; | ||
| public String destinationType; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found having those 2 fields here is the easiest way to transit this info down the asynchronous call chain |
||
| public String info; | ||
| public String tfr; | ||
| public String mets; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed because it's not only an airport which can be pressed...