├── Moyeu
├── HtmlAgilityPack.dll
├── Resources
│ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── ic_icon_layer.png
│ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── ic_icon_layer.png
│ ├── drawable-hdpi
│ │ ├── ic_add.png
│ │ ├── ic_bike.png
│ │ ├── ic_clock.png
│ │ ├── ic_lock.png
│ │ ├── ic_favorite.png
│ │ ├── ic_near_me.png
│ │ ├── ic_bike_small.png
│ │ ├── ic_drawer_map.png
│ │ ├── ic_small_star.png
│ │ ├── drawer_shadow.9.png
│ │ ├── ic_action_search.png
│ │ ├── ic_bike_number.png
│ │ ├── ic_drawer_star.png
│ │ ├── ic_station_lock.png
│ │ ├── ic_action_refresh.png
│ │ ├── ic_drawer_rentals.png
│ │ └── ic_action_mylocation.png
│ ├── drawable-nodpi
│ │ ├── hero.jpg
│ │ ├── background.9.png
│ │ ├── loading_graphic.png
│ │ ├── pane_item_bg_normal.9.png
│ │ └── pane_item_bg_selected.9.png
│ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── ic_icon_layer.png
│ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── ic_icon_layer.png
│ ├── drawable-xhdpi
│ │ ├── ic_add.png
│ │ ├── ic_bike.png
│ │ ├── ic_lock.png
│ │ ├── ic_clock.png
│ │ ├── ic_near_me.png
│ │ ├── ic_favorite.png
│ │ ├── drawer_shadow.9.png
│ │ ├── ic_bike_number.png
│ │ ├── ic_bike_small.png
│ │ ├── ic_drawer_map.png
│ │ ├── ic_drawer_star.png
│ │ ├── ic_small_star.png
│ │ ├── ic_station_lock.png
│ │ ├── ic_action_refresh.png
│ │ ├── ic_action_search.png
│ │ ├── ic_drawer_rentals.png
│ │ └── ic_action_mylocation.png
│ ├── drawable-xxhdpi
│ │ ├── ic_add.png
│ │ ├── ic_bike.png
│ │ ├── ic_clock.png
│ │ ├── ic_lock.png
│ │ ├── ic_favorite.png
│ │ ├── ic_near_me.png
│ │ ├── ic_bike_number.png
│ │ ├── ic_bike_small.png
│ │ ├── ic_drawer_map.png
│ │ ├── ic_drawer_star.png
│ │ ├── ic_small_star.png
│ │ ├── drawer_shadow.9.png
│ │ ├── ic_action_search.png
│ │ ├── ic_station_lock.png
│ │ ├── ic_action_refresh.png
│ │ ├── ic_drawer_rentals.png
│ │ └── ic_action_mylocation.png
│ ├── drawable-xxxhdpi
│ │ ├── ic_add.png
│ │ ├── ic_bike.png
│ │ ├── ic_clock.png
│ │ ├── ic_lock.png
│ │ ├── ic_near_me.png
│ │ ├── ic_bike_small.png
│ │ ├── ic_drawer_map.png
│ │ ├── ic_favorite.png
│ │ ├── ic_small_star.png
│ │ ├── ic_bike_number.png
│ │ ├── ic_drawer_star.png
│ │ ├── ic_station_lock.png
│ │ ├── ic_action_refresh.png
│ │ ├── ic_action_search.png
│ │ ├── ic_drawer_rentals.png
│ │ └── ic_action_mylocation.png
│ ├── values
│ │ ├── wear.xml
│ │ ├── attrs.xml
│ │ ├── Strings.xml
│ │ └── style.xml
│ ├── drawable
│ │ ├── flash_bar_background.xml
│ │ ├── info_pane_vert_divider.xml
│ │ ├── time_cell_bg.xml
│ │ ├── info_pane_header_bg.xml
│ │ ├── list_selector_bg.xml
│ │ ├── info_pane_underline.xml
│ │ ├── drawer_header_underline.xml
│ │ ├── list_divider_material.xml
│ │ ├── ic_favorite_selector.xml
│ │ ├── info_pane_btn_bg.xml
│ │ └── pane_item_bg.xml
│ ├── mipmap-anydpi-v26
│ │ └── icon.xml
│ ├── color
│ │ ├── accent_color_list.xml
│ │ └── favorite_color_list.xml
│ ├── layout
│ │ ├── DrawerHeader.axml
│ │ ├── RentalHeader.axml
│ │ ├── MapLayout.axml
│ │ ├── RentalItem.axml
│ │ └── Main.axml
│ ├── drawable-v21
│ │ ├── info_pane_btn_bg.xml
│ │ ├── ic_favorite_offon_anim.xml
│ │ ├── ic_favorite_onoff_anim.xml
│ │ ├── ic_favorite_selector.xml
│ │ ├── ic_favorite_vector.xml
│ │ ├── ic_bike_small.xml
│ │ ├── ic_racks_vector.xml
│ │ └── ic_bike_vector.xml
│ ├── xml
│ │ └── searchable.xml
│ ├── animator
│ │ ├── frag_slide_out.xml
│ │ └── frag_slide_in.xml
│ ├── menu
│ │ ├── map_menu.xml
│ │ └── drawer_menu.xml
│ ├── anim-v21
│ │ ├── favorite_heart_sign_out.xml
│ │ ├── favorite_add_sign_out.xml
│ │ ├── favorite_heart_sign_in.xml
│ │ ├── favorite_add_sign_in.xml
│ │ └── paper_state_list_anim_material.xml
│ ├── values-v21
│ │ └── style.xml
│ └── raw
│ │ └── GMapStyle.json
├── IMoyeuSection.cs
├── Helpers
│ ├── DoubleExtensions.cs
│ ├── AnalyticsHelper.cs
│ ├── AndroidExtensions.cs
│ ├── TaskHelpers.cs
│ ├── GeoUtils.cs
│ └── AnimationExtensions.cs
├── BitmapEvaluator.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── AndroidManifest.xml
├── Visual
│ ├── FlashBarController.cs
│ ├── RoundCornerDrawable.cs
│ ├── CheckedImageButton.cs
│ └── ChronometerView.cs
├── Data
│ ├── GoogleApis.cs
│ ├── FavoriteManager.cs
│ └── HubwayHistory.cs
├── Storage
│ └── BitmapCache.cs
├── Fragments
│ └── LoginDialogFragment.cs
├── InfoWindowAdapter.cs
└── AddressCompletionAdapter.cs
├── MoyeuWear
├── Resources
│ ├── drawable-hdpi
│ │ ├── Icon.png
│ │ ├── ic_bg_bike.png
│ │ ├── ic_bg_lock.png
│ │ ├── ic_small_bike.png
│ │ ├── ic_small_lock.png
│ │ ├── ic_full_navigate.png
│ │ ├── ic_hubway_loading.png
│ │ ├── ic_small_distance.png
│ │ ├── ic_full_add_favorite.png
│ │ └── ic_full_remove_favorite.png
│ ├── drawable-mdpi
│ │ ├── Icon.png
│ │ ├── ic_bg_bike.png
│ │ ├── ic_bg_lock.png
│ │ ├── ic_small_bike.png
│ │ ├── ic_small_lock.png
│ │ ├── ic_full_navigate.png
│ │ ├── ic_hubway_loading.png
│ │ ├── ic_small_distance.png
│ │ ├── ic_full_add_favorite.png
│ │ └── ic_full_remove_favorite.png
│ ├── drawable-xhdpi
│ │ ├── Icon.png
│ │ ├── ic_bg_bike.png
│ │ ├── ic_bg_lock.png
│ │ ├── ic_small_bike.png
│ │ ├── ic_small_lock.png
│ │ ├── ic_full_navigate.png
│ │ ├── ic_hubway_loading.png
│ │ ├── ic_small_distance.png
│ │ ├── ic_full_add_favorite.png
│ │ └── ic_full_remove_favorite.png
│ ├── drawable-xxhdpi
│ │ ├── Icon.png
│ │ ├── ic_bg_bike.png
│ │ └── ic_bg_lock.png
│ ├── drawable-xxxhdpi
│ │ └── Icon.png
│ ├── drawable-nodpi
│ │ ├── pager_background.png
│ │ ├── pager_background2.png
│ │ ├── switch_track.xml
│ │ └── switch_thumb.xml
│ ├── values
│ │ └── Strings.xml
│ ├── drawable
│ │ ├── hubway_loading.xml
│ │ ├── navigate_button.xml
│ │ └── favorite_button.xml
│ ├── layout
│ │ ├── ActionButtonLayout.axml
│ │ ├── Main.axml
│ │ └── StationCardLayout.axml
│ └── AboutResources.txt
├── IMoyeuActions.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── SimpleStation.cs
├── Assets
│ └── AboutAssets.txt
├── ShadowedBitmapDrawable.cs
├── RoundRectDrawable.cs
├── ActionButtonFragment.cs
├── StationGridAdapter.cs
└── StationCardFragment.cs
├── HtmlParserSharp
├── Resources
│ ├── values
│ │ └── Strings.xml
│ └── AboutResources.txt
├── Properties
│ └── AssemblyInfo.cs
├── Common
│ ├── ParserErrorEventArgs.cs
│ ├── DocumentMode.cs
│ ├── EncodingDetectedEventArgs.cs
│ ├── Attributes.cs
│ ├── XmlViolationPolicy.cs
│ ├── DocumentModeEventArgs.cs
│ └── DoctypeExpectation.cs
├── Core
│ ├── ILocator.cs
│ ├── TaintableLocator.cs
│ ├── Locator.cs
│ ├── CharsetState.cs
│ ├── InsertionMode.cs
│ ├── CoalescingTreeBuilder.cs
│ ├── UTF16Buffer.cs
│ ├── ITreeBuilderState.cs
│ ├── Portability.cs
│ ├── DispatchGroup.cs
│ ├── StateSnapshot.cs
│ └── TreeBuilderConstants.cs
├── LICENSE.txt
└── HtmlParserSharp.csproj
├── MoyeuTests
├── packages.config
├── MoyeuTests.csproj
└── Tests.cs
├── README.md
├── station-history.cs
└── Moyeu.sln
/Moyeu/HtmlAgilityPack.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/HtmlAgilityPack.dll
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_add.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-nodpi/hero.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-nodpi/hero.jpg
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_bike.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_clock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_add.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_bike.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_add.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/Icon.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/Icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_favorite.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_near_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_near_me.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_clock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_near_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_near_me.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_bike.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_clock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_add.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_bike.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_clock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-hdpi/ic_icon_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-hdpi/ic_icon_layer.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/Icon.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_bike_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_bike_small.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_drawer_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_drawer_map.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_small_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_small_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-nodpi/background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-nodpi/background.9.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_favorite.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_favorite.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_near_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_near_me.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_near_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_near_me.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xhdpi/ic_icon_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xhdpi/ic_icon_layer.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xxhdpi/ic_icon_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xxhdpi/ic_icon_layer.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_action_search.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_bike_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_bike_number.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_drawer_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_drawer_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_station_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_station_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-nodpi/loading_graphic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-nodpi/loading_graphic.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_bike_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_bike_number.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_bike_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_bike_small.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_drawer_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_drawer_map.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_drawer_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_drawer_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_small_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_small_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_station_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_station_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_bike_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_bike_number.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_bike_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_bike_small.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_drawer_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_drawer_map.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_drawer_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_drawer_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_small_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_small_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_bike_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_bike_small.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_map.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_favorite.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_small_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_small_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-xxxhdpi/ic_icon_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/mipmap-xxxhdpi/ic_icon_layer.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_bg_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_bg_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_bg_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_bg_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_bg_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_bg_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_bg_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_bg_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_bg_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_bg_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_bg_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_bg_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xxhdpi/ic_bg_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xxhdpi/ic_bg_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xxhdpi/ic_bg_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xxhdpi/ic_bg_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_action_refresh.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_drawer_rentals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_drawer_rentals.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_action_refresh.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_drawer_rentals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_drawer_rentals.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_station_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_station_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_bike_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_bike_number.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_star.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_station_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_station_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_small_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_small_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_small_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_small_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_small_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_small_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_small_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_small_lock.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_small_bike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_small_bike.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_small_lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_small_lock.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-hdpi/ic_action_mylocation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-hdpi/ic_action_mylocation.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xhdpi/ic_action_mylocation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xhdpi/ic_action_mylocation.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_action_refresh.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_drawer_rentals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_drawer_rentals.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_action_refresh.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_rentals.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_drawer_rentals.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_full_navigate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_full_navigate.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_hubway_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_hubway_loading.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_small_distance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_small_distance.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_full_navigate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_full_navigate.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_hubway_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_hubway_loading.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_small_distance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_small_distance.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-nodpi/pager_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-nodpi/pager_background.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_full_navigate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_full_navigate.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-nodpi/pane_item_bg_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-nodpi/pane_item_bg_normal.9.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxhdpi/ic_action_mylocation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxhdpi/ic_action_mylocation.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-xxxhdpi/ic_action_mylocation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-xxxhdpi/ic_action_mylocation.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-nodpi/pager_background2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-nodpi/pager_background2.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_hubway_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_hubway_loading.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_small_distance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_small_distance.png
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-nodpi/pane_item_bg_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/Moyeu/Resources/drawable-nodpi/pane_item_bg_selected.9.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_full_add_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_full_add_favorite.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_full_add_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_full_add_favorite.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_full_add_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_full_add_favorite.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-hdpi/ic_full_remove_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-hdpi/ic_full_remove_favorite.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-mdpi/ic_full_remove_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-mdpi/ic_full_remove_favorite.png
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-xhdpi/ic_full_remove_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/Moyeu/HEAD/MoyeuWear/Resources/drawable-xhdpi/ic_full_remove_favorite.png
--------------------------------------------------------------------------------
/HtmlParserSharp/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | HtmlParserSharp
5 |
6 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | MoyeuWear
5 |
6 |
--------------------------------------------------------------------------------
/Moyeu/Resources/values/wear.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - hubway_station_fetcher
5 |
6 |
--------------------------------------------------------------------------------
/MoyeuTests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/flash_bar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/info_pane_vert_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/IMoyeuSection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Moyeu
4 | {
5 | public interface IMoyeuSection
6 | {
7 | string Name { get; }
8 | string Title { get; }
9 | void RefreshData ();
10 | bool OnBackPressed ();
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/time_cell_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Moyeu/Resources/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Moyeu/Resources/color/accent_color_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/layout/DrawerHeader.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Moyeu/Resources/color/favorite_color_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MoyeuWear/IMoyeuActions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MoyeuWear;
3 |
4 | namespace Moyeu
5 | {
6 | public interface IMoyeuActions
7 | {
8 | BikeActionStatus CurrentStatus { get; }
9 | void NavigateToStation (SimpleStation station);
10 | void ToggleFavoriteStation (int stationID, bool cked);
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable/hubway_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/info_pane_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-nodpi/switch_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Moyeu/Resources/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/Moyeu/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Moyeu
5 | Search station
6 | Open drawer
7 | Close Drawer
8 |
9 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/info_pane_header_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/list_selector_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_favorite_offon_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_favorite_onoff_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/info_pane_underline.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Moyeu/Resources/animator/frag_slide_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/drawer_header_underline.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/list_divider_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Moyeu/Resources/animator/frag_slide_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/ic_favorite_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MoyeuWear/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Moyeu/Resources/menu/map_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/DoubleExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Moyeu
4 | {
5 | public static class DoubleExtensions
6 | {
7 | static readonly IFormatProvider neutralProvider =
8 | System.Globalization.CultureInfo.InvariantCulture;
9 |
10 | public static double ToSafeDouble (this string input)
11 | {
12 | if (string.IsNullOrEmpty (input))
13 | return 0d;
14 | return double.Parse (input, neutralProvider);
15 | }
16 |
17 | public static string ToSafeString (this double input)
18 | {
19 | return input.ToString (neutralProvider);
20 | }
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/info_pane_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
12 |
14 |
--------------------------------------------------------------------------------
/MoyeuWear/SimpleStation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.Graphics;
3 |
4 | namespace MoyeuWear
5 | {
6 | public struct SimpleStation
7 | {
8 | public int Id { get; set; }
9 |
10 | public string Primary { get; set; }
11 | public string Secondary { get; set; }
12 |
13 | public double Distance { get; set; }
14 | public double Lat { get; set; }
15 | public double Lon { get; set; }
16 |
17 | public bool IsFavorite { get; set; }
18 |
19 | public int Bikes { get; set; }
20 | public int Racks { get; set; }
21 |
22 | public Bitmap Background { get; set; }
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable/pane_item_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
12 |
14 |
--------------------------------------------------------------------------------
/Moyeu/Resources/layout/RentalHeader.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/AnalyticsHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin;
4 |
5 | using Android.Content;
6 |
7 | namespace Moyeu
8 | {
9 | public class AnalyticsHelper
10 | {
11 | const string ApiKey = "...";
12 |
13 | //static bool initialized;
14 |
15 | public static void Initialize (Context context)
16 | {
17 | /*if (!initialized) {
18 | try {
19 | Insights.Initialize (ApiKey, context);
20 | } catch {}
21 | }
22 | initialized = true;*/
23 | }
24 |
25 | public static void LogException (string tag, Exception e)
26 | {
27 | /*try {
28 | Insights.Report (e, "Tag", tag);
29 | } catch {}*/
30 | }
31 | }
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/Moyeu/Resources/anim-v21/favorite_heart_sign_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
16 |
--------------------------------------------------------------------------------
/Moyeu/Resources/values-v21/style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #600000
4 | #e00032
5 | #ff5252
6 |
7 | #000000
8 |
9 | 350
10 |
11 |
16 |
--------------------------------------------------------------------------------
/MoyeuWear/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_favorite_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
13 |
17 |
--------------------------------------------------------------------------------
/MoyeuWear/ShadowedBitmapDrawable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.Graphics;
4 | using Android.Graphics.Drawables;
5 |
6 | namespace MoyeuWear
7 | {
8 | public class ShadowedBitmapDrawable : BitmapDrawable
9 | {
10 | float shadowLevel;
11 |
12 | public ShadowedBitmapDrawable (Bitmap bmp) : base (bmp)
13 | {
14 |
15 | }
16 |
17 | public Color ShadowColor {
18 | get;
19 | set;
20 | }
21 |
22 | public void SetShadowLevel (float level)
23 | {
24 | this.shadowLevel = level;
25 | InvalidateSelf ();
26 | }
27 |
28 | public override void Draw (Canvas canvas)
29 | {
30 | base.Draw (canvas);
31 | var shadow = ShadowColor;
32 | var newAlpha = (byte)(shadow.A * shadowLevel);
33 | shadow.A = newAlpha;
34 | canvas.DrawColor (shadow);
35 | }
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/Moyeu/Resources/menu/drawer_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Moyeu/Resources/anim-v21/favorite_add_sign_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
16 |
22 |
--------------------------------------------------------------------------------
/Moyeu/Resources/anim-v21/favorite_heart_sign_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
13 |
20 |
26 |
27 |
--------------------------------------------------------------------------------
/Moyeu/BitmapEvaluator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.Animation;
4 | using Android.Graphics;
5 | using Java.Lang;
6 |
7 | namespace Moyeu
8 | {
9 | public class BitmapEvaluator : Java.Lang.Object, ITypeEvaluator
10 | {
11 | Bitmap cacheBitmap;
12 | Paint blendPaint;
13 |
14 | public Java.Lang.Object Evaluate (float fraction, Java.Lang.Object startValue, Java.Lang.Object endValue)
15 | {
16 | var bmp1 = startValue as Bitmap;
17 | var bmp2 = endValue as Bitmap;
18 | if (cacheBitmap == null)
19 | cacheBitmap = Bitmap.CreateBitmap (bmp1.Width, bmp1.Height, Bitmap.Config.Argb8888);
20 | if (blendPaint == null) {
21 | blendPaint = new Paint ();
22 | blendPaint.SetXfermode (new PorterDuffXfermode (PorterDuff.Mode.SrcOver));
23 | }
24 |
25 | using (var canvas = new Canvas (cacheBitmap)) {
26 | canvas.DrawBitmap (bmp1, 0, 0, null);
27 | blendPaint.Alpha = (int)((1 - fraction) * 255);
28 | canvas.DrawBitmap (bmp2, 0, 0, blendPaint);
29 | }
30 | return cacheBitmap;
31 | }
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/Moyeu/Resources/raw/GMapStyle.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "administrative.land_parcel",
4 | "elementType": "labels",
5 | "stylers": [
6 | {
7 | "visibility": "off"
8 | }
9 | ]
10 | },
11 | {
12 | "featureType": "poi",
13 | "stylers": [
14 | {
15 | "visibility": "off"
16 | }
17 | ]
18 | },
19 | {
20 | "featureType": "poi",
21 | "elementType": "labels.text",
22 | "stylers": [
23 | {
24 | "visibility": "off"
25 | }
26 | ]
27 | },
28 | {
29 | "featureType": "poi.business",
30 | "stylers": [
31 | {
32 | "visibility": "off"
33 | }
34 | ]
35 | },
36 | {
37 | "featureType": "poi.park",
38 | "elementType": "labels.text",
39 | "stylers": [
40 | {
41 | "visibility": "off"
42 | }
43 | ]
44 | },
45 | {
46 | "featureType": "road.local",
47 | "elementType": "labels",
48 | "stylers": [
49 | {
50 | "visibility": "off"
51 | }
52 | ]
53 | }
54 | ]
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_favorite_vector.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
14 |
15 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_bike_small.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
19 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle ("HtmlParserSharp")]
8 | [assembly: AssemblyDescription ("")]
9 | [assembly: AssemblyConfiguration ("")]
10 | [assembly: AssemblyCompany ("")]
11 | [assembly: AssemblyProduct ("")]
12 | [assembly: AssemblyCopyright ("jeremie")]
13 | [assembly: AssemblyTrademark ("")]
14 | [assembly: AssemblyCulture ("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion ("1.0.0")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/Moyeu/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("Moyeu")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("jeremie")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/MoyeuWear/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle ("MoyeuWear")]
9 | [assembly: AssemblyDescription ("")]
10 | [assembly: AssemblyConfiguration ("")]
11 | [assembly: AssemblyCompany ("")]
12 | [assembly: AssemblyProduct ("")]
13 | [assembly: AssemblyCopyright ("jeremie")]
14 | [assembly: AssemblyTrademark ("")]
15 | [assembly: AssemblyCulture ("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion ("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/Moyeu/Visual/FlashBarController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Views;
5 | using Android.Widget;
6 | using Android.Graphics;
7 | using Android.Animation;
8 |
9 | namespace Moyeu
10 | {
11 | public class FlashBarController
12 | {
13 | FrameLayout layout;
14 | TextView text;
15 |
16 | public FlashBarController (View parentView)
17 | {
18 | layout = parentView.FindViewById (Resource.Id.FlashBarLayout);
19 | text = parentView.FindViewById (Resource.Id.FlashBarText);
20 | }
21 |
22 | public void ShowLoading ()
23 | {
24 | text.Text = "Loading";
25 | layout.Visibility = ViewStates.Visible;
26 | layout.AlphaAnimate (1, duration: 400);
27 | }
28 |
29 | public void ShowLoaded ()
30 | {
31 | layout.AlphaAnimate (0, duration: 400, endAction: () => {
32 | layout.Visibility = ViewStates.Gone;
33 | });
34 | }
35 |
36 | public void ShowInformation (string info)
37 | {
38 | text.Text = info;
39 | layout.Visibility = ViewStates.Visible;
40 | layout.AlphaAnimate (1, duration: 500, endAction: () => {
41 | layout.AlphaAnimate (0, duration: 400, startDelay: 2000);
42 | });
43 | }
44 | }
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_racks_vector.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
16 |
21 |
26 |
--------------------------------------------------------------------------------
/Moyeu/Resources/anim-v21/favorite_add_sign_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
12 |
13 |
20 |
26 |
32 |
33 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/AndroidExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.Hardware;
4 | using Android.Util;
5 | using Android.Content;
6 | using Android.Runtime;
7 | using Android.Views;
8 | using Android.Graphics.Drawables;
9 |
10 | namespace Moyeu
11 | {
12 | public static class AndroidExtensions
13 | {
14 | static float density;
15 | static ColorDrawable defaultBgColor;
16 |
17 | public static void Initialize (Context context)
18 | {
19 | var wm = context.GetSystemService (Context.WindowService).JavaCast ();
20 | var displayMetrics = new DisplayMetrics ();
21 | wm.DefaultDisplay.GetMetrics (displayMetrics);
22 | density = displayMetrics.Density;
23 |
24 | var bg = new TypedValue ();
25 | context.Theme.ResolveAttribute (Android.Resource.Attribute.ColorBackground, bg, true);
26 | defaultBgColor = new ColorDrawable (new Android.Graphics.Color (bg.Data));
27 | }
28 |
29 | public static bool IsMaterial {
30 | get {
31 | return Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop;
32 | }
33 | }
34 |
35 | public static int ToPixels (this int dp)
36 | {
37 | return (int)(dp * density + 0.5f);
38 | }
39 |
40 | public static ColorDrawable DefaultBackground {
41 | get {
42 | return defaultBgColor;
43 | }
44 | }
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/layout/ActionButtonLayout.axml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
16 |
24 |
33 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable/navigate_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
-
6 |
7 |
10 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
18 | -
19 |
20 |
-
21 |
22 |
25 |
26 |
27 |
28 | -
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/TaskHelpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Android.Util;
4 |
5 | namespace Moyeu
6 | {
7 | public static class TaskHelpers
8 | {
9 | public static async void IgnoreIfFaulted (this Task original, string logMessage = null)
10 | {
11 | try {
12 | if (original == null)
13 | return;
14 | await original.ConfigureAwait (false);
15 | } catch (Exception e) {
16 | if (logMessage != null)
17 | Log.Error ("AsyncError", logMessage + " " + e.ToString ());
18 | }
19 | }
20 |
21 | public static async Task PreventExceptionThrowing (this Task original)
22 | {
23 | try {
24 | await original;
25 | } catch { }
26 | }
27 |
28 | public static async Task DefaultIfNullOrCanceled (this Task original, T defaultValue = default (T))
29 | {
30 | if (original == null)
31 | return defaultValue;
32 | try {
33 | return await original.ConfigureAwait (false);
34 | } catch (OperationCanceledException) {
35 | return defaultValue;
36 | }
37 | }
38 |
39 | public static async Task DefaultIfFaulted (this Task original, T defaultValue, string logMessage = null)
40 | {
41 | try {
42 | return await original.ConfigureAwait (false);
43 | } catch (Exception e) {
44 | if (logMessage != null)
45 | Log.Error ("AsyncError", logMessage + " " + e.ToString ());
46 | return defaultValue;
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Moyeu/Resources/drawable-v21/ic_bike_vector.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
24 |
28 |
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Moyeu
2 |
3 | Moyeu is an Android application built with [Xamarin.Android](http://xamarin.com/monoforandroid) to visualize Boston's [Hubway](http://thehubway.com/) bike sharing system.
4 |
5 | ## Building/Running
6 |
7 | Every dependency is part of the project either as a submodule or a component.
8 |
9 | Still, since some Google API are used, to properly run the code you need to [setup an API key](https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key) with them.
10 |
11 | ## License
12 |
13 | All code is available under the [Apache 2.0 Licence](http://www.apache.org/licenses/LICENSE-2.0.html). Reuse as much as you want.
14 |
15 | ## Credits
16 |
17 | Icons:
18 |
19 | - Map designed by Jonathan Higley from The Noun Project
20 | - Bicycle designed by Ugur Akdemir from The Noun Project
21 | - Bike Lock designed by Joe Harrison from The Noun Project
22 |
23 | Images:
24 |
25 | - Hubway by Tony Webster (CC BY)
26 |
27 | Data provided by Hubway at [http://thehubway.com/data/stations/bikeStations.xml](http://thehubway.com/data/stations/bikeStations.xml)
28 |
--------------------------------------------------------------------------------
/Moyeu/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/ParserErrorEventArgs.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Patrick Reisert
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and associated documentation files (the "Software"),
6 | * to deal in the Software without restriction, including without limitation
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | * and/or sell copies of the Software, and to permit persons to whom the
9 | * Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | * DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using System;
24 |
25 | #pragma warning disable 1591
26 |
27 | namespace HtmlParserSharp.Common
28 | {
29 | public class ParserErrorEventArgs : EventArgs
30 | {
31 | public string Message { get; private set; }
32 | public bool IsWarning { get; private set; }
33 |
34 | public ParserErrorEventArgs(string message, bool isWarning)
35 | {
36 | Message = message;
37 | IsWarning = isWarning;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
12 |
23 |
39 |
--------------------------------------------------------------------------------
/MoyeuWear/RoundRectDrawable.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Util;
12 | using Android.Views;
13 | using Android.Widget;
14 | using Android.Graphics;
15 | using Android.Graphics.Drawables;
16 |
17 | namespace MoyeuWear
18 | {
19 | public class RoundRectDrawable : Drawable
20 | {
21 | float radius;
22 | Paint paint;
23 | RectF bounds;
24 |
25 | public RoundRectDrawable (Color background, float radius)
26 | {
27 | this.radius = radius;
28 | this.paint = new Paint {
29 | Color = background,
30 | Dither = true,
31 | AntiAlias = true
32 | };
33 | this.bounds = new RectF ();
34 | }
35 |
36 | public override void Draw (Canvas canvas)
37 | {
38 | canvas.DrawRoundRect (bounds, radius, radius, paint);
39 | }
40 |
41 | protected override void OnBoundsChange (Rect bounds)
42 | {
43 | base.OnBoundsChange (bounds);
44 | this.bounds.Set (bounds);
45 | }
46 |
47 | public Color Background {
48 | get { return paint.Color; }
49 | set {
50 | paint.Color = value;
51 | InvalidateSelf ();
52 | }
53 | }
54 |
55 | public float Radius {
56 | get { return radius; }
57 | set {
58 | radius = value;
59 | InvalidateSelf ();
60 | }
61 | }
62 |
63 | public override int Alpha {
64 | get {
65 | return 1;
66 | }
67 | set {
68 | }
69 | }
70 |
71 | public override void SetAlpha (int alpha)
72 | {
73 | }
74 |
75 | public override void SetColorFilter (ColorFilter cf)
76 | {
77 | }
78 |
79 | public override int Opacity {
80 | get {
81 | return (int)Format.Opaque;
82 | }
83 | }
84 | }
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/DocumentMode.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2008 Mozilla Foundation
4 | * Copyright (c) 2012 Patrick Reisert
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a
7 | * copy of this software and associated documentation files (the "Software"),
8 | * to deal in the Software without restriction, including without limitation
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 | * and/or sell copies of the Software, and to permit persons to whom the
11 | * Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 | * DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | #pragma warning disable 1591
26 |
27 | namespace HtmlParserSharp.Common
28 | {
29 | public enum DocumentMode
30 | {
31 | ///
32 | /// The Standards Mode
33 | ///
34 | StandardsMode,
35 |
36 | ///
37 | /// The Limited Quirks Mode aka. The Almost Standards Mode
38 | ///
39 | AlmostStandardsMode,
40 |
41 | ///
42 | /// The Quirks Mode
43 | ///
44 | ///
45 | QuirksMode
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/GeoUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Moyeu
5 | {
6 | public class GeoUtils
7 | {
8 | // Use spherical law of cosines
9 | public static double Distance (GeoPoint p1, GeoPoint p2)
10 | {
11 | const int EarthRadius = 6371;
12 | return Math.Acos (Math.Sin (DegToRad (p1.Lat)) * Math.Sin (DegToRad (p2.Lat)) +
13 | Math.Cos (DegToRad (p1.Lat)) * Math.Cos (DegToRad (p2.Lat)) *
14 | Math.Cos (DegToRad (p2.Lon) - DegToRad (p1.Lon))) * EarthRadius;
15 | }
16 |
17 | static double DegToRad (double deg)
18 | {
19 | return deg * Math.PI / 180;
20 | }
21 |
22 | public static void DumpLocation (GeoPoint p, Stream stream)
23 | {
24 | using (var writer = new BinaryWriter (stream, System.Text.Encoding.UTF8, true)) {
25 | writer.Write (p.Lat);
26 | writer.Write (p.Lon);
27 | }
28 | }
29 |
30 | public static GeoPoint ParseFromStream (Stream stream)
31 | {
32 | using (var reader = new BinaryReader (stream, System.Text.Encoding.UTF8, true)) {
33 | return new GeoPoint {
34 | Lat = reader.ReadDouble (),
35 | Lon = reader.ReadDouble ()
36 | };
37 | }
38 | }
39 |
40 | static bool UseMiles {
41 | get { return System.Globalization.CultureInfo.CurrentCulture.Name == "en-US"; }
42 | }
43 |
44 | public static string GetUnitForDistance (double distance)
45 | {
46 | return UseMiles ? "mi" : (distance >= 1000 ? "km" : "m");
47 | }
48 |
49 | public static string GetDisplayDistance (double distance, bool strictValue = false)
50 | {
51 | var isMiles = UseMiles;
52 | var display = (isMiles ? distance * 0.00062137 : (distance >= 1000 ? (distance / 1000) : distance)).ToString (isMiles ? "N1" : "N0");
53 | return display == "0" && !strictValue ? "<1" : display;
54 | }
55 | }
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Core/ILocator.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Patrick Reisert
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and associated documentation files (the "Software"),
6 | * to deal in the Software without restriction, including without limitation
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | * and/or sell copies of the Software, and to permit persons to whom the
9 | * Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | * DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | #pragma warning disable 1591 // Missing XML comment
24 | #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason'
25 | #pragma warning disable 1587 // XML comment is not placed on a valid element
26 |
27 | namespace HtmlParserSharp.Core
28 | {
29 | ///
30 | /// Interface for getting the current line and column
31 | /// (Corresponds to the SAX Locator interface).
32 | /// This is implemented by Locator and Tokenizer.
33 | ///
34 | public interface ILocator
35 | {
36 | int LineNumber { get; }
37 | int ColumnNumber { get; }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Moyeu/Visual/RoundCornerDrawable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.Graphics;
4 | using Android.Graphics.Drawables;
5 | using Android.Content.Res;
6 |
7 | using Rdio.TangoAndCache.Android.UI.Drawables;
8 |
9 | namespace Moyeu
10 | {
11 | public class RoundCornerDrawable : SelfDisposingBitmapDrawable
12 | {
13 | float mCornerRadius;
14 | RectF mRect = new RectF ();
15 | BitmapShader bitmapShader;
16 | Paint paint;
17 | Paint strokePaint;
18 | int margin;
19 |
20 | public RoundCornerDrawable (Resources res, Bitmap bitmap, float cornerRadius = 5, int margin = 3)
21 | : base (res, bitmap)
22 | {
23 | mCornerRadius = cornerRadius;
24 |
25 | bitmapShader = new BitmapShader (bitmap, Shader.TileMode.Clamp, Shader.TileMode.Clamp);
26 |
27 | paint = new Paint () {
28 | AntiAlias = true,
29 | };
30 | paint.SetShader (bitmapShader);
31 | strokePaint = new Paint () {
32 | Color = Color.Rgb (200, 200, 200),
33 | StrokeWidth = 2,
34 | };
35 | strokePaint.SetStyle (Paint.Style.Stroke);
36 |
37 | this.margin = margin;
38 | }
39 |
40 | protected override void OnBoundsChange (Rect bounds)
41 | {
42 | base.OnBoundsChange (bounds);
43 | mRect.Set (margin, margin, bounds.Width () - margin, bounds.Height () - margin);
44 | }
45 |
46 | public override void Draw (Canvas canvas)
47 | {
48 | canvas.DrawRoundRect (mRect, mCornerRadius, mCornerRadius, strokePaint);
49 | canvas.DrawRoundRect (mRect, mCornerRadius, mCornerRadius, paint);
50 | }
51 |
52 | public override int Opacity {
53 | get {
54 | return (int)Format.Translucent;
55 | }
56 | }
57 |
58 | public override void SetAlpha (int alpha)
59 | {
60 | paint.Alpha = alpha;
61 | }
62 |
63 | public override void SetColorFilter (ColorFilter cf)
64 | {
65 | paint.SetColorFilter (cf);
66 | }
67 | }
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/Moyeu/Data/GoogleApis.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Net.Http;
4 | using System.Collections.Generic;
5 | using System.Threading.Tasks;
6 |
7 | using Android.Widget;
8 | using Android.Graphics;
9 | using Android.Graphics.Drawables;
10 | using Android.Content;
11 |
12 | using LatLng = Android.Gms.Maps.Model.LatLng;
13 |
14 | namespace Moyeu
15 | {
16 | public class GoogleApis
17 | {
18 | public const int MaxStreetViewSize = 640;
19 |
20 | const string ApiKey = "...";
21 |
22 | public static string MakeStreetViewUrl (GeoPoint position, int width, int height)
23 | {
24 | var parameters = new Dictionary {
25 | { "key", ApiKey },
26 | { "sensor", "false" },
27 | { "size", Math.Min (width, MaxStreetViewSize) + "x" + Math.Min (height, MaxStreetViewSize) },
28 | { "location", position.Lat.ToSafeString () + "," + position.Lon.ToSafeString () },
29 | { "pitch", "-10" },
30 | };
31 |
32 | return BuildUrl ("https://maps.googleapis.com/maps/api/streetview?", parameters);
33 | }
34 |
35 | public static string MakeMapUrl (GeoPoint location, int width, int height)
36 | {
37 | var zoom = "17";
38 | var markerSize = "size:med";
39 | var parameters = new Dictionary {
40 | { "key", ApiKey },
41 | { "zoom", zoom },
42 | { "sensor", "true" },
43 | { "size", width + "x" + height },
44 | { "center", location.Lat + "," + location.Lon },
45 | { "markers", markerSize + "|" + location.Lat + "," + location.Lon }
46 | };
47 |
48 | return BuildUrl ("https://maps.googleapis.com/maps/api/staticmap?",
49 | parameters);
50 | }
51 |
52 | static string BuildUrl (string baseUrl, Dictionary parameters)
53 | {
54 | return baseUrl + string.Join ("&", parameters.Select (pvp => pvp.Key + "=" + pvp.Value));
55 | }
56 | }
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Core/TaintableLocator.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Mozilla Foundation
3 | * Copyright (c) 2012 Patrick Reisert
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a
6 | * copy of this software and associated documentation files (the "Software"),
7 | * to deal in the Software without restriction, including without limitation
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 | * and/or sell copies of the Software, and to permit persons to whom the
10 | * Software is furnished to do so, subject to the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included in
13 | * all copies or substantial portions of the Software.
14 | *
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 | * DEALINGS IN THE SOFTWARE.
22 | */
23 |
24 | #pragma warning disable 1591 // Missing XML comment
25 | #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason'
26 | #pragma warning disable 1587 // XML comment is not placed on a valid element
27 |
28 | namespace HtmlParserSharp.Core
29 | {
30 | public class TaintableLocator : Locator
31 | {
32 | public TaintableLocator(ILocator locator)
33 | : base(locator)
34 | {
35 | IsTainted = false;
36 | }
37 |
38 | public void MarkTainted()
39 | {
40 | IsTainted = true;
41 | }
42 |
43 | public bool IsTainted { get; private set; }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Core/Locator.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2011 Mozilla Foundation
4 | * Copyright (c) 2012 Patrick Reisert
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a
7 | * copy of this software and associated documentation files (the "Software"),
8 | * to deal in the Software without restriction, including without limitation
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 | * and/or sell copies of the Software, and to permit persons to whom the
11 | * Software is furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 | * DEALINGS IN THE SOFTWARE.
23 | */
24 |
25 | #pragma warning disable 1591 // Missing XML comment
26 | #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason'
27 | #pragma warning disable 1587 // XML comment is not placed on a valid element
28 |
29 | namespace HtmlParserSharp.Core
30 | {
31 | public class Locator : ILocator
32 | {
33 | public int ColumnNumber { get; private set; }
34 |
35 | public int LineNumber { get; private set; }
36 |
37 | public Locator(ILocator locator)
38 | {
39 | ColumnNumber = locator.ColumnNumber;
40 | LineNumber = locator.LineNumber;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Moyeu/Helpers/AnimationExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Android.Views;
4 | using Android.Animation;
5 |
6 | using Android.Support.V4.View;
7 | using Runnable = Java.Lang.Runnable;
8 | using Android.Views.Animations;
9 | using Android.Graphics;
10 | using Android.Transitions;
11 |
12 | namespace Moyeu
13 | {
14 | public static class AnimationExtensions
15 | {
16 | public static void AlphaAnimate (this View view, float alpha, int duration = 300, Action endAction = null, int startDelay = 0)
17 | {
18 | var animator = ViewCompat.Animate (view);
19 | animator
20 | .SetDuration (duration)
21 | .SetStartDelay (startDelay)
22 | .Alpha (alpha);
23 | if (endAction != null)
24 | animator.WithEndAction (new Runnable (endAction));
25 | animator.Start ();
26 | }
27 |
28 | public static void TranslationYAnimate (this View view, int translation, int duration = 300,
29 | IInterpolator interpolator = null, Action endAction = null)
30 | {
31 | var animator = ViewCompat.Animate (view);
32 | animator
33 | .SetDuration (duration)
34 | .TranslationY (translation);
35 | if (endAction != null)
36 | animator.WithEndAction (new Runnable (endAction));
37 | if (interpolator != null)
38 | animator.SetInterpolator (interpolator);
39 | animator.Start ();
40 | }
41 |
42 | public static void SetupFragmentTransitions (Android.Support.V4.App.Fragment frag)
43 | {
44 | if (!AndroidExtensions.IsMaterial)
45 | return;
46 | frag.EnterTransition = new Slide (GravityFlags.Left);
47 | frag.ExitTransition = new Fade (FadingMode.Out);
48 | }
49 |
50 | public static void SetupAutoSceneTransition (ViewGroup root)
51 | {
52 | if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat)
53 | TransitionManager.BeginDelayedTransition (root);
54 | }
55 | }
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/EncodingDetectedEventArgs.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Patrick Reisert
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and associated documentation files (the "Software"),
6 | * to deal in the Software without restriction, including without limitation
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | * and/or sell copies of the Software, and to permit persons to whom the
9 | * Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | * DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using System;
24 |
25 | #pragma warning disable 1591
26 |
27 | namespace HtmlParserSharp.Common
28 | {
29 | public class EncodingDetectedEventArgs : EventArgs
30 | {
31 | public string Encoding { get; private set; }
32 |
33 | ///
34 | /// When true, the client has decided to accept the charset-encoding for the document and the
35 | /// current processing must be suspended. (Set true to stop encoding).
36 | ///
37 |
38 | public bool AcceptEncoding { get; set; }
39 |
40 | public EncodingDetectedEventArgs(string encoding)
41 | {
42 | Encoding = encoding;
43 | AcceptEncoding = false;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Moyeu/Visual/CheckedImageButton.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Util;
12 | using Android.Views;
13 | using Android.Widget;
14 |
15 | namespace Moyeu
16 | {
17 | public class CheckedImageButton : ImageButton, ICheckable
18 | {
19 | static readonly int[] CheckedStateSet = {
20 | Android.Resource.Attribute.StateChecked
21 | };
22 | bool chked;
23 |
24 | public CheckedImageButton (Context context) :
25 | base (context)
26 | {
27 | Initialize ();
28 | }
29 |
30 | public CheckedImageButton (Context context, IAttributeSet attrs) :
31 | base (context, attrs)
32 | {
33 | Initialize ();
34 | }
35 |
36 | public CheckedImageButton (Context context, IAttributeSet attrs, int defStyle) :
37 | base (context, attrs, defStyle)
38 | {
39 | Initialize ();
40 | }
41 |
42 | public CheckedImageButton (IntPtr handle, JniHandleOwnership own)
43 | : base (handle, own)
44 | {
45 | }
46 |
47 | void Initialize ()
48 | {
49 | }
50 |
51 | public override bool PerformClick ()
52 | {
53 | Toggle ();
54 | return base.PerformClick ();
55 | }
56 |
57 | public void Toggle ()
58 | {
59 | JumpDrawablesToCurrentState ();
60 | Checked = !Checked;
61 | }
62 |
63 | public bool Checked {
64 | get {
65 | return chked;
66 | }
67 | set {
68 | if (chked == value)
69 | return;
70 | chked = value;
71 | RefreshDrawableState ();
72 | }
73 | }
74 |
75 | public override int[] OnCreateDrawableState (int extraSpace)
76 | {
77 | var space = extraSpace + (Checked ? CheckedStateSet.Length : 0);
78 | var drawableState = base.OnCreateDrawableState (space);
79 | if (Checked)
80 | MergeDrawableStates (drawableState, CheckedStateSet);
81 | return drawableState;
82 | }
83 | }
84 | }
85 |
86 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/Attributes.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Patrick Reisert
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and associated documentation files (the "Software"),
6 | * to deal in the Software without restriction, including without limitation
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | * and/or sell copies of the Software, and to permit persons to whom the
9 | * Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | * DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using System;
24 |
25 | #pragma warning disable 1591
26 |
27 | namespace HtmlParserSharp.Common
28 | {
29 | // This file contains the attributes that correspond to the annotations
30 | // @NsUri, @Prefix and @Local in the Java code. Probably we can safely remove these.
31 |
32 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method)]
33 | public class NsUriAttribute : Attribute { }
34 |
35 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method)]
36 | public class PrefixAttribute : Attribute { }
37 |
38 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method)]
39 | public class LocalAttribute : Attribute { }
40 | }
41 |
--------------------------------------------------------------------------------
/Moyeu/Storage/BitmapCache.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.Content;
4 | using Android.Graphics;
5 | using Android.Graphics.Drawables;
6 |
7 | using Rdio.TangoAndCache.Android.UI.Drawables;
8 | using Rdio.TangoAndCache.Android.Collections;
9 |
10 | namespace Moyeu
11 | {
12 | public class BitmapCache
13 | {
14 | Context context;
15 | bool useRoundCorners;
16 |
17 | DiskCache diskCache;
18 | ReuseBitmapDrawableCache memCache;
19 |
20 | BitmapCache (Context ctx, DiskCache diskCache, bool useRoundCorners)
21 | {
22 | this.context = ctx;
23 | this.useRoundCorners = useRoundCorners;
24 | this.diskCache = diskCache;
25 | var highWatermark = Java.Lang.Runtime.GetRuntime().MaxMemory() / 3;
26 | var lowWatermark = highWatermark / 2;
27 | this.memCache = new ReuseBitmapDrawableCache (highWatermark, lowWatermark, highWatermark);
28 | }
29 |
30 | public static BitmapCache CreateCache (Context ctx, string cacheName, string version = "1.0", bool useRoundCorners = true)
31 | {
32 | return new BitmapCache (ctx, DiskCache.CreateCache (ctx, cacheName, version), useRoundCorners);
33 | }
34 |
35 | public SelfDisposingBitmapDrawable AddOrUpdate (string key, Bitmap bmp, TimeSpan duration)
36 | {
37 | diskCache.AddOrUpdate (key, bmp, duration);
38 | var drawable = CreateCacheableDrawable (bmp);
39 | memCache.Add (new Uri (key), drawable);
40 | return drawable;
41 | }
42 |
43 | public bool TryGet (string key, out SelfDisposingBitmapDrawable drawable)
44 | {
45 | if (memCache.TryGetValue (new Uri (key), out drawable))
46 | return true;
47 |
48 | Bitmap bmp;
49 | if (!diskCache.TryGet (key, out bmp))
50 | return false;
51 |
52 | drawable = CreateCacheableDrawable (bmp);
53 | return true;
54 | }
55 |
56 | SelfDisposingBitmapDrawable CreateCacheableDrawable (Bitmap bmp)
57 | {
58 | var res = context.Resources;
59 | return useRoundCorners ? new RoundCornerDrawable (res, bmp) : new SelfDisposingBitmapDrawable (res, bmp);
60 | }
61 | }
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable-nodpi/switch_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
-
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 | -
17 |
18 |
-
19 |
20 |
21 |
22 |
23 |
24 | -
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
-
32 |
33 |
34 |
35 |
36 |
37 | -
38 |
39 |
40 |
41 |
42 | -
43 |
44 |
-
45 |
46 |
47 |
48 |
49 |
50 | -
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Moyeu/Resources/anim-v21/paper_state_list_anim_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 | -
18 |
19 |
23 |
27 |
28 |
29 | -
30 |
31 |
36 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/XmlViolationPolicy.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2012 Patrick Reisert
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a
6 | * copy of this software and associated documentation files (the "Software"),
7 | * to deal in the Software without restriction, including without limitation
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 | * and/or sell copies of the Software, and to permit persons to whom the
10 | * Software is furnished to do so, subject to the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included in
13 | * all copies or substantial portions of the Software.
14 | *
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 | * DEALINGS IN THE SOFTWARE.
22 | */
23 |
24 | using System;
25 | using System.Collections.Generic;
26 | using System.Linq;
27 | using System.Text;
28 |
29 | #pragma warning disable 1591
30 |
31 | namespace HtmlParserSharp.Common
32 | {
33 | ///
34 | /// Policy for XML 1.0 violations.
35 | ///
36 | ///
37 | public enum XmlViolationPolicy
38 | {
39 | ///
40 | /// Conform to HTML 5, allow XML 1.0 to be violated.
41 | ///
42 | Allow,
43 |
44 | ///
45 | /// Halt when something cannot be mapped to XML 1.0.
46 | ///
47 | Fatal,
48 |
49 | ///
50 | /// Be non-conforming and alter the infoset to fit
51 | /// XML 1.0 when something would otherwise not be
52 | /// mappable to XML 1.0.
53 | ///
54 | AlterInfoset
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Core/CharsetState.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2007-2011 Mozilla Foundation
4 | * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
5 | * Foundation, and Opera Software ASA.
6 | * Copyright (c) 2012 Patrick Reisert
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a
9 | * copy of this software and associated documentation files (the "Software"),
10 | * to deal in the Software without restriction, including without limitation
11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 | * and/or sell copies of the Software, and to permit persons to whom the
13 | * Software is furnished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 | * DEALINGS IN THE SOFTWARE.
25 | */
26 |
27 | #pragma warning disable 1591 // Missing XML comment
28 | #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason'
29 | #pragma warning disable 1587 // XML comment is not placed on a valid element
30 |
31 | namespace HtmlParserSharp.Core
32 | {
33 | public enum CharsetState
34 | {
35 | CHARSET_INITIAL = 0,
36 |
37 | CHARSET_C = 1,
38 |
39 | CHARSET_H = 2,
40 |
41 | CHARSET_A = 3,
42 |
43 | CHARSET_R = 4,
44 |
45 | CHARSET_S = 5,
46 |
47 | CHARSET_E = 6,
48 |
49 | CHARSET_T = 7,
50 |
51 | CHARSET_EQUALS = 8,
52 |
53 | CHARSET_SINGLE_QUOTED = 9,
54 |
55 | CHARSET_DOUBLE_QUOTED = 10,
56 |
57 | CHARSET_UNQUOTED = 11
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/station-history.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Xml.Linq;
5 | using System.Collections.Generic;
6 |
7 | class T
8 | {
9 | const int NumDataPoint = 6;
10 |
11 | public static void Main (string[] args)
12 | {
13 | var basePath = args[0];
14 | var baseOutPath = args[1];
15 | var currentTime = DateTime.UtcNow;
16 | // Round off time if not on a 5 minutes base
17 | if ((currentTime.Minute % 5) != 0) {
18 | var lastMinute = currentTime.Minute % 10;
19 | currentTime -= TimeSpan.FromMinutes (lastMinute - (lastMinute > 5 ? 5 : 0));
20 | }
21 |
22 | // station ID -> amount of bikes at that time
23 | var dataPoints = new Dictionary> ();
24 | var times = new List ();
25 |
26 | for (int i = 0; i < NumDataPoint; i++) {
27 | var time = currentTime - TimeSpan.FromMinutes (i * 5);
28 | var path = GetFilePathForDate (basePath, time);
29 | GatherDataPointsFromFile (path, dataPoints);
30 | times.Add (time);
31 | }
32 |
33 | var output = Path.Combine (baseOutPath, "history");
34 | var lines = new List ();
35 | lines.Add (string.Join ("|", times.Select (t => t.ToBinary ().ToString ()).Reverse ()));
36 | lines.AddRange (dataPoints.Select (dp => dp.Key + "|" + string.Join ("|", dp.Value.Select (v => v.ToString ()).Reverse ())));
37 | File.WriteAllLines (output, lines);
38 |
39 | Console.WriteLine ("Success");
40 | }
41 |
42 | static string GetFilePathForDate (string basePath, DateTime date)
43 | {
44 | var baseName = string.Format ("bikeStations_{0:yyyy-MM-dd_HH-mm}-", date);
45 | return Enumerable.Range (0, 20)
46 | .Select (i => Path.Combine (basePath, baseName + i.ToString ("D2") + ".xml"))
47 | .First (p => File.Exists (p));
48 | }
49 |
50 | static void GatherDataPointsFromFile (string filepath, Dictionary> dataPoints)
51 | {
52 | using (var fd = File.OpenRead (filepath)) {
53 | var doc = XDocument.Load (fd);
54 | foreach (var station in doc.Root.Elements ("station")) {
55 | var name = (string)station.Element ("id");
56 | List list;
57 | if (!dataPoints.TryGetValue (name, out list))
58 | dataPoints[name] = list = new List (NumDataPoint);
59 | list.Add (int.Parse ((string)station.Element ("nbBikes")));
60 | }
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/MoyeuWear/ActionButtonFragment.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Util;
12 | using Android.Views;
13 | using Android.Widget;
14 | using Android.Graphics.Drawables;
15 |
16 | using Android.Support.Wearable.Views;
17 |
18 | using MoyeuWear;
19 |
20 | namespace Moyeu
21 | {
22 | public class ActionButtonFragment : Fragment
23 | {
24 | int buttonDrawableId;
25 |
26 | string text;
27 | Action callback;
28 |
29 | Tuple texts;
30 | bool initialState;
31 | Action toggleCallback;
32 |
33 | public static ActionButtonFragment WithAction (string text, int buttonDrawableId, Action callback = null)
34 | {
35 | var r = new ActionButtonFragment ();
36 | r.text = text;
37 | r.buttonDrawableId = buttonDrawableId;
38 | r.callback = callback;
39 | return r;
40 | }
41 |
42 | public static ActionButtonFragment WithToggleAction (Tuple texts, int buttonDrawableId, bool initialState, Action callback = null)
43 | {
44 | var r = new ActionButtonFragment ();
45 | r.texts = texts;
46 | r.buttonDrawableId = buttonDrawableId;
47 | r.toggleCallback = callback;
48 | r.initialState = initialState;
49 | return r;
50 | }
51 |
52 | public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
53 | {
54 | return new ActionPage (inflater.Context) {
55 | Background = null
56 | };
57 | }
58 |
59 | public override void OnViewCreated (View view, Bundle savedInstanceState)
60 | {
61 | base.OnViewCreated (view, savedInstanceState);
62 | var page = (ActionPage)view;
63 |
64 | if (texts == null) {
65 | page.SetImageResource (buttonDrawableId);
66 | if (callback != null)
67 | page.Click += (sender, e) => callback ();
68 | page.SetText (text);
69 | } else {
70 | page.SetImageResource (buttonDrawableId);
71 | page.SetText (initialState ? texts.Item2 : texts.Item1);
72 | //toggle.Checked = initialState;
73 | /*if (toggleCallback != null) {
74 | toggle.CheckedChange += (sender, e) => {
75 | toggle.Text = e.IsChecked ? texts.Item2 : texts.Item1;
76 | toggleCallback (e.IsChecked);
77 | };
78 | }*/
79 | }
80 | }
81 | }
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Core/InsertionMode.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2007-2011 Mozilla Foundation
4 | * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
5 | * Foundation, and Opera Software ASA.
6 | * Copyright (c) 2012 Patrick Reisert
7 | *
8 | * Permission is hereby granted, free of charge, to any person obtaining a
9 | * copy of this software and associated documentation files (the "Software"),
10 | * to deal in the Software without restriction, including without limitation
11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 | * and/or sell copies of the Software, and to permit persons to whom the
13 | * Software is furnished to do so, subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in
16 | * all copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 | * DEALINGS IN THE SOFTWARE.
25 | */
26 |
27 | #pragma warning disable 1591 // Missing XML comment
28 | #pragma warning disable 1570 // XML comment on 'construct' has badly formed XML — 'reason'
29 | #pragma warning disable 1587 // XML comment is not placed on a valid element
30 |
31 | namespace HtmlParserSharp.Core
32 | {
33 | public enum InsertionMode
34 | {
35 | INITIAL = 0,
36 |
37 | BEFORE_HTML = 1,
38 |
39 | BEFORE_HEAD = 2,
40 |
41 | IN_HEAD = 3,
42 |
43 | IN_HEAD_NOSCRIPT = 4,
44 |
45 | AFTER_HEAD = 5,
46 |
47 | IN_BODY = 6,
48 |
49 | IN_TABLE = 7,
50 |
51 | IN_CAPTION = 8,
52 |
53 | IN_COLUMN_GROUP = 9,
54 |
55 | IN_TABLE_BODY = 10,
56 |
57 | IN_ROW = 11,
58 |
59 | IN_CELL = 12,
60 |
61 | IN_SELECT = 13,
62 |
63 | IN_SELECT_IN_TABLE = 14,
64 |
65 | AFTER_BODY = 15,
66 |
67 | IN_FRAMESET = 16,
68 |
69 | AFTER_FRAMESET = 17,
70 |
71 | AFTER_AFTER_BODY = 18,
72 |
73 | AFTER_AFTER_FRAMESET = 19,
74 |
75 | TEXT = 20,
76 |
77 | FRAMESET_OK = 21
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Moyeu/Data/FavoriteManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Threading.Tasks;
5 |
6 | using Android.App;
7 | using Android.Content;
8 | using Android.Content.PM;
9 | using Android.OS;
10 | using Android.Runtime;
11 |
12 | namespace Moyeu
13 | {
14 | public class FavoriteManager
15 | {
16 | const string FavoriteKey = "favoritesString";
17 |
18 | Context context;
19 | ISharedPreferences prefs;
20 |
21 | public static event EventHandler FavoritesChanged;
22 |
23 | static FavoriteManager instance;
24 |
25 | public static FavoriteManager Obtain (Context context)
26 | {
27 | return instance ?? (instance = new FavoriteManager (context));
28 | }
29 |
30 | private FavoriteManager (Context context)
31 | {
32 | this.context = context;
33 | }
34 |
35 | ISharedPreferences Preferences {
36 | get {
37 | return prefs ?? (prefs = context.GetSharedPreferences ("preferences", FileCreationMode.Private));
38 | }
39 | }
40 |
41 | public HashSet LastFavorites {
42 | get;
43 | private set;
44 | }
45 |
46 | public HashSet GetFavoriteStationIds ()
47 | {
48 | var favs = Preferences.GetString (FavoriteKey, string.Empty);
49 | var result = new HashSet (favs.Split (',')
50 | .Where (f => !string.IsNullOrEmpty (f))
51 | .Select (f => int.Parse (f)));
52 | LastFavorites = result;
53 | return result;
54 | }
55 |
56 | public Task> GetFavoriteStationIdsAsync ()
57 | {
58 | return Task.Run (new Func> (GetFavoriteStationIds));
59 | }
60 |
61 | public void AddToFavorite (int id)
62 | {
63 | var existingIds = GetFavoriteStationIds ();
64 | existingIds.Add (id);
65 | var editor = Preferences.Edit ();
66 | editor.PutString (FavoriteKey, string.Join (",", existingIds.Select (i => i.ToString ())));
67 | editor.Commit ();
68 | if (FavoritesChanged != null)
69 | FavoritesChanged (this, EventArgs.Empty);
70 | }
71 |
72 | public void RemoveFromFavorite (int id)
73 | {
74 | var existingIds = GetFavoriteStationIds ();
75 | existingIds.Remove (id);
76 | var editor = Preferences.Edit ();
77 | editor.PutString (FavoriteKey, string.Join (",", existingIds.Select (i => i.ToString ())));
78 | editor.Commit ();
79 | if (FavoritesChanged != null)
80 | FavoritesChanged (this, EventArgs.Empty);
81 | }
82 | }
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/MoyeuTests/MoyeuTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {71FD3927-460A-4BCC-AB43-0B8C11E63B91}
9 | Library
10 | MoyeuTests
11 | MoyeuTests
12 | v4.5
13 |
14 |
15 | true
16 | full
17 | false
18 | bin\Debug
19 | DEBUG;
20 | prompt
21 | 4
22 | false
23 |
24 |
25 | full
26 | true
27 | bin\Release
28 | prompt
29 | 4
30 | false
31 |
32 |
33 |
34 |
35 | ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll
36 |
37 |
38 | ..\packages\Xamarin.UITest.1.3.10\lib\Xamarin.UITest.dll
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | {12143BA7-FFC5-4E11-8B31-89A96247F504}
48 | Moyeu
49 | False
50 | False
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/DocumentModeEventArgs.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 Patrick Reisert
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a
5 | * copy of this software and associated documentation files (the "Software"),
6 | * to deal in the Software without restriction, including without limitation
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | * and/or sell copies of the Software, and to permit persons to whom the
9 | * Software is furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | *
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | * DEALINGS IN THE SOFTWARE.
21 | */
22 |
23 | using System;
24 |
25 | #pragma warning disable 1591
26 |
27 | namespace HtmlParserSharp.Common
28 | {
29 | public class DocumentModeEventArgs : EventArgs
30 | {
31 | public DocumentMode Mode { get; private set; }
32 | public string PublicIdentifier { get; private set; }
33 | public string SystemIdentifier { get; private set; }
34 | public bool Html4SpecificAdditionalErrorChecks { get; private set; }
35 |
36 | ///
37 | /// Receive notification of the document mode.
38 | ///
39 | /// The document mode.
40 | /// The public identifier of the doctype or null if unavailable.
41 | /// The system identifier of the doctype or null if unavailable.
42 | /// true if HTML 4-specific checks were enabled,
43 | /// false otherwise
44 | public DocumentModeEventArgs(DocumentMode mode, string publicIdentifier, string systemIdentifier, bool html4SpecificAdditionalErrorChecks)
45 | {
46 | Mode = mode;
47 | PublicIdentifier = publicIdentifier;
48 | SystemIdentifier = systemIdentifier;
49 | Html4SpecificAdditionalErrorChecks = html4SpecificAdditionalErrorChecks;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/layout/StationCardLayout.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
22 |
27 |
36 |
37 |
38 |
48 |
59 |
--------------------------------------------------------------------------------
/Moyeu/Data/HubwayHistory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Xml.Linq;
5 | using System.Collections.Generic;
6 | using System.Threading.Tasks;
7 | using System.Net.Http;
8 |
9 | namespace Moyeu
10 | {
11 | public class HubwayHistory
12 | {
13 | const string HistoryApiEndpoint = "http://api.moyeuapp.net/history";
14 |
15 | HttpClient client = new HttpClient (new Xamarin.Android.Net.AndroidClientHandler ());
16 | Dictionary>> historyCache;
17 | DateTime lastFetch = DateTime.MinValue;
18 |
19 | public async Task>> GetStationHistory (int stationID)
20 | {
21 | if (NeedFetching)
22 | await FetchData ();
23 |
24 | IEnumerable> result = null;
25 | if (!historyCache.TryGetValue (stationID, out result))
26 | return Enumerable.Empty> ();
27 | return result;
28 | }
29 |
30 | bool NeedFetching {
31 | get {
32 | var now = DateTime.UtcNow;
33 | // The dumb check to begin with
34 | return Math.Abs ((now - lastFetch).TotalMinutes) > 5
35 | // If minute decimal change, it's necessarily a re-fetch
36 | || lastFetch.Minute / 10 != now.Minute / 10
37 | // Also if the two timestamps are on each side of a 5
38 | || ((lastFetch.Minute % 10) < 5 ^ (now.Minute % 10) < 5);
39 | }
40 | }
41 |
42 | async Task FetchData ()
43 | {
44 | historyCache = new Dictionary>> ();
45 |
46 | for (int i = 0; i < 3; i++) {
47 | try {
48 | var data = await client.GetStringAsync (HistoryApiEndpoint);
49 | // If another update was done in the meantime, no need to process it
50 | if (!NeedFetching)
51 | return;
52 |
53 | var reader = new StringReader (data);
54 | string line = reader.ReadLine ();
55 | var times = line.Split ('|').Select (t => DateTime.FromBinary (long.Parse (t))).ToArray ();
56 | while ((line = reader.ReadLine ()) != null) {
57 | var split = line.Split ('|');
58 | var id = int.Parse (split[0]);
59 | var datapoints = split.Skip (1).Select ((v, index) => {
60 | var time = times[index];
61 | var num = int.Parse (v);
62 |
63 | return new KeyValuePair (time, num);
64 | }).ToArray ();
65 | historyCache[id] = datapoints;
66 | }
67 | lastFetch = DateTime.UtcNow;
68 | } catch (Exception e) {
69 | AnalyticsHelper.LogException ("HistoryDownloader", e);
70 | Android.Util.Log.Error ("HistoryDownloader", e.ToString ());
71 | }
72 | }
73 | }
74 | }
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/MoyeuWear/Resources/drawable/favorite_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
-
6 |
7 |
10 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
18 | -
19 |
20 |
-
21 |
22 |
25 |
26 |
27 |
28 | -
29 |
30 |
31 |
32 |
33 | -
34 |
35 |
-
36 |
37 |
40 |
41 |
42 |
43 | -
44 |
45 |
46 |
47 |
48 | -
49 |
50 |
-
51 |
52 |
55 |
56 |
57 |
58 | -
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Moyeu.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moyeu", "Moyeu\Moyeu.csproj", "{12143BA7-FFC5-4E11-8B31-89A96247F504}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyeuTests", "MoyeuTests\MoyeuTests.csproj", "{71FD3927-460A-4BCC-AB43-0B8C11E63B91}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlParserSharp", "HtmlParserSharp\HtmlParserSharp.csproj", "{63AFF4BB-171A-4295-A87E-C5A7D6A06E10}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {12143BA7-FFC5-4E11-8B31-89A96247F504}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {12143BA7-FFC5-4E11-8B31-89A96247F504}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {12143BA7-FFC5-4E11-8B31-89A96247F504}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {12143BA7-FFC5-4E11-8B31-89A96247F504}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {63AFF4BB-171A-4295-A87E-C5A7D6A06E10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {63AFF4BB-171A-4295-A87E-C5A7D6A06E10}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {63AFF4BB-171A-4295-A87E-C5A7D6A06E10}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {63AFF4BB-171A-4295-A87E-C5A7D6A06E10}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {71FD3927-460A-4BCC-AB43-0B8C11E63B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {71FD3927-460A-4BCC-AB43-0B8C11E63B91}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {71FD3927-460A-4BCC-AB43-0B8C11E63B91}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {71FD3927-460A-4BCC-AB43-0B8C11E63B91}.Release|Any CPU.Build.0 = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(MonoDevelopProperties) = preSolution
30 | Policies = $0
31 | $0.TextStylePolicy = $1
32 | $1.inheritsSet = null
33 | $1.scope = text/x-csharp
34 | $0.CSharpFormattingPolicy = $2
35 | $2.IndentSwitchSection = False
36 | $2.NewLinesForBracesInProperties = False
37 | $2.NewLinesForBracesInAccessors = False
38 | $2.NewLinesForBracesInAnonymousMethods = False
39 | $2.NewLinesForBracesInControlBlocks = False
40 | $2.NewLinesForBracesInAnonymousTypes = False
41 | $2.NewLinesForBracesInObjectCollectionArrayInitializers = False
42 | $2.NewLinesForBracesInLambdaExpressionBody = False
43 | $2.NewLineForElse = False
44 | $2.NewLineForCatch = False
45 | $2.NewLineForFinally = False
46 | $2.SpacingAfterMethodDeclarationName = True
47 | $2.SpaceAfterMethodCallName = True
48 | $2.scope = text/x-csharp
49 | EndGlobalSection
50 | EndGlobal
51 |
--------------------------------------------------------------------------------
/MoyeuTests/Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using NUnit.Framework;
5 | using Xamarin.UITest;
6 | using Xamarin.UITest.Android;
7 | using Xamarin.UITest.Queries;
8 |
9 | namespace MoyeuTests
10 | {
11 | [TestFixture]
12 | public class Tests
13 | {
14 | AndroidApp app;
15 |
16 | [SetUp]
17 | public void BeforeEachTest ()
18 | {
19 | app = ConfigureApp
20 | .Android
21 | .EnableLocalScreenshots ()
22 | .StartApp ();
23 | }
24 |
25 | [Test]
26 | public void InitialLaunch ()
27 | {
28 | app.WaitForElement (q => q.Id ("FlashBarText"));
29 | app.WaitForNoElement (q => q.Id ("FlashBarText"),
30 | postTimeout: TimeSpan.FromSeconds (1));
31 | app.Screenshot ("Loaded map");
32 | }
33 |
34 | [Test]
35 | public void SwitchToFavorites_Empty ()
36 | {
37 | app.Tap (q => q.Id ("toolbar").Class ("ImageButton"));
38 | app.WaitForElement (q => q.Id ("left_drawer"),
39 | postTimeout: TimeSpan.FromSeconds (1));
40 | app.Tap (q => q.Id ("left_drawer").Descendant ().Text ("Favorites"));
41 | app.WaitForNoElement (q => q.Id ("left_drawer"),
42 | postTimeout: TimeSpan.FromSeconds (1));
43 | app.Screenshot ("Empty favorites");
44 | }
45 |
46 | [Test]
47 | public void SwitchToFavorites_WithTwoFavs ()
48 | {
49 | app.Invoke ("reportFullyDrawn");
50 | app.Tap (q => q.Id ("toolbar").Class ("ImageButton"));
51 | app.WaitForElement (q => q.Id ("left_drawer"),
52 | postTimeout: TimeSpan.FromSeconds (1));
53 | app.Tap (q => q.Id ("left_drawer").Descendant ().Text ("Favorites"));
54 | app.WaitForNoElement (q => q.Id ("left_drawer"),
55 | postTimeout: TimeSpan.FromSeconds (1));
56 | app.Screenshot ("Two favorites");
57 | }
58 |
59 | [Test]
60 | public void SwitchToRentals ()
61 | {
62 | app.Tap (q => q.Id ("toolbar").Class ("ImageButton"));
63 | app.WaitForElement (q => q.Id ("left_drawer"),
64 | postTimeout: TimeSpan.FromSeconds (1));
65 | app.Tap (q => q.Id ("left_drawer").Descendant ().Text ("Rental History"));
66 | app.WaitForNoElement (q => q.Id ("left_drawer"),
67 | postTimeout: TimeSpan.FromSeconds (1));
68 | app.WaitForElement (q => q.Id ("username"));
69 | app.Screenshot ("Login form");
70 | app.EnterText (q => q.Id ("username"), "*");
71 | app.EnterText (q => q.Id ("password"), "*");
72 | app.Tap (q => q.Button ("loginBtn"));
73 | app.WaitForElement (q => q.Id ("loading_icon"));
74 | app.Screenshot ("Loading screen");
75 | app.WaitForNoElement (q => q.Id ("loading_icon"),
76 | postTimeout: TimeSpan.FromMilliseconds (500));
77 | app.Screenshot ("Loaded rentals");
78 | }
79 | }
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/HtmlParserSharp/Common/DoctypeExpectation.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 Henri Sivonen
3 | * Copyright (c) 2012 Patrick Reisert
4 | *
5 | * Permission is hereby granted, free of charge, to any person obtaining a
6 | * copy of this software and associated documentation files (the "Software"),
7 | * to deal in the Software without restriction, including without limitation
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 | * and/or sell copies of the Software, and to permit persons to whom the
10 | * Software is furnished to do so, subject to the following conditions:
11 | *
12 | * The above copyright notice and this permission notice shall be included in
13 | * all copies or substantial portions of the Software.
14 | *
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 | * DEALINGS IN THE SOFTWARE.
22 | */
23 |
24 | using System;
25 | using System.Collections.Generic;
26 | using System.Linq;
27 | using System.Text;
28 |
29 | #pragma warning disable 1591
30 |
31 | namespace HtmlParserSharp.Common
32 | {
33 | ///
34 | /// Used for indicating desired behavior with legacy doctypes.
35 | ///
36 | public enum DoctypeExpectation
37 | {
38 | ///
39 | /// Be a pure HTML5 parser.
40 | ///
41 | Html,
42 |
43 | ///
44 | /// Require the HTML 4.01 Transitional public id. Turn on HTML4-specific
45 | /// additional errors regardless of doctype.
46 | ///
47 | Html401Transitional,
48 |
49 | ///
50 | /// Require the HTML 4.01 Transitional public id and a system id. Turn on
51 | /// HTML4-specific additional errors regardless of doctype.
52 | ///
53 | Html401Strict,
54 |
55 | ///
56 | /// Treat the doctype required by HTML 5, doctypes with the HTML 4.01 Strict
57 | /// public id and doctypes with the HTML 4.01 Transitional public id and a
58 | /// system id as non-errors. Turn on HTML4-specific additional errors if the
59 | /// public id is the HTML 4.01 Strict or Transitional public id.
60 | ///
61 | Auto,
62 |
63 | ///
64 | /// Never enable HTML4-specific error checks. Never report any doctype
65 | /// condition as an error. (Doctype tokens in wrong places will be
66 | /// reported as errors, though.) The application may decide what to log
67 | /// in response to calls to DocumentModeHanler. This mode
68 | /// is meant for doing surveys on existing content.
69 | ///
70 | NoDoctypeErrors
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Moyeu/Resources/layout/MapLayout.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
19 |
32 |
40 |
41 |
54 |
56 |
67 |
--------------------------------------------------------------------------------
/Moyeu/Visual/ChronometerView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Android.App;
6 | using Android.Content;
7 | using Android.OS;
8 | using Android.Runtime;
9 | using Android.Util;
10 | using Android.Views;
11 | using Android.Widget;
12 | using Android.Graphics;
13 |
14 | namespace Moyeu
15 | {
16 | public class ChronometerView : View
17 | {
18 | TimeSpan time;
19 |
20 | Color baseQuadrantColor;
21 | Paint chromeBorder;
22 | Paint markerPaint;
23 | Paint fillPaint;
24 | RectF oval;
25 |
26 | public ChronometerView (Context context) :
27 | base (context)
28 | {
29 | Initialize ();
30 | }
31 |
32 | public ChronometerView (Context context, IAttributeSet attrs) :
33 | base (context, attrs)
34 | {
35 | Initialize ();
36 | }
37 |
38 | public ChronometerView (Context context, IAttributeSet attrs, int defStyle) :
39 | base (context, attrs, defStyle)
40 | {
41 | Initialize ();
42 | }
43 |
44 | void Initialize ()
45 | {
46 | baseQuadrantColor = Color.Rgb (0x33, 0xb5, 0xe5);
47 | var chromeColor = Color.Rgb (0x33, 0x33, 0x33);
48 |
49 | chromeBorder = new Paint {
50 | AntiAlias = true,
51 | Color = chromeColor,
52 | StrokeWidth = Math.Max (1, 1.ToPixels () / 2)
53 | };
54 | markerPaint = new Paint {
55 | Color = chromeColor,
56 | AntiAlias = true
57 | };
58 | fillPaint = new Paint {
59 | AntiAlias = true
60 | };
61 | oval = new RectF ();
62 | }
63 |
64 | public TimeSpan Time {
65 | get {
66 | return time;
67 | }
68 | set {
69 | time = value;
70 | Invalidate ();
71 | }
72 | }
73 |
74 | protected override void OnDraw (Android.Graphics.Canvas canvas)
75 | {
76 | var radius = (Height / 2) - 4;
77 | var middleX = Width / 2;
78 | var middleY = Height / 2;
79 |
80 | var minutes = (int)time.TotalMinutes;
81 | var rotation = minutes / 60;
82 | var color = baseQuadrantColor;
83 |
84 | for (int i = 0; i <= rotation; i++) {
85 | var angle = minutes > 60 ? 360 : (int)((minutes * 360f) / 60);
86 |
87 | fillPaint.Color = color;
88 | oval.Set (middleX - radius,
89 | middleY - radius,
90 | middleX + radius,
91 | middleY + radius);
92 | canvas.DrawArc (oval, -90, angle, true, fillPaint);
93 |
94 | minutes -= 60;
95 | color = Color.Rgb ((byte)Math.Max (0, color.R - 30),
96 | (byte)Math.Max (0, color.G - 30),
97 | (byte)Math.Max (0, color.B - 30));
98 | }
99 |
100 | // Draw chrome
101 | chromeBorder.SetStyle (Paint.Style.Stroke);
102 | canvas.DrawCircle (middleX, middleY, radius, chromeBorder);
103 |
104 | // Draw markers
105 | var innerRadius = radius - 6;
106 | for (int i = 0; i < 8; i++) {
107 | var stepAngle = i * Math.PI / 4;
108 | canvas.DrawCircle (middleX - (int)Math.Round (Math.Sin (stepAngle) * innerRadius),
109 | middleY - (int)Math.Round (Math.Cos (stepAngle) * innerRadius),
110 | 1, markerPaint);
111 | }
112 | }
113 | }
114 | }
115 |
116 |
--------------------------------------------------------------------------------
/Moyeu/Resources/layout/RentalItem.axml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
16 |
22 |
29 |
30 |
38 |
47 |
58 |
59 |
67 |
74 |
--------------------------------------------------------------------------------
/Moyeu/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
19 |
24 |
25 |
34 |
40 |
53 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/MoyeuWear/StationGridAdapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.Threading.Tasks;
5 |
6 | using Android.App;
7 | using Android.Content;
8 | using Android.Runtime;
9 | using Android.Views;
10 | using Android.Widget;
11 | using Android.OS;
12 | using Android.Graphics;
13 | using Android.Graphics.Drawables;
14 |
15 | using Android.Support.Wearable;
16 | using Android.Support.Wearable.Activity;
17 | using Android.Support.Wearable.Views;
18 |
19 | using MoyeuWear;
20 |
21 | namespace Moyeu
22 | {
23 | public class StationGridAdapter : FragmentGridPagerAdapter
24 | {
25 | IList stations;
26 | IMoyeuActions actions;
27 | StationCardFragment[] stationFragments;
28 | Drawable[] backgrounds;
29 |
30 | public StationGridAdapter (FragmentManager manager,
31 | IList stations,
32 | IMoyeuActions actions)
33 | : base (manager)
34 | {
35 | this.stations = stations;
36 | this.actions = actions;
37 | this.stationFragments = new StationCardFragment[stations.Count];
38 | this.backgrounds = new Drawable[stations.Count];
39 | }
40 |
41 | public void SwitchCount ()
42 | {
43 | foreach (var frag in stationFragments)
44 | if (frag != null)
45 | frag.SwitchCount ();
46 | }
47 |
48 | public override int RowCount {
49 | get {
50 | return stations.Count;
51 | }
52 | }
53 |
54 | public override Drawable GetBackgroundForRow (int row)
55 | {
56 | if (backgrounds [row] != null)
57 | return backgrounds [row];
58 |
59 | var station = stations [row];
60 | var bg = station.Background != null ?
61 | new ShadowedBitmapDrawable (station.Background) { ShadowColor = Color.Argb (0x80, 0, 0, 0) } :
62 | GridPagerAdapter.BackgroundNone;
63 | backgrounds [row] = bg;
64 | return bg;
65 | }
66 |
67 | public override Drawable GetBackgroundForPage (int p0, int p1)
68 | {
69 | return GridPagerAdapter.BackgroundNone;
70 | }
71 |
72 | public override int GetColumnCount (int p0)
73 | {
74 | // The data item and two actions (navigate, favorite)
75 | return 3;
76 | }
77 |
78 | public override int GetOptionsForPage (int row, int column)
79 | {
80 | return column > 0 ? GridPagerAdapter.OptionDisableParallax : GridPagerAdapter.PageDefaultOptions;
81 | }
82 |
83 | public override Fragment GetFragment (int row, int column)
84 | {
85 | var station = stations [row];
86 | var id = station.Id;
87 |
88 | if (column == 1)
89 | return ActionButtonFragment.WithAction ("Navigate", Resource.Drawable.navigate_button,
90 | () => actions.NavigateToStation (station));
91 | if (column == 2)
92 | return ActionButtonFragment.WithToggleAction (Tuple.Create ("Favorite", "Unfavorite"),
93 | Resource.Drawable.favorite_button,
94 | station.IsFavorite,
95 | cked => actions.ToggleFavoriteStation (id, cked));
96 |
97 | return stationFragments [row] ??
98 | (stationFragments [row] = StationCardFragment.WithStation (station, actions.CurrentStatus));
99 | }
100 | }
101 | }
102 |
103 |
--------------------------------------------------------------------------------
/Moyeu/Fragments/LoginDialogFragment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Android.App;
8 | using Android.Content;
9 | using Android.OS;
10 | using Android.Runtime;
11 | using Android.Util;
12 | using Android.Views;
13 | using Android.Widget;
14 |
15 | using Runnable = Java.Lang.Runnable;
16 |
17 | namespace Moyeu
18 | {
19 | public class LoginDialogFragment : Android.Support.V4.App.DialogFragment
20 | {
21 | public event EventHandler Dismissed;
22 |
23 | TaskCompletionSource newCredentials
24 | = new TaskCompletionSource ();
25 |
26 | Button loginBtn;
27 | ProgressBar statusProgress;
28 | TextView statusText;
29 | EditText username;
30 | EditText password;
31 |
32 | public override void OnCreate (Bundle savedInstanceState)
33 | {
34 | base.OnCreate (savedInstanceState);
35 | SetStyle ((int)DialogFragmentStyle.NoFrame, Resource.Style.MoyeuDialog);
36 | }
37 |
38 | public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
39 | {
40 | var dialogView = inflater.Inflate (Resource.Layout.LoginDialogLayout, container, false);
41 | if (AndroidExtensions.IsMaterial)
42 | dialogView.SetBackgroundDrawable (null);
43 | loginBtn = dialogView.FindViewById