修正由于 gif 格式图片导致的崩溃
This commit is contained in:
1 parent
e1edd00fb0
commit
3aff219639
28 files changed
+661
-759
No files matched your search
Binary file not shown.
@@ -1,478 +0,0 @@
|
||||
int array download_item_long_click 0x7f080006
|
||||
int array favourite_item_long_click 0x7f080005
|
||||
int array is_exhentai 0x7f080009
|
||||
int array list_item_long_click 0x7f080004
|
||||
int array list_list_title 0x7f080000
|
||||
int array min_rating 0x7f080001
|
||||
int array page_scaling_entries 0x7f080002
|
||||
int array page_scaling_entry_values 0x7f080003
|
||||
int array preference_screen_ori_entries 0x7f080007
|
||||
int array preference_screen_ori_entry_values 0x7f080008
|
||||
int array pull_next 0x7f08000c
|
||||
int array pull_pre 0x7f08000b
|
||||
int array pull_refresh 0x7f08000a
|
||||
int attr adjustViewBounds 0x7f01000e
|
||||
int attr alignmentMode 0x7f010004
|
||||
int attr baseline 0x7f010014
|
||||
int attr baselineAlignBottom 0x7f010012
|
||||
int attr columnCount 0x7f010002
|
||||
int attr columnOrderPreserved 0x7f010006
|
||||
int attr cropToPadding 0x7f010013
|
||||
int attr drawableAlpha 0x7f010015
|
||||
int attr layout_column 0x7f010009
|
||||
int attr layout_columnSpan 0x7f01000a
|
||||
int attr layout_gravity 0x7f01000b
|
||||
int attr layout_row 0x7f010007
|
||||
int attr layout_rowSpan 0x7f010008
|
||||
int attr mask 0x7f010016
|
||||
int attr maxHeight 0x7f010010
|
||||
int attr maxWidth 0x7f01000f
|
||||
int attr orientation 0x7f010000
|
||||
int attr rowCount 0x7f010001
|
||||
int attr rowOrderPreserved 0x7f010005
|
||||
int attr scaleType 0x7f01000d
|
||||
int attr src 0x7f01000c
|
||||
int attr tint 0x7f010011
|
||||
int attr useDefaultMargins 0x7f010003
|
||||
int color blue_dark 0x7f090001
|
||||
int color blue_light 0x7f090000
|
||||
int dimen activity_horizontal_margin 0x7f070001
|
||||
int dimen activity_vertical_margin 0x7f070002
|
||||
int dimen default_gap 0x7f070000
|
||||
int dimen menu_offset 0x7f070004
|
||||
int dimen shadow_width 0x7f070003
|
||||
int drawable artistcg 0x7f020000
|
||||
int drawable asianporn 0x7f020001
|
||||
int drawable back 0x7f020002
|
||||
int drawable cosplay 0x7f020003
|
||||
int drawable doujinshi 0x7f020004
|
||||
int drawable front 0x7f020005
|
||||
int drawable gamecg 0x7f020006
|
||||
int drawable ic_action_action_search 0x7f020007
|
||||
int drawable ic_action_completed 0x7f020008
|
||||
int drawable ic_action_core_overflow 0x7f020009
|
||||
int drawable ic_action_download 0x7f02000a
|
||||
int drawable ic_action_favourite 0x7f02000b
|
||||
int drawable ic_action_jump 0x7f02000c
|
||||
int drawable ic_action_pause 0x7f02000d
|
||||
int drawable ic_action_refresh 0x7f02000e
|
||||
int drawable ic_action_remove 0x7f02000f
|
||||
int drawable ic_action_search 0x7f020010
|
||||
int drawable ic_action_settings 0x7f020011
|
||||
int drawable ic_action_start 0x7f020012
|
||||
int drawable ic_launcher 0x7f020013
|
||||
int drawable ic_navigation_drawer 0x7f020014
|
||||
int drawable ic_pulltorefresh_arrow 0x7f020015
|
||||
int drawable ic_touch 0x7f020016
|
||||
int drawable imageset 0x7f020017
|
||||
int drawable manga 0x7f020018
|
||||
int drawable mask 0x7f020019
|
||||
int drawable misc 0x7f02001a
|
||||
int drawable non_h 0x7f02001b
|
||||
int drawable progress_large 0x7f02001c
|
||||
int drawable progress_small 0x7f02001d
|
||||
int drawable sadpanda 0x7f02001e
|
||||
int drawable scrollbar_blue 0x7f02001f
|
||||
int drawable scrollbar_white 0x7f020020
|
||||
int drawable spinner_16_inner 0x7f020021
|
||||
int drawable spinner_16_outer 0x7f020022
|
||||
int drawable spinner_76_inner 0x7f020023
|
||||
int drawable spinner_76_outer 0x7f020024
|
||||
int drawable star 0x7f020025
|
||||
int drawable star_empty 0x7f020026
|
||||
int drawable star_half 0x7f020027
|
||||
int drawable textfield 0x7f020028
|
||||
int drawable unknown 0x7f020029
|
||||
int drawable welcome 0x7f02002a
|
||||
int drawable western 0x7f02002b
|
||||
int id action 0x7f06003d
|
||||
int id action_download 0x7f060089
|
||||
int id action_favourite 0x7f060088
|
||||
int id action_jump 0x7f06008c
|
||||
int id action_refresh 0x7f06008b
|
||||
int id action_search 0x7f06008a
|
||||
int id action_settings 0x7f06008d
|
||||
int id alignBounds 0x7f060002
|
||||
int id alignMargins 0x7f060003
|
||||
int id app_start_view 0x7f060086
|
||||
int id autoCompleteTextView1 0x7f060083
|
||||
int id bottom 0x7f060005
|
||||
int id bottom_panel 0x7f060075
|
||||
int id button_artistcg 0x7f060041
|
||||
int id button_asianporn 0x7f060047
|
||||
int id button_check_login 0x7f06006d
|
||||
int id button_cosplay 0x7f060046
|
||||
int id button_doujinshi 0x7f06003f
|
||||
int id button_gamecg 0x7f060042
|
||||
int id button_imageset 0x7f060045
|
||||
int id button_login 0x7f06006c
|
||||
int id button_manga 0x7f060040
|
||||
int id button_misc 0x7f060048
|
||||
int id button_non_h 0x7f060044
|
||||
int id button_read 0x7f06002b
|
||||
int id button_western 0x7f060043
|
||||
int id center 0x7f06000c
|
||||
int id centerCrop 0x7f060017
|
||||
int id centerInside 0x7f060018
|
||||
int id center_horizontal 0x7f06000a
|
||||
int id center_vertical 0x7f060008
|
||||
int id checkbox_advance 0x7f06004a
|
||||
int id checkbox_sdesc 0x7f06004e
|
||||
int id checkbox_sdt1 0x7f060051
|
||||
int id checkbox_sdt2 0x7f060052
|
||||
int id checkbox_sh 0x7f060053
|
||||
int id checkbox_sname 0x7f06004c
|
||||
int id checkbox_sr 0x7f060054
|
||||
int id checkbox_stags 0x7f06004d
|
||||
int id checkbox_sto 0x7f060050
|
||||
int id checkbox_storr 0x7f06004f
|
||||
int id clip_horizontal 0x7f06000f
|
||||
int id clip_vertical 0x7f06000e
|
||||
int id cover 0x7f060060
|
||||
int id custom 0x7f060034
|
||||
int id detail_average 0x7f060029
|
||||
int id detail_button_cancel 0x7f06002d
|
||||
int id detail_button_every 0x7f06002f
|
||||
int id detail_button_known 0x7f060030
|
||||
int id detail_button_once 0x7f06002e
|
||||
int id detail_cover 0x7f06001b
|
||||
int id detail_language 0x7f060027
|
||||
int id detail_pages 0x7f060025
|
||||
int id detail_people 0x7f06002a
|
||||
int id detail_posted 0x7f060024
|
||||
int id detail_rate 0x7f060028
|
||||
int id detail_refresh 0x7f060021
|
||||
int id detail_size 0x7f060026
|
||||
int id detail_title 0x7f06001c
|
||||
int id detail_type 0x7f060022
|
||||
int id detail_uploader 0x7f060023
|
||||
int id detail_wait 0x7f060020
|
||||
int id download 0x7f060039
|
||||
int id drawer_layout 0x7f060059
|
||||
int id drawer_login 0x7f060066
|
||||
int id drawer_login_over 0x7f060067
|
||||
int id end 0x7f060011
|
||||
int id favourite 0x7f06003e
|
||||
int id fill 0x7f06000d
|
||||
int id fill_horizontal 0x7f06000b
|
||||
int id fill_vertical 0x7f060009
|
||||
int id filter_advance 0x7f06004b
|
||||
int id fitCenter 0x7f060015
|
||||
int id fitEnd 0x7f060016
|
||||
int id fitStart 0x7f060014
|
||||
int id fitXY 0x7f060013
|
||||
int id footer_progressBar 0x7f060079
|
||||
int id footer_tip_text 0x7f06007a
|
||||
int id head_arrowImageView 0x7f06007f
|
||||
int id head_contentLayout 0x7f06007e
|
||||
int id head_progressBar 0x7f060080
|
||||
int id head_tipsTextView 0x7f060081
|
||||
int id header 0x7f060077
|
||||
int id header_arrow_image 0x7f06007b
|
||||
int id header_progressBar 0x7f06007c
|
||||
int id header_tip_text 0x7f06007d
|
||||
int id horizontal 0x7f060000
|
||||
int id info 0x7f06003c
|
||||
int id is_exhentai 0x7f060068
|
||||
int id left 0x7f060006
|
||||
int id list 0x7f060035
|
||||
int id list_button_logout 0x7f060070
|
||||
int id list_jump_edit 0x7f060058
|
||||
int id list_jump_sum 0x7f060056
|
||||
int id list_jump_to 0x7f060057
|
||||
int id list_list 0x7f06005b
|
||||
int id list_main 0x7f06005a
|
||||
int id list_menu_list 0x7f060064
|
||||
int id list_menu_login 0x7f060065
|
||||
int id list_no_found 0x7f06005f
|
||||
int id list_refresh 0x7f06005d
|
||||
int id list_view 0x7f060078
|
||||
int id list_wait_first 0x7f06005c
|
||||
int id list_wait_login 0x7f06006e
|
||||
int id list_wait_logout 0x7f060071
|
||||
int id manga_detail 0x7f06001a
|
||||
int id manga_detail_normal 0x7f06001d
|
||||
int id manga_detail_offensive 0x7f06001e
|
||||
int id manga_detail_pining 0x7f06001f
|
||||
int id manga_detail_scrollview 0x7f060019
|
||||
int id matrix 0x7f060012
|
||||
int id message 0x7f060033
|
||||
int id name 0x7f060061
|
||||
int id negative_button 0x7f060036
|
||||
int id neutral_button 0x7f060037
|
||||
int id page_list 0x7f06002c
|
||||
int id pager 0x7f06006b
|
||||
int id paper_list_layout 0x7f060072
|
||||
int id paper_list_wait 0x7f060073
|
||||
int id password 0x7f06006a
|
||||
int id positive_button 0x7f060038
|
||||
int id preview_button_refresh 0x7f060074
|
||||
int id preview_num 0x7f060076
|
||||
int id progressBar 0x7f06003b
|
||||
int id rate 0x7f060063
|
||||
int id remove 0x7f060084
|
||||
int id right 0x7f060007
|
||||
int id sadpanda 0x7f06005e
|
||||
int id scroll_view 0x7f060032
|
||||
int id search_bar 0x7f060082
|
||||
int id search_text 0x7f060049
|
||||
int id set_name_edit 0x7f060085
|
||||
int id spinner_min_rating 0x7f060055
|
||||
int id start 0x7f060010
|
||||
int id text_username 0x7f06006f
|
||||
int id thumb 0x7f06003a
|
||||
int id title 0x7f060031
|
||||
int id top 0x7f060004
|
||||
int id type 0x7f060062
|
||||
int id username 0x7f060069
|
||||
int id vertical 0x7f060001
|
||||
int id wait_message 0x7f060087
|
||||
int layout detail 0x7f030000
|
||||
int layout detail_normal 0x7f030001
|
||||
int layout detail_offensive 0x7f030002
|
||||
int layout detail_pining 0x7f030003
|
||||
int layout dialog 0x7f030004
|
||||
int layout download 0x7f030005
|
||||
int layout download_item 0x7f030006
|
||||
int layout favourite 0x7f030007
|
||||
int layout filter 0x7f030008
|
||||
int layout jump 0x7f030009
|
||||
int layout list 0x7f03000a
|
||||
int layout list_item 0x7f03000b
|
||||
int layout list_item_text 0x7f03000c
|
||||
int layout list_menu_list 0x7f03000d
|
||||
int layout list_menu_login 0x7f03000e
|
||||
int layout login 0x7f03000f
|
||||
int layout manga 0x7f030010
|
||||
int layout menu_item 0x7f030011
|
||||
int layout menu_login 0x7f030012
|
||||
int layout menu_login_over 0x7f030013
|
||||
int layout page_list 0x7f030014
|
||||
int layout page_list_panel 0x7f030015
|
||||
int layout pull_list_view 0x7f030016
|
||||
int layout pull_list_view_footer 0x7f030017
|
||||
int layout pull_list_view_header 0x7f030018
|
||||
int layout pull_to_refresh_head 0x7f030019
|
||||
int layout search_view 0x7f03001a
|
||||
int layout set_name 0x7f03001b
|
||||
int layout start 0x7f03001c
|
||||
int layout wait 0x7f03001d
|
||||
int menu detail 0x7f0c0000
|
||||
int menu main 0x7f0c0001
|
||||
int raw change_log 0x7f050000
|
||||
int raw thanks 0x7f050001
|
||||
int string _default 0x7f0a0094
|
||||
int string action_refresh 0x7f0a0058
|
||||
int string action_settings 0x7f0a0059
|
||||
int string actual_size 0x7f0a009c
|
||||
int string add 0x7f0a0090
|
||||
int string add_tag 0x7f0a0071
|
||||
int string add_to_favourite 0x7f0a00a0
|
||||
int string advance_search_left 0x7f0a00a6
|
||||
int string app_name 0x7f0a0000
|
||||
int string cache_large 0x7f0a006e
|
||||
int string changelog 0x7f0a008a
|
||||
int string check_login 0x7f0a000a
|
||||
int string checkbox_advance 0x7f0a0013
|
||||
int string checkbox_sdesc 0x7f0a0016
|
||||
int string checkbox_sdt1 0x7f0a0019
|
||||
int string checkbox_sdt2 0x7f0a001a
|
||||
int string checkbox_sh 0x7f0a001b
|
||||
int string checkbox_sname 0x7f0a0014
|
||||
int string checkbox_sr 0x7f0a001c
|
||||
int string checkbox_stags 0x7f0a0015
|
||||
int string checkbox_sto 0x7f0a0018
|
||||
int string checkbox_storr 0x7f0a0017
|
||||
int string checking_update 0x7f0a002a
|
||||
int string create_cache_error 0x7f0a0070
|
||||
int string dailog_check_network 0x7f0a0005
|
||||
int string dailog_network_error_no 0x7f0a0007
|
||||
int string dailog_network_error_yes 0x7f0a0006
|
||||
int string dailog_waring_no 0x7f0a0004
|
||||
int string dailog_waring_plain 0x7f0a0002
|
||||
int string dailog_waring_title 0x7f0a0001
|
||||
int string dailog_waring_yes 0x7f0a0003
|
||||
int string detail_average 0x7f0a0032
|
||||
int string detail_button_cancel 0x7f0a0037
|
||||
int string detail_button_every 0x7f0a0039
|
||||
int string detail_button_known 0x7f0a003b
|
||||
int string detail_button_once 0x7f0a0038
|
||||
int string detail_button_read 0x7f0a0036
|
||||
int string detail_language 0x7f0a0031
|
||||
int string detail_not_rated 0x7f0a003d
|
||||
int string detail_offensive 0x7f0a0035
|
||||
int string detail_offensive_title 0x7f0a0034
|
||||
int string detail_pages 0x7f0a002f
|
||||
int string detail_people 0x7f0a0033
|
||||
int string detail_pining 0x7f0a003a
|
||||
int string detail_posted 0x7f0a002e
|
||||
int string detail_preview_error 0x7f0a003c
|
||||
int string detail_size 0x7f0a0030
|
||||
int string detail_uploader 0x7f0a002d
|
||||
int string develop 0x7f0a00a5
|
||||
int string dialog_messgae_login_or_not 0x7f0a000e
|
||||
int string dialog_send_crash_no 0x7f0a0023
|
||||
int string dialog_send_crash_plain 0x7f0a0021
|
||||
int string dialog_send_crash_title 0x7f0a0020
|
||||
int string dialog_send_crash_yes 0x7f0a0022
|
||||
int string dialog_title_login_or_not 0x7f0a000d
|
||||
int string dialog_wait_send_crash_msg 0x7f0a0008
|
||||
int string download 0x7f0a0097
|
||||
int string download_successfully 0x7f0a0080
|
||||
int string download_task_finished 0x7f0a007e
|
||||
int string download_unsuccessfully 0x7f0a0081
|
||||
int string downloading 0x7f0a007f
|
||||
int string em_can_not_reach 0x7f0a0054
|
||||
int string em_check_login_error 0x7f0a004d
|
||||
int string em_client_protocol 0x7f0a0049
|
||||
int string em_host_error 0x7f0a0057
|
||||
int string em_login_error 0x7f0a004c
|
||||
int string em_logout_error 0x7f0a004e
|
||||
int string em_network_error 0x7f0a0043
|
||||
int string em_no_network 0x7f0a0053
|
||||
int string em_no_network_2 0x7f0a0055
|
||||
int string em_open_input_stream_error 0x7f0a0047
|
||||
int string em_parser_error 0x7f0a0046
|
||||
int string em_put_cache_error 0x7f0a004a
|
||||
int string em_read_input_stream_error 0x7f0a0048
|
||||
int string em_request_error 0x7f0a0056
|
||||
int string em_response_code_error 0x7f0a0045
|
||||
int string em_retry 0x7f0a0050
|
||||
int string em_retry_times 0x7f0a0051
|
||||
int string em_timeout 0x7f0a0044
|
||||
int string em_unknown_error 0x7f0a0052
|
||||
int string em_url_error 0x7f0a004f
|
||||
int string em_url_format_error 0x7f0a004b
|
||||
int string error 0x7f0a0089
|
||||
int string exit_tip 0x7f0a0009
|
||||
int string favourite 0x7f0a0096
|
||||
int string first_page 0x7f0a003f
|
||||
int string fit_to_height 0x7f0a009e
|
||||
int string fit_to_screen 0x7f0a009f
|
||||
int string fit_to_width 0x7f0a009d
|
||||
int string found_update 0x7f0a002c
|
||||
int string hint_no_keyword 0x7f0a0012
|
||||
int string homepage 0x7f0a0095
|
||||
int string input_error 0x7f0a006f
|
||||
int string jump 0x7f0a0092
|
||||
int string jump_sum 0x7f0a001d
|
||||
int string jump_to 0x7f0a001e
|
||||
int string landscape 0x7f0a005d
|
||||
int string last_page 0x7f0a0084
|
||||
int string list_title 0x7f0a0027
|
||||
int string load_pre 0x7f0a003e
|
||||
int string login 0x7f0a008b
|
||||
int string logout 0x7f0a008c
|
||||
int string new_tag_name 0x7f0a0076
|
||||
int string no_found 0x7f0a0026
|
||||
int string not_login 0x7f0a000f
|
||||
int string not_started 0x7f0a0082
|
||||
int string password 0x7f0a008f
|
||||
int string period 0x7f0a0087
|
||||
int string portrait 0x7f0a005c
|
||||
int string preference_author 0x7f0a006c
|
||||
int string preference_author_summary 0x7f0a006d
|
||||
int string preference_auto_page_cache 0x7f0a0067
|
||||
int string preference_auto_page_cache_summary_off 0x7f0a0069
|
||||
int string preference_auto_page_cache_summary_on 0x7f0a0068
|
||||
int string preference_cache_summary 0x7f0a0065
|
||||
int string preference_cache_summary_no 0x7f0a0066
|
||||
int string preference_category_about 0x7f0a006b
|
||||
int string preference_category_cache 0x7f0a0060
|
||||
int string preference_category_display 0x7f0a005a
|
||||
int string preference_clear_cp_cache 0x7f0a0062
|
||||
int string preference_clear_page_cache 0x7f0a0064
|
||||
int string preference_cp_cache 0x7f0a0061
|
||||
int string preference_download_path 0x7f0a006a
|
||||
int string preference_page_cache 0x7f0a0063
|
||||
int string preference_page_scaling 0x7f0a005e
|
||||
int string preference_screen_ori 0x7f0a005b
|
||||
int string preference_settings_title 0x7f0a005f
|
||||
int string pull_next_pull 0x7f0a007b
|
||||
int string pull_next_release 0x7f0a007c
|
||||
int string pull_pre_pull 0x7f0a0079
|
||||
int string pull_pre_release 0x7f0a007a
|
||||
int string pull_refresh_pull 0x7f0a0077
|
||||
int string pull_refresh_release 0x7f0a0078
|
||||
int string refresh 0x7f0a0088
|
||||
int string remove 0x7f0a00a1
|
||||
int string remove_info_data 0x7f0a00a2
|
||||
int string retry_max_next 0x7f0a0042
|
||||
int string retry_max_pre 0x7f0a0041
|
||||
int string sadpanda 0x7f0a0085
|
||||
int string some_page 0x7f0a0093
|
||||
int string star_2 0x7f0a0098
|
||||
int string star_3 0x7f0a0099
|
||||
int string star_4 0x7f0a009a
|
||||
int string star_5 0x7f0a009b
|
||||
int string start_download_task 0x7f0a007d
|
||||
int string start_reloading 0x7f0a0040
|
||||
int string tag_change_name 0x7f0a0075
|
||||
int string tag_name 0x7f0a0072
|
||||
int string tag_name_empty 0x7f0a0073
|
||||
int string tag_name_exist 0x7f0a0074
|
||||
int string tap_update 0x7f0a0029
|
||||
int string thanks 0x7f0a00a4
|
||||
int string toast_add_download 0x7f0a0025
|
||||
int string toast_add_favourite 0x7f0a0024
|
||||
int string toast_invalid_page 0x7f0a001f
|
||||
int string toast_login_failed 0x7f0a000c
|
||||
int string toast_login_succeeded 0x7f0a000b
|
||||
int string toast_logout_failed 0x7f0a0011
|
||||
int string toast_logout_succeeded 0x7f0a0010
|
||||
int string unfinished 0x7f0a0086
|
||||
int string up_to_date 0x7f0a002b
|
||||
int string update 0x7f0a00a3
|
||||
int string update_message 0x7f0a0028
|
||||
int string username 0x7f0a008e
|
||||
int string wait 0x7f0a008d
|
||||
int string waiting 0x7f0a0083
|
||||
int string what_to_do 0x7f0a0091
|
||||
int style ActionBar 0x7f0b0000
|
||||
int style AppTheme 0x7f0b0009
|
||||
int style AppTheme_NoActionBar 0x7f0b000a
|
||||
int style AppTheme_NoActionBar_Transparent 0x7f0b000b
|
||||
int style Button 0x7f0b0003
|
||||
int style Button_Blue 0x7f0b0004
|
||||
int style Button_White 0x7f0b0005
|
||||
int style OverFlow 0x7f0b0001
|
||||
int style PopupMenu 0x7f0b0002
|
||||
int style ProgressBar 0x7f0b0006
|
||||
int style ProgressBar_Large 0x7f0b0008
|
||||
int style ProgressBar_Small 0x7f0b0007
|
||||
int[] styleable CheckImage { 0x7f010016 }
|
||||
int styleable CheckImage_mask 0
|
||||
int[] styleable GridLayout { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006 }
|
||||
int styleable GridLayout_alignmentMode 4
|
||||
int styleable GridLayout_columnCount 2
|
||||
int styleable GridLayout_columnOrderPreserved 6
|
||||
int styleable GridLayout_orientation 0
|
||||
int styleable GridLayout_rowCount 1
|
||||
int styleable GridLayout_rowOrderPreserved 5
|
||||
int styleable GridLayout_useDefaultMargins 3
|
||||
int[] styleable GridLayout_Layout { 0x010100f4, 0x010100f5, 0x010100f6, 0x010100f7, 0x010100f8, 0x010100f9, 0x010100fa, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b }
|
||||
int styleable GridLayout_Layout_android_layout_height 1
|
||||
int styleable GridLayout_Layout_android_layout_margin 2
|
||||
int styleable GridLayout_Layout_android_layout_marginBottom 6
|
||||
int styleable GridLayout_Layout_android_layout_marginLeft 3
|
||||
int styleable GridLayout_Layout_android_layout_marginRight 5
|
||||
int styleable GridLayout_Layout_android_layout_marginTop 4
|
||||
int styleable GridLayout_Layout_android_layout_width 0
|
||||
int styleable GridLayout_Layout_layout_column 9
|
||||
int styleable GridLayout_Layout_layout_columnSpan 10
|
||||
int styleable GridLayout_Layout_layout_gravity 11
|
||||
int styleable GridLayout_Layout_layout_row 7
|
||||
int styleable GridLayout_Layout_layout_rowSpan 8
|
||||
int[] styleable SuperImageView { 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015 }
|
||||
int styleable SuperImageView_adjustViewBounds 2
|
||||
int styleable SuperImageView_baseline 8
|
||||
int styleable SuperImageView_baselineAlignBottom 6
|
||||
int styleable SuperImageView_cropToPadding 7
|
||||
int styleable SuperImageView_drawableAlpha 9
|
||||
int styleable SuperImageView_maxHeight 4
|
||||
int styleable SuperImageView_maxWidth 3
|
||||
int styleable SuperImageView_scaleType 1
|
||||
int styleable SuperImageView_src 0
|
||||
int styleable SuperImageView_tint 5
|
||||
int xml searchable 0x7f040000
|
||||
int xml settings 0x7f040001
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 304 B |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
+24
-25
@@ -1,26 +1,25 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/textfield" >
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/autoCompleteTextView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:singleLine="true"
|
||||
android:background="@android:color/transparent" >
|
||||
</AutoCompleteTextView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/ic_action_remove" />
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/autoCompleteTextView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ems="10"
|
||||
android:singleLine="true"
|
||||
android:background="@android:color/transparent" >
|
||||
</AutoCompleteTextView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/ic_action_remove" />
|
||||
|
||||
</LinearLayout>
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
Version 0.4.2 (2014-??-??)
|
||||
Version 0.4.2 (2014-04-04)
|
||||
* 添加内置存储空间或 Sd Card 检测
|
||||
* 修正由于 gif 格式图片导致的崩溃
|
||||
* 优化网络连接
|
||||
|
||||
Version 0.4.1 (2014-04-02)
|
||||
* 修正单点触控缩放错误
|
||||
|
||||
@@ -13,12 +13,11 @@ import com.hippo.ehviewer.util.ThreadPool;
|
||||
import com.hippo.ehviewer.util.Ui;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class AppContext extends Application implements UncaughtExceptionHandler {
|
||||
|
||||
private static final String TAG = "CrashApplication";
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "AppContext";
|
||||
|
||||
private Thread.UncaughtExceptionHandler mDefaultHandler;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.hippo.ehviewer;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.NotificationManager;
|
||||
@@ -12,10 +12,10 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.hippo.ehviewer.network.Downloader;
|
||||
import com.hippo.ehviewer.network.HttpHelper;
|
||||
import com.hippo.ehviewer.util.Config;
|
||||
@@ -30,6 +30,7 @@ import com.hippo.ehviewer.view.AlertButton;
|
||||
import com.hippo.ehviewer.widget.DialogBuilder;
|
||||
|
||||
public class UpdateHelper {
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "UpdateHelper";
|
||||
private static final int NOTIFICATION_ID = -1;
|
||||
|
||||
@@ -41,7 +42,7 @@ public class UpdateHelper {
|
||||
|
||||
private Activity mActivity;
|
||||
private String updateFileName;
|
||||
private OnCheckUpdateListener listener;
|
||||
private OnCheckUpdateListener mListener;
|
||||
|
||||
|
||||
private int downloadHost = QINIU;
|
||||
@@ -51,7 +52,7 @@ public class UpdateHelper {
|
||||
}
|
||||
|
||||
public UpdateHelper SetOnCheckUpdateListener(OnCheckUpdateListener listener) {
|
||||
this.listener = listener;
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -60,6 +61,14 @@ public class UpdateHelper {
|
||||
checkUpdate();
|
||||
}
|
||||
|
||||
|
||||
class CheckUpdatePackage {
|
||||
public OnCheckUpdateListener listener;
|
||||
public Activity activity;
|
||||
public String pageContext;
|
||||
public HttpHelper hp;
|
||||
}
|
||||
|
||||
public void checkUpdate() {
|
||||
final AppContext appContext = (AppContext)(mActivity.getApplicationContext());
|
||||
final HttpHelper hp = new HttpHelper(mActivity.getApplicationContext());
|
||||
@@ -81,77 +90,97 @@ public class UpdateHelper {
|
||||
@Override
|
||||
public void onFutureDone(Future<String> future) {
|
||||
String pageContext = future.get();
|
||||
if (pageContext != null) {
|
||||
Config.setUpdateDate();
|
||||
String[] items = pageContext.split("\n");
|
||||
if (items.length > 3) {
|
||||
|
||||
if (listener != null)
|
||||
listener.onSuccess(pageContext);
|
||||
|
||||
String newVer = items[0];
|
||||
|
||||
String tempUrl = "";
|
||||
switch (downloadHost) {
|
||||
case GOOGLE:
|
||||
tempUrl = EhClient.UPDATE_URL + items[1];
|
||||
break;
|
||||
case QINIU:
|
||||
tempUrl = EhClient.UPDATE_URI_QINIU + Util.getFileForUrl(items[1]);
|
||||
break;
|
||||
}
|
||||
final String url = tempUrl;
|
||||
final String name = url.substring(url.lastIndexOf('/')+1);
|
||||
updateFileName = name;
|
||||
String size = items[2];
|
||||
String info = items[3];
|
||||
|
||||
AlertDialog dialog = new DialogBuilder(mActivity).setTitle(R.string.update)
|
||||
.setMessage(String.format(mActivity.getString(R.string.update_message), newVer, size, info))
|
||||
.setNegativeButton(android.R.string.cancel, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((AlertButton)v).dialog.dismiss();
|
||||
}
|
||||
}).setPositiveButton(android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((AlertButton)v).dialog.dismiss();
|
||||
Downloader d = new Downloader();
|
||||
try {
|
||||
d.resetData(Config.getDownloadPath(), name, url);
|
||||
d.setOnDownloadListener(new UpdateListener());
|
||||
new Thread(d).start();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).create();
|
||||
if (!mActivity.isFinishing())
|
||||
dialog.show();
|
||||
} else {
|
||||
if(pageContext.equals("none")) {
|
||||
if (listener != null)
|
||||
listener.onNoUpdate();
|
||||
} else if(pageContext.equals("error")){
|
||||
if (listener != null)
|
||||
listener.onFailure(appContext.getString(R.string.em_request_error));
|
||||
} else if (pageContext.equals("NameNotFound")){
|
||||
if (listener != null)
|
||||
listener.onFailure("NameNotFound");
|
||||
}else {
|
||||
if (listener != null)
|
||||
listener.onFailure(appContext.getString(R.string.em_host_error));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(hp.getEMsg());
|
||||
}
|
||||
CheckUpdatePackage checkUpdatePackage = new CheckUpdatePackage();
|
||||
checkUpdatePackage.listener = mListener;
|
||||
checkUpdatePackage.activity = mActivity;
|
||||
checkUpdatePackage.pageContext = pageContext;
|
||||
checkUpdatePackage.hp = hp;
|
||||
Message msg = new Message();
|
||||
msg.obj = checkUpdatePackage;
|
||||
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO
|
||||
@SuppressLint("HandlerLeak")
|
||||
private Handler mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
CheckUpdatePackage checkUpdatePackage = (CheckUpdatePackage)msg.obj;
|
||||
OnCheckUpdateListener listener = checkUpdatePackage.listener;
|
||||
Activity activity = checkUpdatePackage.activity;
|
||||
String pageContext = checkUpdatePackage.pageContext;
|
||||
|
||||
if (pageContext != null) {
|
||||
Config.setUpdateDate();
|
||||
String[] items = pageContext.split("\n");
|
||||
if (items.length > 3) {
|
||||
|
||||
String newVer = items[0];
|
||||
String tempUrl = "";
|
||||
switch (downloadHost) {
|
||||
case GOOGLE:
|
||||
tempUrl = EhClient.UPDATE_URL + items[1];
|
||||
break;
|
||||
case QINIU:
|
||||
tempUrl = EhClient.UPDATE_URI_QINIU + Util.getFileForUrl(items[1]);
|
||||
break;
|
||||
}
|
||||
final String url = tempUrl;
|
||||
final String name = url.substring(url.lastIndexOf('/')+1);
|
||||
updateFileName = name;
|
||||
String size = items[2];
|
||||
String info = items[3];
|
||||
|
||||
AlertDialog dialog = new DialogBuilder(activity).setTitle(R.string.update)
|
||||
.setMessage(String.format(activity.getString(R.string.update_message), newVer, size, info))
|
||||
.setNegativeButton(android.R.string.cancel, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((AlertButton)v).dialog.dismiss();
|
||||
}
|
||||
}).setPositiveButton(android.R.string.ok, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((AlertButton)v).dialog.dismiss();
|
||||
Downloader d = new Downloader();
|
||||
try {
|
||||
d.resetData(Config.getDownloadPath(), name, url);
|
||||
d.setOnDownloadListener(new UpdateListener());
|
||||
new Thread(d).start();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).create();
|
||||
dialog.show();
|
||||
|
||||
if (listener != null)
|
||||
listener.onSuccess(pageContext);
|
||||
} else {
|
||||
if(pageContext.equals("none")) {
|
||||
if (listener != null)
|
||||
listener.onNoUpdate();
|
||||
} else if(pageContext.equals("error")){
|
||||
if (listener != null)
|
||||
listener.onFailure(activity.getString(R.string.em_request_error));
|
||||
} else if (pageContext.equals("NameNotFound")){
|
||||
if (listener != null)
|
||||
listener.onFailure("NameNotFound"); // TODO
|
||||
}else {
|
||||
if (listener != null)
|
||||
listener.onFailure(activity.getString(R.string.em_host_error));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(checkUpdatePackage.hp.getEMsg());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public interface OnCheckUpdateListener {
|
||||
public void onSuccess(String pageContext);
|
||||
public void onNoUpdate();
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import com.hippo.ehviewer.AppContext;
|
||||
import com.hippo.ehviewer.BeautifyScreen;
|
||||
import com.hippo.ehviewer.R;
|
||||
@@ -82,7 +84,7 @@ public class MangaActivity extends Activity {
|
||||
|
||||
// TODO use downloader to download image
|
||||
// TODO combine it with MangaDownloadActivity
|
||||
private class MangaUrlGetListener implements EhClient.OnGetManagaUrlListener {
|
||||
private class MangaUrlGetListener implements EhClient.OnGetMangaUrlListener {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Object checkFlag, String[] arg) {
|
||||
@@ -178,7 +180,7 @@ public class MangaActivity extends Activity {
|
||||
getPrePage = false;
|
||||
} else if (index == lastPage && nextPageUrl != "last") { // If get nextPage
|
||||
lastPage++;
|
||||
mEhClient.getManagaUrl(nextPageUrl, lastPage, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(nextPageUrl, lastPage, new MangaUrlGetListener());
|
||||
mImageSet.changeState(lastPage, ImageSet.STATE_LOADING);
|
||||
}
|
||||
}
|
||||
@@ -197,10 +199,10 @@ public class MangaActivity extends Activity {
|
||||
Toast.LENGTH_SHORT).show();
|
||||
if (targetPage == firstPage - 1 &&
|
||||
getPrePage == true) {
|
||||
mEhClient.getManagaUrl(allPrePageUrl, targetPage, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(allPrePageUrl, targetPage, new MangaUrlGetListener());
|
||||
}
|
||||
else {
|
||||
mEhClient.getManagaUrl(allNextPageUrl, targetPage, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(allNextPageUrl, targetPage, new MangaUrlGetListener());
|
||||
}
|
||||
mImageSet.changeState(targetPage, ImageSet.STATE_LOADING);
|
||||
} else {
|
||||
@@ -287,7 +289,7 @@ public class MangaActivity extends Activity {
|
||||
lastPage = firstPage;
|
||||
gid = intent.getStringExtra("gid");
|
||||
title = intent.getStringExtra("title");
|
||||
mFolder = new File(Config.getDownloadPath(), title);
|
||||
mFolder = new File(Config.getDownloadPath(), StringEscapeUtils.escapeHtml4(title));
|
||||
if (mFolder.isFile())
|
||||
mFolder.delete();
|
||||
mFolder.mkdirs();
|
||||
@@ -312,17 +314,23 @@ public class MangaActivity extends Activity {
|
||||
if (mStop && index == lastPage) {
|
||||
mStop = false;
|
||||
MangaUrlGetListener listener = new MangaUrlGetListener();
|
||||
mEhClient.getManagaUrl(allNextPageUrl, lastPage, listener);
|
||||
mEhClient.getMangaUrl(allNextPageUrl, lastPage, listener);
|
||||
mImageSet.changeState(lastPage, ImageSet.STATE_LOADING);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTapDoubleText(int index) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
isv.setOnScrollPageListener(new GalleryView.OnScrollPageListener() {
|
||||
@Override
|
||||
public void onScrollPage(int index) {
|
||||
if (mStop && index == lastPage) {
|
||||
mStop = false;
|
||||
mEhClient.getManagaUrl(allNextPageUrl, lastPage, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(allNextPageUrl, lastPage, new MangaUrlGetListener());
|
||||
mImageSet.changeState(lastPage, ImageSet.STATE_LOADING);
|
||||
}
|
||||
|
||||
@@ -330,7 +338,7 @@ public class MangaActivity extends Activity {
|
||||
&& !allPrePageUrl.equals("first")
|
||||
&& index == firstPage - 1) {
|
||||
getPrePage = true;
|
||||
mEhClient.getManagaUrl(allPrePageUrl, firstPage - 1, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(allPrePageUrl, firstPage - 1, new MangaUrlGetListener());
|
||||
mImageSet.changeState(firstPage - 1, ImageSet.STATE_LOADING);
|
||||
}
|
||||
}
|
||||
@@ -351,7 +359,7 @@ public class MangaActivity extends Activity {
|
||||
imagesUrl.set(lastPage, new String[]{url, null});
|
||||
|
||||
// Get image and next page
|
||||
mEhClient.getManagaUrl(url, lastPage, new MangaUrlGetListener());
|
||||
mEhClient.getMangaUrl(url, lastPage, new MangaUrlGetListener());
|
||||
mImageSet.changeState(lastPage, ImageSet.STATE_LOADING);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ public class MangaDetailActivity extends Activity {
|
||||
}
|
||||
|
||||
private class MangaDetailGetListener implements
|
||||
EhClient.OnGetManagaDetailListener {
|
||||
EhClient.OnGetMangaDetailListener {
|
||||
@Override
|
||||
public void onSuccess(MangaDetail md) {
|
||||
Cache.mdCache.put(mangaDetail.gid, md);
|
||||
@@ -239,7 +239,7 @@ public class MangaDetailActivity extends Activity {
|
||||
// Refresh
|
||||
public void buttonRefresh(View v) {
|
||||
MangaDetailGetListener listener = new MangaDetailGetListener();
|
||||
mEhClient.getManagaDetail(url, mangaDetail, listener);
|
||||
mEhClient.getMangaDetail(url, mangaDetail, listener);
|
||||
// Delete refresh button
|
||||
refeshButton.setVisibility(View.GONE);
|
||||
// Add progressBar
|
||||
@@ -265,7 +265,7 @@ public class MangaDetailActivity extends Activity {
|
||||
}
|
||||
|
||||
MangaDetailGetListener listener = new MangaDetailGetListener();
|
||||
mEhClient.getManagaDetail(url, mangaDetail, listener);
|
||||
mEhClient.getMangaDetail(url, mangaDetail, listener);
|
||||
// Delete offensiveView
|
||||
mangaDetailOffensive.setVisibility(View.GONE);
|
||||
// Add progressBar
|
||||
@@ -286,7 +286,7 @@ public class MangaDetailActivity extends Activity {
|
||||
}
|
||||
|
||||
MangaDetailGetListener listener = new MangaDetailGetListener();
|
||||
mEhClient.getManagaDetail(url, mangaDetail, listener);
|
||||
mEhClient.getMangaDetail(url, mangaDetail, listener);
|
||||
// Delete offensiveView
|
||||
mangaDetailOffensive.setVisibility(View.GONE);
|
||||
// Add progressBar
|
||||
@@ -519,7 +519,7 @@ public class MangaDetailActivity extends Activity {
|
||||
if (getFromCache)
|
||||
layout(mangaDetail);
|
||||
else
|
||||
mEhClient.getManagaDetail(url, mangaDetail, new MangaDetailGetListener());
|
||||
mEhClient.getMangaDetail(url, mangaDetail, new MangaDetailGetListener());
|
||||
}
|
||||
|
||||
private void layout(MangaDetail md) {
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import com.hippo.ehviewer.AppContext;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.gallery.GalleryView;
|
||||
@@ -81,7 +83,9 @@ public class MangaDownloadActivity extends Activity {
|
||||
int endIndex = intent.getIntExtra(KEY_END_INDEX, 0);
|
||||
GLRootView glrv= (GLRootView)findViewById(R.id.gl_root_view);
|
||||
|
||||
mDownloadImageSet = new DownloadImageSet(this, gid, new File(Config.getDownloadPath(), title), size, 0, endIndex, null);
|
||||
File folder = new File(Config.getDownloadPath(), StringEscapeUtils.escapeHtml4(title));
|
||||
folder.mkdirs();
|
||||
mDownloadImageSet = new DownloadImageSet(this, gid, folder, size, 0, endIndex, null);
|
||||
GalleryView isv = new GalleryView(getApplicationContext(), mDownloadImageSet, 0);
|
||||
isv.setOnEdgeListener(new GalleryView.OnEdgeListener() {
|
||||
@Override
|
||||
@@ -94,6 +98,9 @@ public class MangaDownloadActivity extends Activity {
|
||||
}
|
||||
});
|
||||
glrv.setContentPane(isv);
|
||||
|
||||
// Avoid error when use Movie
|
||||
//glrv.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -713,7 +713,7 @@ public class MangaListActivity extends Activity {
|
||||
}
|
||||
|
||||
private class MangaListGetListener implements
|
||||
EhClient.OnGetManagaListListener {
|
||||
EhClient.OnGetMangaListListener {
|
||||
@Override
|
||||
public void onSuccess(Object checkFlag, ArrayList<ListMangaDetail> newLmdArray,
|
||||
int indexPerPage, int maxPage) {
|
||||
@@ -1217,7 +1217,7 @@ public class MangaListActivity extends Activity {
|
||||
listUrls.setPage(0);
|
||||
else
|
||||
listUrls.setPage(firstPage - 1);
|
||||
mEhClient.getManagaList(listUrls.getUrl(),
|
||||
mEhClient.getMangaList(listUrls.getUrl(),
|
||||
new MangaListGetPackage((lastGetStamp = System.currentTimeMillis()), listUrls, false, title),
|
||||
new MangaListGetListener());
|
||||
}
|
||||
@@ -1227,7 +1227,7 @@ public class MangaListActivity extends Activity {
|
||||
mListFirst = true;
|
||||
mLoadListOver = false;
|
||||
RefreshPackage rp = (RefreshPackage)obj;
|
||||
mEhClient.getManagaList(rp.listUrls.getUrl(),
|
||||
mEhClient.getMangaList(rp.listUrls.getUrl(),
|
||||
new MangaListGetPackage((lastGetStamp = System.currentTimeMillis()),
|
||||
rp.listUrls, true, rp.title),
|
||||
new MangaListGetListener());
|
||||
@@ -1241,7 +1241,7 @@ public class MangaListActivity extends Activity {
|
||||
if (listUrls.setPage(lastPage + 1)) {
|
||||
mListFirst = true;
|
||||
mLoadListOver = false;
|
||||
mEhClient.getManagaList(listUrls.getUrl(),
|
||||
mEhClient.getMangaList(listUrls.getUrl(),
|
||||
new MangaListGetPackage((lastGetStamp = System.currentTimeMillis()), listUrls, false, title),
|
||||
new MangaListGetListener());
|
||||
}
|
||||
@@ -1306,6 +1306,7 @@ public class MangaListActivity extends Activity {
|
||||
checkUpdate();
|
||||
|
||||
// Check login
|
||||
layoutDrawRight();
|
||||
checkLogin(false);
|
||||
|
||||
// get MangeList
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.hippo.ehviewer.gallery;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Movie;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.util.Log;
|
||||
@@ -11,9 +12,12 @@ import android.view.MotionEvent;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.gallery.data.ImageSet;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.BitmapTexture;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.ColorTexture;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.GLCanvas;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.GLPaint;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.MovieTexture;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.StringTexture;
|
||||
import com.hippo.ehviewer.gallery.glrenderer.UploadedTexture;
|
||||
import com.hippo.ehviewer.gallery.ui.GLView;
|
||||
import com.hippo.ehviewer.gallery.ui.GestureRecognizer;
|
||||
import com.hippo.ehviewer.gallery.util.GalleryUtils;
|
||||
@@ -21,6 +25,9 @@ import com.hippo.ehviewer.util.Config;
|
||||
import com.hippo.ehviewer.util.TimeRunner;
|
||||
import com.hippo.ehviewer.util.Ui;
|
||||
|
||||
// TODO 双击加载该页
|
||||
// TODO 长按从该页开始加载
|
||||
|
||||
|
||||
// TODO 手动触屏滑动可能闪烁
|
||||
public class GalleryView extends GLView {
|
||||
@@ -83,8 +90,11 @@ public class GalleryView extends GLView {
|
||||
private static final int TAP_AREA_MASK_COLOR = 0x88000000;
|
||||
|
||||
// TODO
|
||||
private static final int BACKGROUND_COLOR = Color.BLACK;
|
||||
private static final int MASK_COLOR = 0x88000000;
|
||||
|
||||
|
||||
|
||||
private final GestureRecognizer mGestureRecognizer;
|
||||
private Context mContext;
|
||||
|
||||
@@ -139,6 +149,7 @@ public class GalleryView extends GLView {
|
||||
|
||||
public interface OnTapTextListener {
|
||||
public void onTapText(int index);
|
||||
public void onTapDoubleText(int index);
|
||||
}
|
||||
|
||||
public interface OnScrollPageListener {
|
||||
@@ -170,7 +181,7 @@ public class GalleryView extends GLView {
|
||||
setState();
|
||||
|
||||
mGestureRecognizer = new GestureRecognizer(mContext, new MyGestureListener());
|
||||
setBackgroundColor(GalleryUtils.intColorToFloatARGBArray(Color.BLACK));
|
||||
setBackgroundColor(GalleryUtils.intColorToFloatARGBArray(BACKGROUND_COLOR));
|
||||
|
||||
showItems = new ShowItem[TARGET_INDEX_SIZE];
|
||||
|
||||
@@ -233,13 +244,15 @@ public class GalleryView extends GLView {
|
||||
protected void render(GLCanvas canvas) {
|
||||
super.render(canvas);
|
||||
|
||||
boolean hasMovie = false;
|
||||
ShowItem item;
|
||||
switch (mScrollState) {
|
||||
case SCROLL_NONE:
|
||||
item = showItems[CUR_TARGET_INDEX];
|
||||
if (item != null) {
|
||||
if (item != null)
|
||||
item.draw(canvas);
|
||||
}
|
||||
if (item instanceof MovieImage)
|
||||
hasMovie |= true;
|
||||
break;
|
||||
|
||||
case SCROLL_LEFT:
|
||||
@@ -247,9 +260,14 @@ public class GalleryView extends GLView {
|
||||
item = showItems[PRE_TARGET_INDEX];
|
||||
if (item != null)
|
||||
item.draw(canvas, scrollXOffset, scrollYOffset);
|
||||
if (item instanceof MovieImage)
|
||||
hasMovie |= true;
|
||||
|
||||
item = showItems[CUR_TARGET_INDEX];
|
||||
if (item != null)
|
||||
item.draw(canvas, scrollXOffset, scrollYOffset);
|
||||
if (item instanceof MovieImage)
|
||||
hasMovie |= true;
|
||||
break;
|
||||
|
||||
case SCROLL_RIGHT:
|
||||
@@ -257,9 +275,14 @@ public class GalleryView extends GLView {
|
||||
item = showItems[CUR_TARGET_INDEX];
|
||||
if (item != null)
|
||||
item.draw(canvas, scrollXOffset, scrollYOffset);
|
||||
if (item instanceof MovieImage)
|
||||
hasMovie |= true;
|
||||
|
||||
item = showItems[NEXT_TARGET_INDEX];
|
||||
if (item != null)
|
||||
item.draw(canvas, scrollXOffset, scrollYOffset);
|
||||
if (item instanceof MovieImage)
|
||||
hasMovie |= true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -267,8 +290,11 @@ public class GalleryView extends GLView {
|
||||
if (mShowTapArea && mInit)
|
||||
drawTapArea(canvas);
|
||||
|
||||
// Mask to reduce brightness
|
||||
// TODO Mask to reduce brightness
|
||||
//canvas.fillRect(0, 0, mWidth, mHeight, MASK_COLOR);
|
||||
|
||||
if (hasMovie)
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void resetSizePosition() {
|
||||
@@ -494,7 +520,7 @@ public class GalleryView extends GLView {
|
||||
if (showItem != null)
|
||||
showItem.recycle();
|
||||
if (state == ImageSet.STATE_LOADED)
|
||||
showItems[targetIndex] = new Image();
|
||||
showItems[targetIndex] = new EmptyItem();
|
||||
else {
|
||||
showItems[targetIndex] = new Text(getErrorStateString(state));
|
||||
}
|
||||
@@ -534,21 +560,28 @@ public class GalleryView extends GLView {
|
||||
|
||||
class DecodeImageListener implements ImageSet.OnDecodeOverListener {
|
||||
@Override
|
||||
public void onDecodeOver(Bitmap bmp, int index) {
|
||||
public void onDecodeOver(Object res, int index) {
|
||||
int targetIndex = index - mCurIndex + 1;
|
||||
ShowItem showItem;
|
||||
Image image;
|
||||
|
||||
if (targetIndex < 0 || targetIndex > 2
|
||||
|| !((showItem = showItems[targetIndex]) instanceof Image)
|
||||
|| (image = (Image)showItem).isLoaded()) {// If it do not need any more
|
||||
if (bmp != null)
|
||||
bmp.recycle();
|
||||
|| !((showItem = showItems[targetIndex]) instanceof EmptyItem)) {// If it do not need any more
|
||||
if (res != null && res instanceof Bitmap)
|
||||
((Bitmap)res).recycle();
|
||||
} else {
|
||||
if (bmp == null) {
|
||||
showItems[targetIndex] = new Text("读取图片错误");
|
||||
if (res == null) {
|
||||
showItems[targetIndex] = new Text("读取图片错误"); // TODO
|
||||
} else {
|
||||
image.load(bmp);
|
||||
if (res instanceof Bitmap) {
|
||||
BitmapImage bi = new BitmapImage();
|
||||
bi.load((Bitmap)res);
|
||||
showItems[targetIndex] = bi;
|
||||
} else {
|
||||
MovieImage mi = new MovieImage();
|
||||
mi.load((Movie)res);
|
||||
showItems[targetIndex] = mi;
|
||||
}
|
||||
}
|
||||
resetSizePosition(targetIndex);
|
||||
}
|
||||
@@ -735,7 +768,7 @@ public class GalleryView extends GLView {
|
||||
|| showItems[CUR_TARGET_INDEX] instanceof Text) {
|
||||
if (mOnTapTextListener != null)
|
||||
mOnTapTextListener.onTapText(mCurIndex);
|
||||
return true;
|
||||
//return true;
|
||||
}
|
||||
|
||||
if (isInArea(leftArea, (int)x, (int)y)) {
|
||||
@@ -768,6 +801,12 @@ public class GalleryView extends GLView {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrollBegin(float dx, float dy, float totalX,
|
||||
float totalY) {
|
||||
@@ -1079,18 +1118,36 @@ public class GalleryView extends GLView {
|
||||
public abstract void recycle();
|
||||
}
|
||||
|
||||
private class Image extends ShowItem{
|
||||
private BitmapTexture mTexture;
|
||||
private Bitmap mContextBmp;
|
||||
private class EmptyItem extends ShowItem{
|
||||
|
||||
private ColorTexture mTexture;
|
||||
|
||||
public EmptyItem() {
|
||||
mTexture = new ColorTexture(BACKGROUND_COLOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recycle() {
|
||||
mTexture = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GLCanvas canvas, int xOffset, int yOffset) {
|
||||
mTexture.draw(canvas, xOffset, yOffset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private abstract class Image extends ShowItem{
|
||||
private UploadedTexture mTexture;
|
||||
public float imageScale = 1;
|
||||
|
||||
public void load(Bitmap bmp) {
|
||||
if (mTexture != null)
|
||||
recycle();
|
||||
mTexture = new BitmapTexture(bmp);
|
||||
mContextBmp = bmp;
|
||||
width = bmp.getWidth();
|
||||
height = bmp.getHeight();
|
||||
/**
|
||||
* You must call init before draw
|
||||
* @param texture
|
||||
*/
|
||||
public void init(UploadedTexture texture) {
|
||||
mTexture = texture;
|
||||
imageScale = 1;
|
||||
}
|
||||
|
||||
@@ -1098,18 +1155,6 @@ public class GalleryView extends GLView {
|
||||
return mTexture != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recycle() {
|
||||
if (mTexture == null)
|
||||
return;
|
||||
|
||||
mTexture.recycle();
|
||||
mContextBmp.recycle();
|
||||
|
||||
mTexture = null;
|
||||
mContextBmp = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GLCanvas canvas, int xOffset, int yOffset) {
|
||||
if (mTexture != null) {
|
||||
@@ -1191,6 +1236,62 @@ public class GalleryView extends GLView {
|
||||
}
|
||||
}
|
||||
|
||||
private class BitmapImage extends Image{
|
||||
private BitmapTexture mTexture;
|
||||
private Bitmap mContextBmp;
|
||||
|
||||
public void load(Bitmap bmp) {
|
||||
if (mTexture != null)
|
||||
recycle();
|
||||
mContextBmp = bmp;
|
||||
mTexture = new BitmapTexture(bmp);
|
||||
width = mContextBmp.getWidth();
|
||||
height = mContextBmp.getHeight();
|
||||
|
||||
super.init(mTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recycle() {
|
||||
if (mTexture == null)
|
||||
return;
|
||||
|
||||
mTexture.recycle();
|
||||
mContextBmp.recycle();
|
||||
|
||||
mTexture = null;
|
||||
mContextBmp = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class MovieImage extends Image{
|
||||
private MovieTexture mTexture;
|
||||
private Movie mContextMovie;
|
||||
|
||||
public void load(Movie movie) {
|
||||
if (mTexture != null)
|
||||
recycle();
|
||||
mContextMovie = movie;
|
||||
mTexture = MovieTexture.newInstance(mContextMovie);
|
||||
|
||||
width = mContextMovie.width();
|
||||
height = mContextMovie.height();
|
||||
|
||||
super.init(mTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recycle() {
|
||||
if (mTexture == null)
|
||||
return;
|
||||
|
||||
mTexture.recycle();
|
||||
|
||||
mTexture = null;
|
||||
mContextMovie = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class Text extends ShowItem{
|
||||
private StringTexture mTexture;
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ import android.content.IntentFilter;
|
||||
import com.hippo.ehviewer.service.DownloadService;
|
||||
|
||||
public class DownloadImageSet extends ImageSet {
|
||||
|
||||
|
||||
|
||||
|
||||
public DownloadImageSet(Context context, String gid, File folder, int size,
|
||||
int startIndex, int endIndex, Set<Integer> failIndexSet) {
|
||||
super(context, gid, folder, size, startIndex, endIndex, failIndexSet);
|
||||
|
||||
@@ -17,9 +17,12 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Movie;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
// TODO 初期建立一个线程检索文件夹中所有文件以寻找到所有图片文件
|
||||
|
||||
/**
|
||||
* @author Hippo
|
||||
*
|
||||
@@ -31,8 +34,15 @@ import android.util.SparseArray;
|
||||
*/
|
||||
public class ImageSet {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "ImageSet";
|
||||
|
||||
private static final String GIF_EXTENSION = "gif";
|
||||
|
||||
public static final int TYPE_NONE = 0x0;
|
||||
public static final int TYPE_BITMAP = 0x1;
|
||||
public static final int TYPE_MOVIE = 0x2;
|
||||
|
||||
public static final int INVALID_ID = -1;
|
||||
|
||||
public static final int STATE_NONE = 0;
|
||||
@@ -55,29 +65,39 @@ public class ImageSet {
|
||||
}
|
||||
|
||||
public interface OnDecodeOverListener {
|
||||
void onDecodeOver(Bitmap bmp, int index);
|
||||
/**
|
||||
* May return Bitmap or Movie
|
||||
*
|
||||
* @param res
|
||||
* @param index
|
||||
*/
|
||||
void onDecodeOver(Object res, int index);
|
||||
}
|
||||
|
||||
private class ImageData {
|
||||
int state;
|
||||
String fileName;
|
||||
int type;
|
||||
|
||||
public ImageData() {
|
||||
state = STATE_NONE;
|
||||
fileName = null;
|
||||
type = TYPE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
// [startIndex, endIndex)
|
||||
public ImageSet(Context context, String gid, File folder, int size, int startIndex, int endIndex,
|
||||
Set<Integer> failIndexSet) {
|
||||
if (folder == null || !folder.isDirectory())
|
||||
throw new IllegalArgumentException("Folder is null or not directory");
|
||||
if (folder == null)
|
||||
throw new IllegalArgumentException("Folder is null");
|
||||
if (!folder.isDirectory())
|
||||
throw new IllegalArgumentException("Folder is not directory, path is " + folder.getPath());
|
||||
if (size < 0 || startIndex < 0
|
||||
|| startIndex > endIndex || endIndex > size)
|
||||
throw new IllegalArgumentException("size or index value error, size = "
|
||||
+ size + ", startIndex = " + startIndex
|
||||
+ ", endIndex" + endIndex);
|
||||
+ ", endIndex = " + endIndex + ", path is " + folder.getPath());
|
||||
|
||||
mContext = context;
|
||||
mGid = gid;
|
||||
@@ -126,37 +146,39 @@ public class ImageSet {
|
||||
else
|
||||
state = imageData.state;
|
||||
if (state == STATE_LOADED && listener != null) {
|
||||
mThreadPool.submit(new Job<Bitmap>() {
|
||||
mThreadPool.submit(new Job<Object>() {
|
||||
@Override
|
||||
public Bitmap run(JobContext jc) {
|
||||
Bitmap bmp = null;
|
||||
if (imageData.fileName == null) {
|
||||
imageData.fileName = getFileForName(getFileNameForIndex(index));
|
||||
}
|
||||
if (imageData.fileName == null)
|
||||
public Object run(JobContext jc) {
|
||||
Object res = null;
|
||||
if (imageData.fileName == null
|
||||
&& !getFileForName(getFileNameForIndex(index), imageData))
|
||||
return null;
|
||||
|
||||
|
||||
Log.d(TAG, imageData.fileName);
|
||||
|
||||
File file = new File(mFolder, imageData.fileName);
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
BitmapFactory.Options opt = new BitmapFactory.Options();
|
||||
opt.inPreferredConfig = Bitmap.Config.ARGB_8888;
|
||||
fis = new FileInputStream(file);
|
||||
bmp = BitmapFactory.decodeStream(fis, null, opt);
|
||||
if (imageData.type == TYPE_BITMAP) {
|
||||
BitmapFactory.Options opt = new BitmapFactory.Options();
|
||||
// TODO why only ARGB_8888 always work well, other may slit image
|
||||
opt.inPreferredConfig = Bitmap.Config.ARGB_8888;
|
||||
res = BitmapFactory.decodeStream(fis, null, opt);
|
||||
} else if (imageData.type == TYPE_MOVIE) {
|
||||
res = Movie.decodeStream(fis);
|
||||
} else {
|
||||
// TYPE_NONE or something else, get error
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (fis != null)
|
||||
Util.closeStreamQuietly(fis);
|
||||
}
|
||||
return bmp;
|
||||
return res;
|
||||
}
|
||||
}, new FutureListener<Bitmap>() {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Bitmap> future) {
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
listener.onDecodeOver(future.get(), index);
|
||||
}
|
||||
});
|
||||
@@ -169,13 +191,19 @@ public class ImageSet {
|
||||
return String.format("%05d", index + 1);
|
||||
}
|
||||
|
||||
public String getFileForName(String name) {
|
||||
public boolean getFileForName(String name, ImageData imageData) {
|
||||
String[] list = mFolder.list();
|
||||
for (String item : list) {
|
||||
if(name.equals(Util.getName(item)))
|
||||
return item;
|
||||
if(name.equals(Util.getName(item))) {
|
||||
imageData.fileName = item;
|
||||
if (Util.getExtension(item).toLowerCase().equals(GIF_EXTENSION))
|
||||
imageData.type = TYPE_MOVIE;
|
||||
else
|
||||
imageData.type = TYPE_BITMAP;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void changeState(int index, int state) {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.hippo.ehviewer.gallery.glrenderer;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Movie;
|
||||
import android.util.Log;
|
||||
|
||||
public class MovieTexture extends CanvasTexture {
|
||||
private static final int DEFAULT_MOVIE_DURATION = 1000;
|
||||
|
||||
private final Movie mMovie;
|
||||
private final int mDuration;
|
||||
private final long mMovieStart;
|
||||
|
||||
private MovieTexture(Movie movie, int width, int height) {
|
||||
super(width, height);
|
||||
mMovie = movie;
|
||||
int dur = mMovie.duration();
|
||||
if (dur == 0)
|
||||
mDuration = DEFAULT_MOVIE_DURATION;
|
||||
else
|
||||
mDuration = dur;
|
||||
mMovieStart = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static MovieTexture newInstance(Movie movie) {
|
||||
Assert.assertTrue(movie != null);
|
||||
return new MovieTexture(movie, movie.width(), movie.height());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onBind(GLCanvas canvas) {
|
||||
invalidateContent();
|
||||
setSize(mMovie.width(), mMovie.height());
|
||||
return super.onBind(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas, Bitmap backing) {
|
||||
mMovie.setTime((int)((System.currentTimeMillis() - mMovieStart) % mDuration));
|
||||
mMovie.draw(canvas, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ package com.hippo.ehviewer.gallery.glrenderer;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Bitmap.Config;
|
||||
import android.opengl.GLUtils;
|
||||
|
||||
import android.util.Log;
|
||||
import junit.framework.Assert;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -231,7 +231,7 @@ public abstract class UploadedTexture extends BasicTexture {
|
||||
int format = GLUtils.getInternalFormat(bitmap);
|
||||
int type = GLUtils.getType(bitmap);
|
||||
Config config = bitmap.getConfig();
|
||||
|
||||
|
||||
canvas.initializeTextureSize(this, format, type);
|
||||
canvas.texSubImage2D(this, mBorder, mBorder, bitmap, format, type);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public class GestureRecognizer {
|
||||
public interface Listener {
|
||||
boolean onSingleTapUp(float x, float y);
|
||||
boolean onDoubleTap(float x, float y);
|
||||
void onLongPress(MotionEvent e);
|
||||
boolean onScrollBegin(float dx, float dy, float totalX, float totalY);
|
||||
boolean onScroll(float dx, float dy, float totalX, float totalY);
|
||||
boolean onScrollEnd();
|
||||
@@ -89,7 +90,12 @@ public class GestureRecognizer {
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
return mListener.onDoubleTap(e.getX(), e.getY());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
mListener.onLongPress(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(
|
||||
MotionEvent e1, MotionEvent e2, float dx, float dy) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.net.UnknownHostException;
|
||||
@@ -60,7 +61,8 @@ public class HttpHelper {
|
||||
else if (mException instanceof MalformedURLException)
|
||||
return mContext.getString(R.string.em_url_format_error);
|
||||
|
||||
else if (mException instanceof ConnectTimeoutException)
|
||||
else if (mException instanceof ConnectTimeoutException ||
|
||||
mException instanceof SocketTimeoutException)
|
||||
return mContext.getString(R.string.em_timeout);
|
||||
|
||||
else if (mException instanceof UnknownHostException)
|
||||
@@ -140,6 +142,7 @@ public class HttpHelper {
|
||||
throw new RedirectionException();
|
||||
} catch (Exception e) {
|
||||
mException = e;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (conn != null)
|
||||
conn.disconnect();
|
||||
@@ -210,6 +213,7 @@ public class HttpHelper {
|
||||
throw new RedirectionException();
|
||||
} catch (Exception e) {
|
||||
mException = e;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (conn != null)
|
||||
conn.disconnect();
|
||||
@@ -268,6 +272,7 @@ public class HttpHelper {
|
||||
throw new RedirectionException();
|
||||
} catch (Exception e) {
|
||||
mException = e;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (conn != null)
|
||||
conn.disconnect();
|
||||
@@ -329,6 +334,7 @@ public class HttpHelper {
|
||||
throw new RedirectionException();
|
||||
} catch (Exception e) {
|
||||
mException = e;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (conn != null)
|
||||
conn.disconnect();
|
||||
@@ -413,6 +419,7 @@ public class HttpHelper {
|
||||
throw new RedirectionException();
|
||||
} catch (Exception e) {
|
||||
mException = e;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (baos != null)
|
||||
Util.closeStreamQuietly(baos);
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.hippo.ehviewer.service.DownloadService;
|
||||
import com.hippo.ehviewer.util.ThreadPool.Job;
|
||||
import com.hippo.ehviewer.util.ThreadPool.JobContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Movie;
|
||||
@@ -61,18 +60,14 @@ public class EhClient {
|
||||
public static final String EXHENTAI_DETAIL_HEADER = "http://exhentai.org/g/";
|
||||
|
||||
public static final String UPDATE_URL = "http://ehviewersu.appsp0t.com/";
|
||||
|
||||
|
||||
public static final String UPDATE_URI_QINIU = "http://ehviewer.qiniudn.com/";
|
||||
|
||||
private static final int RETRY_TIMES = 5;
|
||||
|
||||
public static String listHeader;
|
||||
public static String detailHeader;
|
||||
|
||||
private boolean mLogin = false;
|
||||
private String name;
|
||||
private String logoutUrl;
|
||||
private String mName;
|
||||
private String mLogoutUrl;
|
||||
|
||||
private AppContext mAppContext;
|
||||
private ThreadPool mThreadPool;
|
||||
@@ -92,13 +87,13 @@ public class EhClient {
|
||||
public void onFailure(String eMsg);
|
||||
}
|
||||
|
||||
public interface OnGetManagaListListener {
|
||||
public interface OnGetMangaListListener {
|
||||
public void onSuccess(Object checkFlag, ArrayList<ListMangaDetail> lmdArray,
|
||||
int indexPerPage, int maxPage);
|
||||
public void onFailure(Object checkFlag, String eMsg);
|
||||
}
|
||||
|
||||
public interface OnGetManagaDetailListener {
|
||||
public interface OnGetMangaDetailListener {
|
||||
public void onSuccess(MangaDetail md);
|
||||
public void onFailure(String eMsg);
|
||||
}
|
||||
@@ -108,7 +103,7 @@ public class EhClient {
|
||||
public void onFailure(Object checkFlag, String eMsg);
|
||||
}
|
||||
|
||||
public interface OnGetManagaUrlListener {
|
||||
public interface OnGetMangaUrlListener {
|
||||
public void onSuccess(Object checkFlag, String[] arg);
|
||||
public void onFailure(Object checkFlag, String eMsg);
|
||||
}
|
||||
@@ -161,10 +156,106 @@ public class EhClient {
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return name;
|
||||
return mName;
|
||||
}
|
||||
|
||||
private static final int LOGIN = 0x0;
|
||||
private static final int CHECK_LOGIN = 0x1;
|
||||
private static final int LOGOUT = 0x2;
|
||||
private static final int GET_MANGA_LIST = 0x3;
|
||||
private static final int GET_MANGA_DETAIL = 0x4;
|
||||
private static final int GET_PAGE_LIST = 0x5;
|
||||
private static final int GET_MANGA_URL = 0x6;
|
||||
|
||||
private static Handler mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
|
||||
switch (msg.what) {
|
||||
case LOGIN:
|
||||
LoginPackage loginPackage = (LoginPackage) msg.obj;
|
||||
OnLoginListener listener1 = loginPackage.listener;
|
||||
if (loginPackage.ok)
|
||||
listener1.onSuccess();
|
||||
else
|
||||
listener1.onFailure(loginPackage.eMsg);
|
||||
break;
|
||||
|
||||
case CHECK_LOGIN:
|
||||
CheckLoginPackage checkLoginPackage = (CheckLoginPackage) msg.obj;
|
||||
OnCheckLoginListener listener2 = checkLoginPackage.listener;
|
||||
if (checkLoginPackage.ok)
|
||||
listener2.onSuccess();
|
||||
else
|
||||
listener2.onFailure(checkLoginPackage.eMsg);
|
||||
break;
|
||||
|
||||
case LOGOUT:
|
||||
LogoutPackage logoutPackage = (LogoutPackage) msg.obj;
|
||||
OnLogoutListener listener3 = logoutPackage.listener;
|
||||
if (logoutPackage.ok)
|
||||
listener3.onSuccess();
|
||||
else
|
||||
listener3.onFailure(logoutPackage.eMsg);
|
||||
break;
|
||||
|
||||
case GET_MANGA_LIST:
|
||||
GetMangaListPackage getMangaListPackage = (GetMangaListPackage) msg.obj;
|
||||
OnGetMangaListListener listener4 = getMangaListPackage.listener;
|
||||
if (getMangaListPackage.lmdArray != null)
|
||||
listener4.onSuccess(getMangaListPackage.checkFlag,
|
||||
getMangaListPackage.lmdArray,
|
||||
getMangaListPackage.indexPerPage,
|
||||
getMangaListPackage.maxPage);
|
||||
else
|
||||
listener4.onFailure(getMangaListPackage.checkFlag,
|
||||
getMangaListPackage.eMsg);
|
||||
break;
|
||||
|
||||
case GET_MANGA_DETAIL:
|
||||
GetMangaDetailPackage getMangaDetailPackage = (GetMangaDetailPackage) msg.obj;
|
||||
OnGetMangaDetailListener listener5 = getMangaDetailPackage.listener;
|
||||
if (getMangaDetailPackage.ok)
|
||||
listener5.onSuccess(getMangaDetailPackage.mangaDetail);
|
||||
else
|
||||
listener5.onFailure(getMangaDetailPackage.eMsg);
|
||||
break;
|
||||
|
||||
case GET_PAGE_LIST:
|
||||
GetPageListPackage getPageListPackage = (GetPageListPackage) msg.obj;
|
||||
OnGetPageListListener listener6 = getPageListPackage.listener;
|
||||
if (getPageListPackage.pageList != null)
|
||||
listener6.onSuccess(getPageListPackage.checkFlag, getPageListPackage.pageList);
|
||||
else
|
||||
listener6.onFailure(getPageListPackage.checkFlag, getPageListPackage.eMsg);
|
||||
break;
|
||||
|
||||
case GET_MANGA_URL:
|
||||
GetMangaUrlPackage getMangaUrlPackage = (GetMangaUrlPackage) msg.obj;
|
||||
OnGetMangaUrlListener listener7 = getMangaUrlPackage.listener;
|
||||
if (getMangaUrlPackage.strs != null)
|
||||
listener7.onSuccess(getMangaUrlPackage.checkFlag, getMangaUrlPackage.strs);
|
||||
else
|
||||
listener7.onFailure(getMangaUrlPackage.checkFlag, getMangaUrlPackage.eMsg);
|
||||
break;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Login
|
||||
private class LoginPackage {
|
||||
public boolean ok;
|
||||
public OnLoginListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public LoginPackage(boolean ok, OnLoginListener listener, String eMsg) {
|
||||
this.ok = ok;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class LoginRunnable implements Runnable {
|
||||
|
||||
private String username;
|
||||
@@ -212,22 +303,33 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.ok) {
|
||||
if (listener != null)
|
||||
listener.onSuccess();
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = LOGIN;
|
||||
msg.obj = new LoginPackage(task.ok, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Check login get info and logout url
|
||||
private class CheckLoginPackage {
|
||||
public boolean ok;
|
||||
public OnCheckLoginListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public CheckLoginPackage(boolean ok, OnCheckLoginListener listener, String eMsg) {
|
||||
this.ok = ok;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class checkLoginRunnable implements Runnable {
|
||||
|
||||
public String eMsg;
|
||||
public boolean ok;
|
||||
public String name;
|
||||
public String logoutUrl;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -240,7 +342,6 @@ public class EhClient {
|
||||
Matcher m = p.matcher(pageContent);
|
||||
if (m.find() && m.groupCount() == 2) {
|
||||
ok = true;
|
||||
mLogin = true;
|
||||
name = m.group(1);
|
||||
logoutUrl = StringEscapeUtils.unescapeHtml4(m.group(2));
|
||||
} else
|
||||
@@ -255,31 +356,38 @@ public class EhClient {
|
||||
mThreadPool.submit(new Job<Object>() {
|
||||
@Override
|
||||
public Object run(JobContext jc) {
|
||||
|
||||
Log.d(TAG, Thread.currentThread().toString());
|
||||
|
||||
task.run();
|
||||
return null;
|
||||
}
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
|
||||
Log.d(TAG, Thread.currentThread().toString());
|
||||
|
||||
if (task.ok) {
|
||||
mLogin = true;
|
||||
if (listener != null)
|
||||
listener.onSuccess();
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(task.eMsg);
|
||||
mName = task.name;
|
||||
mLogoutUrl = task.logoutUrl;
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = CHECK_LOGIN;
|
||||
msg.obj = new CheckLoginPackage(task.ok, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Logout
|
||||
private class LogoutPackage {
|
||||
public boolean ok;
|
||||
public OnLogoutListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public LogoutPackage(boolean ok, OnLogoutListener listener, String eMsg) {
|
||||
this.ok = ok;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class LogoutRunnable implements Runnable {
|
||||
|
||||
public String eMsg;
|
||||
@@ -289,7 +397,7 @@ public class EhClient {
|
||||
public void run() {
|
||||
ok = false;
|
||||
HttpHelper hp = new HttpHelper(mAppContext);
|
||||
String pageContent = hp.get(logoutUrl);
|
||||
String pageContent = hp.get(mLogoutUrl);
|
||||
if (pageContent != null) {
|
||||
if (pageContent.contains("<p>You are now logged out<br />"))
|
||||
ok = true;
|
||||
@@ -311,20 +419,37 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.ok) {
|
||||
if (task.ok)
|
||||
mLogin = false;
|
||||
if (listener != null)
|
||||
listener.onSuccess();
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = LOGOUT;
|
||||
msg.obj = new LogoutPackage(task.ok, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Get Manga List
|
||||
private class GetManagaListRunnable implements Runnable {
|
||||
private class GetMangaListPackage {
|
||||
public Object checkFlag;
|
||||
public ArrayList<ListMangaDetail> lmdArray;
|
||||
public int indexPerPage;
|
||||
public int maxPage;
|
||||
public OnGetMangaListListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public GetMangaListPackage(Object checkFlag, ArrayList<ListMangaDetail> lmdArray, int indexPerPage,
|
||||
int maxPage, OnGetMangaListListener listener, String eMsg) {
|
||||
this.checkFlag = checkFlag;
|
||||
this.lmdArray = lmdArray;
|
||||
this.indexPerPage = indexPerPage;
|
||||
this.maxPage = maxPage;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class GetMangaListRunnable implements Runnable {
|
||||
|
||||
private String url;
|
||||
|
||||
@@ -333,7 +458,7 @@ public class EhClient {
|
||||
public int maxPage;
|
||||
public String eMsg;
|
||||
|
||||
public GetManagaListRunnable(String url) {
|
||||
public GetMangaListRunnable(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@@ -429,10 +554,10 @@ public class EhClient {
|
||||
}
|
||||
}
|
||||
|
||||
public void getManagaList(String url, final Object checkFlag,
|
||||
final OnGetManagaListListener listener) {
|
||||
public void getMangaList(String url, final Object checkFlag,
|
||||
final OnGetMangaListListener listener) {
|
||||
|
||||
final GetManagaListRunnable task = new GetManagaListRunnable(url);
|
||||
final GetMangaListRunnable task = new GetMangaListRunnable(url);
|
||||
mThreadPool.submit(new Job<Object>() {
|
||||
@Override
|
||||
public Object run(JobContext jc) {
|
||||
@@ -442,13 +567,10 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.lmdArray != null) {
|
||||
if (listener != null)
|
||||
listener.onSuccess(checkFlag, task.lmdArray, task.indexPerPage, task.maxPage);
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(checkFlag, task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = GET_MANGA_LIST;
|
||||
msg.obj = new GetMangaListPackage(checkFlag, task.lmdArray, task.indexPerPage, task.maxPage, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -506,7 +628,22 @@ public class EhClient {
|
||||
}
|
||||
|
||||
// Get Manga Detail
|
||||
private class GetManagaDetailRunnable implements Runnable {
|
||||
private class GetMangaDetailPackage {
|
||||
public boolean ok;
|
||||
public MangaDetail mangaDetail;
|
||||
public OnGetMangaDetailListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public GetMangaDetailPackage(boolean ok, MangaDetail mangaDetail,
|
||||
OnGetMangaDetailListener listener, String eMsg) {
|
||||
this.ok = ok;
|
||||
this.mangaDetail = mangaDetail;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class GetMangaDetailRunnable implements Runnable {
|
||||
|
||||
private String url;
|
||||
private MangaDetail md;
|
||||
@@ -514,7 +651,7 @@ public class EhClient {
|
||||
public boolean ok;
|
||||
public String eMsg;
|
||||
|
||||
public GetManagaDetailRunnable(String url, MangaDetail md) {
|
||||
public GetMangaDetailRunnable(String url, MangaDetail md) {
|
||||
this.url = url;
|
||||
this.md = md;
|
||||
}
|
||||
@@ -577,10 +714,10 @@ public class EhClient {
|
||||
}
|
||||
}
|
||||
|
||||
public void getManagaDetail(String url, final MangaDetail md,
|
||||
final OnGetManagaDetailListener listener) {
|
||||
public void getMangaDetail(String url, final MangaDetail md,
|
||||
final OnGetMangaDetailListener listener) {
|
||||
|
||||
final GetManagaDetailRunnable task = new GetManagaDetailRunnable(url, md);
|
||||
final GetMangaDetailRunnable task = new GetMangaDetailRunnable(url, md);
|
||||
mThreadPool.submit(new Job<Object>() {
|
||||
@Override
|
||||
public Object run(JobContext jc) {
|
||||
@@ -590,13 +727,10 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.ok) {
|
||||
if (listener != null)
|
||||
listener.onSuccess(md);
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = GET_MANGA_DETAIL;
|
||||
msg.obj = new GetMangaDetailPackage(task.ok, md, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -646,6 +780,21 @@ public class EhClient {
|
||||
}
|
||||
|
||||
// Get page list
|
||||
private class GetPageListPackage {
|
||||
public Object checkFlag;
|
||||
public PageList pageList;
|
||||
public OnGetPageListListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public GetPageListPackage(Object checkFlag, PageList pageList, OnGetPageListListener listener,
|
||||
String eMsg) {
|
||||
this.checkFlag = checkFlag;
|
||||
this.pageList = pageList;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class GetPageListRunnable implements Runnable {
|
||||
private String url;
|
||||
|
||||
@@ -658,11 +807,12 @@ public class EhClient {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PageList pageList = null;
|
||||
pageList = null;
|
||||
|
||||
HttpHelper hp = new HttpHelper(mAppContext);
|
||||
String pageContent = hp.get(url);
|
||||
if (pageContent != null) {
|
||||
|
||||
pageList = getPageList(pageContent);
|
||||
if (pageList == null)
|
||||
eMsg = mAppContext.getString(R.string.em_parser_error);
|
||||
@@ -684,13 +834,10 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.pageList != null) {
|
||||
if (listener != null)
|
||||
listener.onSuccess(checkFlag, task.pageList);
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(checkFlag, task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = GET_PAGE_LIST;
|
||||
msg.obj = new GetPageListPackage(checkFlag, task.pageList, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -710,19 +857,34 @@ public class EhClient {
|
||||
}
|
||||
|
||||
// Get Manga url and next page
|
||||
private class GetManagaUrlRunnable implements Runnable {
|
||||
private class GetMangaUrlPackage {
|
||||
public Object checkFlag;
|
||||
public String[] strs;
|
||||
public OnGetMangaUrlListener listener;
|
||||
public String eMsg;
|
||||
|
||||
public GetMangaUrlPackage(Object checkFlag, String[] strs, OnGetMangaUrlListener listener,
|
||||
String eMsg) {
|
||||
this.checkFlag = checkFlag;
|
||||
this.strs = strs;
|
||||
this.listener = listener;
|
||||
this.eMsg = eMsg;
|
||||
}
|
||||
}
|
||||
|
||||
private class GetMangaUrlRunnable implements Runnable {
|
||||
private String url;
|
||||
|
||||
public String[] strs;
|
||||
public String eMsg;
|
||||
|
||||
public GetManagaUrlRunnable(String url) {
|
||||
public GetMangaUrlRunnable(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String[] strs = null;
|
||||
strs = null;
|
||||
|
||||
HttpHelper hp = new HttpHelper(mAppContext);
|
||||
String pageContent = hp.get(url);
|
||||
@@ -748,9 +910,9 @@ public class EhClient {
|
||||
}
|
||||
}
|
||||
|
||||
public void getManagaUrl(String url, final Object checkFlag, final OnGetManagaUrlListener listener) {
|
||||
public void getMangaUrl(String url, final Object checkFlag, final OnGetMangaUrlListener listener) {
|
||||
|
||||
final GetManagaUrlRunnable task = new GetManagaUrlRunnable(url);
|
||||
final GetMangaUrlRunnable task = new GetMangaUrlRunnable(url);
|
||||
mThreadPool.submit(new Job<Object>() {
|
||||
@Override
|
||||
public Object run(JobContext jc) {
|
||||
@@ -760,13 +922,10 @@ public class EhClient {
|
||||
}, new FutureListener<Object>() {
|
||||
@Override
|
||||
public void onFutureDone(Future<Object> future) {
|
||||
if (task.strs != null) {
|
||||
if (listener != null)
|
||||
listener.onSuccess(checkFlag, task.strs);
|
||||
} else {
|
||||
if (listener != null)
|
||||
listener.onFailure(checkFlag, task.eMsg);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.what = GET_MANGA_URL;
|
||||
msg.obj = new GetMangaUrlPackage(checkFlag, task.strs, listener, task.eMsg);
|
||||
mHandler.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1075,7 +1234,7 @@ public class EhClient {
|
||||
}
|
||||
|
||||
//Create folder
|
||||
File folder = new File(Config.getDownloadPath() + curDownloadInfo.title); // TODO For title contain invailed char
|
||||
File folder = new File(Config.getDownloadPath() + StringEscapeUtils.escapeHtml4(curDownloadInfo.title)); // TODO For title contain invailed char
|
||||
if (!folder.mkdirs() && !folder.isDirectory()) {
|
||||
listener.onDownloadMangaOver(curDownloadInfo.gid, false);
|
||||
curDownloadInfo.status = DownloadInfo.FAILED;
|
||||
|
||||
@@ -132,8 +132,7 @@ public class AutoWrapLayout extends ViewGroup {
|
||||
int maxRightNoPadding = rightBound;
|
||||
int bottomBound;
|
||||
int lastMaxBottom = paddingTop;
|
||||
int maxBottom = lastMaxBottom; // maxBottom is maxBottomNoPadding
|
||||
//int maxBottomNoPadding = maxBottom;
|
||||
int maxBottom = lastMaxBottom;
|
||||
int childWidth;
|
||||
int childHeight;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.hippo.ehviewer.widget;
|
||||
|
||||
import com.hippo.ehviewer.ListUrls;
|
||||
import com.hippo.ehviewer.R;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -8,7 +7,6 @@ import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
@@ -57,8 +55,6 @@ public class PullListView extends LinearLayout implements AbsListView.OnScrollLi
|
||||
private boolean isHeaderRecored = false;
|
||||
private boolean isFooterRecored = false;
|
||||
|
||||
private int mTouchSlop;
|
||||
|
||||
// Header String to show
|
||||
private String mHeaderPullStr;
|
||||
private String mHeaderReleaseStr;
|
||||
@@ -228,14 +224,10 @@ public class PullListView extends LinearLayout implements AbsListView.OnScrollLi
|
||||
|
||||
mHeader.setPadding(headerOriginalLeftPadding, -headerHeight, headerOriginalRightPadding, headerOriginalBottomPadding);
|
||||
mHeader.invalidate();
|
||||
|
||||
//mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem,
|
||||
|
||||
Reference in new issue
Block a user