From e129be23017455ddcadb90fb84c40d5110e58500 Mon Sep 17 00:00:00 2001 From: Elvis Date: Wed, 13 Mar 2019 16:09:48 +0800 Subject: [PATCH] 添加一些修改选项 --- C5/app/src/main/java/com/sunvote/xpadapp/fragments/SigninFragment.java | 6 ++++++ C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java | 2 +- C5/app/src/main/java/com/sunvote/xpadapp/fragments/SingleTitleFragment.java | 15 +++++++++------ C5/app/src/main/java/com/sunvote/xpadcomm/AntZipUtil.java | 1 + C5/app/src/main/java/com/sunvote/xpadcomm/DownloadFileModule.java | 16 ++++++++++++++-- C5/app/src/main/res/drawable-hdpi/rendavote.xml | 2 +- C5/app/src/main/res/drawable/bgpic_1.png | Bin 293149 -> 0 bytes C5/app/src/main/res/drawable/btn_signin_disable.xml | 4 ++++ C5/app/src/main/res/drawable/btn_signin_enable.xml | 4 ++++ C5/app/src/main/res/drawable/signin_selector.xml | 8 ++++---- C5/app/src/main/res/drawable/submitted.png | Bin 0 -> 163150 bytes C5/app/src/main/res/layout/fragment_custom_election.xml | 4 ++-- C5/app/src/main/res/layout/fragment_election.xml | 4 ++-- C5/app/src/main/res/layout/fragment_offline.xml | 3 +-- C5/app/src/main/res/layout/fragment_signin.xml | 3 ++- C5/app/src/main/res/layout/fragment_signin_result_vote.xml | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------ C5/app/src/main/res/layout/fragment_singlevote.xml | 75 ++++++++++++++++++++++++++++++++++++--------------------------------------- C5/app/src/main/res/values/strings.xml | 6 +++--- C5/xpadprotocal/build/libs/xpadprotocal.jar | Bin 76978 -> 0 bytes 19 files changed, 189 insertions(+), 123 deletions(-) create mode 100644 C5/app/src/main/res/drawable/btn_signin_disable.xml create mode 100644 C5/app/src/main/res/drawable/btn_signin_enable.xml create mode 100644 C5/app/src/main/res/drawable/submitted.png diff --git a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SigninFragment.java b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SigninFragment.java index e6e5312..c176029 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SigninFragment.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SigninFragment.java @@ -1,5 +1,6 @@ package com.sunvote.xpadapp.fragments; +import android.graphics.Color; import android.os.Bundle; import android.os.Message; import android.util.Log; @@ -46,6 +47,7 @@ public class SigninFragment extends BaseFragment { btnSignin = (Button)view.findViewById(R.id.signin_btnSign); btnSignin.setEnabled(false); + btnSignin.setTextColor(Color.parseColor("#c75d3a")); btnSignin.setOnClickListener(new OnClickListener() { @Override @@ -68,9 +70,11 @@ public class SigninFragment extends BaseFragment { public void onVoteEvent( VoteInfo info) { if(info.mode ==XPadApi.VoteType_Signin){ btnSignin.setEnabled(true); + btnSignin.setTextColor(Color.RED); }else if(info.mode == XPadApi.VoteType_Stop){ btnSignin.setEnabled(false); + btnSignin.setTextColor(Color.parseColor("#c75d3a")); } if(SharedPreferencesUtil.getData(getActivity(),"signin","").equals("" + voteInfo.dataPos)){ LogUtil.i(TAG,"该dataPos已签到。"); @@ -85,6 +89,7 @@ public class SigninFragment extends BaseFragment { public void onVoteSubmitSuccess() { tv.setText(getString(R.string.signined)); btnSignin.setEnabled(false); + btnSignin.setTextColor(Color.parseColor("#c75d3a")); // bgView.setBackgroundColor(0xFF009966); SharedPreferencesUtil.saveData(getActivity(),"signin",""+voteInfo.dataPos); ((MainActivity)getActivity()).myHandler.sendEmptyMessageDelayed(MainActivity.MSG_DELAY_TO_VIEW,2000); @@ -94,6 +99,7 @@ public class SigninFragment extends BaseFragment { super.onVoteSubmitError(); tv.setText(getString(R.string.please_signin)); btnSignin.setEnabled(true); + btnSignin.setTextColor(Color.RED); } } 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 index d3d0fd7..6f63b0a 100644 --- a/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java +++ b/C5/app/src/main/java/com/sunvote/xpadapp/fragments/SinginResultFragment.java @@ -31,7 +31,7 @@ public class SinginResultFragment extends BaseFragment { shidaoresult.setText("" + resultInfo.num3); yingdaoresult.setText("" + resultInfo.num2); weidaoresult.setText("" + resultInfo.num1); - ((MainActivity)getActivity()).setBackgroundColor(Color.parseColor("#042160")); + ((MainActivity)getActivity()).setBackgroundColor(Color.parseColor("#042148")); if ((resultInfo.bits & 0xF) == 0xF) { result.setText(""); } else if ((resultInfo.bits & 0xF) == 0) { 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 d0f018b..06de4af 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 @@ -141,14 +141,15 @@ public class SingleTitleFragment extends BaseFragment implements ContentVoteOnBa tvTitle.setText(bill.title); } - if(voteInfo.mode1_msgType < 2){ + if(voteInfo.mode1_msgType <= 2){ votetype.setText(R.string.yianbiaojue); } - if(voteInfo.mode1_msgType == 2){ - votetype.setText(R.string.yianxuanju); - } if(voteInfo.mode1_msgType > 2){ - votetype.setText(R.string.yianceping); + if(voteInfo.mode4 > 2){ + votetype.setText(R.string.yianceping); + }else{ + votetype.setText(R.string.yianbiaojue); + } } tvTitle.setOnClickListener(new OnClickListener() { @@ -538,7 +539,9 @@ public class SingleTitleFragment extends BaseFragment implements ContentVoteOnBa if (voteInfo.mode2_modify == 1) { showModify(); singlevoteTvTipsLayout.setVisibility(View.VISIBLE); - tvTips.setText(getString(R.string.submited)); +// tvTips.setText(getString(R.string.submited)); + tvTips.setText(""); + tvTips.setBackgroundResource(R.drawable.submitted); } else { disableVote(); singlevoteTvTipsLayout.setVisibility(View.VISIBLE); diff --git a/C5/app/src/main/java/com/sunvote/xpadcomm/AntZipUtil.java b/C5/app/src/main/java/com/sunvote/xpadcomm/AntZipUtil.java index a88bc2e..979abc0 100644 --- a/C5/app/src/main/java/com/sunvote/xpadcomm/AntZipUtil.java +++ b/C5/app/src/main/java/com/sunvote/xpadcomm/AntZipUtil.java @@ -329,6 +329,7 @@ public class AntZipUtil { } File f = new File(outputDirectory + File.separator + zipEntry.getName()); + f.deleteOnExit(); f.createNewFile(); InputStream in = zipFile.getInputStream(zipEntry); FileOutputStream out = new FileOutputStream(f); diff --git a/C5/app/src/main/java/com/sunvote/xpadcomm/DownloadFileModule.java b/C5/app/src/main/java/com/sunvote/xpadcomm/DownloadFileModule.java index f657d36..a3956d9 100644 --- a/C5/app/src/main/java/com/sunvote/xpadcomm/DownloadFileModule.java +++ b/C5/app/src/main/java/com/sunvote/xpadcomm/DownloadFileModule.java @@ -160,9 +160,21 @@ public class DownloadFileModule { private void unzip(){ if (fileName.endsWith(".zip") || fileName.endsWith(".rar") || fileName.endsWith(".7z")) { - String outDirName = fileName.substring(0, fileName.length() - 4); + String outDirName = ""; + boolean isAdd = false; + if(fileName.startsWith("q")){ + isAdd = true; + } + if(isAdd){ + outDirName = fileName.substring(1,fileName.length() - 4); + }else{ + outDirName = fileName.substring(0, fileName.length() - 4); + } String uzipDirPath = FILEPATH + "/" + outDirName; - createAndCleanFolder(uzipDirPath); + + if(!isAdd){ + createAndCleanFolder(uzipDirPath); + } try { boolean ret = AntZipUtil.unZip(FILEPATH + fileName, uzipDirPath); if (fileReciverInterface != null) { diff --git a/C5/app/src/main/res/drawable-hdpi/rendavote.xml b/C5/app/src/main/res/drawable-hdpi/rendavote.xml index 8163b08..8bb16f4 100644 --- a/C5/app/src/main/res/drawable-hdpi/rendavote.xml +++ b/C5/app/src/main/res/drawable-hdpi/rendavote.xml @@ -8,5 +8,5 @@ android:left="5dp" android:right="5dp" android:top="5dp" /> - + \ 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 index a8696f6..cfc735a 100644 Binary files a/C5/app/src/main/res/drawable/bgpic_1.png and b/C5/app/src/main/res/drawable/bgpic_1.png differ diff --git a/C5/app/src/main/res/drawable/btn_signin_disable.xml b/C5/app/src/main/res/drawable/btn_signin_disable.xml new file mode 100644 index 0000000..d16c5ab --- /dev/null +++ b/C5/app/src/main/res/drawable/btn_signin_disable.xml @@ -0,0 +1,4 @@ + + + diff --git a/C5/app/src/main/res/drawable/btn_signin_enable.xml b/C5/app/src/main/res/drawable/btn_signin_enable.xml new file mode 100644 index 0000000..99138b7 --- /dev/null +++ b/C5/app/src/main/res/drawable/btn_signin_enable.xml @@ -0,0 +1,4 @@ + + + diff --git a/C5/app/src/main/res/drawable/signin_selector.xml b/C5/app/src/main/res/drawable/signin_selector.xml index cd764e3..d085e8e 100644 --- a/C5/app/src/main/res/drawable/signin_selector.xml +++ b/C5/app/src/main/res/drawable/signin_selector.xml @@ -3,12 +3,12 @@ - - + + - + - + diff --git a/C5/app/src/main/res/drawable/submitted.png b/C5/app/src/main/res/drawable/submitted.png new file mode 100644 index 0000000..94c85bb Binary files /dev/null and b/C5/app/src/main/res/drawable/submitted.png differ diff --git a/C5/app/src/main/res/layout/fragment_custom_election.xml b/C5/app/src/main/res/layout/fragment_custom_election.xml index 948b41f..46143e3 100644 --- a/C5/app/src/main/res/layout/fragment_custom_election.xml +++ b/C5/app/src/main/res/layout/fragment_custom_election.xml @@ -232,7 +232,7 @@ android:layout_height="@dimen/button_heigh" android:layout_alignParentLeft="true" android:layout_below="@id/singlevote_confirm_textview" - android:layout_marginLeft="@dimen/button_to_left" + android:layout_marginLeft="200dp" android:layout_marginTop="@dimen/button_to_right" android:background="@drawable/btn_signin_d" android:text="@string/cancel" @@ -246,7 +246,7 @@ android:layout_height="@dimen/button_heigh" android:layout_alignParentRight="true" android:layout_below="@id/singlevote_confirm_textview" - android:layout_marginRight="@dimen/button_to_right" + android:layout_marginRight="200dp" android:layout_marginTop="@dimen/button_to_right" android:background="@drawable/btn_agree" android:text="@string/ok" diff --git a/C5/app/src/main/res/layout/fragment_election.xml b/C5/app/src/main/res/layout/fragment_election.xml index 698cda4..79df4c8 100644 --- a/C5/app/src/main/res/layout/fragment_election.xml +++ b/C5/app/src/main/res/layout/fragment_election.xml @@ -380,7 +380,7 @@ android:layout_height="@dimen/button_heigh" android:layout_alignParentLeft="true" android:layout_below="@id/singlevote_confirm_textview" - android:layout_marginLeft="@dimen/button_to_left" + android:layout_marginLeft="200dp" android:layout_marginTop="@dimen/button_to_content" android:background="@drawable/btn_signin_d" android:text="@string/cancel" @@ -394,7 +394,7 @@ android:layout_height="@dimen/button_heigh" android:layout_alignParentRight="true" android:layout_below="@id/singlevote_confirm_textview" - android:layout_marginRight="@dimen/button_to_right" + android:layout_marginRight="200dp" android:layout_marginTop="@dimen/button_to_content" android:background="@drawable/btn_agree" android:text="@string/ok" diff --git a/C5/app/src/main/res/layout/fragment_offline.xml b/C5/app/src/main/res/layout/fragment_offline.xml index a562722..13e6cc1 100644 --- a/C5/app/src/main/res/layout/fragment_offline.xml +++ b/C5/app/src/main/res/layout/fragment_offline.xml @@ -2,8 +2,7 @@ + android:layout_height="match_parent"> diff --git a/C5/app/src/main/res/layout/fragment_signin_result_vote.xml b/C5/app/src/main/res/layout/fragment_signin_result_vote.xml index 7b0339d..329de63 100644 --- a/C5/app/src/main/res/layout/fragment_signin_result_vote.xml +++ b/C5/app/src/main/res/layout/fragment_signin_result_vote.xml @@ -2,121 +2,160 @@ + android:background="#0952B5"> - + android:background="#5386cb" + android:layout_marginTop="54dp"/> - + + android:layout_weight="1" + android:textColor="@color/white" + android:textSize="@dimen/big_text_p4" + android:textStyle="bold" /> + android:layout_weight="1" + android:layout_toRightOf="@+id/yindao" + android:paddingLeft="60dp" + android:gravity="left" + android:text="@string/yindao" + android:textColor="@color/white" + android:textSize="@dimen/big_text_p4" + android:textStyle="bold" /> - + + android:background="#5386CB" /> - + android:gravity="center_vertical" + android:layout_centerHorizontal="true" + > + + + + + + + - + android:textStyle="bold" + android:textSize="@dimen/big_text_p4" /> + - + + android:layout_centerHorizontal="true" + android:layout_marginBottom="40dp" + android:textColor="@color/white" + android:textSize="@dimen/big_text_p5" /> + - \ No newline at end of file diff --git a/C5/app/src/main/res/layout/fragment_singlevote.xml b/C5/app/src/main/res/layout/fragment_singlevote.xml index ba94290..180620d 100644 --- a/C5/app/src/main/res/layout/fragment_singlevote.xml +++ b/C5/app/src/main/res/layout/fragment_singlevote.xml @@ -7,7 +7,7 @@ @@ -109,7 +109,6 @@ android:layout_centerVertical="true" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" - android:layout_marginTop="20dp" android:fadeScrollbars="false" android:fillViewport="false" android:scrollbarAlwaysDrawVerticalTrack="true" @@ -120,6 +119,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" + android:layout_margin="110dp" android:background="@color/white" android:gravity="center" android:scrollbars="vertical" @@ -141,41 +141,38 @@ + > + + + android:alpha="0.9" + android:background="@drawable/voted_empty" + android:rotation="-20" + android:textSize="@dimen/big_text_p1" + android:textStyle="bold" + android:visibility="gone" /> - + 中天会议表决系统 Hello world! Settings - 中天无纸化会议表决系统 - 人大版 + 人大智能平板会议表决系统 + 普及版 正在连接会议网络... 欢迎使用 中天无纸化会议表决系统 @@ -46,7 +46,7 @@ 说 明 结果 请按键签到 - 签到 + 签 到 另选他人 投票 标题 diff --git a/C5/xpadprotocal/build/libs/xpadprotocal.jar b/C5/xpadprotocal/build/libs/xpadprotocal.jar index d4ff4a9..70767cc 100644 Binary files a/C5/xpadprotocal/build/libs/xpadprotocal.jar and b/C5/xpadprotocal/build/libs/xpadprotocal.jar differ -- libgit2 0.21.4