├── .checkstyle ├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.ui.prefs ├── AndroidManifest.xml ├── LICENSE ├── TODO ├── assets └── startpage │ ├── bookmarks.png │ ├── history.png │ ├── linef.png │ └── search.png ├── project.properties ├── res ├── anim │ ├── gd_grow_from_bottom.xml │ ├── gd_grow_from_bottomleft_to_topright.xml │ ├── gd_grow_from_bottomright_to_topleft.xml │ ├── gd_grow_from_top.xml │ ├── gd_grow_from_topleft_to_bottomright.xml │ ├── gd_grow_from_topright_to_bottomleft.xml │ ├── gd_shrink_from_bottom.xml │ ├── gd_shrink_from_bottomleft_to_topright.xml │ ├── gd_shrink_from_bottomright_to_topleft.xml │ ├── gd_shrink_from_top.xml │ ├── gd_shrink_from_topleft_to_bottomright.xml │ └── gd_shrink_from_topright_to_bottomleft.xml ├── drawable-hdpi │ ├── btn_bottom.9.png │ ├── btn_bottom_disabled.9.png │ ├── btn_bottom_pressed.9.png │ ├── btn_default.9.png │ ├── btn_default_disabled.9.png │ ├── btn_default_pressed.9.png │ ├── default_video_poster.png │ ├── fav_icn_background.png │ ├── fav_icn_default.png │ ├── fav_icn_default_toolbar.png │ ├── fav_icn_unknown.png │ ├── gd_quick_action_arrow_up.png │ ├── gd_quick_action_grid_arrow_down.png │ ├── gd_quick_action_grid_bg.9.png │ ├── gd_quick_action_grid_bottom_frame.9.png │ ├── gd_quick_action_grid_selector_focused.9.png │ ├── gd_quick_action_grid_selector_pressed.9.png │ ├── gd_quick_action_top_frame.9.png │ ├── ic_btn_back.png │ ├── ic_btn_bookmarks.png │ ├── ic_btn_close_panel.png │ ├── ic_btn_close_tab.png │ ├── ic_btn_find.png │ ├── ic_btn_find_next.png │ ├── ic_btn_find_prev.png │ ├── ic_btn_forward.png │ ├── ic_btn_go.png │ ├── ic_btn_home.png │ ├── ic_btn_mobile_view.png │ ├── ic_btn_next.png │ ├── ic_btn_open_tab.png │ ├── ic_btn_reload.png │ ├── ic_btn_select.png │ ├── ic_btn_share.png │ ├── ic_btn_stop.png │ ├── ic_menu_add.png │ ├── ic_menu_add_bookmark.png │ ├── ic_menu_bookmarks.png │ ├── ic_menu_delete.png │ ├── ic_menu_downloads.png │ ├── ic_menu_exit.png │ ├── ic_menu_preferences.png │ ├── ic_menu_sort.png │ ├── ic_menu_sync.png │ ├── ic_tab_bookmarks_selected.png │ ├── ic_tab_bookmarks_unselected.png │ ├── ic_tab_history_selected.png │ ├── ic_tab_history_unselected.png │ ├── ic_tab_weave_selected.png │ ├── ic_tab_weave_unselected.png │ ├── stat_sys_download.png │ ├── stat_sys_download_anim0.png │ ├── stat_sys_download_anim1.png │ ├── stat_sys_download_anim2.png │ ├── stat_sys_download_anim3.png │ ├── stat_sys_download_anim4.png │ └── stat_sys_download_anim5.png ├── drawable-mdpi │ ├── btn_bottom.9.png │ ├── btn_bottom_disabled.9.png │ ├── btn_bottom_pressed.9.png │ ├── btn_default.9.png │ ├── btn_default_disabled.9.png │ ├── btn_default_pressed.9.png │ ├── default_video_poster.png │ ├── fav_icn_background.png │ ├── fav_icn_default.png │ ├── fav_icn_default_toolbar.png │ ├── fav_icn_unknown.png │ ├── folder_icon.png │ ├── gd_quick_action_arrow_up.png │ ├── gd_quick_action_grid_arrow_down.png │ ├── gd_quick_action_grid_bg.9.png │ ├── gd_quick_action_grid_bottom_frame.9.png │ ├── gd_quick_action_grid_selector_focused.9.png │ ├── gd_quick_action_grid_selector_pressed.9.png │ ├── gd_quick_action_top_frame.9.png │ ├── ic_btn_bookmarks.png │ ├── ic_btn_close_panel.png │ ├── ic_btn_close_tab.png │ ├── ic_btn_find.png │ ├── ic_btn_find_next.png │ ├── ic_btn_find_prev.png │ ├── ic_btn_forward.png │ ├── ic_btn_go.png │ ├── ic_btn_home.png │ ├── ic_btn_mobile_view.png │ ├── ic_btn_next.png │ ├── ic_btn_open_tab.png │ ├── ic_btn_reload.png │ ├── ic_btn_select.png │ ├── ic_btn_share.png │ ├── ic_btn_stop.png │ ├── ic_menu_add.png │ ├── ic_menu_add_bookmark.png │ ├── ic_menu_bookmarks.png │ ├── ic_menu_delete.png │ ├── ic_menu_downloads.png │ ├── ic_menu_exit.png │ ├── ic_menu_preferences.png │ ├── ic_menu_sort.png │ ├── ic_menu_sync.png │ ├── ic_tab_bookmarks_selected.png │ ├── ic_tab_bookmarks_unselected.png │ ├── ic_tab_history_selected.png │ ├── ic_tab_history_unselected.png │ ├── ic_tab_weave_selected.png │ ├── ic_tab_weave_unselected.png │ ├── stat_sys_download.png │ ├── stat_sys_download_anim0.png │ ├── stat_sys_download_anim1.png │ ├── stat_sys_download_anim2.png │ ├── stat_sys_download_anim3.png │ ├── stat_sys_download_anim4.png │ └── stat_sys_download_anim5.png ├── drawable │ ├── bubbleleft48.png │ ├── bubbleright48.png │ ├── buttons.xml │ ├── buttons_bottom.xml │ ├── download_anim.xml │ ├── gd_quick_action_grid_selector.xml │ ├── ic_tab_bookmarks.xml │ ├── ic_tab_history.xml │ ├── ic_tab_weave.xml │ ├── icon.png │ ├── next_tab.png │ ├── previous_tab.png │ ├── spinner.xml │ ├── spinner_black_20_1.png │ ├── spinner_black_20_2.png │ ├── spinner_black_20_3.png │ ├── spinner_black_20_4.png │ ├── spinner_black_20_5.png │ ├── spinner_black_20_6.png │ ├── spinner_black_20_7.png │ ├── spinner_black_20_8.png │ ├── tb_background_bottom.png │ └── tb_background_top.png ├── layout │ ├── about_activity.xml │ ├── adblocker_whitelist_activity.xml │ ├── adblocker_whitelist_row.xml │ ├── base_spinner_custom_preference_activity.xml │ ├── bookmark_row.xml │ ├── bookmarks_history_activity.xml │ ├── bookmarks_list_activity.xml │ ├── changelog_activity.xml │ ├── download_row.xml │ ├── downloads_list_activity.xml │ ├── edit_bookmark_activity.xml │ ├── gd_quick_action_grid.xml │ ├── gd_quick_action_grid_item.xml │ ├── history_row.xml │ ├── http_authentication_dialog.xml │ ├── javascript_prompt_dialog.xml │ ├── main.xml │ ├── mobile_view_list_activity.xml │ ├── mobile_view_list_row.xml │ ├── preferences_activity.xml │ ├── url_autocomplete_line.xml │ ├── video_loading_progress.xml │ ├── weave_bookmark_row.xml │ ├── weave_bookmarks_list_activity.xml │ ├── weave_preferences_activity.xml │ └── webview.xml ├── raw │ ├── adsweep │ ├── changelog │ ├── start.html │ ├── start_bookmarks.html │ ├── start_history.html │ ├── start_search.html │ └── start_style.css ├── values-de │ └── strings.xml ├── values-es │ └── strings.xml ├── values-fr │ └── strings.xml ├── values-zh │ └── strings.xml └── values │ ├── colors.xml │ ├── gd_styles.xml │ ├── strings.xml │ └── styles.xml └── src └── org ├── emergent └── android │ └── weave │ └── client │ ├── Base32.java │ ├── Base64.java │ ├── Base64Encoder.java │ ├── BulkKeyCouplet.java │ ├── Dbg.java │ ├── Hex.java │ ├── HexEncoder.java │ ├── QueryParams.java │ ├── QueryResult.java │ ├── UserWeave.java │ ├── WeaveAccountInfo.java │ ├── WeaveBasicObject.java │ ├── WeaveConstants.java │ ├── WeaveCryptoUtil.java │ ├── WeaveException.java │ ├── WeaveFactory.java │ ├── WeaveHeader.java │ ├── WeaveResponse.java │ ├── WeaveSSLSocketFactory.java │ ├── WeaveTransport.java │ └── WeaveUtil.java ├── greendroid ├── QuickAction.java ├── QuickActionGrid.java └── QuickActionWidget.java └── zirco ├── controllers └── Controller.java ├── events ├── EventConstants.java ├── EventController.java └── IDownloadEventsListener.java ├── model ├── DbAdapter.java ├── UrlSuggestionItemComparator.java ├── adapters │ ├── BookmarksCursorAdapter.java │ ├── DownloadListAdapter.java │ ├── HistoryExpandableListAdapter.java │ ├── UrlSuggestionCursorAdapter.java │ └── WeaveBookmarksCursorAdapter.java └── items │ ├── BookmarkItem.java │ ├── DownloadItem.java │ ├── HistoryItem.java │ ├── UrlSuggestionItem.java │ └── WeaveBookmarkItem.java ├── providers ├── BookmarksProviderWrapper.java ├── WeaveColumns.java ├── WeaveContentProvider.java └── ZircoBookmarksContentProvider.java ├── sync ├── ISyncListener.java └── WeaveSyncTask.java ├── ui ├── activities │ ├── AboutActivity.java │ ├── AdBlockerWhiteListActivity.java │ ├── BookmarksHistoryActivity.java │ ├── BookmarksListActivity.java │ ├── ChangelogActivity.java │ ├── DownloadsListActivity.java │ ├── EditBookmarkActivity.java │ ├── HistoryListActivity.java │ ├── IToolbarsContainer.java │ ├── MainActivity.java │ ├── MobileViewListActivity.java │ ├── WeaveBookmarksListActivity.java │ └── preferences │ │ ├── BaseSpinnerCustomPreferenceActivity.java │ │ ├── HomepagePreferenceActivity.java │ │ ├── PreferencesActivity.java │ │ ├── SearchUrlPreferenceActivity.java │ │ ├── UserAgentPreferenceActivity.java │ │ ├── WeavePreferencesActivity.java │ │ └── WeaveServerPreferenceActivity.java ├── components │ ├── CustomWebView.java │ └── CustomWebViewClient.java └── runnables │ ├── DownloadRunnable.java │ ├── FaviconUpdaterRunnable.java │ ├── HideToolbarsRunnable.java │ ├── HistoryUpdater.java │ ├── XmlHistoryBookmarksExporter.java │ └── XmlHistoryBookmarksImporter.java └── utils ├── AnimationManager.java ├── ApplicationUtils.java ├── Constants.java ├── DateUtils.java ├── IOUtils.java ├── ProxyChangeReceiver.java ├── ProxySettings.java └── UrlUtils.java /.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | zirco-browser 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | net.sf.eclipsecs.core.CheckstyleBuilder 30 | 31 | 32 | 33 | 34 | 35 | com.android.ide.eclipse.adt.AndroidNature 36 | org.eclipse.jdt.core.javanature 37 | net.sf.eclipsecs.core.CheckstyleNature 38 | 39 | 40 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/TODO -------------------------------------------------------------------------------- /assets/startpage/bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/assets/startpage/bookmarks.png -------------------------------------------------------------------------------- /assets/startpage/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/assets/startpage/history.png -------------------------------------------------------------------------------- /assets/startpage/linef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/assets/startpage/linef.png -------------------------------------------------------------------------------- /assets/startpage/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/assets/startpage/search.png -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Indicates whether an apk should be generated for each density. 11 | split.density=false 12 | # Project target. 13 | target=android-8 14 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_bottomleft_to_topright.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_bottomright_to_topleft.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_topleft_to_bottomright.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/anim/gd_grow_from_topright_to_bottomleft.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_bottomleft_to_topright.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_bottomright_to_topleft.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_topleft_to_bottomright.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /res/anim/gd_shrink_from_topright_to_bottomleft.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 31 | 32 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_bottom.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_bottom.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_bottom_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_bottom_disabled.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_bottom_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_bottom_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_default.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_default.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_default_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_default_disabled.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/btn_default_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/btn_default_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/default_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/default_video_poster.png -------------------------------------------------------------------------------- /res/drawable-hdpi/fav_icn_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/fav_icn_background.png -------------------------------------------------------------------------------- /res/drawable-hdpi/fav_icn_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/fav_icn_default.png -------------------------------------------------------------------------------- /res/drawable-hdpi/fav_icn_default_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/fav_icn_default_toolbar.png -------------------------------------------------------------------------------- /res/drawable-hdpi/fav_icn_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/fav_icn_unknown.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_grid_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_grid_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_grid_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_grid_bg.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_grid_bottom_frame.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_grid_bottom_frame.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_grid_selector_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_grid_selector_focused.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_grid_selector_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_grid_selector_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/gd_quick_action_top_frame.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/gd_quick_action_top_frame.9.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_back.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_bookmarks.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_close_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_close_panel.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_close_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_close_tab.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_find.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_find_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_find_next.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_find_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_find_prev.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_forward.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_go.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_home.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_mobile_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_mobile_view.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_next.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_open_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_open_tab.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_reload.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_select.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_share.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_btn_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_btn_stop.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_add.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_add_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_add_bookmark.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_bookmarks.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_delete.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_downloads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_downloads.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_exit.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_sort.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_menu_sync.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_bookmarks_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_bookmarks_selected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_bookmarks_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_bookmarks_unselected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_history_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_history_selected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_history_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_history_unselected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_weave_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_weave_selected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_weave_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/ic_tab_weave_unselected.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim0.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim1.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim2.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim3.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim4.png -------------------------------------------------------------------------------- /res/drawable-hdpi/stat_sys_download_anim5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-hdpi/stat_sys_download_anim5.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_bottom.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_bottom.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_bottom_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_bottom_disabled.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_bottom_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_bottom_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_default.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_default.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_default_disabled.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_default_disabled.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/btn_default_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/btn_default_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/default_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/default_video_poster.png -------------------------------------------------------------------------------- /res/drawable-mdpi/fav_icn_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/fav_icn_background.png -------------------------------------------------------------------------------- /res/drawable-mdpi/fav_icn_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/fav_icn_default.png -------------------------------------------------------------------------------- /res/drawable-mdpi/fav_icn_default_toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/fav_icn_default_toolbar.png -------------------------------------------------------------------------------- /res/drawable-mdpi/fav_icn_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/fav_icn_unknown.png -------------------------------------------------------------------------------- /res/drawable-mdpi/folder_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/folder_icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_arrow_up.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_grid_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_grid_arrow_down.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_grid_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_grid_bg.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_grid_bottom_frame.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_grid_bottom_frame.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_grid_selector_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_grid_selector_focused.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_grid_selector_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_grid_selector_pressed.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/gd_quick_action_top_frame.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/gd_quick_action_top_frame.9.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_bookmarks.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_close_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_close_panel.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_close_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_close_tab.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_find.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_find_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_find_next.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_find_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_find_prev.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_forward.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_go.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_home.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_mobile_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_mobile_view.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_next.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_open_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_open_tab.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_reload.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_select.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_share.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_btn_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_btn_stop.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_add.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_add_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_add_bookmark.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_bookmarks.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_delete.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_downloads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_downloads.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_exit.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_sort.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_menu_sync.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_bookmarks_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_bookmarks_selected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_bookmarks_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_bookmarks_unselected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_history_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_history_selected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_history_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_history_unselected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_weave_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_weave_selected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_weave_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/ic_tab_weave_unselected.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim0.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim1.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim2.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim3.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim4.png -------------------------------------------------------------------------------- /res/drawable-mdpi/stat_sys_download_anim5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable-mdpi/stat_sys_download_anim5.png -------------------------------------------------------------------------------- /res/drawable/bubbleleft48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/bubbleleft48.png -------------------------------------------------------------------------------- /res/drawable/bubbleright48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/bubbleright48.png -------------------------------------------------------------------------------- /res/drawable/buttons.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /res/drawable/buttons_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /res/drawable/download_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/drawable/gd_quick_action_grid_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_bookmarks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_weave.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/icon.png -------------------------------------------------------------------------------- /res/drawable/next_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/next_tab.png -------------------------------------------------------------------------------- /res/drawable/previous_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/previous_tab.png -------------------------------------------------------------------------------- /res/drawable/spinner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_1.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_2.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_3.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_4.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_5.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_6.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_7.png -------------------------------------------------------------------------------- /res/drawable/spinner_black_20_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/spinner_black_20_8.png -------------------------------------------------------------------------------- /res/drawable/tb_background_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/tb_background_bottom.png -------------------------------------------------------------------------------- /res/drawable/tb_background_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darvin/zirco-browser/6603f9007b64f639af859c7d83b87509c6e8ac7c/res/drawable/tb_background_top.png -------------------------------------------------------------------------------- /res/layout/adblocker_whitelist_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 25 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /res/layout/adblocker_whitelist_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /res/layout/base_spinner_custom_preference_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 27 | 28 | 31 | 32 | 35 | 36 | 41 | 46 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /res/layout/bookmark_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 24 | 25 | 33 | 37 | 46 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /res/layout/bookmarks_history_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 22 | 27 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /res/layout/bookmarks_list_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 25 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /res/layout/changelog_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 28 | 29 | 33 | 34 | 37 | 41 | 42 | 43 | 44 | 50 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /res/layout/download_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 23 | 26 | 30 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /res/layout/downloads_list_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 25 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /res/layout/edit_bookmark_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 22 | 23 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 43 | 44 | 46 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /res/layout/gd_quick_action_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 23 | 24 | 30 | 31 | 35 | 36 | 41 | 42 | 45 | 46 | 50 | 51 | -------------------------------------------------------------------------------- /res/layout/gd_quick_action_grid_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | -------------------------------------------------------------------------------- /res/layout/history_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 25 | 26 | 36 | 37 | 43 | 49 | 50 | 55 | 56 | 57 | 58 | 65 | 66 | -------------------------------------------------------------------------------- /res/layout/http_authentication_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 22 | 23 | 32 | 33 | 43 | 44 | 52 | 53 | 63 | -------------------------------------------------------------------------------- /res/layout/javascript_prompt_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 24 | 25 | 32 | 33 | 43 | 44 | -------------------------------------------------------------------------------- /res/layout/mobile_view_list_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 25 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /res/layout/mobile_view_list_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /res/layout/url_autocomplete_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 24 | 26 | 32 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /res/layout/video_loading_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 24 | 25 | 30 | 31 | 38 | -------------------------------------------------------------------------------- /res/layout/weave_bookmark_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 22 | 23 | 31 | 36 | 45 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /res/layout/weave_bookmarks_list_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 14 | 15 | 19 | 22 | 23 | 28 | 29 | 30 | 32 | 33 | 36 | 37 | 40 | 41 | 44 | 47 | 50 | 51 | 52 | 53 | 57 | 58 | -------------------------------------------------------------------------------- /res/layout/weave_preferences_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 14 | 18 | 22 | 26 | 30 | -------------------------------------------------------------------------------- /res/layout/webview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 21 | 22 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /res/raw/start.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
%s
11 | %s 12 |
13 | 14 | -------------------------------------------------------------------------------- /res/raw/start_bookmarks.html: -------------------------------------------------------------------------------- 1 |
2 |

%s

3 |
4 |
5 | 6 |
-------------------------------------------------------------------------------- /res/raw/start_history.html: -------------------------------------------------------------------------------- 1 |
2 |

%s

3 |
4 |
5 | 6 |
-------------------------------------------------------------------------------- /res/raw/start_search.html: -------------------------------------------------------------------------------- 1 |
2 |

%s

3 |
4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /res/raw/start_style.css: -------------------------------------------------------------------------------- 1 | body { font-family: "Helvetica-Bold",Helvetica,Geneva,Arial,sans-serif; margin: 0 0 1em 0; padding: 0; background-image: url("linef.png"); } 2 | #main { margin: 0; padding: 0; } 3 | a:link, a:visited { color: #333333; text-decoration: none; } 4 | input[type="text"] { margin: 0.5em 0 0.5em 0.5em; width: 70%; border: 1px solid #e3e3e3; } 5 | input[type="submit"] { background-color: #f5f5f5; border: 1px solid #e3e3e3; } 6 | #title { margin: 0 0 0 0; padding-top: 10px; height: 27px; background-color: #f5f5f5; color: #4b4b4b; border-bottom: 1px solid #b1b1b1; font-size: larger; font-weight: bold; text-align: center; } 7 | .box-title { margin: 1em 1em 0 1em; padding: 0; background-color: #ffffff; color: #333333; border: 1px solid #b1b1b1; border-radius: 8px 8px 0 0; } 8 | .box-title p { margin: 0.25em 0; } 9 | .box-title a { margin: 0 0.5em; width: 18px; height: 14px; background-color: #eeeeee; border: 1px solid #cacaca; } 10 | .box-title img { vertical-align: middle; padding: 0 0.5em; } 11 | .box-content { margin: 0 1em 0 1em; padding: 0; background-color: #ffffff; border: 1px solid #b1b1b1; border-top: 1px solid transparent; border-radius: 0 0 8px 8px; } -------------------------------------------------------------------------------- /res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | #17170443 20 | 21 | -------------------------------------------------------------------------------- /res/values/gd_styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 5dp 24 | 25 | 40 | 41 | 49 | 53 | 54 | 61 | 65 | 69 | 70 | 75 | 79 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 22 | 23 | 27 | 28 | 30 | 31 | 35 | 36 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/Base64.java: -------------------------------------------------------------------------------- 1 | package org.emergent.android.weave.client; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.io.OutputStream; 6 | 7 | class Base64 8 | { 9 | private static final Base64Encoder encoder = new Base64Encoder(); 10 | 11 | /** 12 | * encode the input data producing a base 64 encoded byte array. 13 | * 14 | * @return a byte array containing the base 64 encoded data. 15 | */ 16 | public static byte[] encode( 17 | byte[] data) 18 | { 19 | int len = (data.length + 2) / 3 * 4; 20 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(len); 21 | 22 | try 23 | { 24 | encoder.encode(data, 0, data.length, bOut); 25 | } 26 | catch (IOException e) 27 | { 28 | throw new RuntimeException("exception encoding base64 string: " + e); 29 | } 30 | 31 | return bOut.toByteArray(); 32 | } 33 | 34 | /** 35 | * Encode the byte data to base 64 writing it to the given output stream. 36 | * 37 | * @return the number of bytes produced. 38 | */ 39 | public static int encode( 40 | byte[] data, 41 | OutputStream out) 42 | throws IOException 43 | { 44 | return encoder.encode(data, 0, data.length, out); 45 | } 46 | 47 | /** 48 | * Encode the byte data to base 64 writing it to the given output stream. 49 | * 50 | * @return the number of bytes produced. 51 | */ 52 | public static int encode( 53 | byte[] data, 54 | int off, 55 | int length, 56 | OutputStream out) 57 | throws IOException 58 | { 59 | return encoder.encode(data, off, length, out); 60 | } 61 | 62 | /** 63 | * decode the base 64 encoded input data. It is assumed the input data is valid. 64 | * 65 | * @return a byte array representing the decoded data. 66 | */ 67 | public static byte[] decode( 68 | byte[] data) 69 | { 70 | int len = data.length / 4 * 3; 71 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(len); 72 | 73 | try 74 | { 75 | encoder.decode(data, 0, data.length, bOut); 76 | } 77 | catch (IOException e) 78 | { 79 | throw new RuntimeException("exception decoding base64 string: " + e); 80 | } 81 | 82 | return bOut.toByteArray(); 83 | } 84 | 85 | /** 86 | * decode the base 64 encoded String data - whitespace will be ignored. 87 | * 88 | * @return a byte array representing the decoded data. 89 | */ 90 | public static byte[] decode( 91 | String data) 92 | { 93 | int len = data.length() / 4 * 3; 94 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(len); 95 | 96 | try 97 | { 98 | encoder.decode(data, bOut); 99 | } 100 | catch (IOException e) 101 | { 102 | throw new RuntimeException("exception decoding base64 string: " + e); 103 | } 104 | 105 | return bOut.toByteArray(); 106 | } 107 | 108 | /** 109 | * decode the base 64 encoded String data writing it to the given output stream, 110 | * whitespace characters will be ignored. 111 | * 112 | * @return the number of bytes produced. 113 | */ 114 | public static int decode( 115 | String data, 116 | OutputStream out) 117 | throws IOException 118 | { 119 | return encoder.decode(data, out); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/BulkKeyCouplet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.emergent.android.weave.client; 17 | 18 | import java.security.Key; 19 | 20 | /** 21 | * @author Patrick Woodworth 22 | */ 23 | class BulkKeyCouplet { 24 | public final Key cipherKey; 25 | public final Key hmacKey; 26 | 27 | public BulkKeyCouplet(Key cipherKey, Key hmacKey) { 28 | this.cipherKey = cipherKey; 29 | this.hmacKey = hmacKey; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/Hex.java: -------------------------------------------------------------------------------- 1 | package org.emergent.android.weave.client; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.io.OutputStream; 6 | 7 | class Hex 8 | { 9 | private static final HexEncoder encoder = new HexEncoder(); 10 | 11 | /** 12 | * encode the input data producing a Hex encoded byte array. 13 | * 14 | * @return a byte array containing the Hex encoded data. 15 | */ 16 | public static byte[] encode( 17 | byte[] data) 18 | { 19 | return encode(data, 0, data.length); 20 | } 21 | 22 | /** 23 | * encode the input data producing a Hex encoded byte array. 24 | * 25 | * @return a byte array containing the Hex encoded data. 26 | */ 27 | public static byte[] encode( 28 | byte[] data, 29 | int off, 30 | int length) 31 | { 32 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(); 33 | 34 | try 35 | { 36 | encoder.encode(data, off, length, bOut); 37 | } 38 | catch (IOException e) 39 | { 40 | throw new RuntimeException("exception encoding Hex string: " + e); 41 | } 42 | 43 | return bOut.toByteArray(); 44 | } 45 | 46 | /** 47 | * Hex encode the byte data writing it to the given output stream. 48 | * 49 | * @return the number of bytes produced. 50 | */ 51 | public static int encode( 52 | byte[] data, 53 | OutputStream out) 54 | throws IOException 55 | { 56 | return encoder.encode(data, 0, data.length, out); 57 | } 58 | 59 | /** 60 | * Hex encode the byte data writing it to the given output stream. 61 | * 62 | * @return the number of bytes produced. 63 | */ 64 | public static int encode( 65 | byte[] data, 66 | int off, 67 | int length, 68 | OutputStream out) 69 | throws IOException 70 | { 71 | return encoder.encode(data, off, length, out); 72 | } 73 | 74 | /** 75 | * decode the Hex encoded input data. It is assumed the input data is valid. 76 | * 77 | * @return a byte array representing the decoded data. 78 | */ 79 | public static byte[] decode( 80 | byte[] data) 81 | { 82 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(); 83 | 84 | try 85 | { 86 | encoder.decode(data, 0, data.length, bOut); 87 | } 88 | catch (IOException e) 89 | { 90 | throw new RuntimeException("exception decoding Hex string: " + e); 91 | } 92 | 93 | return bOut.toByteArray(); 94 | } 95 | 96 | /** 97 | * decode the Hex encoded String data - whitespace will be ignored. 98 | * 99 | * @return a byte array representing the decoded data. 100 | */ 101 | public static byte[] decode( 102 | String data) 103 | { 104 | ByteArrayOutputStream bOut = new ByteArrayOutputStream(); 105 | 106 | try 107 | { 108 | encoder.decode(data, bOut); 109 | } 110 | catch (IOException e) 111 | { 112 | throw new RuntimeException("exception decoding Hex string: " + e); 113 | } 114 | 115 | return bOut.toByteArray(); 116 | } 117 | 118 | /** 119 | * decode the Hex encoded String data writing it to the given output stream, 120 | * whitespace characters will be ignored. 121 | * 122 | * @return the number of bytes produced. 123 | */ 124 | public static int decode( 125 | String data, 126 | OutputStream out) 127 | throws IOException 128 | { 129 | return encoder.decode(data, out); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/HexEncoder.java: -------------------------------------------------------------------------------- 1 | package org.emergent.android.weave.client; 2 | 3 | import java.io.IOException; 4 | import java.io.OutputStream; 5 | 6 | class HexEncoder { 7 | 8 | protected final byte[] encodingTable = 9 | { 10 | (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', 11 | (byte)'8', (byte)'9', (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f' 12 | }; 13 | 14 | /* 15 | * set up the decoding table. 16 | */ 17 | protected final byte[] decodingTable = new byte[128]; 18 | 19 | protected void initialiseDecodingTable() { 20 | for (int i = 0; i < encodingTable.length; i++) { 21 | decodingTable[encodingTable[i]] = (byte)i; 22 | } 23 | 24 | decodingTable['A'] = decodingTable['a']; 25 | decodingTable['B'] = decodingTable['b']; 26 | decodingTable['C'] = decodingTable['c']; 27 | decodingTable['D'] = decodingTable['d']; 28 | decodingTable['E'] = decodingTable['e']; 29 | decodingTable['F'] = decodingTable['f']; 30 | } 31 | 32 | public HexEncoder() { 33 | initialiseDecodingTable(); 34 | } 35 | 36 | /** 37 | * encode the input data producing a Hex output stream. 38 | * 39 | * @return the number of bytes produced. 40 | */ 41 | public int encode( 42 | byte[] data, 43 | int off, 44 | int length, 45 | OutputStream out) 46 | throws IOException 47 | { 48 | for (int i = off; i < (off + length); i++) { 49 | int v = data[i] & 0xff; 50 | 51 | out.write(encodingTable[(v >>> 4)]); 52 | out.write(encodingTable[v & 0xf]); 53 | } 54 | 55 | return length * 2; 56 | } 57 | 58 | private boolean ignore( 59 | char c) 60 | { 61 | return (c == '\n' || c == '\r' || c == '\t' || c == ' '); 62 | } 63 | 64 | /** 65 | * decode the Hex encoded byte data writing it to the given output stream, 66 | * whitespace characters will be ignored. 67 | * 68 | * @return the number of bytes produced. 69 | */ 70 | public int decode( 71 | byte[] data, 72 | int off, 73 | int length, 74 | OutputStream out) 75 | throws IOException 76 | { 77 | byte b1, b2; 78 | int outLen = 0; 79 | 80 | int end = off + length; 81 | 82 | while (end > off) { 83 | if (!ignore((char)data[end - 1])) { 84 | break; 85 | } 86 | 87 | end--; 88 | } 89 | 90 | int i = off; 91 | while (i < end) { 92 | while (i < end && ignore((char)data[i])) { 93 | i++; 94 | } 95 | 96 | b1 = decodingTable[data[i++]]; 97 | 98 | while (i < end && ignore((char)data[i])) { 99 | i++; 100 | } 101 | 102 | b2 = decodingTable[data[i++]]; 103 | 104 | out.write((b1 << 4) | b2); 105 | 106 | outLen++; 107 | } 108 | 109 | return outLen; 110 | } 111 | 112 | /** 113 | * decode the Hex encoded String data writing it to the given output stream, 114 | * whitespace characters will be ignored. 115 | * 116 | * @return the number of bytes produced. 117 | */ 118 | public int decode( 119 | String data, 120 | OutputStream out) 121 | throws IOException 122 | { 123 | byte b1, b2; 124 | int length = 0; 125 | 126 | int end = data.length(); 127 | 128 | while (end > 0) { 129 | if (!ignore(data.charAt(end - 1))) { 130 | break; 131 | } 132 | 133 | end--; 134 | } 135 | 136 | int i = 0; 137 | while (i < end) { 138 | while (i < end && ignore(data.charAt(i))) { 139 | i++; 140 | } 141 | 142 | b1 = decodingTable[data.charAt(i++)]; 143 | 144 | while (i < end && ignore(data.charAt(i))) { 145 | i++; 146 | } 147 | 148 | b2 = decodingTable[data.charAt(i++)]; 149 | 150 | out.write((b1 << 4) | b2); 151 | 152 | length++; 153 | } 154 | 155 | return length; 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/QueryParams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * @author Patrick Woodworth 23 | */ 24 | public class QueryParams { 25 | 26 | private Date m_older; 27 | 28 | private Date m_newer; 29 | 30 | private boolean m_full = true; 31 | 32 | private String m_sort = "newest"; 33 | 34 | public QueryParams() { 35 | } 36 | 37 | public Date getOlder() { 38 | return m_older; 39 | } 40 | 41 | public QueryParams setOlder(Date older) { 42 | m_older = older; 43 | return this; 44 | } 45 | 46 | public Date getNewer() { 47 | return m_newer; 48 | } 49 | 50 | public QueryParams setNewer(Date newer) { 51 | m_newer = newer; 52 | return this; 53 | } 54 | 55 | public boolean isFull() { 56 | return m_full; 57 | } 58 | 59 | public QueryParams setFull(boolean full) { 60 | m_full = full; 61 | return this; 62 | } 63 | 64 | public String getSort() { 65 | return m_sort; 66 | } 67 | 68 | public QueryParams setSort(String sort) { 69 | m_sort = sort; 70 | return this; 71 | } 72 | 73 | public String toQueryString() { 74 | StringBuffer retval = new StringBuffer(); 75 | retval.append("?full=").append(m_full ? "1" : "0"); 76 | if (m_sort != null) 77 | retval.append("&sort=").append(m_sort); 78 | if (m_older != null) 79 | retval.append("&older=").append(WeaveUtil.toModifiedTimeString(m_older)); 80 | if (m_newer != null) 81 | retval.append("&newer=").append(WeaveUtil.toModifiedTimeString(m_newer)); 82 | return retval.toString(); 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | return toQueryString(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/QueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | import java.net.URI; 20 | import java.util.Date; 21 | 22 | /** 23 | * @author Patrick Woodworth 24 | */ 25 | public class QueryResult { 26 | 27 | private final URI m_uri; 28 | 29 | private Date m_serverTimestamp; 30 | 31 | private T m_value; 32 | 33 | QueryResult(WeaveResponse response) { 34 | this(response, null); 35 | } 36 | 37 | QueryResult(WeaveResponse response, T value) { 38 | m_uri = response.getUri(); 39 | m_serverTimestamp = response.getServerTimestamp(); 40 | m_value = value; 41 | } 42 | 43 | public URI getUri() { 44 | return m_uri; 45 | } 46 | 47 | public Date getServerTimestamp() { 48 | return m_serverTimestamp; 49 | } 50 | 51 | public T getValue() { 52 | return m_value; 53 | } 54 | 55 | void setValue(T value) { 56 | m_value = value; 57 | } 58 | 59 | public long getServerTimestampInSeconds() { 60 | if (m_serverTimestamp != null) 61 | return m_serverTimestamp.getTime(); 62 | return 0; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveAccountInfo.java: -------------------------------------------------------------------------------- 1 | package org.emergent.android.weave.client; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | 9 | /** 10 | * @author Patrick Woodworth 11 | */ 12 | public class WeaveAccountInfo { 13 | 14 | private final URI m_server; 15 | private final String m_username; 16 | private final String m_password; 17 | private final char[] m_secret; 18 | 19 | private WeaveAccountInfo(URI server, String username, String password, char[] secret) { 20 | if (server == null) 21 | throw new NullPointerException("server was null"); 22 | if (username == null) 23 | throw new NullPointerException("username was null"); 24 | if (password == null) 25 | throw new NullPointerException("password was null"); 26 | if (secret == null) 27 | throw new NullPointerException("secret was null"); 28 | m_server = server; 29 | m_username = username; 30 | m_password = password; 31 | m_secret = secret; 32 | } 33 | 34 | public URI getServer() { 35 | return m_server; 36 | } 37 | 38 | public String getServerAsString() { 39 | return WeaveUtil.toString(getServer()); 40 | } 41 | 42 | public String getUsername() { 43 | return m_username; 44 | } 45 | 46 | public String getPassword() { 47 | return m_password; 48 | } 49 | 50 | public String getSecretAsString() { 51 | return m_secret == null ? null : new String(m_secret); 52 | } 53 | 54 | public char[] getSecret() { 55 | return m_secret; 56 | } 57 | 58 | public String toAuthToken() { 59 | try { 60 | JSONObject retval = new JSONObject(); 61 | retval.put("server", getServerAsString()); 62 | retval.put("username", getUsername()); 63 | retval.put("password", getPassword()); 64 | retval.put("secret", getSecretAsString()); 65 | return retval.toString(); 66 | } catch (JSONException e) { 67 | throw new IllegalStateException(e); 68 | } 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | try { 74 | return toAuthToken(); 75 | } catch (Exception ignored) { } 76 | return super.toString(); 77 | } 78 | 79 | public static WeaveAccountInfo createWeaveAccountInfo(String authtoken) { 80 | try { 81 | JSONObject retval = new JSONObject(authtoken); 82 | URI server = URI.create(retval.getString("server")); 83 | String username = retval.getString("username"); 84 | String password = retval.getString("password"); 85 | char[] secret = retval.getString("secret").toCharArray(); 86 | return createWeaveAccountInfo(server, username, password, secret); 87 | } catch (JSONException e) { 88 | throw new IllegalStateException(e); 89 | } 90 | } 91 | 92 | public static WeaveAccountInfo createWeaveAccountInfo(String serverUri, String username, String password, char[] encsecret) throws URISyntaxException { 93 | return createWeaveAccountInfo(new URI(serverUri), username, password, encsecret); 94 | } 95 | 96 | public static WeaveAccountInfo createWeaveAccountInfo(URI serverUri, String username, String password, char[] encsecret) { 97 | return new WeaveAccountInfo(serverUri, username, password, encsecret); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | /** 20 | * @author Patrick Woodworth 21 | */ 22 | public class WeaveConstants { 23 | 24 | private static final String PACKAGE_NAME = WeaveConstants.class.getPackage().getName(); 25 | 26 | private static final String APP_NAME = "EmergentWeave"; 27 | 28 | private static final double APP_VERSION = 0.9; 29 | 30 | private static final String APP_VERSION_STRING = String.format("%1.1f", APP_VERSION); 31 | 32 | private static final String USER_AGENT_DEFAULT = APP_NAME + "/" + APP_VERSION_STRING; 33 | 34 | private static final String LOGGER_NAME_DEFAULT = APP_NAME; // maps to android log tag 35 | 36 | private static final String LOGGER_NAME = getProperty("logger_name", LOGGER_NAME_DEFAULT); 37 | 38 | static final String WEAVE_API_VERSION = "1.0"; 39 | 40 | static final int UNAUTHORIZED_HTTP_STATUS_CODE = 401; 41 | 42 | public static final boolean ALLOW_INVALID_CERTS_DEFAULT = true; // todo this should be false 43 | 44 | static final boolean CONNECTION_POOL_ENABLED_DEFAULT = true; 45 | 46 | public static final String LOGGER_NAME_FULL = getProperty("logger_name_full", PACKAGE_NAME + "." + LOGGER_NAME); 47 | 48 | public static final String USER_AGENT = getProperty("user_agent", USER_AGENT_DEFAULT); 49 | 50 | private WeaveConstants() { 51 | // no instantiation 52 | } 53 | 54 | private static String getProperty(String key, String def) { 55 | return System.getProperty(getFullyQualifiedKey(key), def); 56 | } 57 | 58 | private static String getFullyQualifiedKey(String key) { 59 | return PACKAGE_NAME + "." + key; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | import org.apache.http.client.HttpResponseException; 20 | 21 | /** 22 | * @author Patrick Woodworth 23 | */ 24 | @SuppressWarnings("serial") 25 | public class WeaveException extends Exception { 26 | 27 | private final WeaveException.ExceptionType m_type; 28 | 29 | public WeaveException() { 30 | this(WeaveException.ExceptionType.GENERAL); 31 | } 32 | 33 | public WeaveException(WeaveException.ExceptionType type) { 34 | m_type = type; 35 | } 36 | 37 | public WeaveException(String message) { 38 | this(WeaveException.ExceptionType.GENERAL, message); 39 | } 40 | 41 | public WeaveException(WeaveException.ExceptionType type, String message) { 42 | super(message); 43 | m_type = type; 44 | } 45 | 46 | public WeaveException(Throwable cause) { 47 | this(WeaveException.ExceptionType.GENERAL, cause); 48 | } 49 | 50 | public WeaveException(WeaveException.ExceptionType type, Throwable cause) { 51 | super(cause); 52 | m_type = type; 53 | } 54 | 55 | public WeaveException(String message, Throwable cause) { 56 | this(WeaveException.ExceptionType.GENERAL, message, cause); 57 | } 58 | 59 | public WeaveException(WeaveException.ExceptionType type, String message, Throwable cause) { 60 | super(message, cause); 61 | m_type = type; 62 | } 63 | 64 | public WeaveException.ExceptionType getType() { 65 | return m_type; 66 | } 67 | 68 | public static boolean isAuthFailure(HttpResponseException e) { 69 | int statusCode = e.getStatusCode(); 70 | if (WeaveConstants.UNAUTHORIZED_HTTP_STATUS_CODE == statusCode) 71 | return true; 72 | return false; 73 | } 74 | 75 | public enum ExceptionType { 76 | GENERAL, 77 | BACKOFF, 78 | ; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | import java.net.URI; 20 | 21 | /** 22 | * @author Patrick Woodworth 23 | */ 24 | public class WeaveFactory { 25 | 26 | private WeaveTransport m_transport; 27 | private final boolean m_acceptInvalidCerts; 28 | private final boolean m_useConnectionPool; 29 | 30 | public WeaveFactory(boolean acceptInvalidCerts) { 31 | m_acceptInvalidCerts = acceptInvalidCerts; 32 | m_useConnectionPool = WeaveConstants.CONNECTION_POOL_ENABLED_DEFAULT; 33 | } 34 | 35 | public UserWeave createUserWeave(URI server, String username, String password) { 36 | return new UserWeave(getWeaveTransport(), server, username, password); 37 | } 38 | 39 | public boolean isInvalidCertsAccepted() { 40 | return m_acceptInvalidCerts; 41 | } 42 | 43 | public boolean isConnectionPoolEnabled() { 44 | return m_useConnectionPool; 45 | } 46 | 47 | protected WeaveTransport createWeaveTransport() { 48 | return new WeaveTransport(isConnectionPoolEnabled(), isInvalidCertsAccepted()); 49 | } 50 | 51 | protected synchronized WeaveTransport getWeaveTransport() { 52 | if (m_transport == null) { 53 | m_transport = createWeaveTransport(); 54 | } 55 | return m_transport; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | /** 20 | * @author Patrick Woodworth 21 | */ 22 | enum WeaveHeader { 23 | 24 | X_WEAVE_BACKOFF("X-Weave-Backoff"), 25 | X_WEAVE_ALERT("X-Weave-Alert"), 26 | X_WEAVE_TIMESTAMP("X-Weave-Timestamp"), 27 | X_WEAVE_RECORDS("X-Weave-Records"), 28 | X_WEAVE_IF_UNMODIFIED_SINCE("X-If-Unmodified-Since"), 29 | ; 30 | 31 | private final String m_name; 32 | 33 | WeaveHeader(String name) { 34 | m_name = name; 35 | } 36 | 37 | public String getName() { 38 | return m_name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/org/emergent/android/weave/client/WeaveResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Patrick Woodworth 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.emergent.android.weave.client; 18 | 19 | import org.apache.http.HttpEntity; 20 | import org.apache.http.HttpResponse; 21 | import org.apache.http.util.EntityUtils; 22 | 23 | import java.io.IOException; 24 | import java.net.URI; 25 | import java.util.Date; 26 | 27 | /** 28 | * @author Patrick Woodworth 29 | */ 30 | public class WeaveResponse { 31 | 32 | private final WeaveTransport.WeaveResponseHeaders m_responseHeaders; 33 | private final String m_body; 34 | private URI m_uri; 35 | 36 | public WeaveResponse(HttpResponse response) throws IOException { 37 | m_responseHeaders = new WeaveTransport.WeaveResponseHeaders(response); 38 | HttpEntity entity = response.getEntity(); 39 | m_body = entity == null ? null : EntityUtils.toString(entity); 40 | } 41 | 42 | public WeaveTransport.WeaveResponseHeaders getResponseHeaders() { 43 | return m_responseHeaders; 44 | } 45 | 46 | public String getBody() { 47 | return m_body; 48 | } 49 | 50 | public Date getServerTimestamp() { 51 | return m_responseHeaders.getServerTimestamp(); 52 | } 53 | 54 | public long getBackoffSeconds() { 55 | return m_responseHeaders.getBackoffSeconds(); 56 | } 57 | 58 | public URI getUri() { 59 | return m_uri; 60 | } 61 | 62 | public void setUri(URI uri) { 63 | m_uri = uri; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/org/greendroid/QuickAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 Cyril Mottier (http://www.cyrilmottier.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.greendroid; 17 | 18 | import java.lang.ref.WeakReference; 19 | 20 | import android.content.Context; 21 | import android.graphics.drawable.Drawable; 22 | import android.view.View; 23 | 24 | /** 25 | * A QuickAction implements an item in a {@link QuickActionWidget}. A 26 | * QuickAction represents a single action and may contain a text and an icon. 27 | * 28 | * @author Benjamin Fellous 29 | * @author Cyril Mottier 30 | */ 31 | public class QuickAction { 32 | 33 | public Drawable mDrawable; 34 | public CharSequence mTitle; 35 | 36 | /* package */WeakReference mView; 37 | 38 | public QuickAction(Drawable d, CharSequence title) { 39 | mDrawable = d; 40 | mTitle = title; 41 | } 42 | 43 | public QuickAction(Context ctx, int drawableId, CharSequence title) { 44 | mDrawable = ctx.getResources().getDrawable(drawableId); 45 | mTitle = title; 46 | } 47 | 48 | public QuickAction(Context ctx, Drawable d, int titleId) { 49 | mDrawable = d; 50 | mTitle = ctx.getResources().getString(titleId); 51 | } 52 | 53 | public QuickAction(Context ctx, int drawableId, int titleId) { 54 | mDrawable = ctx.getResources().getDrawable(drawableId); 55 | mTitle = ctx.getResources().getString(titleId); 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /src/org/zirco/events/EventConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.events; 17 | 18 | /** 19 | * This class defines events constants. 20 | */ 21 | public class EventConstants { 22 | 23 | public static final String EVT_DOWNLOAD_ON_START = "EVT_DOWNLOAD_ON_START"; 24 | public static final String EVT_DOWNLOAD_ON_FINISHED = "EVT_DOWNLOAD_ON_FINISHED"; 25 | public static final String EVT_DOWNLOAD_ON_PROGRESS = "EVT_DOWNLOAD_ON_PROGRESS"; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/org/zirco/events/EventController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.events; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Iterator; 20 | import java.util.List; 21 | 22 | /** 23 | * Implementation of the EventController. 24 | */ 25 | public final class EventController { 26 | 27 | private List mDownloadListeners; 28 | 29 | /** 30 | * Holder for singleton implementation. 31 | */ 32 | private static class EventControllerHolder { 33 | private static final EventController INSTANCE = new EventController(); 34 | } 35 | 36 | /** 37 | * Get the unique instance of the Controller. 38 | * @return The instance of the Controller 39 | */ 40 | public static EventController getInstance() { 41 | return EventControllerHolder.INSTANCE; 42 | } 43 | 44 | /** 45 | * Private Constructor. 46 | */ 47 | private EventController() { 48 | mDownloadListeners = new ArrayList(); 49 | } 50 | 51 | /** 52 | * Add a listener for download events. 53 | * @param listener The listener to add. 54 | */ 55 | public synchronized void addDownloadListener(IDownloadEventsListener listener) { 56 | 57 | if (!mDownloadListeners.contains(listener)) { 58 | mDownloadListeners.add(listener); 59 | } 60 | } 61 | 62 | /** 63 | * Remove a listener for download events. 64 | * @param listener The listener to remove. 65 | */ 66 | public synchronized void removeDownloadListener(IDownloadEventsListener listener) { 67 | mDownloadListeners.remove(listener); 68 | } 69 | 70 | /** 71 | * Trigger a download event. 72 | * @param event The event. 73 | * @param data Additional data. 74 | */ 75 | public synchronized void fireDownloadEvent(String event, Object data) { 76 | Iterator iter = mDownloadListeners.iterator(); 77 | while (iter.hasNext()) { 78 | iter.next().onDownloadEvent(event, data); 79 | } 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/org/zirco/events/IDownloadEventsListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.events; 17 | 18 | /** 19 | * Interface for object listening to download events. 20 | */ 21 | public interface IDownloadEventsListener { 22 | 23 | /** 24 | * The method run on download events. 25 | * @param event The event. 26 | * @param data Additional data. 27 | */ 28 | void onDownloadEvent(String event, Object data); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/org/zirco/model/UrlSuggestionItemComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model; 17 | 18 | import java.util.Comparator; 19 | 20 | import org.zirco.model.items.UrlSuggestionItem; 21 | 22 | /** 23 | * Comparator for UrlSuggestionItem. 24 | */ 25 | public class UrlSuggestionItemComparator implements Comparator { 26 | 27 | @Override 28 | public int compare(UrlSuggestionItem object1, UrlSuggestionItem object2) { 29 | Float value1 = new Float(object1.getNote()); 30 | Float value2 = new Float(object2.getNote()); 31 | return value2.compareTo(value1); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/org/zirco/model/adapters/BookmarksCursorAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model.adapters; 17 | 18 | import org.zirco.R; 19 | import android.content.Context; 20 | import android.database.Cursor; 21 | import android.graphics.Bitmap; 22 | import android.graphics.BitmapFactory; 23 | import android.graphics.Canvas; 24 | import android.graphics.drawable.BitmapDrawable; 25 | import android.provider.Browser; 26 | import android.view.View; 27 | import android.view.ViewGroup; 28 | import android.widget.ImageView; 29 | import android.widget.SimpleCursorAdapter; 30 | 31 | /** 32 | * Cursor adapter for bookmarks. 33 | */ 34 | public class BookmarksCursorAdapter extends SimpleCursorAdapter { 35 | 36 | private int mFaviconSize; 37 | 38 | /** 39 | * Constructor. 40 | * @param context The context. 41 | * @param layout The layout. 42 | * @param c The Cursor. 43 | * @param from Input array. 44 | * @param to Output array. 45 | */ 46 | public BookmarksCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int faviconSize) { 47 | super(context, layout, c, from, to); 48 | mFaviconSize = faviconSize; 49 | } 50 | 51 | @Override 52 | public View getView(int position, View convertView, ViewGroup parent) { 53 | View superView = super.getView(position, convertView, parent); 54 | 55 | ImageView thumbnailView = (ImageView) superView.findViewById(R.id.BookmarkRow_Thumbnail); 56 | 57 | byte[] favicon = getCursor().getBlob(getCursor().getColumnIndex(Browser.BookmarkColumns.FAVICON)); 58 | if (favicon != null) { 59 | BitmapDrawable icon = new BitmapDrawable(BitmapFactory.decodeByteArray(favicon, 0, favicon.length)); 60 | 61 | Bitmap bm = Bitmap.createBitmap(mFaviconSize, mFaviconSize, Bitmap.Config.ARGB_4444); 62 | Canvas canvas = new Canvas(bm); 63 | 64 | icon.setBounds(0, 0, mFaviconSize, mFaviconSize); 65 | icon.draw(canvas); 66 | 67 | thumbnailView.setImageBitmap(bm); 68 | } else { 69 | thumbnailView.setImageResource(R.drawable.fav_icn_unknown); 70 | } 71 | 72 | return superView; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/org/zirco/model/adapters/UrlSuggestionCursorAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model.adapters; 17 | 18 | import org.zirco.R; 19 | import android.content.Context; 20 | import android.database.Cursor; 21 | import android.view.View; 22 | import android.view.ViewGroup; 23 | import android.widget.ImageView; 24 | import android.widget.SimpleCursorAdapter; 25 | 26 | /** 27 | * Adapter for suggestions. 28 | */ 29 | public class UrlSuggestionCursorAdapter extends SimpleCursorAdapter { 30 | 31 | public static final String URL_SUGGESTION_ID = "_id"; 32 | public static final String URL_SUGGESTION_TITLE = "URL_SUGGESTION_TITLE"; 33 | public static final String URL_SUGGESTION_URL = "URL_SUGGESTION_URL"; 34 | public static final String URL_SUGGESTION_TYPE = "URL_SUGGESTION_TYPE"; 35 | 36 | /** 37 | * Constructor. 38 | * @param context The context. 39 | * @param layout The layout. 40 | * @param c The Cursor. 41 | * @param from Input array. 42 | * @param to Output array. 43 | */ 44 | public UrlSuggestionCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { 45 | super(context, layout, c, from, to); 46 | } 47 | 48 | @Override 49 | public View getView(int position, View convertView, ViewGroup parent) { 50 | 51 | View superView = super.getView(position, convertView, parent); 52 | 53 | ImageView iconView = (ImageView) superView.findViewById(R.id.AutocompleteImageView); 54 | 55 | int resultType; 56 | try { 57 | resultType = Integer.parseInt(getCursor().getString(getCursor().getColumnIndex(URL_SUGGESTION_TYPE))); 58 | } catch (Exception e) { 59 | resultType = 0; 60 | } 61 | 62 | switch (resultType) { 63 | case 1: iconView.setImageResource(R.drawable.ic_tab_history_unselected); break; 64 | case 2: iconView.setImageResource(R.drawable.ic_tab_bookmarks_unselected); break; 65 | case 3: iconView.setImageResource(R.drawable.ic_tab_weave_unselected); break; 66 | default: break; 67 | } 68 | 69 | return superView; 70 | } 71 | 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/org/zirco/model/adapters/WeaveBookmarksCursorAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 - 2011 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model.adapters; 17 | 18 | import org.zirco.R; 19 | import org.zirco.providers.WeaveColumns; 20 | 21 | import android.content.Context; 22 | import android.database.Cursor; 23 | import android.view.View; 24 | import android.view.ViewGroup; 25 | import android.widget.ImageView; 26 | import android.widget.SimpleCursorAdapter; 27 | import android.widget.TextView; 28 | 29 | public class WeaveBookmarksCursorAdapter extends SimpleCursorAdapter { 30 | 31 | public WeaveBookmarksCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { 32 | super(context, layout, c, from, to); 33 | } 34 | 35 | @Override 36 | public View getView(int position, View convertView, ViewGroup parent) { 37 | View superView = super.getView(position, convertView, parent); 38 | 39 | Cursor c = getCursor(); 40 | 41 | boolean isFolder = c.getInt(c.getColumnIndex(WeaveColumns.WEAVE_BOOKMARKS_FOLDER)) > 0 ? true : false; 42 | 43 | ImageView iconView = (ImageView) superView.findViewById(R.id.BookmarkRow_Thumbnail); 44 | TextView urlView = (TextView) superView.findViewById(R.id.BookmarkRow_Url); 45 | 46 | if (isFolder) { 47 | urlView.setVisibility(View.GONE); 48 | iconView.setImageResource(R.drawable.folder_icon); 49 | } else { 50 | urlView.setVisibility(View.VISIBLE); 51 | iconView.setImageResource(R.drawable.fav_icn_default); 52 | } 53 | 54 | return superView; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/org/zirco/model/items/BookmarkItem.java: -------------------------------------------------------------------------------- 1 | package org.zirco.model.items; 2 | 3 | /** 4 | * Represent a bookmark. 5 | */ 6 | public class BookmarkItem { 7 | 8 | private String mTitle; 9 | private String mUrl; 10 | 11 | /** 12 | * Constructor. 13 | * @param title The bookmark title. 14 | * @param url The bookmark url. 15 | */ 16 | public BookmarkItem(String title, String url) { 17 | mTitle = title; 18 | mUrl = url; 19 | } 20 | 21 | /** 22 | * Get the bookmark title. 23 | * @return The bookmark title. 24 | */ 25 | public String getTitle() { 26 | return mTitle; 27 | } 28 | 29 | /** 30 | * Get the bookmark url. 31 | * @return The bookmark url. 32 | */ 33 | public String getUrl() { 34 | return mUrl; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/org/zirco/model/items/HistoryItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model.items; 17 | 18 | import android.graphics.Bitmap; 19 | import android.graphics.BitmapFactory; 20 | 21 | /** 22 | * Represent an history element. 23 | */ 24 | public class HistoryItem { 25 | 26 | private long mId; 27 | private String mTitle; 28 | private String mUrl; 29 | private boolean mIsBookmark; 30 | private Bitmap mFavicon; 31 | 32 | /** 33 | * Constructor. 34 | * @param id The element id. 35 | * @param title The title. 36 | * @param url The url. 37 | * @param isBookmark True if this item is also a bookmark. 38 | * @param faviconData The favicon. 39 | */ 40 | public HistoryItem(long id, String title, String url, boolean isBookmark, byte[] faviconData) { 41 | mId = id; 42 | mTitle = title; 43 | mUrl = url; 44 | mIsBookmark = isBookmark; 45 | if (faviconData != null) { 46 | mFavicon = BitmapFactory.decodeByteArray(faviconData, 0, faviconData.length); 47 | } else { 48 | mFavicon = null; 49 | } 50 | } 51 | 52 | /** 53 | * Get the id. 54 | * @return The id. 55 | */ 56 | public long getId() { 57 | return mId; 58 | } 59 | 60 | /** 61 | * Get the title. 62 | * @return The title. 63 | */ 64 | public String getTitle() { 65 | return mTitle; 66 | } 67 | 68 | /** 69 | * Get the url. 70 | * @return The url. 71 | */ 72 | public String getUrl() { 73 | return mUrl; 74 | } 75 | 76 | public boolean isBookmark() { 77 | return mIsBookmark; 78 | } 79 | 80 | /** 81 | * Get the favicon. 82 | * @return The favicon. 83 | */ 84 | public Bitmap getFavicon() { 85 | return mFavicon; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/org/zirco/model/items/UrlSuggestionItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.model.items; 17 | 18 | /** 19 | * Store a suggestion item. 20 | */ 21 | public class UrlSuggestionItem { 22 | 23 | private static final float TITLE_COEFFICIENT = 2; 24 | private static final float URL_COEFFICIENT = 1; 25 | 26 | private static final float BOOKMARK_COEFFICIENT = 3; 27 | private static final float WEAVE_COEFFICIENT = 1; 28 | private static final float HISTORY_COEFFICIENT = 1; 29 | 30 | private String mPattern; 31 | private String mTitle; 32 | private String mUrl; 33 | private int mType; 34 | 35 | private float mNote; 36 | private boolean mNoteComputed = false; 37 | 38 | /** 39 | * Constructor. 40 | * @param pattern The parent pattern. 41 | * @param title The item's title. 42 | * @param url The item's url. 43 | * @param type The item's type (1 -> history, 2 -> bookmark). 44 | */ 45 | public UrlSuggestionItem(String pattern, String title, String url, int type) { 46 | mPattern = pattern; 47 | mTitle = title; 48 | mUrl = url; 49 | mType = type; 50 | } 51 | 52 | /** 53 | * Get the item's title. 54 | * @return The title. 55 | */ 56 | public String getTitle() { 57 | return mTitle; 58 | } 59 | 60 | /** 61 | * Get the item's url. 62 | * @return The url. 63 | */ 64 | public String getUrl() { 65 | return mUrl; 66 | } 67 | 68 | /** 69 | * Get the item's type. 70 | * @return The type. 71 | */ 72 | public int getType() { 73 | return mType; 74 | } 75 | 76 | /** 77 | * Get the note of this item. Compute it if not already done. 78 | * @return The note. 79 | */ 80 | public float getNote() { 81 | if (!mNoteComputed) { 82 | computeNote(); 83 | mNoteComputed = true; 84 | } 85 | return mNote; 86 | } 87 | 88 | /** 89 | * Compute the note of the current item. 90 | * The principle is to count the number of occurence of the pattern in the title and in the url, and to do a weighted sum. 91 | * A match in title weight more than a match in url, and a match in bookmark weight more than a match in history. 92 | */ 93 | private void computeNote() { 94 | String pattern = mPattern.toLowerCase(); 95 | 96 | // Count the number of match in a string, did not find a cleaner way. 97 | int titleMatchCount; 98 | String title = mTitle.toLowerCase(); 99 | if (title.equals(pattern)) { 100 | titleMatchCount = 1; 101 | } else { 102 | titleMatchCount = title.split(pattern).length - 1; 103 | } 104 | 105 | String url = mUrl.toLowerCase(); 106 | int urlMatchCount = url.split("\\Q" + pattern + "\\E").length - 1; 107 | 108 | mNote = (titleMatchCount * TITLE_COEFFICIENT) + (urlMatchCount * URL_COEFFICIENT); 109 | 110 | switch(mType) { 111 | case 1: mNote = mNote * HISTORY_COEFFICIENT; break; 112 | case 2: mNote = mNote * BOOKMARK_COEFFICIENT; break; 113 | case 3: mNote = mNote * WEAVE_COEFFICIENT; break; 114 | default: break; 115 | } 116 | 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /src/org/zirco/model/items/WeaveBookmarkItem.java: -------------------------------------------------------------------------------- 1 | package org.zirco.model.items; 2 | 3 | public class WeaveBookmarkItem { 4 | 5 | private String mTitle; 6 | private String mUrl; 7 | private boolean mIsFolder; 8 | private String mWeaveId; 9 | 10 | public WeaveBookmarkItem(String title, String url, String weaveId, boolean isFolder) { 11 | mTitle = title; 12 | mUrl = url; 13 | mWeaveId = weaveId; 14 | mIsFolder = isFolder; 15 | } 16 | 17 | public String getTitle() { 18 | return mTitle; 19 | } 20 | 21 | public String getUrl() { 22 | return mUrl; 23 | } 24 | 25 | public String getWeaveId() { 26 | return mWeaveId; 27 | } 28 | 29 | public boolean isFolder() { 30 | return mIsFolder; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/org/zirco/providers/WeaveColumns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 - 2011 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.providers; 17 | 18 | import android.net.Uri; 19 | import android.provider.BaseColumns; 20 | 21 | public class WeaveColumns implements BaseColumns { 22 | 23 | private WeaveColumns() { } 24 | 25 | public static final Uri CONTENT_URI = Uri.parse("content://" + WeaveContentProvider.AUTHORITY + "/" + WeaveContentProvider.WEAVE_BOOKMARKS_TABLE); 26 | 27 | public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.zirco.weave"; 28 | public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.zirco.weave"; 29 | 30 | public static final String WEAVE_BOOKMARKS_ID = "_id"; 31 | public static final String WEAVE_BOOKMARKS_WEAVE_ID = "weave_id"; 32 | public static final String WEAVE_BOOKMARKS_WEAVE_PARENT_ID = "weave_parent_id"; 33 | public static final String WEAVE_BOOKMARKS_TITLE = "title"; 34 | public static final String WEAVE_BOOKMARKS_URL = "url"; 35 | public static final String WEAVE_BOOKMARKS_FOLDER = "folder"; 36 | 37 | public static final String[] WEAVE_BOOKMARKS_PROJECTION = { WEAVE_BOOKMARKS_ID, 38 | WEAVE_BOOKMARKS_WEAVE_ID, 39 | WEAVE_BOOKMARKS_WEAVE_PARENT_ID, 40 | WEAVE_BOOKMARKS_TITLE, 41 | WEAVE_BOOKMARKS_URL, 42 | WEAVE_BOOKMARKS_FOLDER }; 43 | } 44 | -------------------------------------------------------------------------------- /src/org/zirco/sync/ISyncListener.java: -------------------------------------------------------------------------------- 1 | package org.zirco.sync; 2 | 3 | public interface ISyncListener { 4 | 5 | void onSyncProgress(int step, int done, int total); 6 | 7 | void onSyncEnd(Throwable result); 8 | 9 | void onSyncCancelled(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/AboutActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities; 17 | 18 | import org.zirco.R; 19 | 20 | import android.app.Activity; 21 | import android.content.pm.PackageInfo; 22 | import android.content.pm.PackageManager; 23 | import android.content.pm.PackageManager.NameNotFoundException; 24 | import android.os.Bundle; 25 | import android.util.Log; 26 | import android.view.View; 27 | import android.view.Window; 28 | import android.widget.Button; 29 | import android.widget.TextView; 30 | 31 | /** 32 | * About dialog activity. 33 | */ 34 | public class AboutActivity extends Activity { 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | 40 | Window w = getWindow(); 41 | w.requestFeature(Window.FEATURE_LEFT_ICON); 42 | 43 | setContentView(R.layout.about_activity); 44 | 45 | w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_dialog_info); 46 | 47 | TextView versionText = (TextView) this.findViewById(R.id.AboutActivity_VersionText); 48 | versionText.setText(this.getString(R.string.AboutActivity_VersionText) + " " + getVersion()); 49 | 50 | TextView licenseText = (TextView) this.findViewById(R.id.AboutActivity_LicenseText); 51 | licenseText.setText(this.getString(R.string.AboutActivity_LicenseText) + " " + this.getString(R.string.AboutActivity_LicenseTextValue)); 52 | 53 | TextView urlText = (TextView) this.findViewById(R.id.AboutActivity_UrlText); 54 | urlText.setText(this.getString(R.string.AboutActivity_UrlTextValue)); 55 | 56 | Button closeBtn = (Button) this.findViewById(R.id.AboutActivity_CloseBtn); 57 | closeBtn.setOnClickListener(new View.OnClickListener() { 58 | 59 | public void onClick(View view) { 60 | finish(); 61 | } 62 | 63 | }); 64 | } 65 | 66 | /** 67 | * Get the current package version. 68 | * @return The current version. 69 | */ 70 | private String getVersion() { 71 | String result = ""; 72 | try { 73 | 74 | PackageManager manager = this.getPackageManager(); 75 | PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0); 76 | 77 | result = String.format("%s (%s)", info.versionName, info.versionCode); 78 | 79 | } catch (NameNotFoundException e) { 80 | Log.w(AboutActivity.class.toString(), "Unable to get application version: " + e.getMessage()); 81 | result = "Unable to get application version."; 82 | } 83 | 84 | return result; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/BookmarksHistoryActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities; 17 | 18 | import org.zirco.R; 19 | import org.zirco.controllers.Controller; 20 | import org.zirco.utils.Constants; 21 | 22 | import android.app.TabActivity; 23 | import android.content.Intent; 24 | import android.content.res.Configuration; 25 | import android.content.res.Resources; 26 | import android.os.Bundle; 27 | import android.preference.PreferenceManager; 28 | import android.view.Window; 29 | import android.view.WindowManager; 30 | import android.widget.TabHost; 31 | import android.widget.TabHost.OnTabChangeListener; 32 | 33 | /** 34 | * Combined bookmarks and history activity. 35 | */ 36 | public class BookmarksHistoryActivity extends TabActivity { 37 | 38 | @Override 39 | protected void onCreate(Bundle savedInstanceState) { 40 | super.onCreate(savedInstanceState); 41 | 42 | if (Controller.getInstance().getPreferences().getBoolean(Constants.PREFERENCES_SHOW_FULL_SCREEN, false)) { 43 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 44 | } 45 | 46 | if (Controller.getInstance().getPreferences().getBoolean(Constants.PREFERENCES_GENERAL_HIDE_TITLE_BARS, true)) { 47 | requestWindowFeature(Window.FEATURE_NO_TITLE); 48 | } 49 | 50 | setContentView(R.layout.bookmarks_history_activity); 51 | 52 | setTitle(R.string.BookmarksListActivity_Title); 53 | 54 | Resources res = getResources(); 55 | TabHost tabHost = getTabHost(); 56 | TabHost.TabSpec spec; 57 | Intent intent; 58 | 59 | // Bookmarks 60 | intent = new Intent().setClass(this, BookmarksListActivity.class); 61 | 62 | spec = tabHost.newTabSpec("bookmarks").setIndicator(res.getString(R.string.Main_MenuShowBookmarks), 63 | res.getDrawable(R.drawable.ic_tab_bookmarks)) 64 | .setContent(intent); 65 | tabHost.addTab(spec); 66 | 67 | // History 68 | intent = new Intent().setClass(this, HistoryListActivity.class); 69 | 70 | spec = tabHost.newTabSpec("history").setIndicator(res.getString(R.string.Main_MenuShowHistory), 71 | res.getDrawable(R.drawable.ic_tab_history)) 72 | .setContent(intent); 73 | tabHost.addTab(spec); 74 | 75 | if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(Constants.PREFERENCE_USE_WEAVE, false)) { 76 | // Weave bookmarks 77 | intent = new Intent().setClass(this, WeaveBookmarksListActivity.class); 78 | 79 | spec = tabHost.newTabSpec("weave").setIndicator(res.getString(R.string.WeaveBookmarksListActivity_Title), 80 | res.getDrawable(R.drawable.ic_tab_weave)) 81 | .setContent(intent); 82 | tabHost.addTab(spec); 83 | } 84 | 85 | tabHost.setCurrentTab(0); 86 | 87 | tabHost.setOnTabChangedListener(new OnTabChangeListener() { 88 | @Override 89 | public void onTabChanged(String tabId) { 90 | if (tabId.equals("bookmarks")) { 91 | setTitle(R.string.BookmarksListActivity_Title); 92 | } else if (tabId.equals("history")) { 93 | setTitle(R.string.HistoryListActivity_Title); 94 | } else if (tabId.equals("weave")) { 95 | setTitle(R.string.WeaveBookmarksListActivity_Title); 96 | } else { 97 | setTitle(R.string.ApplicationName); 98 | } 99 | } 100 | }); 101 | } 102 | 103 | @Override 104 | public void onConfigurationChanged(Configuration newConfig) { 105 | super.onConfigurationChanged(newConfig); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/ChangelogActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.ApplicationUtils; 20 | 21 | import android.app.Activity; 22 | import android.os.Bundle; 23 | import android.view.View; 24 | import android.view.Window; 25 | import android.widget.Button; 26 | import android.widget.TextView; 27 | 28 | /** 29 | * Changelog dialog activity. 30 | */ 31 | public class ChangelogActivity extends Activity { 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | 37 | Window w = getWindow(); 38 | w.requestFeature(Window.FEATURE_LEFT_ICON); 39 | 40 | setContentView(R.layout.changelog_activity); 41 | 42 | w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_dialog_info); 43 | 44 | TextView changelogText = (TextView) findViewById(R.id.ChangelogContent); 45 | changelogText.setText(ApplicationUtils.getChangelogString(this)); 46 | 47 | Button closeBtn = (Button) this.findViewById(R.id.ChangelogActivity_CloseBtn); 48 | closeBtn.setOnClickListener(new View.OnClickListener() { 49 | 50 | public void onClick(View view) { 51 | finish(); 52 | } 53 | 54 | }); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/EditBookmarkActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities; 17 | 18 | import org.zirco.R; 19 | import org.zirco.providers.BookmarksProviderWrapper; 20 | import org.zirco.utils.Constants; 21 | 22 | import android.app.Activity; 23 | import android.os.Bundle; 24 | import android.view.View; 25 | import android.view.Window; 26 | import android.widget.Button; 27 | import android.widget.EditText; 28 | 29 | /** 30 | * Add / Edit bookmark activity. 31 | */ 32 | public class EditBookmarkActivity extends Activity { 33 | 34 | private EditText mTitleEditText; 35 | private EditText mUrlEditText; 36 | 37 | private Button mOkButton; 38 | private Button mCancelButton; 39 | 40 | private long mRowId = -1; 41 | 42 | @Override 43 | public void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | 46 | Window w = getWindow(); 47 | w.requestFeature(Window.FEATURE_LEFT_ICON); 48 | 49 | setContentView(R.layout.edit_bookmark_activity); 50 | 51 | w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_input_add); 52 | 53 | mTitleEditText = (EditText) findViewById(R.id.EditBookmarkActivity_TitleValue); 54 | mUrlEditText = (EditText) findViewById(R.id.EditBookmarkActivity_UrlValue); 55 | 56 | mOkButton = (Button) findViewById(R.id.EditBookmarkActivity_BtnOk); 57 | mCancelButton = (Button) findViewById(R.id.EditBookmarkActivity_BtnCancel); 58 | 59 | mOkButton.setOnClickListener(new View.OnClickListener() { 60 | @Override 61 | public void onClick(View v) { 62 | setAsBookmark(); 63 | setResult(RESULT_OK); 64 | finish(); 65 | } 66 | }); 67 | 68 | mCancelButton.setOnClickListener(new View.OnClickListener() { 69 | @Override 70 | public void onClick(View v) { 71 | setResult(RESULT_CANCELED); 72 | finish(); 73 | } 74 | }); 75 | 76 | Bundle extras = getIntent().getExtras(); 77 | if (extras != null) { 78 | 79 | String title = extras.getString(Constants.EXTRA_ID_BOOKMARK_TITLE); 80 | if ((title != null) && 81 | (title.length() > 0)) { 82 | mTitleEditText.setText(title); 83 | } 84 | 85 | String url = extras.getString(Constants.EXTRA_ID_BOOKMARK_URL); 86 | if ((url != null) && 87 | (url.length() > 0)) { 88 | mUrlEditText.setText(url); 89 | } else { 90 | mUrlEditText.setHint("http://"); 91 | } 92 | 93 | mRowId = extras.getLong(Constants.EXTRA_ID_BOOKMARK_ID); 94 | 95 | } 96 | 97 | if (mRowId == -1) { 98 | setTitle(R.string.EditBookmarkActivity_TitleAdd); 99 | } 100 | } 101 | 102 | /** 103 | * Set the current title and url values as a bookmark, e.g. adding a record if necessary or set only the bookmark flag. 104 | */ 105 | private void setAsBookmark() { 106 | BookmarksProviderWrapper.setAsBookmark(getContentResolver(), mRowId, mTitleEditText.getText().toString(), mUrlEditText.getText().toString(), true); 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/IToolbarsContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities; 17 | 18 | /** 19 | * Interface defining a tool bar container. 20 | */ 21 | public interface IToolbarsContainer { 22 | 23 | /** 24 | * Hide the tool bars of this item. 25 | */ 26 | void hideToolbars(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/BaseSpinnerCustomPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | 20 | import android.app.Activity; 21 | import android.os.Bundle; 22 | import android.view.View; 23 | import android.view.Window; 24 | import android.view.View.OnClickListener; 25 | import android.widget.AdapterView; 26 | import android.widget.ArrayAdapter; 27 | import android.widget.Button; 28 | import android.widget.EditText; 29 | import android.widget.Spinner; 30 | import android.widget.AdapterView.OnItemSelectedListener; 31 | 32 | /** 33 | * Base class for a dialog activity for a preference which can have several predefined values, and a customizable one. 34 | */ 35 | public abstract class BaseSpinnerCustomPreferenceActivity extends Activity { 36 | 37 | protected Spinner mSpinner; 38 | protected EditText mCustomEditText; 39 | 40 | @Override 41 | protected void onCreate(Bundle savedInstanceState) { 42 | super.onCreate(savedInstanceState); 43 | 44 | Window w = getWindow(); 45 | w.requestFeature(Window.FEATURE_LEFT_ICON); 46 | 47 | setContentView(R.layout.base_spinner_custom_preference_activity); 48 | 49 | w.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_dialog_map); 50 | 51 | mCustomEditText = (EditText) findViewById(R.id.BaseSpinnerCustomPreferenceEditText); 52 | 53 | mSpinner = (Spinner) findViewById(R.id.BaseSpinnerCustomPreferenceSpinner); 54 | 55 | mSpinner.setPromptId(getSpinnerPromptId()); 56 | 57 | ArrayAdapter adapter = ArrayAdapter.createFromResource(this, getSpinnerValuesArrayId(), android.R.layout.simple_spinner_item); 58 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 59 | mSpinner.setAdapter(adapter); 60 | 61 | setSpinnerValueFromPreferences(); 62 | 63 | mSpinner.setOnItemSelectedListener(new OnItemSelectedListener() { 64 | 65 | @Override 66 | public void onItemSelected(AdapterView arg0, View arg1, int position, long id) { 67 | onSpinnerItemSelected(position); 68 | } 69 | 70 | @Override 71 | public void onNothingSelected(AdapterView arg0) { } 72 | 73 | }); 74 | 75 | Button okBtn = (Button) findViewById(R.id.BaseSpinnerCustomPreferenceOk); 76 | okBtn.setOnClickListener(new OnClickListener() { 77 | 78 | @Override 79 | public void onClick(View v) { 80 | onOk(); 81 | finish(); 82 | } 83 | }); 84 | 85 | Button cancelBtn = (Button) findViewById(R.id.BaseSpinnerCustomPreferenceCancel); 86 | cancelBtn.setOnClickListener(new OnClickListener() { 87 | 88 | @Override 89 | public void onClick(View v) { 90 | finish(); 91 | } 92 | }); 93 | } 94 | 95 | /** 96 | * Get the resource id for the prompt of the spinner. 97 | * @return The resource id. 98 | */ 99 | protected abstract int getSpinnerPromptId(); 100 | 101 | /** 102 | * Get the resource id for the array values of the spinner. 103 | * @return The array id. 104 | */ 105 | protected abstract int getSpinnerValuesArrayId(); 106 | 107 | /** 108 | * Initialize the spinner with the current value in preferences. 109 | */ 110 | protected abstract void setSpinnerValueFromPreferences(); 111 | 112 | /** 113 | * Behavior when the spinner selected item change. 114 | * @param position The new selected index. 115 | */ 116 | protected abstract void onSpinnerItemSelected(int position); 117 | 118 | /** 119 | * Behavior when the user press the Ok button. 120 | */ 121 | protected abstract void onOk(); 122 | 123 | } 124 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/HomepagePreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.SharedPreferences.Editor; 22 | import android.os.Bundle; 23 | import android.preference.PreferenceManager; 24 | 25 | /** 26 | * Home page preference chooser activity. 27 | */ 28 | public class HomepagePreferenceActivity extends BaseSpinnerCustomPreferenceActivity { 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | } 34 | 35 | @Override 36 | protected int getSpinnerPromptId() { 37 | return R.string.HomepagePreferenceActivity_Prompt; 38 | } 39 | 40 | @Override 41 | protected int getSpinnerValuesArrayId() { 42 | return R.array.HomepageValues; 43 | } 44 | 45 | @Override 46 | protected void onOk() { 47 | Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); 48 | editor.putString(Constants.PREFERENCES_GENERAL_HOME_PAGE, mCustomEditText.getText().toString()); 49 | editor.commit(); 50 | } 51 | 52 | @Override 53 | protected void onSpinnerItemSelected(int position) { 54 | switch (position) { 55 | case 0: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_ABOUT_START); break; 56 | case 1: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_ABOUT_BLANK); break; 57 | case 2: { 58 | mCustomEditText.setEnabled(true); 59 | 60 | if ((mCustomEditText.getText().toString().equals(Constants.URL_ABOUT_START)) || 61 | (mCustomEditText.getText().toString().equals(Constants.URL_ABOUT_BLANK))) { 62 | mCustomEditText.setText(null); 63 | } 64 | break; 65 | } 66 | default: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_ABOUT_START); break; 67 | } 68 | } 69 | 70 | @Override 71 | protected void setSpinnerValueFromPreferences() { 72 | String currentHomepage = PreferenceManager.getDefaultSharedPreferences(this).getString(Constants.PREFERENCES_GENERAL_HOME_PAGE, Constants.URL_ABOUT_START); 73 | 74 | if (currentHomepage.equals(Constants.URL_ABOUT_START)) { 75 | mSpinner.setSelection(0); 76 | mCustomEditText.setEnabled(false); 77 | mCustomEditText.setText(Constants.URL_ABOUT_START); 78 | } else if (currentHomepage.equals(Constants.URL_ABOUT_BLANK)) { 79 | mSpinner.setSelection(1); 80 | mCustomEditText.setEnabled(false); 81 | mCustomEditText.setText(Constants.URL_ABOUT_BLANK); 82 | } else { 83 | mSpinner.setSelection(2); 84 | mCustomEditText.setEnabled(true); 85 | mCustomEditText.setText(currentHomepage); 86 | } 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/SearchUrlPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.SharedPreferences.Editor; 22 | import android.os.Bundle; 23 | import android.preference.PreferenceManager; 24 | 25 | /** 26 | * Search url preference chooser activity. 27 | */ 28 | public class SearchUrlPreferenceActivity extends BaseSpinnerCustomPreferenceActivity { 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | } 34 | 35 | @Override 36 | protected int getSpinnerPromptId() { 37 | return R.string.SearchUrlPreferenceActivity_Prompt; 38 | } 39 | 40 | @Override 41 | protected int getSpinnerValuesArrayId() { 42 | return R.array.SearchUrlValues; 43 | } 44 | 45 | @Override 46 | protected void setSpinnerValueFromPreferences() { 47 | String currentSearchUrl = PreferenceManager.getDefaultSharedPreferences(this).getString(Constants.PREFERENCES_GENERAL_SEARCH_URL, Constants.URL_SEARCH_GOOGLE); 48 | 49 | if (currentSearchUrl.equals(Constants.URL_SEARCH_GOOGLE)) { 50 | mSpinner.setSelection(0); 51 | mCustomEditText.setEnabled(false); 52 | mCustomEditText.setText(Constants.URL_SEARCH_GOOGLE); 53 | } else if (currentSearchUrl.equals(Constants.URL_SEARCH_WIKIPEDIA)) { 54 | mSpinner.setSelection(1); 55 | mCustomEditText.setEnabled(false); 56 | mCustomEditText.setText(Constants.URL_SEARCH_WIKIPEDIA); 57 | } else { 58 | mSpinner.setSelection(2); 59 | mCustomEditText.setEnabled(true); 60 | mCustomEditText.setText(currentSearchUrl); 61 | } 62 | } 63 | 64 | @Override 65 | protected void onSpinnerItemSelected(int position) { 66 | switch (position) { 67 | case 0: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_SEARCH_GOOGLE); break; 68 | case 1: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_SEARCH_WIKIPEDIA); break; 69 | case 2: { 70 | mCustomEditText.setEnabled(true); 71 | 72 | if ((mCustomEditText.getText().toString().equals(Constants.URL_SEARCH_GOOGLE)) || 73 | (mCustomEditText.getText().toString().equals(Constants.URL_SEARCH_WIKIPEDIA))) { 74 | mCustomEditText.setText(null); 75 | } 76 | break; 77 | } 78 | default: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.URL_SEARCH_GOOGLE); break; 79 | } 80 | } 81 | 82 | @Override 83 | protected void onOk() { 84 | Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); 85 | editor.putString(Constants.PREFERENCES_GENERAL_SEARCH_URL, mCustomEditText.getText().toString()); 86 | editor.commit(); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/UserAgentPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.SharedPreferences.Editor; 22 | import android.preference.PreferenceManager; 23 | 24 | /** 25 | * User agent preference chooser activity. 26 | */ 27 | public class UserAgentPreferenceActivity extends BaseSpinnerCustomPreferenceActivity { 28 | 29 | @Override 30 | protected int getSpinnerPromptId() { 31 | return R.string.UserAgentPreferenceActivity_Prompt; 32 | } 33 | 34 | @Override 35 | protected int getSpinnerValuesArrayId() { 36 | return R.array.UserAgentValues; 37 | } 38 | 39 | @Override 40 | protected void onOk() { 41 | Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); 42 | editor.putString(Constants.PREFERENCES_BROWSER_USER_AGENT, mCustomEditText.getText().toString()); 43 | editor.commit(); 44 | } 45 | 46 | @Override 47 | protected void onSpinnerItemSelected(int position) { 48 | switch (position) { 49 | case 0: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.USER_AGENT_DEFAULT); break; 50 | case 1: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.USER_AGENT_DESKTOP); break; 51 | case 2: { 52 | mCustomEditText.setEnabled(true); 53 | 54 | if ((mCustomEditText.getText().toString().equals(Constants.USER_AGENT_DEFAULT)) || 55 | (mCustomEditText.getText().toString().equals(Constants.USER_AGENT_DESKTOP))) { 56 | mCustomEditText.setText(null); 57 | } 58 | break; 59 | } 60 | default: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.USER_AGENT_DEFAULT); break; 61 | } 62 | } 63 | 64 | @Override 65 | protected void setSpinnerValueFromPreferences() { 66 | String currentUserAgent = PreferenceManager.getDefaultSharedPreferences(this).getString(Constants.PREFERENCES_BROWSER_USER_AGENT, Constants.USER_AGENT_DEFAULT); 67 | 68 | if (currentUserAgent.equals(Constants.USER_AGENT_DEFAULT)) { 69 | mSpinner.setSelection(0); 70 | mCustomEditText.setEnabled(false); 71 | mCustomEditText.setText(Constants.USER_AGENT_DEFAULT); 72 | } else if (currentUserAgent.equals(Constants.USER_AGENT_DESKTOP)) { 73 | mSpinner.setSelection(1); 74 | mCustomEditText.setEnabled(false); 75 | mCustomEditText.setText(Constants.USER_AGENT_DESKTOP); 76 | } else { 77 | mSpinner.setSelection(2); 78 | mCustomEditText.setEnabled(true); 79 | mCustomEditText.setText(currentUserAgent); 80 | } 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/WeavePreferencesActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 - 2011 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.Intent; 22 | import android.os.Bundle; 23 | import android.preference.Preference; 24 | import android.preference.PreferenceActivity; 25 | import android.preference.Preference.OnPreferenceClickListener; 26 | 27 | public class WeavePreferencesActivity extends PreferenceActivity { 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | 33 | addPreferencesFromResource(R.layout.weave_preferences_activity); 34 | 35 | Preference weaveServerPref = (Preference) findPreference(Constants.PREFERENCE_WEAVE_SERVER); 36 | weaveServerPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { 37 | @Override 38 | public boolean onPreferenceClick(Preference preference) { 39 | openWeaveServerActivity(); 40 | return true; 41 | } 42 | }); 43 | } 44 | 45 | private void openWeaveServerActivity() { 46 | Intent i = new Intent(this, WeaveServerPreferenceActivity.class); 47 | startActivity(i); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/org/zirco/ui/activities/preferences/WeaveServerPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 - 2011 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.activities.preferences; 17 | 18 | import org.zirco.R; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.SharedPreferences.Editor; 22 | import android.os.Bundle; 23 | import android.preference.PreferenceManager; 24 | 25 | public class WeaveServerPreferenceActivity extends BaseSpinnerCustomPreferenceActivity { 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | } 31 | 32 | @Override 33 | protected int getSpinnerPromptId() { 34 | return R.string.WeaveServerPreferenceActivity_Prompt; 35 | } 36 | 37 | @Override 38 | protected int getSpinnerValuesArrayId() { 39 | return R.array.WeaveServerValues; 40 | } 41 | 42 | @Override 43 | protected void setSpinnerValueFromPreferences() { 44 | String currentServer = PreferenceManager.getDefaultSharedPreferences(this).getString(Constants.PREFERENCE_WEAVE_SERVER, Constants.WEAVE_DEFAULT_SERVER); 45 | 46 | if (currentServer.equals(Constants.WEAVE_DEFAULT_SERVER)) { 47 | mSpinner.setSelection(0); 48 | mCustomEditText.setEnabled(false); 49 | mCustomEditText.setText(Constants.WEAVE_DEFAULT_SERVER); 50 | } else { 51 | mSpinner.setSelection(1); 52 | mCustomEditText.setEnabled(true); 53 | mCustomEditText.setText(currentServer); 54 | } 55 | } 56 | 57 | @Override 58 | protected void onSpinnerItemSelected(int position) { 59 | switch (position) { 60 | case 0: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.WEAVE_DEFAULT_SERVER); break; 61 | case 1: { 62 | mCustomEditText.setEnabled(true); 63 | 64 | if (mCustomEditText.getText().toString().equals(Constants.WEAVE_DEFAULT_SERVER)) { 65 | mCustomEditText.setText(null); 66 | } 67 | break; 68 | } 69 | default: mCustomEditText.setEnabled(false); mCustomEditText.setText(Constants.WEAVE_DEFAULT_SERVER); break; 70 | } 71 | } 72 | 73 | @Override 74 | protected void onOk() { 75 | Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit(); 76 | editor.putString(Constants.PREFERENCE_WEAVE_SERVER, mCustomEditText.getText().toString()); 77 | editor.commit(); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/org/zirco/ui/runnables/FaviconUpdaterRunnable.java: -------------------------------------------------------------------------------- 1 | package org.zirco.ui.runnables; 2 | 3 | import org.zirco.providers.BookmarksProviderWrapper; 4 | 5 | import android.app.Activity; 6 | import android.graphics.Bitmap; 7 | 8 | /** 9 | * Runnable to update database favicon. 10 | */ 11 | public class FaviconUpdaterRunnable implements Runnable { 12 | 13 | private Activity mActivity; 14 | private String mUrl; 15 | private String mOriginalUrl; 16 | private Bitmap mFavIcon; 17 | 18 | /** 19 | * Constructor. 20 | * @param activity The parent activity. 21 | * @param url The page url. 22 | * @param originalUrl The page original url. 23 | * @param favicon The favicon. 24 | */ 25 | public FaviconUpdaterRunnable(Activity activity, String url, String originalUrl, Bitmap favicon) { 26 | mActivity = activity; 27 | mUrl = url; 28 | mOriginalUrl = originalUrl; 29 | mFavIcon = favicon; 30 | } 31 | 32 | @Override 33 | public void run() { 34 | BookmarksProviderWrapper.updateFavicon(mActivity, mUrl, mOriginalUrl, mFavIcon); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/org/zirco/ui/runnables/HideToolbarsRunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.runnables; 17 | 18 | import org.zirco.ui.activities.IToolbarsContainer; 19 | 20 | import android.os.Handler; 21 | import android.os.Message; 22 | import android.util.Log; 23 | 24 | /** 25 | * A runnable to hide tool bars after the given delay. 26 | */ 27 | public class HideToolbarsRunnable implements Runnable { 28 | 29 | private static final String TAG = "HideToolbarsRunnable"; 30 | 31 | private IToolbarsContainer mParent; 32 | private boolean mDisabled; 33 | private int mDelay; 34 | 35 | /** 36 | * Constructor. 37 | * @param parent The parent tool bar container. 38 | * @param delay The delay before hiding, in milliseconds. 39 | */ 40 | public HideToolbarsRunnable(IToolbarsContainer parent, int delay) { 41 | mParent = parent; 42 | mDisabled = false; 43 | mDelay = delay; 44 | } 45 | 46 | private Handler mHandler = new Handler() { 47 | 48 | public void handleMessage(Message msg) { 49 | if ((mParent != null) && 50 | (!mDisabled)) { 51 | mParent.hideToolbars(); 52 | } 53 | } 54 | }; 55 | 56 | /** 57 | * Disable this runnable. 58 | */ 59 | public void setDisabled() { 60 | mDisabled = true; 61 | } 62 | 63 | @Override 64 | public void run() { 65 | try { 66 | 67 | Thread.sleep(mDelay); 68 | 69 | mHandler.sendEmptyMessage(0); 70 | 71 | } catch (InterruptedException e) { 72 | Log.w(TAG, "Exception in thread: " + e.getMessage()); 73 | 74 | mHandler.sendEmptyMessage(0); 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/org/zirco/ui/runnables/HistoryUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.ui.runnables; 17 | 18 | import org.zirco.providers.BookmarksProviderWrapper; 19 | import org.zirco.utils.Constants; 20 | 21 | import android.content.Context; 22 | import android.preference.PreferenceManager; 23 | 24 | /** 25 | * Runnable to update and truncate the history in background. 26 | */ 27 | public class HistoryUpdater implements Runnable { 28 | 29 | private Context mContext; 30 | private String mTitle; 31 | private String mUrl; 32 | private String mOriginalUrl; 33 | 34 | /** 35 | * Constructor. 36 | * @param context The current context. 37 | * @param title The title. 38 | * @param url The url. 39 | */ 40 | public HistoryUpdater(Context context, String title, String url, String originalUrl) { 41 | mContext = context; 42 | mTitle = title; 43 | mUrl = url; 44 | mOriginalUrl = originalUrl; 45 | 46 | if (mUrl.startsWith(Constants.URL_GOOGLE_MOBILE_VIEW_NO_FORMAT)) { 47 | mUrl = mUrl.substring(Constants.URL_GOOGLE_MOBILE_VIEW_NO_FORMAT.length()); 48 | } 49 | } 50 | 51 | @Override 52 | public void run() { 53 | BookmarksProviderWrapper.updateHistory(mContext.getContentResolver(), mTitle, mUrl, mOriginalUrl); 54 | BookmarksProviderWrapper.truncateHistory(mContext.getContentResolver(), 55 | PreferenceManager.getDefaultSharedPreferences(mContext).getString(Constants.PREFERENCES_BROWSER_HISTORY_SIZE, "90")); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/org/zirco/utils/DateUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 - 2011 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.utils; 17 | 18 | import java.text.ParseException; 19 | import java.text.SimpleDateFormat; 20 | import java.util.Calendar; 21 | import java.util.Date; 22 | 23 | import org.zirco.R; 24 | 25 | import android.content.Context; 26 | import android.util.Log; 27 | 28 | /** 29 | * Utilities for date / time management. 30 | */ 31 | public class DateUtils { 32 | 33 | /** 34 | * Get the default date format. 35 | * @param context The current context. 36 | * @return The default date format. 37 | */ 38 | private static String getDefaultFormat(Context context) { 39 | return context.getResources().getString(R.string.DATE_FORMAT_ISO8601); 40 | } 41 | 42 | /** 43 | * Get a string representation of the current date / time in a format suitable for a file name. 44 | * @return A string representation of the current date / time. 45 | */ 46 | public static String getNowForFileName() { 47 | Calendar c = Calendar.getInstance(); 48 | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-HHmmss"); 49 | 50 | return sdf.format(c.getTime()); 51 | } 52 | 53 | /** 54 | * Parse a string representation of a date in default format to a Date object. 55 | * @param context The current context. 56 | * @param date The date to convert. 57 | * @return The converted date. If an error occurs during conversion, will be the current date. 58 | */ 59 | public static Date convertFromDatabase(Context context, String date) { 60 | SimpleDateFormat sdf = new SimpleDateFormat(getDefaultFormat(context)); 61 | 62 | try { 63 | 64 | return sdf.parse(date); 65 | 66 | } catch (ParseException e) { 67 | Log.w(DateUtils.class.toString(), "Error parsing date (" + date + "): " + e.getMessage()); 68 | 69 | return new Date(); 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/org/zirco/utils/IOUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.utils; 17 | 18 | import java.io.File; 19 | import java.io.FileFilter; 20 | import java.util.ArrayList; 21 | import java.util.Collections; 22 | import java.util.Comparator; 23 | import java.util.List; 24 | 25 | import android.os.Environment; 26 | 27 | /** 28 | * Utilities for I/O reading and writing. 29 | */ 30 | public class IOUtils { 31 | 32 | private static final String APPLICATION_FOLDER = "zirco"; 33 | private static final String DOWNLOAD_FOLDER = "downloads"; 34 | private static final String BOOKMARKS_EXPORT_FOLDER = "bookmarks-exports"; 35 | 36 | /** 37 | * Get the application folder on the SD Card. Create it if not present. 38 | * @return The application folder. 39 | */ 40 | public static File getApplicationFolder() { 41 | File root = Environment.getExternalStorageDirectory(); 42 | if (root.canWrite()) { 43 | 44 | File folder = new File(root, APPLICATION_FOLDER); 45 | 46 | if (!folder.exists()) { 47 | folder.mkdir(); 48 | } 49 | 50 | return folder; 51 | 52 | } else { 53 | return null; 54 | } 55 | } 56 | 57 | /** 58 | * Get the application download folder on the SD Card. Create it if not present. 59 | * @return The application download folder. 60 | */ 61 | public static File getDownloadFolder() { 62 | File root = getApplicationFolder(); 63 | 64 | if (root != null) { 65 | 66 | File folder = new File(root, DOWNLOAD_FOLDER); 67 | 68 | if (!folder.exists()) { 69 | folder.mkdir(); 70 | } 71 | 72 | return folder; 73 | 74 | } else { 75 | return null; 76 | } 77 | } 78 | 79 | /** 80 | * Get the application folder for bookmarks export. Create it if not present. 81 | * @return The application folder for bookmarks export. 82 | */ 83 | public static File getBookmarksExportFolder() { 84 | File root = getApplicationFolder(); 85 | 86 | if (root != null) { 87 | 88 | File folder = new File(root, BOOKMARKS_EXPORT_FOLDER); 89 | 90 | if (!folder.exists()) { 91 | folder.mkdir(); 92 | } 93 | 94 | return folder; 95 | 96 | } else { 97 | return null; 98 | } 99 | } 100 | 101 | /** 102 | * Get the list of xml files in the bookmark export folder. 103 | * @return The list of xml files in the bookmark export folder. 104 | */ 105 | public static List getExportedBookmarksFileList() { 106 | List result = new ArrayList(); 107 | 108 | File folder = getBookmarksExportFolder(); 109 | 110 | if (folder != null) { 111 | 112 | FileFilter filter = new FileFilter() { 113 | 114 | @Override 115 | public boolean accept(File pathname) { 116 | if ((pathname.isFile()) && 117 | (pathname.getPath().endsWith(".xml"))) { 118 | return true; 119 | } 120 | return false; 121 | } 122 | }; 123 | 124 | File[] files = folder.listFiles(filter); 125 | 126 | for (File file : files) { 127 | result.add(file.getName()); 128 | } 129 | } 130 | 131 | Collections.sort(result, new Comparator() { 132 | 133 | @Override 134 | public int compare(String arg0, String arg1) { 135 | return arg1.compareTo(arg0); 136 | } 137 | }); 138 | 139 | return result; 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /src/org/zirco/utils/ProxyChangeReceiver.java: -------------------------------------------------------------------------------- 1 | package org.zirco.utils; 2 | 3 | import org.zirco.ui.activities.MainActivity; 4 | 5 | import android.content.BroadcastReceiver; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.util.Log; 9 | 10 | public class ProxyChangeReceiver extends BroadcastReceiver 11 | { 12 | @Override 13 | public void onReceive(Context context, Intent intent) 14 | { 15 | Log.d("ProxyChangeReceiver", "Proxy change receiver called: " + intent.toString()); 16 | 17 | if (MainActivity.INSTANCE != null) 18 | { 19 | Log.d("ProxyChangeReceiver", "Refresh system preferences"); 20 | MainActivity.INSTANCE.applyPreferences(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/org/zirco/utils/UrlUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Zirco Browser for Android 3 | * 4 | * Copyright (C) 2010 J. Devauchelle and contributors. 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * version 3 as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | */ 15 | 16 | package org.zirco.utils; 17 | 18 | import java.util.Iterator; 19 | 20 | import org.zirco.controllers.Controller; 21 | 22 | import android.content.Context; 23 | import android.preference.PreferenceManager; 24 | 25 | /** 26 | * Url management utils. 27 | */ 28 | public class UrlUtils { 29 | 30 | /** 31 | * Check if a string is an url. 32 | * For now, just consider that if a string contains a dot, it is an url. 33 | * @param url The url to check. 34 | * @return True if the string is an url. 35 | */ 36 | public static boolean isUrl(String url) { 37 | return url.equals(Constants.URL_ABOUT_BLANK) || 38 | url.equals(Constants.URL_ABOUT_START) || 39 | url.contains("."); 40 | } 41 | 42 | /** 43 | * Get the current search url. 44 | * @param context The current context. 45 | * @param searchTerms The terms to search for. 46 | * @return The search url. 47 | */ 48 | public static String getSearchUrl(Context context, String searchTerms) { 49 | String currentSearchUrl = PreferenceManager.getDefaultSharedPreferences(context).getString(Constants.PREFERENCES_GENERAL_SEARCH_URL, Constants.URL_SEARCH_GOOGLE); 50 | return String.format(currentSearchUrl, searchTerms); 51 | } 52 | 53 | /** 54 | * Check en url. Add http:// before if missing. 55 | * @param url The url to check. 56 | * @return The modified url if necessary. 57 | */ 58 | public static String checkUrl(String url) { 59 | if ((url != null) && 60 | (url.length() > 0)) { 61 | 62 | if ((!url.startsWith("http://")) && 63 | (!url.startsWith("https://")) && 64 | (!url.startsWith("file://")) && 65 | (!url.startsWith(Constants.URL_ABOUT_BLANK)) && 66 | (!url.startsWith(Constants.URL_ABOUT_START))) { 67 | 68 | url = "http://" + url; 69 | 70 | } 71 | } 72 | 73 | return url; 74 | } 75 | 76 | /** 77 | * Check if there is an item in the mobile view url list that match a given url. 78 | * @param context The current context. 79 | * @param url The url to check. 80 | * @return True if an item in the list match the given url. 81 | */ 82 | public static boolean checkInMobileViewUrlList(Context context, String url) { 83 | 84 | if (url != null) { 85 | boolean inList = false; 86 | Iterator iter = Controller.getInstance().getMobileViewUrlList(context).iterator(); 87 | while ((iter.hasNext()) && 88 | (!inList)) { 89 | if (url.contains(iter.next())) { 90 | inList = true; 91 | } 92 | } 93 | return inList; 94 | } else { 95 | return false; 96 | } 97 | } 98 | 99 | } 100 | --------------------------------------------------------------------------------