This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright (C) 2015 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"purchase_link_providers": { | |
"image_base_url": "http://flights.tacdn.com/en_US/1696/img/partners/", | |
"list": [ | |
{ | |
"id": "Travelocity", | |
"display_name": "Travelocity", | |
"is_ota": true, | |
"logo_url": "app_logos/travelocity.png" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Slot 1 is for partner merchandising | |
Slot 2 is for Air Watch when valid. If Air Watch is not valid then show ‘Click to Call’ for US and CA IPs if valid. For all other IPs, show partner merchandising | |
Slot 3 is for partner merchandising | |
Slot 4 is for Click to Call if it has not been shown and is valid. If it has been shown, or is not valid, then show Air Watch. Otherwise show partner merchandising | |
Remaining “n” slots are alternating between merchandising and Air Watch (if valid). Tapping a merchandising unit launches custom web view deep link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Overview: | |
Get the cached fare information from API and compare with the lowest price to decide whether to show price going up or down message. | |
Approaches: | |
1. Using PopupWindow.class to show urgency message | |
2. Adding new layout file of the popupWinwod and inflating this layout file | |
3. Adding new model of LastCachedFare and Fetching values of last_cached_fare from API | |
4. Using logic to decide to show the urgency message, conditions can be: | |
a. 24 hours timestamps | |
b. variables in last_cached_fare != null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. adding the interface in SearchResultFragmentsPagerAdapter.java called OnFragmentScrollChangedListener() and declare virtual function called onPageMoved(int scrollY, boolean isDragging); (scrollY is horizontal position. ) | |
2. creating the enum type called ScrollState, with UP, Down | |
3. instaniate that interface named mOnFragmentScrollChangedListener, and override the onTouchEvent() method, and deal with some variables | |
4. In FLightSearchResultsActivity, implements OnFragmentScrollChangedListener, and override onPageMoved() method, | |
onPageMoved() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. So in order to save a copy of flightSearch in memory, one way to do that is create a copy constructor in FlightSearch.java, just copy all the private member variable, like: | |
public FlightSearch(FlightSearch flightSearch) { | |
this.mOriginAirport = flightSearch.getOriginAirport(); | |
this.mDestinationAirport = flightSearch.getDestinationAirport(); | |
this.mFlightSearchMode = flightSearch.getFlightSearchMode(); | |
this.mBookingClass = .... | |
this.mPrefersNonStop = ... | |
this.mOutboundDate = .. | |
this.mReturnDate = .. | |
this.mNumberOfTravelers = ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. In FlightSearchFormActivity, line FilterActivity.resetFilter() replaced with: | |
if (mFlightSearch == null || !isSameFlightSearch(mFlightSearch, mFile)) { | |
FiltersActivity.resetFilters(); | |
} | |
2. isSameFlightSearch(FlightSearch flightSearch, File file) is defined in Utils file. I was trying to make this method | |
do less calculation in UI thread, so another way is create an AsyncTask, as we did in SaveFlightSearchTask.java | |
http://stackoverflow.com/questions/12575068/how-to-get-the-result-of-onpostexecute-to-main-activity-because-asynctask-is-a | |
public static boolean isSameFlightSearch(FlightSearch flightSearch, File file) { | |
if (flightSearch.isValid() && file != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. For paddingStart, Severity: Errors. | |
because we also have paddingLeft, so for old platform, the paddingStart is ignored; so api < 17, the lint tool | |
will show error about paddingStart, and we do not currently support RTL, and paddingStart work the same way as | |
paddingLeft, so i think it really about the NewApi. Because the lint tool just check whether paddingStart is | |
compatible with api < 17, and I check that when api == 16, it works fine and does not crash. I have checked all | |
the lint error list, i do not find other lint checks might solve this. So I think just add | |
tools:ignore="NewApi" will be fine. | |
2. the warnings in build.gradle showing that some of the tools are using the old version, do i need change | |
these to newest, or just suppress lint to ignore NewerVersionAvailable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. created method in FlightSearchResultsActivity called: | |
private boolean isFilterApplied() {} | |
private void updateFilterMessage() { | |
if (isFilterApplied() && mSearchHasCompleted) { | |
Set<ItineraryFilter> itineraryFilters = ItinerarySet.getInstance().itineraryFilters(); | |
final String sb = getSelectedFiltersString(this, itineraryFilters); | |
mFilterMessagePanel.setVisibility(VISIBLE); | |
mFilterMessagePanel.post(new Runnable() { |
NewerOlder