From 4c3de86c21793405c52ca3a23e48180f939e55f1 Mon Sep 17 00:00:00 2001 From: Elvis Date: Fri, 22 Feb 2019 17:34:36 +0800 Subject: [PATCH] UI改版第一版 --- C5/app/build.gradle | 1 - C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java | 39 +++++++++++++++++++++++++++------------ C5/app/src/main/java/com/sunvote/xpadapp/adapter/SingerVoteResultAdapter.java | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ C5/app/src/main/java/com/sunvote/xpadapp/base/BaseActivity.java | 8 +++++++- C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultVoteFragment.java | 919 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java | 32 ++++++++++++++++++++++++++++++++ C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java | 1 - C5/app/src/main/java/com/sunvote/xpadapp/fragments/UserResultVoteFragment.java | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ C5/app/src/main/res/drawable-hdpi/rendavote.xml | 12 ++++++++++++ C5/app/src/main/res/drawable/bgpic_1.png | Bin 0 -> 293149 bytes C5/app/src/main/res/drawable/bgpic_2.png | Bin 0 -> 160916 bytes C5/app/src/main/res/drawable/bgpic_3.png | Bin 0 -> 327237 bytes C5/app/src/main/res/drawable/bgpic_4.png | Bin 0 -> 1636850 bytes C5/app/src/main/res/layout-land-1223x800/activity_main.xml | 47 ----------------------------------------------- C5/app/src/main/res/layout-land-1223x800/activity_pdf.xml | 6 ------ C5/app/src/main/res/layout-land-1223x800/activity_qrcode_connect_wifi.xml | 15 --------------- C5/app/src/main/res/layout-land-1223x800/dialog_service.xml | 243 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_admin.xml | 76 ---------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_choice10_test.xml | 204 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-1223x800/fragment_com_error.xml | 31 ------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_communication_test.xml | 14 -------------- C5/app/src/main/res/layout-land-1223x800/fragment_contentvote.xml | 170 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_document_browser.xml | 87 --------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_download.xml | 21 --------------------- C5/app/src/main/res/layout-land-1223x800/fragment_election.xml | 344 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_firm_update.xml | 86 -------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_keypad_test.xml | 58 ---------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_multi_content.xml | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-1223x800/fragment_multi_content_detail.xml | 238 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_multi_pingsheng.xml | 201 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_multi_title.xml | 200 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/fragment_multi_title_detail.xml | 110 -------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/list_pingsheng_result_item.xml | 116 -------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-1223x800/list_result_election_item.xml | 84 ------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/activity_main.xml | 46 ---------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/activity_pdf.xml | 6 ------ C5/app/src/main/res/layout-land-160dpi-1280x752/activity_qrcode_connect_wifi.xml | 15 --------------- C5/app/src/main/res/layout-land-160dpi-1280x752/dialog_service.xml | 243 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_admin.xml | 76 ---------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_choice10_test.xml | 204 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_com_error.xml | 31 ------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_communication_test.xml | 14 -------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_contentvote.xml | 170 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_document_browser.xml | 87 --------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_download.xml | 21 --------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_election.xml | 349 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_firm_update.xml | 86 -------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_keypad_test.xml | 58 ---------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_content.xml | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_content_detail.xml | 237 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_pingsheng.xml | 201 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_title.xml | 198 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_title_detail.xml | 110 -------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_no_file.xml | 42 ------------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_offline.xml | 36 ------------------------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_online.xml | 37 ------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_election.xml | 175 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_multi_vote.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_pingsheng.xml | 140 -------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_vote.xml | 323 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_show_id.xml | 28 ---------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_signin.xml | 38 -------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_singlevote.xml | 213 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_welcome.xml | 39 --------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_document_list_item.xml | 56 -------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_election_item.xml | 73 ------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_election_item_add.xml | 18 ------------------ C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_content_item.xml | 107 ----------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_pingsheng_item.xml | 146 -------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_title_item.xml | 97 ------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_vote_result_item.xml | 93 --------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_pingsheng_result_item.xml | 116 -------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-160dpi-1280x752/list_result_election_item.xml | 84 ------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_main.xml | 46 ---------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_pdf.xml | 6 ------ C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_qrcode_connect_wifi.xml | 15 --------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/dialog_service.xml | 243 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_admin.xml | 76 ---------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_choice10_test.xml | 204 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_com_error.xml | 31 ------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_communication_test.xml | 14 -------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_contentvote.xml | 170 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_document_browser.xml | 87 --------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_download.xml | 21 --------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_election.xml | 349 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_firm_update.xml | 86 -------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_keypad_test.xml | 58 ---------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_content.xml | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_content_detail.xml | 239 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_pingsheng.xml | 201 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_title.xml | 197 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_title_detail.xml | 110 -------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_no_file.xml | 42 ------------------------------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_offline.xml | 36 ------------------------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_online.xml | 37 ------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_election.xml | 175 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_multi_vote.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_pingsheng.xml | 140 -------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_vote.xml | 323 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_show_id.xml | 28 ---------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_signin.xml | 38 -------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_singlevote.xml | 213 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_welcome.xml | 39 --------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_document_list_item.xml | 56 -------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_election_item.xml | 73 ------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_election_item_add.xml | 18 ------------------ C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_content_item.xml | 107 ----------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_pingsheng_item.xml | 146 -------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_title_item.xml | 97 ------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_vote_result_item.xml | 94 ---------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_pingsheng_result_item.xml | 116 -------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-280dpi-1920x1116/list_result_election_item.xml | 84 ------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_main.xml | 46 ---------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_pdf.xml | 6 ------ C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_qrcode_connect_wifi.xml | 15 --------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/dialog_service.xml | 243 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_admin.xml | 76 ---------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_choice10_test.xml | 204 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_com_error.xml | 31 ------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_communication_test.xml | 14 -------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_contentvote.xml | 170 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_document_browser.xml | 87 --------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_download.xml | 21 --------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_election.xml | 349 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_firm_update.xml | 86 -------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_keypad_test.xml | 58 ---------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_content.xml | 150 ------------------------------------------------------------------------------------------------------------------------------------------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_content_detail.xml | 239 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_pingsheng.xml | 201 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_title.xml | 197 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_title_detail.xml | 110 -------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_no_file.xml | 42 ------------------------------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_offline.xml | 36 ------------------------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_online.xml | 37 ------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_election.xml | 175 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_multi_vote.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_pingsheng.xml | 140 -------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_vote.xml | 323 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_show_id.xml | 28 ---------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_signin.xml | 38 -------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_singlevote.xml | 213 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_welcome.xml | 39 --------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_document_list_item.xml | 56 -------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_election_item.xml | 73 ------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_election_item_add.xml | 18 ------------------ C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_content_item.xml | 107 ----------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_pingsheng_item.xml | 146 -------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_title_item.xml | 97 ------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_vote_result_item.xml | 94 ---------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_pingsheng_result_item.xml | 116 -------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout-land-320dpi-1920x1200/list_result_election_item.xml | 84 ------------------------------------------------------------------------------------ C5/app/src/main/res/layout/activity_main.xml | 21 ++++++++++++--------- C5/app/src/main/res/layout/fragment_offline.xml | 57 ++++++++++++++++++++++++++++++++++++++++----------------- C5/app/src/main/res/layout/fragment_online.xml | 9 +++++---- C5/app/src/main/res/layout/fragment_result_vote.xml | 513 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/layout/fragment_signin.xml | 27 +++++++++++++++------------ C5/app/src/main/res/layout/fragment_signin_result_vote.xml | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ C5/app/src/main/res/layout/fragment_singlevote.xml | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------- C5/app/src/main/res/layout/fragment_welcome.xml | 2 +- C5/app/src/main/res/layout/item_singer_vote_result.xml | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ C5/app/src/main/res/values-land-1223x800/color.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/values-land-1223x800/dimens.xml | 22 ---------------------- C5/app/src/main/res/values-land-1223x800/styles.xml | 33 --------------------------------- C5/app/src/main/res/values-land-160dpi-1280x752/color.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/values-land-160dpi-1280x752/dimens.xml | 22 ---------------------- C5/app/src/main/res/values-land-160dpi-1280x752/styles.xml | 33 --------------------------------- C5/app/src/main/res/values-land-280dpi-1920x1116/color.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/values-land-280dpi-1920x1116/dimens.xml | 22 ---------------------- C5/app/src/main/res/values-land-280dpi-1920x1116/styles.xml | 33 --------------------------------- C5/app/src/main/res/values-land-320dpi-1920x1200/color.xml | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- C5/app/src/main/res/values-land-320dpi-1920x1200/dimens.xml | 22 ---------------------- C5/app/src/main/res/values-land-320dpi-1920x1200/styles.xml | 33 --------------------------------- C5/app/src/main/res/values/color.xml | 2 +- C5/app/src/main/res/values/strings.xml | 5 ++++- 174 files changed, 1220 insertions(+), 17501 deletions(-) create mode 100644 C5/app/src/main/java/com/sunvote/xpadapp/adapter/SingerVoteResultAdapter.java create mode 100644 C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java create mode 100644 C5/app/src/main/java/com/sunvote/xpadapp/fragments/UserResultVoteFragment.java create mode 100644 C5/app/src/main/res/drawable-hdpi/rendavote.xml create mode 100644 C5/app/src/main/res/drawable/bgpic_1.png create mode 100644 C5/app/src/main/res/drawable/bgpic_2.png create mode 100644 C5/app/src/main/res/drawable/bgpic_3.png create mode 100644 C5/app/src/main/res/drawable/bgpic_4.png delete mode 100644 C5/app/src/main/res/layout-land-1223x800/activity_main.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/activity_pdf.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/activity_qrcode_connect_wifi.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/dialog_service.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_admin.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_choice10_test.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_com_error.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_communication_test.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_contentvote.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_document_browser.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_download.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_election.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_firm_update.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_keypad_test.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_multi_content.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_multi_content_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_multi_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_multi_title.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/fragment_multi_title_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/list_pingsheng_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-1223x800/list_result_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/activity_main.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/activity_pdf.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/activity_qrcode_connect_wifi.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/dialog_service.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_admin.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_choice10_test.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_com_error.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_communication_test.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_contentvote.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_document_browser.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_download.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_election.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_firm_update.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_keypad_test.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_content.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_content_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_title.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_multi_title_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_no_file.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_offline.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_online.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_election.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_multi_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_result_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_show_id.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_signin.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_singlevote.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/fragment_welcome.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_document_list_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_election_item_add.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_content_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_pingsheng_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_title_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_multi_vote_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_pingsheng_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-160dpi-1280x752/list_result_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_main.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_pdf.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/activity_qrcode_connect_wifi.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/dialog_service.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_admin.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_choice10_test.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_com_error.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_communication_test.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_contentvote.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_document_browser.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_download.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_election.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_firm_update.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_keypad_test.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_content.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_content_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_title.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_multi_title_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_no_file.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_offline.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_online.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_election.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_multi_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_result_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_show_id.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_signin.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_singlevote.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/fragment_welcome.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_document_list_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_election_item_add.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_content_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_pingsheng_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_title_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_multi_vote_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_pingsheng_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-280dpi-1920x1116/list_result_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_main.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_pdf.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/activity_qrcode_connect_wifi.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/dialog_service.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_admin.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_choice10_test.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_com_error.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_communication_test.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_contentvote.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_document_browser.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_download.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_election.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_firm_update.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_keypad_test.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_content.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_content_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_title.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_multi_title_detail.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_no_file.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_offline.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_online.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_election.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_multi_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_pingsheng.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_result_vote.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_show_id.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_signin.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_singlevote.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/fragment_welcome.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_document_list_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_election_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_election_item_add.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_content_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_pingsheng_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_title_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_multi_vote_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_pingsheng_result_item.xml delete mode 100644 C5/app/src/main/res/layout-land-320dpi-1920x1200/list_result_election_item.xml create mode 100644 C5/app/src/main/res/layout/fragment_signin_result_vote.xml create mode 100644 C5/app/src/main/res/layout/item_singer_vote_result.xml delete mode 100644 C5/app/src/main/res/values-land-1223x800/color.xml delete mode 100644 C5/app/src/main/res/values-land-1223x800/dimens.xml delete mode 100644 C5/app/src/main/res/values-land-1223x800/styles.xml delete mode 100644 C5/app/src/main/res/values-land-160dpi-1280x752/color.xml delete mode 100644 C5/app/src/main/res/values-land-160dpi-1280x752/dimens.xml delete mode 100644 C5/app/src/main/res/values-land-160dpi-1280x752/styles.xml delete mode 100644 C5/app/src/main/res/values-land-280dpi-1920x1116/color.xml delete mode 100644 C5/app/src/main/res/values-land-280dpi-1920x1116/dimens.xml delete mode 100644 C5/app/src/main/res/values-land-280dpi-1920x1116/styles.xml delete mode 100644 C5/app/src/main/res/values-land-320dpi-1920x1200/color.xml delete mode 100644 C5/app/src/main/res/values-land-320dpi-1920x1200/dimens.xml delete mode 100644 C5/app/src/main/res/values-land-320dpi-1920x1200/styles.xml diff --git a/C5/app/build.gradle b/C5/app/build.gradle index a2acdf3..6acc3ab 100644 --- a/C5/app/build.gradle +++ b/C5/app/build.gradle @@ -10,7 +10,6 @@ def buildTime() { android { compileSdkVersion 26 - buildToolsVersion "26.0.2" defaultConfig { minSdkVersion 21 targetSdkVersion 26 diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java b/C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java index d96adcd..c816e1f 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java @@ -56,6 +56,7 @@ import com.sunvote.xpadapp.fragments.MultiContentDetailFragment; import com.sunvote.xpadapp.fragments.MultiContentFragment; import com.sunvote.xpadapp.fragments.MultiPingshengFragment; import com.sunvote.xpadapp.fragments.MultiTitleFragment; +import com.sunvote.xpadapp.fragments.UserResultVoteFragment; import com.sunvote.xpadapp.fragments.NoFileFragment; import com.sunvote.xpadapp.fragments.OfflineFragment; import com.sunvote.xpadapp.fragments.OnLineFragment; @@ -65,6 +66,7 @@ import com.sunvote.xpadapp.fragments.ResultMultiVoteFragment; import com.sunvote.xpadapp.fragments.ResultVoteFragment; import com.sunvote.xpadapp.fragments.ShowIdFragment; import com.sunvote.xpadapp.fragments.SigninFragment; +import com.sunvote.xpadapp.fragments.SinginResultFragment; import com.sunvote.xpadapp.fragments.SingleTitleFragment; import com.sunvote.xpadapp.presenter.ServicePresent; import com.sunvote.xpadapp.presenter.XPadPresenter; @@ -100,7 +102,7 @@ public class MainActivity extends BaseActivity implements ComListener { private final int Msg_Download = 3; private final int Msg_Welcome = 4; - // private final int Msg_Signin = 5; +// private final int Msg_Signin = 5; // private final int Msg_QuickVote = 6; // private final int Msg_SingleTitleVote = 7; // private final int Msg_MultiTitleVote = 8; @@ -625,8 +627,9 @@ public class MainActivity extends BaseActivity implements ComListener { FragmentManager fm = getFragmentManager(); FragmentTransaction transaction = fm.beginTransaction(); ResultVoteFragment fr = new ResultVoteFragment(); - fr.voteInfo = vote; - fr.bill = currBillInfo; +// fr.voteInfo = vote; +// fr.bill = currBillInfo; + fr.setVoteInfo(vote); resultFragment = fr; transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out); transaction.add(R.id.frame_content, fr); @@ -635,6 +638,20 @@ public class MainActivity extends BaseActivity implements ComListener { LogUtil.i(TAG, "showVoteResultFragment 信标"); } + private void showSigninResultFragment(VoteInfo vote) { + hideResultFragment(); + FragmentManager fm = getFragmentManager(); + FragmentTransaction transaction = fm.beginTransaction(); + SinginResultFragment fr = new SinginResultFragment(); + fr.setResultInfo(vote.resultInfo); + resultFragment = fr; + transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out); + transaction.add(R.id.frame_content, fr); + transaction.addToBackStack("signinresult"); + transaction.commitAllowingStateLoss(); + LogUtil.i(TAG, "showSigninResultFragment 信标"); + } + private void showResultElectionFragment(byte[] buffer) { int voteId = buffer[3] & 0xff; @@ -689,11 +706,9 @@ public class MainActivity extends BaseActivity implements ComListener { hideResultFragment(); FragmentTransaction transaction = fm.beginTransaction(); - ResultVoteFragment fr = new ResultVoteFragment(); - fr.voteInfo = null; - fr.data = buffer; - fr.bill = currBillInfo; - fr.options = currBillInfo.billOptions.split("/"); + UserResultVoteFragment fr = new UserResultVoteFragment(); + fr.setData(buffer); + fr.setOptions(currBillInfo.billOptions.split("/")); resultFragment = fr; transaction.setCustomAnimations(android.R.animator.fade_in, android.R.animator.fade_out); transaction.add(R.id.frame_content, fr); @@ -1377,14 +1392,14 @@ public class MainActivity extends BaseActivity implements ComListener { } } if (voteInfo.mode1_msgType == 2) { // 结果显示 - if (voteInfo.resultInfo.resultType == XPadApi.VoteType_BatchVote) { // 多项 + if(voteInfo.resultInfo.resultType == XPadApi.VoteType_Stop){ + showSigninResultFragment(voteInfo); + }else if (voteInfo.resultInfo.resultType == XPadApi.VoteType_BatchVote) { // 多项 if (currFragment != null) { currFragment.onVoteEvent(voteInfo); } - } else { - if (voteInfo.resultInfo.resultType !=101 && voteInfo.resultInfo.resultType != XPadApi.VoteType_BatchElect){ + } else if (voteInfo.resultInfo.resultType !=101 && voteInfo.resultInfo.resultType != XPadApi.VoteType_BatchElect){ showVoteResultFragment(voteInfo); - } } } } else if (voteInfo.mode == XPadApi.VoteType_Signin) { diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/adapter/SingerVoteResultAdapter.java b/C5/app/src/main/java/com/sunvote/xpadapp/adapter/SingerVoteResultAdapter.java new file mode 100644 index 0000000..de82db3 --- /dev/null +++ b/C5/app/src/main/java/com/sunvote/xpadapp/adapter/SingerVoteResultAdapter.java @@ -0,0 +1,143 @@ +package com.sunvote.xpadapp.adapter; + +import android.graphics.Color; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.TextView; + +import com.sunvote.xpadapp.R; + +import java.util.ArrayList; +import java.util.List; + +public class SingerVoteResultAdapter extends BaseAdapter { + + public SingerVoteResultAdapter(LayoutInflater inflater, List dataList, int optionNum) { + this.mInflater = inflater; + this.dataList = dataList; + this.optionNum = optionNum; + } + + private List dataList = new ArrayList<>(); + private int optionNum; + private LayoutInflater mInflater; + + @Override + public int getCount() { + return dataList.size(); + } + + @Override + public Object getItem(int position) { + return dataList.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder viewHolder; + if (convertView == null) { + convertView = mInflater.inflate(R.layout.item_singer_vote_result, null); + viewHolder = new ViewHolder(); + viewHolder.result1 = convertView.findViewById(R.id.result1); + viewHolder.result2 = convertView.findViewById(R.id.result2); + viewHolder.result3 = convertView.findViewById(R.id.result3); + viewHolder.result4 = convertView.findViewById(R.id.result4); + viewHolder.result5 = convertView.findViewById(R.id.result5); + viewHolder.result6 = convertView.findViewById(R.id.result6); + viewHolder.result7 = convertView.findViewById(R.id.result7); + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + setVisible(viewHolder, position); + String[] options = dataList.get(position); + setData(viewHolder, options); + return convertView; + } + + private void setData(ViewHolder viewHolder, String[] options) { + if (optionNum > 0 && options.length > 0) { + viewHolder.result1.setText(options[0]); + } + if (optionNum > 1 && options.length > 1) { + viewHolder.result1.setText(options[1]); + } + if (optionNum > 2 && options.length > 2) { + viewHolder.result1.setText(options[2]); + } + if (optionNum > 3 && options.length > 3) { + viewHolder.result1.setText(options[3]); + } + if (optionNum > 4 && options.length > 4) { + viewHolder.result1.setText(options[4]); + } + if (optionNum > 5 && options.length > 5) { + viewHolder.result1.setText(options[5]); + } + if (optionNum > 6 && options.length > 6) { + viewHolder.result1.setText(options[6]); + } + } + + private void setVisible(ViewHolder viewHolder, int position) { + if (optionNum > 0) { + viewHolder.result1.setVisibility(View.VISIBLE); + } else { + viewHolder.result1.setVisibility(View.GONE); + } + viewHolder.result1.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 1) { + viewHolder.result2.setVisibility(View.VISIBLE); + } else { + viewHolder.result2.setVisibility(View.GONE); + } + viewHolder.result2.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 2) { + viewHolder.result3.setVisibility(View.VISIBLE); + } else { + viewHolder.result3.setVisibility(View.GONE); + } + viewHolder.result3.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 3) { + viewHolder.result4.setVisibility(View.VISIBLE); + } else { + viewHolder.result4.setVisibility(View.GONE); + } + viewHolder.result4.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 4) { + viewHolder.result5.setVisibility(View.VISIBLE); + } else { + viewHolder.result5.setVisibility(View.GONE); + } + viewHolder.result5.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 5) { + viewHolder.result6.setVisibility(View.VISIBLE); + } else { + viewHolder.result6.setVisibility(View.GONE); + } + viewHolder.result6.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + if (optionNum > 6) { + viewHolder.result7.setVisibility(View.VISIBLE); + } else { + viewHolder.result7.setVisibility(View.GONE); + } + viewHolder.result7.setTextColor(position == 0 ? Color.YELLOW : Color.WHITE); + } + + class ViewHolder { + TextView result1; + TextView result2; + TextView result3; + TextView result4; + TextView result5; + TextView result6; + TextView result7; + } +} diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/base/BaseActivity.java b/C5/app/src/main/java/com/sunvote/xpadapp/base/BaseActivity.java index ff519b5..350253b 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/base/BaseActivity.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/base/BaseActivity.java @@ -11,6 +11,7 @@ import android.support.v4.app.FragmentActivity; import android.support.v4.content.ContextCompat; import android.util.DisplayMetrics; import android.view.KeyEvent; +import android.view.Window; import android.view.WindowManager; import android.widget.Toast; @@ -29,12 +30,17 @@ public class BaseActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { - this.getWindow().setFlags(FLAG_HOMEKEY_DISPATCHED, FLAG_HOMEKEY_DISPATCHED);//关键代码 + //无title + requestWindowFeature(Window.FEATURE_NO_TITLE); + //全屏 + getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN , + WindowManager.LayoutParams. FLAG_FULLSCREEN); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.KITKAT){ // getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); // } + super.onCreate(savedInstanceState); checkPermission(); diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultVoteFragment.java b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultVoteFragment.java index 5064a64..0054465 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultVoteFragment.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultVoteFragment.java @@ -1,729 +1,216 @@ package com.sunvote.xpadapp.fragments; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.logging.Handler; - -import com.sunvote.xpadapp.MainActivity; -import com.sunvote.xpadapp.R; -import com.sunvote.xpadapp.base.BaseFragment; -import com.sunvote.xpadapp.base.CustomTextView; -import com.sunvote.xpadapp.base.TextViewUtils; -import com.sunvote.xpadapp.db.DBManager; -import com.sunvote.xpadapp.db.modal.BillInfo; -import com.sunvote.xpadapp.db.modal.MultiTitleItem; -import com.sunvote.xpadcomm.XPadApiInterface.VoteInfo; - -import android.app.FragmentManager; -import android.app.FragmentTransaction; +import android.graphics.Color; import android.os.Bundle; -import android.text.TextPaint; -import android.util.Log; -import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.ImageButton; -import android.widget.RelativeLayout; +import android.view.ViewGroup; +import android.widget.LinearLayout; import android.widget.TextView; -public class ResultVoteFragment extends BaseFragment { - - public BillInfo bill; - public ArrayList subInfo; - public VoteInfo voteInfo; - public String resultStr; - public String[] options; - public byte[] data; - - String TAG = "ResultVoteFragment"; - - private int page = 0; - - TextView tvBillTitle; - TextView tvSubTitle; - TextView tvOption1; - TextView tvValue1; - TextView tvOption2; - TextView tvValue2; - TextView tvOption3; - TextView tvValue3; - TextView tvOption4; - TextView tvValue4; - TextView tvOption5; - TextView tvValue5; - TextView tvOption6; - TextView tvValue6; - TextView tvOption7; - TextView tvValue7; - TextView tvMemo; - TextView tvPage; - - private View fragment_result_option_panel1; - private View fragment_result_option_panel2; - private View fragment_result_option_panel3; - private View fragment_result_option_panel4; - private View fragment_result_option_panel5; - private View fragment_result_option_panel6; - private View fragment_result_option_panel7; - - private Handler mHandle; - - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.fragment_result_vote, container, false); - final MainActivity mact = (MainActivity) getActivity(); - - tvBillTitle = (TextView) view.findViewById(R.id.fragment_result_bill_title); - tvSubTitle = (TextView) view.findViewById(R.id.fragment_result_sub_title); - tvOption1 = (TextView) view.findViewById(R.id.fragment_result_option1); - tvValue1 = (TextView) view.findViewById(R.id.fragment_result_value1); - tvOption2 = (TextView) view.findViewById(R.id.fragment_result_option2); - tvValue2 = (TextView) view.findViewById(R.id.fragment_result_value2); - tvOption3 = (TextView) view.findViewById(R.id.fragment_result_option3); - tvValue3 = (TextView) view.findViewById(R.id.fragment_result_value3); - tvOption4 = (TextView) view.findViewById(R.id.fragment_result_option4); - tvValue4 = (TextView) view.findViewById(R.id.fragment_result_value4); - tvOption5 = (TextView) view.findViewById(R.id.fragment_result_option5); - tvValue5 = (TextView) view.findViewById(R.id.fragment_result_value5); - tvOption6 = (TextView) view.findViewById(R.id.fragment_result_option6); - tvValue6= (TextView) view.findViewById(R.id.fragment_result_value6); - tvOption7 = (TextView) view.findViewById(R.id.fragment_result_option7); - tvValue7= (TextView) view.findViewById(R.id.fragment_result_value7); - - fragment_result_option_panel1 = view.findViewById(R.id.fragment_result_option_panel1); - fragment_result_option_panel2 = view.findViewById(R.id.fragment_result_option_panel2); - fragment_result_option_panel3 = view.findViewById(R.id.fragment_result_option_panel3); - fragment_result_option_panel4 = view.findViewById(R.id.fragment_result_option_panel4); - fragment_result_option_panel5 = view.findViewById(R.id.fragment_result_option_panel5); - fragment_result_option_panel6 = view.findViewById(R.id.fragment_result_option_panel6); - fragment_result_option_panel7 = view.findViewById(R.id.fragment_result_option_panel7); - - fragment_result_option_panel1.setVisibility(View.GONE); - fragment_result_option_panel2.setVisibility(View.GONE); - fragment_result_option_panel3.setVisibility(View.GONE); - fragment_result_option_panel4.setVisibility(View.GONE); - fragment_result_option_panel5.setVisibility(View.GONE); - fragment_result_option_panel6.setVisibility(View.GONE); - fragment_result_option_panel7.setVisibility(View.GONE); - - tvMemo = (TextView) view.findViewById(R.id.fragment_result_memo); - - RelativeLayout pagePanel = (RelativeLayout) view.findViewById(R.id.fragment_result_page_panel); - - tvPage = (TextView) view.findViewById(R.id.fragment_result_page); - view.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - ; - } - }); - Button btnPageUp = (Button) view.findViewById(R.id.fragment_result_pageup); - Button btnPageDown = (Button) view.findViewById(R.id.fragment_result_pagedown); - btnPageUp.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - if (page > 0) { - page--; - showResultByPage(); - tvPage.setText(String.format("%d/%d", page + 1, subInfo.size())); - } - } - }); - - btnPageDown.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (page < subInfo.size() - 1) { - page++; - showResultByPage(); - tvPage.setText(String.format("%d/%d", page + 1, subInfo.size())); - } - } - }); - - ImageButton btnBack = (ImageButton) view.findViewById(R.id.fragment_result_vote_btn_back); - btnBack.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - FragmentManager fm = getFragmentManager(); - FragmentTransaction tx = fm.beginTransaction(); - tx.remove(ResultVoteFragment.this); - tx.commit(); - // mact.resultFragment = null; - } - }); - - pagePanel.setVisibility(View.GONE); - // if (bill != null && bill.title != null) { - // //tvBillTitle.setText(bill.title); - // } - // tvBillTitle.setText(getString(R.string.ceping_result)); - - showResult(); - return view; - } - - - int fenmu;//百分比分母 - int goToBe;//应到 - int goTo;//实到 - int notVote;//未按票数 - - private void showResult(){ - if(voteInfo==null){// 自定义表决结果 - int bitNum = data[2] & 0xf; - int digiters = data[2] >> 4 & 0xf; - int voteNo = data[3] & 0xff; - int resultSelectModel = data[4] & 0xff; //表决结果 - - if (bitNum == 0) { //单字节数值 - fenmu = data[5] & 0xff; - goToBe= data[6] & 0xff; - goTo= data[7] & 0xff; - notVote= data[8] & 0xff; - - int pos =9; - int i = pos; - for (; i < data.length; i++) { - if (pos == data.length - 1) { - break; - } - setView(pos,digiters,bitNum,1); - } - //应到实到 - String strYDSD = ""; - if (goToBe != 0xff) { - strYDSD = strYDSD + getString(R.string.yindao) + ":" + goToBe; - } - if (goTo != 0xff) { - strYDSD = strYDSD + " " + getString(R.string.shidao) + ":" + goTo; - } - tvBillTitle.setText(strYDSD); - if (resultSelectModel != 0xFF) { - if(options!=null){ - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+options[resultSelectModel]); - } - } - } else { - fenmu = (data[5] <<8 | data[6]) & 0xffff; - goToBe = (data[7] << 8 | data[8]) & 0xffff; - goTo = (data[9] << 8 | data[10]) & 0xffff; - notVote= (data[11] << 8 | data[12]) & 0xffff; - - int pos = 13; - int i = pos; - for (; i < data.length; i++) { - if (pos == data.length - 1) { - break; - } - setView(pos,digiters,bitNum,2); - } - //应到实到 - String strYDSD = ""; - if (goToBe != 0xffff) { - strYDSD = strYDSD + getString(R.string.yindao) + ":" + goToBe; - } - if (goTo != 0xffff) { - strYDSD = strYDSD + " " + getString(R.string.shidao) + ":" + goTo; - } - tvBillTitle.setText(strYDSD); - if (resultSelectModel != 0xffff) { - if(options!=null){ - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+options[resultSelectModel]); - } - } - } - return; - } - - int pass = voteInfo.resultInfo.bits & 0xF; - int xiaoShuWei = (voteInfo.resultInfo.bits >> 4) & 0xF; - int fenmu = voteInfo.resultInfo.num0; - Log.d(TAG, "xiaoshu:" + xiaoShuWei + " fenmu:" + fenmu); - if (voteInfo.resultInfo.resultType == 0) {// ??? - tvBillTitle.setText(getString(R.string.signin_result)); - // tvSubTitle.setText("???????"); - fragment_result_option_panel1.setVisibility(View.VISIBLE); - fragment_result_option_panel2.setVisibility(View.VISIBLE); - fragment_result_option_panel3.setVisibility(View.VISIBLE); - tvOption1.setText(getString(R.string.yindao) + getString(R.string.maohao)); - tvValue1.setText(String.valueOf(voteInfo.resultInfo.num2) + getString(R.string.ren)); - tvOption2.setText(getString(R.string.shidao) + getString(R.string.maohao)); - tvValue2.setText(String.valueOf(voteInfo.resultInfo.num3) + getString(R.string.ren)); - tvOption3.setText(getString(R.string.weidao) + getString(R.string.maohao)); - tvValue3.setText(String.valueOf(voteInfo.resultInfo.num1) + getString(R.string.ren)); - - if (pass == 0xF) { - tvMemo.setText(""); - } else if (pass == 0) { - tvMemo.setText(getString(R.string.bufuherenshu)); - } else { - tvMemo.setText(getString(R.string.fuherenshu)); - } - } else if (voteInfo.resultInfo.resultType == 1) { - // tvBillTitle.setText(getString(R.string.biaojue_result)); - String strYDSD = ""; - if (voteInfo.resultInfo.num1 != 0xffff) { - strYDSD = strYDSD + getString(R.string.yindao) + ":" + voteInfo.resultInfo.num1; - } - if (voteInfo.resultInfo.num2 != 0xffff) { - strYDSD = strYDSD + " " + getString(R.string.shidao) + ":" + voteInfo.resultInfo.num2; - } - tvBillTitle.setText(strYDSD); - - tvOption1.setText(getString(R.string.agree)); - tvValue1.setText(String.valueOf(voteInfo.resultInfo.num4) + getString(R.string.piao)); - tvOption2.setText(getString(R.string.oppose)); - tvValue2.setText(String.valueOf(voteInfo.resultInfo.num5) + getString(R.string.piao)); - tvOption3.setText(getString(R.string.weian)); - tvValue3.setText(String.valueOf(voteInfo.resultInfo.num3) + getString(R.string.piao)); - fragment_result_option_panel1.setVisibility(View.VISIBLE); - fragment_result_option_panel2.setVisibility(View.VISIBLE); - fragment_result_option_panel3.setVisibility(View.VISIBLE); - if (fenmu > 0 && fenmu != 0xffff) { - - double pzc = voteInfo.resultInfo.num4 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, xiaoShuWei, false); - - double pfd = voteInfo.resultInfo.num5 * 1.0 / fenmu * 100; - String sfd = formatDoubleToString(pfd, xiaoShuWei, false); - - double pwa = voteInfo.resultInfo.num3 * 1.0 / fenmu * 100; - String swa = formatDoubleToString(pwa, xiaoShuWei, false); - - tvValue1.setText(String.valueOf(voteInfo.resultInfo.num4) + " (" + szc + "%)"); - tvValue2.setText(String.valueOf(voteInfo.resultInfo.num5) + " (" + sfd + "%)"); - tvValue3.setText(String.valueOf(voteInfo.resultInfo.num3) + " (" + swa + "%)"); - } - - if (voteInfo.resultInfo.num4 == 0xffff) { - tvOption1.setText(""); - tvValue1.setText(String.valueOf("")); - } - if (voteInfo.resultInfo.num5 == 0xffff) { - tvOption2.setText(""); - tvValue2.setText(String.valueOf("")); - } - if (voteInfo.resultInfo.num3 == 0xffff) { - tvOption3.setText(""); - tvValue3.setText(String.valueOf("")); - } - - if (pass == 0xf) { - tvMemo.setText(""); - } else if (pass == 0) { - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+getString(R.string.no_pass)); - } else { - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+getString(R.string.pass)); - } - } else { - - if (voteInfo.resultInfo.resultType == 2) { - // tvBillTitle.setText(getString(R.string.biaojue_result)); - tvOption1.setText(getString(R.string.agree)); - tvOption2.setText(getString(R.string.oppose)); - tvOption3.setText(getString(R.string.abstant)); - - fragment_result_option_panel1.setVisibility(View.VISIBLE); - fragment_result_option_panel2.setVisibility(View.VISIBLE); - fragment_result_option_panel3.setVisibility(View.VISIBLE); - - if (pass == 0) { - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+getString(R.string.no_pass)); - } else { - tvMemo.setText(getString(R.string.biaojue_result)+getString(R.string.maohao)+getString(R.string.pass)); - } - - } else if (voteInfo.resultInfo.resultType == 4) { - tvOption1.setText(getString(R.string.manyi)); - tvOption2.setText(getString(R.string.jbmanyi)); - tvOption3.setText(getString(R.string.bumanyi)); - fragment_result_option_panel1.setVisibility(View.VISIBLE); - fragment_result_option_panel2.setVisibility(View.VISIBLE); - fragment_result_option_panel3.setVisibility(View.VISIBLE); - if (pass == 0) { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.manyi)); - } else if (pass == 1) { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.jbmanyi)); - } else { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.bumanyi)); - } - } else if (voteInfo.resultInfo.resultType == 12) { - tvOption1.setText(getString(R.string.manyi)); - tvOption2.setText(getString(R.string.bumanyi)); - tvOption3.setText(getString(R.string.fcbumanyi)); - fragment_result_option_panel1.setVisibility(View.VISIBLE); - fragment_result_option_panel2.setVisibility(View.VISIBLE); - fragment_result_option_panel3.setVisibility(View.VISIBLE); - if (pass == 0) { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.manyi)); - } else if (pass == 1) { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.bumanyi)); - } else { - tvMemo.setText(getString(R.string.ceping_result)+getString(R.string.maohao)+getString(R.string.fcbumanyi)); - } - } - - if (pass == 0xf) { - tvMemo.setText(""); - } - // bg:0,69,134 - String strYDSD = ""; - if (voteInfo.resultInfo.num1 != 0xffff) { - strYDSD = strYDSD + getString(R.string.yindao) + ":" + voteInfo.resultInfo.num1; - } - if (voteInfo.resultInfo.num2 != 0xffff) { - strYDSD = strYDSD + " " + getString(R.string.shidao) + ":" + voteInfo.resultInfo.num2; - } - tvBillTitle.setText(strYDSD); - fragment_result_option_panel4.setVisibility(View.VISIBLE); - tvOption4.setText(getString(R.string.weian)); - tvValue4.setText(String.valueOf(voteInfo.resultInfo.num3) + getString(R.string.piao)); - - tvValue1.setText(String.valueOf(voteInfo.resultInfo.num4) + getString(R.string.piao)); - tvValue2.setText(String.valueOf(voteInfo.resultInfo.num5) + getString(R.string.piao)); - tvValue3.setText(String.valueOf(voteInfo.resultInfo.num6) + getString(R.string.piao)); - - if (fenmu > 0 && fenmu != 0xffff) { - - double pzc = voteInfo.resultInfo.num4 * 1.0 / fenmu * 100; - String strOpt1 = formatDoubleToString(pzc, xiaoShuWei, false); - - double pfd = voteInfo.resultInfo.num5 * 1.0 / fenmu * 100; - String strOpt2 = formatDoubleToString(pfd, xiaoShuWei, false); - - double opt3 = voteInfo.resultInfo.num6 * 1.0 / fenmu * 100; - String strOpt3 = formatDoubleToString(opt3, xiaoShuWei, false); - - double opt4 = voteInfo.resultInfo.num3 * 1.0 / fenmu * 100; - String strOpt4 = formatDoubleToString(opt4, xiaoShuWei, false); - - tvValue1.setText(String.valueOf(voteInfo.resultInfo.num4) + " (" + strOpt1 + "%)"); - tvValue2.setText(String.valueOf(voteInfo.resultInfo.num5) + " (" + strOpt2 + "%)"); - tvValue3.setText(String.valueOf(voteInfo.resultInfo.num6) + " (" + strOpt3 + "%)"); - tvValue4.setText(String.valueOf(voteInfo.resultInfo.num3) + " (" + strOpt4 + "%)"); - } - - if (voteInfo.resultInfo.num4 == 0xffff) { - tvOption1.setText(""); - tvValue1.setText(String.valueOf("")); - } - if (voteInfo.resultInfo.num5 == 0xffff) { - tvOption2.setText(""); - tvValue2.setText(String.valueOf("")); - } - if (voteInfo.resultInfo.num6 == 0xffff) { - tvOption3.setText(""); - tvValue3.setText(String.valueOf("")); - } - if (voteInfo.resultInfo.num3 == 0xffff) { - tvOption4.setText(""); - tvValue4.setText(String.valueOf("")); - } - - } - } - - private void setView(int pos,int digiters,int bitNum,int type){ - if (options.length >= 1) { - int value1; - if(bitNum==0){ - value1 = (data[pos++]) & 0xff; - }else{ - value1 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel1.setVisibility(View.VISIBLE); - tvOption1.setText(options[0]); - TextViewUtils.adjustTvTextSize(tvValue1,350,String.valueOf(value1)); - - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value1 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue1,350,String.valueOf(value1) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value1 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue1,350,String.valueOf(value1) + " (" + szc + "%)"); - } - } - }else { - if(notVote!=0xff){ - tvOption1.setText(getString(R.string.weian)); - tvValue1.setText(String.valueOf(notVote)); - } - return; - } - - if (options.length >= 2) { - int value2; - if(bitNum==0){ - value2 = (data[pos++]) & 0xff; - }else{ - value2 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel2.setVisibility(View.VISIBLE); - tvOption2.setText(options[1]); - TextViewUtils.adjustTvTextSize(tvValue2,350,String.valueOf(value2)); - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value2 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue2,350,String.valueOf(value2) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value2 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue2,350,String.valueOf(value2) + " (" + szc + "%)"); - } - } - }else { - if(notVote!=0xff) { - tvOption2.setText(getString(R.string.weian)); - tvValue2.setText(String.valueOf(notVote)); - } - return; - } - - if (options.length >= 3) { - int value3; - if(bitNum==0){ - value3 = (data[pos++]) & 0xff; - }else{ - value3 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel3.setVisibility(View.VISIBLE); - tvOption3.setText(options[2]); - TextViewUtils.adjustTvTextSize(tvValue3,350,String.valueOf(value3)); - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value3 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue3,350,String.valueOf(value3) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value3 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue3,350,String.valueOf(value3) + " (" + szc + "%)"); - } - } - }else { - if(notVote!=0xff) { - tvOption3.setText(getString(R.string.weian)); - tvValue3.setText(String.valueOf(notVote)); - } - return; - } - - if (options.length >= 4) { - int value4; - if(bitNum==0){ - value4 = (data[pos++]) & 0xff; - }else{ - value4 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel4.setVisibility(View.VISIBLE); - tvOption4.setText(options[3]); - TextViewUtils.adjustTvTextSize(tvValue4,350,String.valueOf(value4)); - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value4 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue4,350,String.valueOf(value4) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value4 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue4,350,String.valueOf(value4) + " (" + szc + "%)"); - } - } - }else { - if(notVote!=0xff) { - tvOption4.setText(getString(R.string.weian)); - tvValue4.setText(String.valueOf(notVote)); - } - return; - } - - if (options.length >= 5) { - int value5 ; - if(bitNum==0){ - value5 = (data[pos++]) & 0xff; - }else{ - value5 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel5.setVisibility(View.VISIBLE); - tvOption5.setText(options[4]); - TextViewUtils.adjustTvTextSize(tvValue5,350,String.valueOf(value5)); - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value5 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue5,350,String.valueOf(value5) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value5 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue5,350,String.valueOf(value5) + " (" + szc + "%)"); - } - } - }else { - if(notVote!=0xff) { - tvOption5.setText(getString(R.string.weian)); - tvValue5.setText(String.valueOf(notVote)); - } - return; - } - - if (options.length >= 6) { - int value6; - if(bitNum==0){ - value6 = (data[pos++]) & 0xff; - }else{ - value6 = (data[pos++] << 8 | data[pos++]) & 0xffff; - } - fragment_result_option_panel6.setVisibility(View.VISIBLE); - tvOption6.setText(options[5]); - TextViewUtils.adjustTvTextSize(tvValue6,350,String.valueOf(value6)); - if(type==1){ - //分母 - if ((fenmu > 0 && fenmu != 0xff)) { - double pzc = value6 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue6,350,String.valueOf(value6) + " (" + szc + "%)"); - } - }else{ - //分母 - if ((fenmu > 0 && fenmu != 0xffff)) { - double pzc = value6 * 1.0 / fenmu * 100; - String szc = formatDoubleToString(pzc, digiters, false); - TextViewUtils.adjustTvTextSize(tvValue6,350,String.valueOf(value6) + " (" + szc + "%)"); - } - } - - if(notVote!=0xff) { - tvOption7.setText(getString(R.string.weian)); - tvValue7.setText(String.valueOf(notVote)); - } - }else { - if(notVote!=0xff) { - tvOption6.setText(getString(R.string.weian)); - tvValue6.setText(String.valueOf(notVote)); - } - return; - } - } - - public static String toDBC(String input) { - char[] c = input.toCharArray(); - for (int i = 0; i < c.length; i++) { - if (c[i] == 12288) { - c[i] = (char) 32; - continue; - } - if (c[i] > 65280 && c[i] < 65375) - c[i] = (char) (c[i] - 65248); - } - return new String(c); - } - - - private void showResultByPage() { - Log.d("ResultVoteFragment", "page:" + page + " resultStr:" + resultStr); - if (options != null) { - if (options.length > 0) { - tvOption1.setText(options[0]); - } - if (options.length > 1) { - tvOption2.setText(options[1]); - } - if (options.length == 2) { - tvOption3.setVisibility(View.GONE); - tvValue3.setVisibility(View.GONE); - } else if (options.length > 2) { - tvOption3.setText(options[2]); - } - } - if (resultStr == null || resultStr.length() == 0) { - return; - } - - if (subInfo == null) { - Log.d(TAG, "subInfo is null"); - MultiTitleItem it = subInfo.get(page); - tvBillTitle.setText(it.title); - } - - String[] results = resultStr.split(";"); - Log.d("ResultVoteFragment", "results:" + results[page]); - - String[] ary = results[page].split(","); - if (ary.length > 0) { - tvValue1.setText(ary[0]); - } - if (ary.length > 1) { - tvValue2.setText(ary[1]); - } - - if (ary.length > 2) { - tvValue3.setText(ary[2]); - } - - if (ary.length > options.length) { - if (ary[ary.length - 1].equals("0")) { - tvMemo.setText(getString(R.string.no_pass)); - } else { - tvMemo.setText(getString(R.string.pass)); - } - } - - } - - - public static String formatDoubleToString(double value, Integer digits, boolean remove) { +import com.sunvote.util.LogUtil; +import com.sunvote.xpadapp.R; +import com.sunvote.xpadapp.base.BaseFragment; +import com.sunvote.xpadcomm.XPadApiInterface; - if (value == 0 || value == 100) { - DecimalFormat df = new DecimalFormat("0"); - return df.format(value); - } +import java.text.DecimalFormat; - if (digits == null || digits < 0) { - return String.valueOf(value); - } else if (digits == 0) { - DecimalFormat df = new DecimalFormat("0"); - return df.format(value); - } else { - String temp = "0"; - if (remove) { - temp = "#"; - } - StringBuffer buffer = new StringBuffer("0."); - for (int i = 0; i < digits; i++) { - buffer.append(temp); - } - DecimalFormat df = new DecimalFormat(buffer.toString()); - return df.format(value); - } - } +public class ResultVoteFragment extends BaseFragment { + private static String TAG = ResultVoteFragment.class.getSimpleName(); + private XPadApiInterface.VoteInfo voteInfo; + private TextView yingdaoresult; + private TextView shidaoresult; + // 表決结果 + private TextView fragmentResultMemo; + private TextView fragmentMemo; + // + private LinearLayout tResult; + private LinearLayout dResult; + private LinearLayout pResult; + + public static String formatDoubleToString(double value, Integer digits, boolean remove) { + if (value == 0 || value == 100) { + DecimalFormat df = new DecimalFormat("0"); + return df.format(value); + } + + if (digits == null || digits < 0) { + return String.valueOf(value); + } else if (digits == 0) { + DecimalFormat df = new DecimalFormat("0"); + return df.format(value); + } else { + String temp = "0"; + if (remove) { + temp = "#"; + } + StringBuffer buffer = new StringBuffer("0."); + for (int i = 0; i < digits; i++) { + buffer.append(temp); + } + DecimalFormat df = new DecimalFormat(buffer.toString()); + return df.format(value); + } + } + + public void setVoteInfo(XPadApiInterface.VoteInfo voteInfo) { + this.voteInfo = voteInfo; + } + + private View createView(String txt,int color) { + TextView tv1 = new TextView(getActivity()); + ViewGroup.LayoutParams vlp = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + tv1.setLayoutParams(vlp);//设置TextView的布局 + tv1.setText(txt); + tv1.setGravity(Gravity.CENTER); + + tv1.setTextSize(25); + tv1.setTextColor(color); + return tv1; + } + + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View root = inflater.inflate(R.layout.fragment_result_vote, container, false); + root.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + } + }); + yingdaoresult = root.findViewById(R.id.yingdaoresult); + shidaoresult = root.findViewById(R.id.shidaoresult); + fragmentResultMemo = root.findViewById(R.id.fragment_result_memo); + fragmentMemo = root.findViewById(R.id.fragment_memo); + + tResult = root.findViewById(R.id.t_result); + dResult = root.findViewById(R.id.d_result); + pResult = root.findViewById(R.id.p_result); + showResult(); + return root; + } + + private void showResult() { + int pass = voteInfo.resultInfo.bits & 0xF; + int xiaoShuWei = (voteInfo.resultInfo.bits >> 4) & 0xF; + int fenmu = voteInfo.resultInfo.num0; + LogUtil.d(TAG, "xiaoshu:" + xiaoShuWei + " fenmu:" + fenmu); + tResult.removeAllViews(); + dResult.removeAllViews(); + pResult.removeAllViews(); + + if (voteInfo.resultInfo.num1 != 0xffff) { + yingdaoresult.setText("" + voteInfo.resultInfo.num1); + } + if (voteInfo.resultInfo.num2 != 0xffff) { + shidaoresult.setText("" + voteInfo.resultInfo.num2); + } + if (pass == 0xf) { + fragmentResultMemo.setText(""); + } else if (pass == 0) { + fragmentResultMemo.setText(getString(R.string.no_pass)); + } else { + fragmentResultMemo.setText(getString(R.string.pass)); + } + + LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.WRAP_CONTENT,1.0f); + if (voteInfo.resultInfo.resultType == 1) { + fragmentMemo.setText(getString(R.string.biaojue_result)); + String szc = "" ; + String sfd = "" ; + String swa = "" ; + if (fenmu > 0 && fenmu != 0xffff) { + double pzc = voteInfo.resultInfo.num4 * 1.0 / fenmu * 100; + szc = formatDoubleToString(pzc, xiaoShuWei, false); + double pfd = voteInfo.resultInfo.num5 * 1.0 / fenmu * 100; + sfd = formatDoubleToString(pfd, xiaoShuWei, false); + double pwa = voteInfo.resultInfo.num3 * 1.0 / fenmu * 100; + swa = formatDoubleToString(pwa, xiaoShuWei, false); + } + if (voteInfo.resultInfo.num4 != 0xffff) { + tResult.addView(createView(getString(R.string.agree),Color.YELLOW),lp); + dResult.addView(createView("" + voteInfo.resultInfo.num4,Color.WHITE),lp); + pResult.addView(createView( szc + "%",Color.WHITE),lp); + + } + if (voteInfo.resultInfo.num5 != 0xffff) { + tResult.addView(createView(getString(R.string.oppose),Color.YELLOW),lp); + dResult.addView(createView("" + voteInfo.resultInfo.num5,Color.WHITE),lp); + pResult.addView(createView( sfd + "%",Color.WHITE),lp); + } + if (voteInfo.resultInfo.num3 != 0xffff) { + tResult.addView(createView(getString(R.string.weian),Color.YELLOW),lp); + dResult.addView(createView("" + voteInfo.resultInfo.num3,Color.WHITE),lp); + pResult.addView(createView( swa + "%",Color.WHITE),lp); + } + } else { + String szc = ""; + String sfd = ""; + String swa = ""; + if (fenmu > 0 && fenmu != 0xffff) { + double pzc = voteInfo.resultInfo.num4 * 1.0 / fenmu * 100; + szc = formatDoubleToString(pzc, xiaoShuWei, false); + double pfd = voteInfo.resultInfo.num5 * 1.0 / fenmu * 100; + sfd = formatDoubleToString(pfd, xiaoShuWei, false); + double pwa = voteInfo.resultInfo.num6 * 1.0 / fenmu * 100; + swa = formatDoubleToString(pwa, xiaoShuWei, false); + } + if (voteInfo.resultInfo.num4 != 0xffff) { + dResult.addView(createView("" + voteInfo.resultInfo.num4,Color.WHITE), lp); + pResult.addView(createView(szc + "%",Color.WHITE), lp); + } + if (voteInfo.resultInfo.num5 != 0xffff) { + dResult.addView(createView("" + voteInfo.resultInfo.num5,Color.WHITE), lp); + pResult.addView(createView(sfd + "%",Color.WHITE), lp); + } + if (voteInfo.resultInfo.num6 != 0xffff) { + dResult.addView(createView("" + voteInfo.resultInfo.num6,Color.WHITE), lp); + pResult.addView(createView(swa + "%",Color.WHITE), lp); + } + if (voteInfo.resultInfo.resultType == 2) { + fragmentMemo.setText(getString(R.string.biaojue_result)); + if (voteInfo.resultInfo.num4 != 0xffff) { + tResult.addView(createView(getString(R.string.agree),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num5 != 0xffff) { + tResult.addView(createView(getString(R.string.oppose),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num6 != 0xffff) { + tResult.addView(createView(getString(R.string.abstant),Color.YELLOW), lp); + } + } else if (voteInfo.resultInfo.resultType == 4) { + fragmentMemo.setText(getString(R.string.ceping_result)); + if (voteInfo.resultInfo.num4 != 0xffff) { + tResult.addView(createView(getString(R.string.manyi),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num5 != 0xffff) { + tResult.addView(createView(getString(R.string.jbmanyi),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num6 != 0xffff) { + tResult.addView(createView(getString(R.string.bumanyi),Color.YELLOW), lp); + } + } else if (voteInfo.resultInfo.resultType == 12) { + fragmentMemo.setText(getString(R.string.ceping_result)); + if (voteInfo.resultInfo.num4 != 0xffff) { + tResult.addView(createView(getString(R.string.manyi),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num5 != 0xffff) { + tResult.addView(createView(getString(R.string.bumanyi),Color.YELLOW), lp); + } + if (voteInfo.resultInfo.num6 != 0xffff) { + tResult.addView(createView(getString(R.string.fcbumanyi),Color.YELLOW), lp); + } + } + if(voteInfo.resultInfo.num3 != 0xffff){ + double opt4 = voteInfo.resultInfo.num3 * 1.0 / fenmu * 100; + String strOpt4 = formatDoubleToString(opt4, xiaoShuWei, false); + tResult.addView(createView(getString(R.string.weian),Color.YELLOW),lp); + dResult.addView(createView("" +voteInfo.resultInfo.num3 ,Color.WHITE),lp); + pResult.addView(createView(strOpt4 + "%",Color.WHITE),lp); + } + } + } } diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java new file mode 100644 index 0000000..84d044b --- /dev/null +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java @@ -0,0 +1,32 @@ +package com.sunvote.xpadapp.fragments; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.sunvote.xpadapp.R; +import com.sunvote.xpadapp.base.BaseFragment; +import com.sunvote.xpadcomm.XPadApiInterface.VoteInfo; + +public class SinginResultFragment extends BaseFragment { + + private VoteInfo.ResultInfo resultInfo; + + public void setResultInfo(VoteInfo.ResultInfo resultInfo) { + this.resultInfo = resultInfo; + } + + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_signin_result_vote, container, false); + TextView shidaoresult = view.findViewById(R.id.shidaoresult); + TextView yingdaoresult = view.findViewById(R.id.yingdaoresult); + TextView weidaoresult = view.findViewById(R.id.weidaoresult); + shidaoresult.setText("" + resultInfo.num3); + yingdaoresult.setText("" + resultInfo.num2); + weidaoresult.setText("" + resultInfo.num1); + return view; + } + +} diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java index ed3939f..f7c786b 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java @@ -113,7 +113,6 @@ public class SingleTitleFragment extends BaseFragment implements ContentVoteOnBa }else{ options = voteOptions[1].split("/"); } -// Log.d(TAG, "options:" + options.toString()); } @Override diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/UserResultVoteFragment.java b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/UserResultVoteFragment.java new file mode 100644 index 0000000..3864dd4 --- /dev/null +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/UserResultVoteFragment.java @@ -0,0 +1,193 @@ +package com.sunvote.xpadapp.fragments; + +import android.graphics.Color; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.sunvote.xpadapp.MainActivity; +import com.sunvote.xpadapp.R; +import com.sunvote.xpadapp.base.BaseFragment; +import com.sunvote.xpadapp.db.modal.BillInfo; +import com.sunvote.xpadapp.db.modal.MultiTitleItem; + +import java.text.DecimalFormat; +import java.util.ArrayList; + +public class UserResultVoteFragment extends BaseFragment { + + private byte[] data; + private String[] options; + + public void setData(byte[] data) { + this.data = data; + } + + public void setOptions(String[] options) { + this.options = options; + } + + private TextView yingdaoresult; + private TextView shidaoresult; + // 表決结果 + private TextView fragmentResultMemo; + private TextView fragmentMemo; + // + private LinearLayout tResult; + private LinearLayout dResult; + private LinearLayout pResult; + + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View root = inflater.inflate(R.layout.fragment_result_vote, container, false); + yingdaoresult = root.findViewById(R.id.yingdaoresult); + shidaoresult = root.findViewById(R.id.shidaoresult); + fragmentResultMemo = root.findViewById(R.id.fragment_result_memo); + fragmentMemo = root.findViewById(R.id.fragment_memo); + + tResult = root.findViewById(R.id.t_result); + dResult = root.findViewById(R.id.d_result); + pResult = root.findViewById(R.id.p_result); + showResult(); + return root; + } + + private View createView(String txt,int color) { + TextView tv1 = new TextView(getActivity()); + ViewGroup.LayoutParams vlp = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT); + tv1.setLayoutParams(vlp);//设置TextView的布局 + tv1.setText(txt); + tv1.setGravity(Gravity.CENTER); + + tv1.setTextSize(25); + tv1.setTextColor(color); + return tv1; + } + + int fenmu,goToBe,goTo,notVote; + + + private void showResult() { + int bitNum = data[2] & 0xf; + int digiters = data[2] >> 4 & 0xf; + int voteNo = data[3] & 0xff; + int resultSelectModel = data[4] & 0xff; //表决结果 + if (bitNum == 0) { //单字节数值 + fenmu = data[5] & 0xff; + goToBe= data[6] & 0xff; + goTo= data[7] & 0xff; + notVote= data[8] & 0xff; + int pos =9; + int i = pos; + for (; i < data.length; i++) { + if (pos == data.length - 1) { + break; + } + setView(pos,digiters,bitNum,1); + } + if (goToBe != 0xff) { + yingdaoresult.setText("" + goToBe); + } + if (goTo != 0xff) { + shidaoresult.setText("" + goTo); + } + if (resultSelectModel != 0xFF) { + if(options!=null){ + fragmentResultMemo.setText(options[resultSelectModel]); + } + } + } else { + fenmu = (data[5] <<8 | data[6]) & 0xffff; + goToBe = (data[7] << 8 | data[8]) & 0xffff; + goTo = (data[9] << 8 | data[10]) & 0xffff; + notVote= (data[11] << 8 | data[12]) & 0xffff; + + int pos = 13; + int i = pos; + for (; i < data.length; i++) { + if (pos == data.length - 1) { + break; + } + setView(pos,digiters,bitNum,2); + } + if (goToBe != 0xff) { + yingdaoresult.setText("" + goToBe); + } + if (goTo != 0xff) { + shidaoresult.setText("" + goTo); + } + if (resultSelectModel != 0xFF) { + if(options!=null){ + fragmentResultMemo.setText(options[resultSelectModel]); + } + } + } + } + + private void setView(int pos, int digiters, int bitNum, int type) { + LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.WRAP_CONTENT,1.0f); + for(int i = 1; i <= options.length ; i++) { + if (options.length >= i) { + int value1; + if (bitNum == 0) { + value1 = (data[pos++]) & 0xff; + } else { + value1 = (data[pos++] << 8 | data[pos++]) & 0xffff; + } + tResult.addView(createView(options[i - 1], Color.YELLOW), lp); + dResult.addView(createView("" + value1, Color.WHITE), lp); + if (type == 1) { + //分母 + if ((fenmu > 0 && fenmu != 0xff)) { + double pzc = value1 * 1.0 / fenmu * 100; + String szc = formatDoubleToString(pzc, digiters, false); + pResult.addView(createView(szc + "%", Color.WHITE), lp); + } + } else { + //分母 + if ((fenmu > 0 && fenmu != 0xffff)) { + double pzc = value1 * 1.0 / fenmu * 100; + String szc = formatDoubleToString(pzc, digiters, false); + pResult.addView(createView(szc + "%", Color.WHITE), lp); + } + } + } + } + if (notVote != 0xff) { + tResult.addView(createView(getString(R.string.weian), Color.YELLOW), lp); + dResult.addView(createView("" + notVote, Color.WHITE), lp); + pResult.addView(createView("0%", Color.WHITE), lp); + } + } + public static String formatDoubleToString(double value, Integer digits, boolean remove) { + + if (value == 0 || value == 100) { + DecimalFormat df = new DecimalFormat("0"); + return df.format(value); + } + + if (digits == null || digits < 0) { + return String.valueOf(value); + } else if (digits == 0) { + DecimalFormat df = new DecimalFormat("0"); + return df.format(value); + } else { + String temp = "0"; + if (remove) { + temp = "#"; + } + StringBuffer buffer = new StringBuffer("0."); + for (int i = 0; i < digits; i++) { + buffer.append(temp); + } + DecimalFormat df = new DecimalFormat(buffer.toString()); + return df.format(value); + } + } + +} diff --git a/C5/app/src/main/res/drawable-hdpi/rendavote.xml b/C5/app/src/main/res/drawable-hdpi/rendavote.xml new file mode 100644 index 0000000..8163b08 --- /dev/null +++ b/C5/app/src/main/res/drawable-hdpi/rendavote.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/C5/app/src/main/res/drawable/bgpic_1.png b/C5/app/src/main/res/drawable/bgpic_1.png new file mode 100644 index 0000000..a8696f6 Binary files /dev/null and b/C5/app/src/main/res/drawable/bgpic_1.png differ diff --git a/C5/app/src/main/res/drawable/bgpic_2.png b/C5/app/src/main/res/drawable/bgpic_2.png new file mode 100644 index 0000000..09212ea Binary files /dev/null and b/C5/app/src/main/res/drawable/bgpic_2.png differ diff --git a/C5/app/src/main/res/drawable/bgpic_3.png b/C5/app/src/main/res/drawable/bgpic_3.png new file mode 100644 index 0000000..71dac3c Binary files /dev/null and b/C5/app/src/main/res/drawable/bgpic_3.png differ diff --git a/C5/app/src/main/res/drawable/bgpic_4.png b/C5/app/src/main/res/drawable/bgpic_4.png new file mode 100644 index 0000000..e8528b3 Binary files /dev/null and b/C5/app/src/main/res/drawable/bgpic_4.png differ diff --git a/C5/app/src/main/res/layout-land-1223x800/activity_main.xml b/C5/app/src/main/res/layout-land-1223x800/activity_main.xml deleted file mode 100644 index e120ef3..0000000 --- a/C5/app/src/main/res/layout-land-1223x800/activity_main.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/C5/app/src/main/res/layout-land-1223x800/activity_pdf.xml b/C5/app/src/main/res/layout-land-1223x800/activity_pdf.xml deleted file mode 100644 index 3509b84..0000000 --- a/C5/app/src/main/res/layout-land-1223x800/activity_pdf.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/C5/app/src/main/res/layout-land-1223x800/activity_qrcode_connect_wifi.xml b/C5/app/src/main/res/layout-land-1223x800/activity_qrcode_connect_wifi.xml deleted file mode 100644 index c1debdd..0000000 --- a/C5/app/src/main/res/layout-land-1223x800/activity_qrcode_connect_wifi.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/C5/app/src/main/res/layout-land-1223x800/dialog_service.xml b/C5/app/src/main/res/layout-land-1223x800/dialog_service.xml deleted file mode 100644 index a4381f7..0000000 --- a/C5/app/src/main/res/layout-land-1223x800/dialog_service.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -