Commit 355448653fc6c039bcb343147f03420f944cafe9
1 parent
75386c29
选举bug 修复
Showing
8 changed files
with
210 additions
and
255 deletions
C5/app/src/main/AndroidManifest.xml
C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java
| ... | ... | @@ -1142,10 +1142,6 @@ public class MainActivity extends BaseActivity implements ComListener { |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | private void setElectionVoteFragment(VoteInfo vote) { |
| 1145 | - /* meetingId=1; | |
| 1146 | - if (dbm == null || !dbm.checkDB() || dbm.confId != meetingId) { | |
| 1147 | - dbm = new DBManager(this, meetingId);// 如果没打开,则打开数据库 | |
| 1148 | - }*/ | |
| 1149 | 1145 | if (dbm == null) { |
| 1150 | 1146 | Toast.makeText(this, "请先开始会议", Toast.LENGTH_LONG).show(); |
| 1151 | 1147 | return; | ... | ... |
C5/app/src/main/java/com/sunvote/xpadapp/db/DBManager.java
| ... | ... | @@ -302,12 +302,6 @@ public class DBManager { |
| 302 | 302 | it.startVote = false; |
| 303 | 303 | titleList.add(it); |
| 304 | 304 | } |
| 305 | - | |
| 306 | - MultiTitleItem it = new MultiTitleItem(); | |
| 307 | - it.result = 0; | |
| 308 | - it.No = 0; | |
| 309 | - it.startVote = false; | |
| 310 | - titleList.add(it); // 另选他人 | |
| 311 | 305 | } catch (Exception e) { |
| 312 | 306 | LogUtil.e(TAG,e); |
| 313 | 307 | } finally { | ... | ... |
C5/app/src/main/java/com/sunvote/xpadapp/fragments/ElectionCustomFragment.java
| ... | ... | @@ -2,6 +2,7 @@ package com.sunvote.xpadapp.fragments; |
| 2 | 2 | |
| 3 | 3 | import android.annotation.SuppressLint; |
| 4 | 4 | import android.content.Context; |
| 5 | +import android.graphics.Color; | |
| 5 | 6 | import android.os.Bundle; |
| 6 | 7 | import android.util.Log; |
| 7 | 8 | import android.view.LayoutInflater; |
| ... | ... | @@ -33,13 +34,13 @@ public class ElectionCustomFragment extends BaseFragment { |
| 33 | 34 | private ArrayList<MultiTitleItem> aryContent = null; |
| 34 | 35 | |
| 35 | 36 | //标题,标题选举信息,提示信息,结果,页码 |
| 36 | - private TextView tvTitle,tvTitleInfo,tvTipInfo,tvResult,tvPage; | |
| 37 | + private TextView tvTitle,tvTitleInfo,tvTipInfo,tvResult; | |
| 37 | 38 | private ListView listview; |
| 38 | 39 | private Button btnConfirm; |
| 39 | 40 | private Button btnModify; |
| 40 | - private Button btnPageUp; | |
| 41 | - private Button btnPageDown; | |
| 42 | - private Button btnPageLast; | |
| 41 | + private View btnPageUp; | |
| 42 | + private View btnPageDown; | |
| 43 | + private View btnPageLast; | |
| 43 | 44 | private Button btnConfirmOK; |
| 44 | 45 | private Button btnConfirmCancel; |
| 45 | 46 | //分页 |
| ... | ... | @@ -85,7 +86,6 @@ public class ElectionCustomFragment extends BaseFragment { |
| 85 | 86 | mAdapter = new MyAdapter(getActivity()); |
| 86 | 87 | listview.setAdapter(mAdapter); |
| 87 | 88 | //显示页 |
| 88 | - tvPage.setText(page + "/" + totalPage); | |
| 89 | 89 | if(voteInfo!=null){ |
| 90 | 90 | tvTitle.setText(bill.title); |
| 91 | 91 | showVote(); |
| ... | ... | @@ -135,7 +135,6 @@ public class ElectionCustomFragment extends BaseFragment { |
| 135 | 135 | public void onClick(View v) { |
| 136 | 136 | page=totalPage; |
| 137 | 137 | listview.setSelection(aryContent.size()); |
| 138 | - tvPage.setText(page + "/" + totalPage); | |
| 139 | 138 | } |
| 140 | 139 | }); |
| 141 | 140 | |
| ... | ... | @@ -198,10 +197,9 @@ public class ElectionCustomFragment extends BaseFragment { |
| 198 | 197 | tvResult =(TextView) view.findViewById(R.id.singlevote_tv_result); |
| 199 | 198 | confirm_panel = (RelativeLayout) view.findViewById(R.id.singlevote_confirm_panel); |
| 200 | 199 | |
| 201 | - tvPage = (TextView) view.findViewById(R.id.election_page); | |
| 202 | - btnPageUp = (Button) view.findViewById(R.id.election_pageup); | |
| 203 | - btnPageDown = (Button) view.findViewById(R.id.election_pagedown); | |
| 204 | - btnPageLast = (Button) view.findViewById(R.id.election_pagelast); | |
| 200 | + btnPageUp = view.findViewById(R.id.election_pageup); | |
| 201 | + btnPageDown = view.findViewById(R.id.election_pagedown); | |
| 202 | + btnPageLast = view.findViewById(R.id.election_pagelast); | |
| 205 | 203 | |
| 206 | 204 | btnConfirm = (Button) view.findViewById(R.id.election_btn_confirm); |
| 207 | 205 | btnModify = (Button)view.findViewById(R.id.election_btn_modify); |
| ... | ... | @@ -370,6 +368,7 @@ public class ElectionCustomFragment extends BaseFragment { |
| 370 | 368 | } else { |
| 371 | 369 | holder = (ViewHolder) convertView.getTag(); |
| 372 | 370 | } |
| 371 | + convertView.setBackgroundColor(position % 2 == 0 ? Color.WHITE : Color.parseColor("#E5E5E5")); | |
| 373 | 372 | holder.tvNum.setText(String.valueOf(it.No)); |
| 374 | 373 | holder.tvName.setText(String.valueOf(it.title)); |
| 375 | 374 | if (it.result == 4) { | ... | ... |
C5/app/src/main/java/com/sunvote/xpadapp/fragments/ElectionFragment.java
| ... | ... | @@ -6,7 +6,10 @@ import android.graphics.Bitmap; |
| 6 | 6 | import android.graphics.BitmapFactory; |
| 7 | 7 | import android.os.Bundle; |
| 8 | 8 | import android.os.Environment; |
| 9 | +import android.text.Spannable; | |
| 10 | +import android.text.SpannableStringBuilder; | |
| 9 | 11 | import android.text.TextUtils; |
| 12 | +import android.text.style.AbsoluteSizeSpan; | |
| 10 | 13 | import android.util.Log; |
| 11 | 14 | import android.view.KeyEvent; |
| 12 | 15 | import android.view.LayoutInflater; |
| ... | ... | @@ -45,6 +48,8 @@ import java.text.SimpleDateFormat; |
| 45 | 48 | import java.util.ArrayList; |
| 46 | 49 | import java.util.Date; |
| 47 | 50 | |
| 51 | +import static com.sunvote.xpadapp.utils.MyStringUtil.replaceBlank; | |
| 52 | + | |
| 48 | 53 | public class ElectionFragment extends BaseFragment { |
| 49 | 54 | private String TAG = "ElectionFragment"; |
| 50 | 55 | private ArrayList<MultiTitleItem> aryContent = null; |
| ... | ... | @@ -85,6 +90,7 @@ public class ElectionFragment extends BaseFragment { |
| 85 | 90 | private String[] options; |
| 86 | 91 | private ImageButton btn_all_ok,btn_all_xx; |
| 87 | 92 | private TextView tv_all_ok,tv_all_xx; |
| 93 | + private View list_election_item_add_btn; | |
| 88 | 94 | private boolean isAllO = false; |
| 89 | 95 | private boolean isAllX = false; |
| 90 | 96 | private StringBuilder voteNameStr = new StringBuilder(""); |
| ... | ... | @@ -126,8 +132,8 @@ public class ElectionFragment extends BaseFragment { |
| 126 | 132 | listview.setAdapter(mAdapter); |
| 127 | 133 | |
| 128 | 134 | tvTitle = (TextView) view.findViewById(R.id.election_title); |
| 129 | - int houxuan = aryContent.size()-1; | |
| 130 | 135 | drawView = (PaletteView) view.findViewById(R.id.draw_view); |
| 136 | + list_election_item_add_btn = view.findViewById(R.id.list_election_item_add_btn); | |
| 131 | 137 | imgClear = (ImageView) view.findViewById(R.id.clear_img); |
| 132 | 138 | tvInfo = (TextView) view.findViewById(R.id.election_info); |
| 133 | 139 | bottomLayout = (RelativeLayout) view.findViewById(R.id.election_pannal_bottom); |
| ... | ... | @@ -140,6 +146,17 @@ public class ElectionFragment extends BaseFragment { |
| 140 | 146 | btn_all_ok =(ImageButton) view.findViewById(R.id.btn_all_ok); |
| 141 | 147 | btn_all_xx=(ImageButton) view.findViewById(R.id.btn_all_xx); |
| 142 | 148 | View btnPageLast = view.findViewById(R.id.election_pagelast); |
| 149 | + list_election_item_add_btn.setOnClickListener(new OnClickListener() { | |
| 150 | + @Override | |
| 151 | + public void onClick(View v) { | |
| 152 | + if(votedCount>= voteInfo.select ){ | |
| 153 | + Toast.makeText(getActivity(), getString(R.string.max_select)+voteInfo.select+getString(R.string.person), Toast.LENGTH_SHORT).show(); | |
| 154 | + return; | |
| 155 | + } | |
| 156 | + drawView.clear(); | |
| 157 | + addOtherLayout.setVisibility(View.VISIBLE); | |
| 158 | + } | |
| 159 | + }); | |
| 143 | 160 | addOtherLayout.setOnClickListener(new OnClickListener() { |
| 144 | 161 | @Override |
| 145 | 162 | public void onClick(View v) { |
| ... | ... | @@ -322,13 +339,12 @@ public class ElectionFragment extends BaseFragment { |
| 322 | 339 | voteNameStr.append(strName).append(","); |
| 323 | 340 | SharedPreferencesUtil.saveData(getActivity(),strName,getNotePath()); |
| 324 | 341 | drawView.saveScreenShot(getNotePath()); |
| 325 | - Log.d(TAG, "add other" + edtOther.getText().toString()); | |
| 326 | 342 | MultiTitleItem it = new MultiTitleItem(); |
| 327 | 343 | it.startVote = true; |
| 328 | 344 | it.No = --otherCount; |
| 329 | 345 | it.result = 1; |
| 330 | 346 | it.title = edtOther.getText().toString(); |
| 331 | - aryContent.add(aryContent.size() - 1, it); | |
| 347 | + aryContent.add(aryContent.size() , it); | |
| 332 | 348 | mAdapter.notifyDataSetChanged(); |
| 333 | 349 | addOtherLayout.setVisibility(View.GONE); |
| 334 | 350 | checkVoted(); |
| ... | ... | @@ -364,7 +380,11 @@ public class ElectionFragment extends BaseFragment { |
| 364 | 380 | //tvInfo.setText(""); |
| 365 | 381 | if(voteInfo!=null){ |
| 366 | 382 | if(voteInfo!=null){ |
| 367 | - tvTitle.setText(bill.title); | |
| 383 | + SpannableStringBuilder text1= new SpannableStringBuilder(replaceBlank(bill.title)); | |
| 384 | + text1.setSpan(new AbsoluteSizeSpan(70), 0, text1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
| 385 | + SpannableStringBuilder text= new SpannableStringBuilder( "(侯选" + aryContent.size() + "人)"); | |
| 386 | + text.setSpan(new AbsoluteSizeSpan(45), 0, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
| 387 | + tvTitle.setText(text1.append(text)); | |
| 368 | 388 | } |
| 369 | 389 | showVote(); |
| 370 | 390 | checkVoted(); |
| ... | ... | @@ -628,43 +648,7 @@ public class ElectionFragment extends BaseFragment { |
| 628 | 648 | |
| 629 | 649 | Log.v("BaseAdapterTest", "getView " + position + " " + convertView); |
| 630 | 650 | MultiTitleItem it = aryContent.get(position); |
| 631 | - if (position > 0 && position == aryContent.size() - 1) { | |
| 632 | - convertView = mInflater.inflate(R.layout.list_election_item_add, null); | |
| 633 | - Button btnAdd = (Button) convertView.findViewById(R.id.list_election_item_add_btn); | |
| 634 | - int opposeCount=checkOpposeVoted(); | |
| 635 | - if (it.startVote && voteInfo.other > 0) { | |
| 636 | - //btnAdd.setEnabled(true); | |
| 637 | - if(((aryContent.size()-1)- voteInfo.select)<opposeCount){ | |
| 638 | - btnAdd.setVisibility(View.VISIBLE); | |
| 639 | - convertView.setVisibility(View.VISIBLE); | |
| 640 | - }else{ | |
| 641 | - btnAdd.setVisibility(View.INVISIBLE); | |
| 642 | - convertView.setVisibility(View.INVISIBLE); | |
| 643 | - } | |
| 644 | - } else { | |
| 645 | - //btnAdd.setEnabled(false); | |
| 646 | - btnAdd.setVisibility(View.INVISIBLE); | |
| 647 | - convertView.setVisibility(View.INVISIBLE); | |
| 648 | - } | |
| 649 | - btnAdd.setOnClickListener(new OnClickListener() { | |
| 650 | - @Override | |
| 651 | - public void onClick(View v) { | |
| 652 | - Log.d(TAG, "add other"); | |
| 653 | - if(votedCount>= voteInfo.select ){ | |
| 654 | - Toast.makeText(getActivity(), getString(R.string.max_select)+voteInfo.select+getString(R.string.person), Toast.LENGTH_SHORT).show(); | |
| 655 | - return; | |
| 656 | - } | |
| 657 | - drawView.clear(); | |
| 658 | - addOtherLayout.setVisibility(View.VISIBLE); | |
| 659 | -// edtOther.requestFocus(); | |
| 660 | -// showInputMethod(edtOther, true, 1500); | |
| 661 | - | |
| 662 | - } | |
| 663 | - }); | |
| 664 | - return convertView; | |
| 665 | - } | |
| 666 | - | |
| 667 | - if (convertView == null || convertView.findViewById(R.id.list_election_item_add_btn) != null) { | |
| 651 | + if (convertView == null ) { | |
| 668 | 652 | convertView = mInflater.inflate(R.layout.list_election_item, null); |
| 669 | 653 | holder = new ViewHolder(); |
| 670 | 654 | holder.tvName = (TextView) convertView.findViewById(R.id.list_election_item_name); |
| ... | ... | @@ -674,9 +658,9 @@ public class ElectionFragment extends BaseFragment { |
| 674 | 658 | holder.RG = (RadioGroup) convertView.findViewById(R.id.list_election_item_radio_group); |
| 675 | 659 | holder.btnDel = (RadioButton) convertView.findViewById(R.id.list_election_item_del); |
| 676 | 660 | holder.imgBook = (PhotoView) convertView.findViewById(R.id.img_book); |
| 677 | - convertView.setTag(holder); // ��ViewHolder���� | |
| 661 | + convertView.setTag(holder); | |
| 678 | 662 | } else { |
| 679 | - holder = (ViewHolder) convertView.getTag(); // �� | |
| 663 | + holder = (ViewHolder) convertView.getTag(); | |
| 680 | 664 | } |
| 681 | 665 | holder.seq.setText("" + (position+1)); |
| 682 | 666 | holder.tvName.setText(String.valueOf(it.title)); |
| ... | ... | @@ -720,7 +704,6 @@ public class ElectionFragment extends BaseFragment { |
| 720 | 704 | btn_all_ok.setEnabled(true); |
| 721 | 705 | } |
| 722 | 706 | |
| 723 | - /* ΪButton��ӵ���¼� */ | |
| 724 | 707 | holder.btnO.setOnClickListener(new OnClickListener() { |
| 725 | 708 | @Override |
| 726 | 709 | public void onClick(View v) { |
| ... | ... | @@ -838,6 +821,12 @@ public class ElectionFragment extends BaseFragment { |
| 838 | 821 | } |
| 839 | 822 | mAdapter.notifyDataSetChanged(); |
| 840 | 823 | listview.invalidate(); |
| 824 | + | |
| 825 | + if((aryContent.size()- voteInfo.select)<checkOpposeVoted()){ | |
| 826 | + list_election_item_add_btn.setVisibility(View.VISIBLE); | |
| 827 | + }else{ | |
| 828 | + list_election_item_add_btn.setVisibility(View.GONE); | |
| 829 | + } | |
| 841 | 830 | } |
| 842 | 831 | |
| 843 | 832 | private int checkOpposeVoted() { | ... | ... |
C5/app/src/main/res/layout/fragment_custom_election.xml
| ... | ... | @@ -37,18 +37,12 @@ |
| 37 | 37 | |
| 38 | 38 | </LinearLayout> |
| 39 | 39 | |
| 40 | - | |
| 41 | - | |
| 42 | - | |
| 43 | - | |
| 44 | 40 | <RelativeLayout |
| 45 | 41 | android:id="@+id/election_pannal_OX" |
| 46 | 42 | android:layout_width="match_parent" |
| 47 | - android:background="@drawable/shapes" | |
| 48 | - android:layout_marginTop="10dp" | |
| 49 | - android:layout_height="40dp" | |
| 50 | - android:layout_marginLeft="20dp" | |
| 51 | - android:layout_marginRight="20dp" | |
| 43 | + android:layout_height="50dp" | |
| 44 | + android:paddingLeft="20dp" | |
| 45 | + android:paddingRight="20dp" | |
| 52 | 46 | android:layout_below="@+id/line_panel" > |
| 53 | 47 | <TextView |
| 54 | 48 | android:id="@+id/tv_num" |
| ... | ... | @@ -58,33 +52,33 @@ |
| 58 | 52 | android:layout_centerVertical="true" |
| 59 | 53 | android:gravity="center" |
| 60 | 54 | android:text="序号" |
| 61 | - android:textColor="@color/black" | |
| 55 | + android:textColor="@color/gray" | |
| 62 | 56 | android:textSize="@dimen/big_text_p5" /> |
| 63 | 57 | |
| 64 | - <View | |
| 58 | + <!-- <View | |
| 65 | 59 | android:id="@+id/view_line" |
| 66 | 60 | android:layout_width="2px" |
| 67 | 61 | android:layout_height="match_parent" |
| 68 | 62 | android:background="@color/votebakground" |
| 69 | - android:layout_toRightOf="@id/tv_num"/> | |
| 63 | + android:layout_toRightOf="@id/tv_num"/>--> | |
| 70 | 64 | |
| 71 | 65 | <TextView |
| 72 | 66 | android:id="@+id/tv_name" |
| 73 | 67 | android:layout_width="400dp" |
| 74 | 68 | android:layout_height="wrap_content" |
| 75 | 69 | android:layout_centerVertical="true" |
| 76 | - android:layout_toRightOf="@id/view_line" | |
| 70 | + android:layout_toRightOf="@id/tv_num" | |
| 77 | 71 | android:gravity="center" |
| 78 | 72 | android:text="项目" |
| 79 | - android:textColor="@color/black" | |
| 73 | + android:textColor="@color/red" | |
| 80 | 74 | android:textSize="@dimen/big_text_p5" /> |
| 81 | 75 | |
| 82 | - <View | |
| 76 | + <!-- <View | |
| 83 | 77 | android:layout_width="2px" |
| 84 | 78 | android:layout_height="match_parent" |
| 85 | 79 | android:background="@color/votebakground" |
| 86 | 80 | android:layout_toRightOf="@id/tv_name"/> |
| 87 | - | |
| 81 | +--> | |
| 88 | 82 | <TextView |
| 89 | 83 | android:id="@+id/tv_agree" |
| 90 | 84 | android:layout_width="wrap_content" |
| ... | ... | @@ -92,7 +86,7 @@ |
| 92 | 86 | android:gravity="center" |
| 93 | 87 | android:layout_centerVertical="true" |
| 94 | 88 | android:text="赞成" |
| 95 | - android:textColor="@color/black" | |
| 89 | + android:textColor="@color/red" | |
| 96 | 90 | android:layout_toRightOf="@id/tv_name" |
| 97 | 91 | android:layout_marginLeft="50dp" |
| 98 | 92 | android:textSize="@dimen/big_text_p5" /> |
| ... | ... | @@ -104,7 +98,7 @@ |
| 104 | 98 | android:gravity="center" |
| 105 | 99 | android:layout_centerVertical="true" |
| 106 | 100 | android:text="反对" |
| 107 | - android:textColor="@color/black" | |
| 101 | + android:textColor="@color/red" | |
| 108 | 102 | android:layout_toRightOf="@id/tv_agree" |
| 109 | 103 | android:layout_marginLeft="40dp" |
| 110 | 104 | android:textSize="@dimen/big_text_p5" /> |
| ... | ... | @@ -116,7 +110,7 @@ |
| 116 | 110 | android:gravity="center" |
| 117 | 111 | android:layout_centerVertical="true" |
| 118 | 112 | android:text="弃权" |
| 119 | - android:textColor="@color/black" | |
| 113 | + android:textColor="@color/red" | |
| 120 | 114 | android:layout_toRightOf="@id/tv_oppose" |
| 121 | 115 | android:layout_marginLeft="40dp" |
| 122 | 116 | android:textSize="@dimen/big_text_p5" /> |
| ... | ... | @@ -130,16 +124,14 @@ |
| 130 | 124 | android:layout_alignParentBottom="true" |
| 131 | 125 | android:layout_alignParentStart="true" |
| 132 | 126 | android:alpha="0.9" |
| 133 | - android:background="@drawable/gray_alpha" | |
| 127 | + android:background="@color/white" | |
| 134 | 128 | android:visibility="visible"> |
| 135 | 129 | |
| 136 | 130 | <Button |
| 137 | 131 | android:id="@+id/election_btn_confirm" |
| 138 | 132 | android:layout_width="wrap_content" |
| 139 | 133 | android:layout_height="wrap_content" |
| 140 | - android:layout_alignParentRight="true" | |
| 141 | - android:layout_centerVertical="true" | |
| 142 | - android:layout_marginRight="20dp" | |
| 134 | + android:layout_centerInParent="true" | |
| 143 | 135 | android:background="@drawable/oppos_selector" |
| 144 | 136 | android:text="@string/confirm_submit" |
| 145 | 137 | android:textColor="@color/white" |
| ... | ... | @@ -150,9 +142,7 @@ |
| 150 | 142 | android:id="@+id/election_btn_modify" |
| 151 | 143 | android:layout_width="wrap_content" |
| 152 | 144 | android:layout_height="wrap_content" |
| 153 | - android:layout_alignParentRight="true" | |
| 154 | - android:layout_centerVertical="true" | |
| 155 | - android:layout_marginRight="20dp" | |
| 145 | + android:layout_centerInParent="true" | |
| 156 | 146 | android:background="@drawable/signin_selector" |
| 157 | 147 | android:text="@string/modify" |
| 158 | 148 | android:textColor="@color/white" |
| ... | ... | @@ -160,28 +150,6 @@ |
| 160 | 150 | android:textStyle="bold" |
| 161 | 151 | android:visibility="invisible" /> |
| 162 | 152 | |
| 163 | - <Button | |
| 164 | - android:id="@+id/election_pagelast" | |
| 165 | - android:layout_width="120dp" | |
| 166 | - android:layout_height="wrap_content" | |
| 167 | - android:layout_centerVertical="true" | |
| 168 | - android:layout_toLeftOf="@id/election_btn_confirm" | |
| 169 | - android:background="@drawable/page_selector" | |
| 170 | - android:layout_marginRight="20dp" | |
| 171 | - android:text="最后一页" | |
| 172 | - android:textSize="@dimen/big_text_p5" /> | |
| 173 | - | |
| 174 | - <Button | |
| 175 | - android:id="@+id/election_pagedown" | |
| 176 | - android:layout_width="wrap_content" | |
| 177 | - android:layout_height="wrap_content" | |
| 178 | - android:layout_centerVertical="true" | |
| 179 | - android:layout_toLeftOf="@id/election_pagelast" | |
| 180 | - android:background="@drawable/page_selector" | |
| 181 | - android:layout_marginRight="20dp" | |
| 182 | - android:text="@string/page_down" | |
| 183 | - android:textSize="@dimen/big_text_p5" /> | |
| 184 | - | |
| 185 | 153 | <TextView |
| 186 | 154 | android:id="@+id/tv_tip_info" |
| 187 | 155 | android:layout_width="wrap_content" |
| ... | ... | @@ -191,31 +159,6 @@ |
| 191 | 159 | android:text="" |
| 192 | 160 | android:textSize="@dimen/big_text_p4" /> |
| 193 | 161 | |
| 194 | - <TextView | |
| 195 | - android:id="@+id/election_page" | |
| 196 | - android:layout_width="wrap_content" | |
| 197 | - android:layout_height="wrap_content" | |
| 198 | - android:layout_centerInParent="true" | |
| 199 | - android:layout_marginRight="80dp" | |
| 200 | - android:text="1/10" | |
| 201 | - android:textSize="@dimen/big_text_p4" | |
| 202 | - android:visibility="invisible" /> | |
| 203 | - | |
| 204 | - <Button | |
| 205 | - android:id="@+id/election_pageup" | |
| 206 | - android:layout_width="wrap_content" | |
| 207 | - android:layout_height="wrap_content" | |
| 208 | - android:layout_centerVertical="true" | |
| 209 | - android:layout_toLeftOf="@id/election_pagedown" | |
| 210 | - android:background="@drawable/page_selector" | |
| 211 | - android:text="@string/page_up" | |
| 212 | - android:layout_marginRight="40dp" | |
| 213 | - android:textSize="@dimen/big_text_p5" | |
| 214 | - android:visibility="visible" /> | |
| 215 | - | |
| 216 | - | |
| 217 | - | |
| 218 | - | |
| 219 | 162 | </RelativeLayout> |
| 220 | 163 | |
| 221 | 164 | <ListView |
| ... | ... | @@ -224,11 +167,47 @@ |
| 224 | 167 | android:layout_height="match_parent" |
| 225 | 168 | android:layout_above="@id/election_pannal_bottom" |
| 226 | 169 | android:layout_below="@id/election_pannal_OX" |
| 227 | - android:layout_marginBottom="2px" | |
| 228 | - android:layout_marginLeft="20dp" | |
| 229 | - android:layout_marginRight="20dp" | |
| 170 | + android:layout_marginBottom="1dp" | |
| 230 | 171 | android:divider="@color/votebakground" |
| 231 | - android:dividerHeight="2px" /> | |
| 172 | + android:background="@color/white" | |
| 173 | + android:dividerHeight="1dp" /> | |
| 174 | + | |
| 175 | + <LinearLayout | |
| 176 | + android:layout_width="40dp" | |
| 177 | + android:layout_height="150dp" | |
| 178 | + android:layout_alignParentRight="true" | |
| 179 | + android:layout_centerVertical="true" | |
| 180 | + android:layout_marginBottom="50dp" | |
| 181 | + android:layout_marginRight="20dp" | |
| 182 | + android:layout_marginTop="50dp" | |
| 183 | + android:background="@drawable/right_control" | |
| 184 | + android:orientation="vertical"> | |
| 185 | + | |
| 186 | + <ImageView | |
| 187 | + android:id="@+id/election_pageup" | |
| 188 | + android:layout_width="wrap_content" | |
| 189 | + android:layout_height="0dp" | |
| 190 | + android:layout_weight="1" | |
| 191 | + android:padding="10dp" | |
| 192 | + android:src="@drawable/page_up" /> | |
| 193 | + | |
| 194 | + <ImageView | |
| 195 | + android:id="@+id/election_pagedown" | |
| 196 | + android:layout_width="wrap_content" | |
| 197 | + android:layout_height="0dp" | |
| 198 | + android:layout_weight="1" | |
| 199 | + android:padding="10dp" | |
| 200 | + android:src="@drawable/page_down" /> | |
| 201 | + | |
| 202 | + <ImageView | |
| 203 | + android:id="@+id/election_pagelast" | |
| 204 | + android:layout_width="wrap_content" | |
| 205 | + android:layout_height="0dp" | |
| 206 | + android:layout_weight="1" | |
| 207 | + android:padding="10dp" | |
| 208 | + android:src="@drawable/page_frist" /> | |
| 209 | + | |
| 210 | + </LinearLayout> | |
| 232 | 211 | |
| 233 | 212 | <RelativeLayout |
| 234 | 213 | android:id="@+id/singlevote_confirm_panel" |
| ... | ... | @@ -289,7 +268,7 @@ |
| 289 | 268 | android:textSize="@dimen/big_text_p2" |
| 290 | 269 | android:textStyle="bold" |
| 291 | 270 | android:visibility="invisible" |
| 292 | - android:layout_alignParentRight="true" | |
| 271 | + android:layout_centerInParent="true" | |
| 293 | 272 | android:layout_marginTop="40dp" |
| 294 | 273 | android:layout_marginRight="40dp"/> |
| 295 | 274 | </RelativeLayout> |
| 296 | 275 | \ No newline at end of file | ... | ... |
C5/app/src/main/res/layout/fragment_election.xml
| ... | ... | @@ -31,7 +31,17 @@ |
| 31 | 31 | android:id="@+id/election_info" |
| 32 | 32 | android:layout_width="wrap_content" |
| 33 | 33 | android:layout_height="wrap_content" |
| 34 | + android:layout_marginRight="20dp" | |
| 34 | 35 | android:text="" |
| 36 | + android:textSize="@dimen/big_text_p5" /> | |
| 37 | + | |
| 38 | + <Button | |
| 39 | + android:id="@+id/list_election_item_add_btn" | |
| 40 | + android:layout_width="120dp" | |
| 41 | + android:layout_height="50dp" | |
| 42 | + android:background="@drawable/agree_selector" | |
| 43 | + android:text="@string/select_other" | |
| 44 | + android:textColor="@color/white" | |
| 35 | 45 | android:layout_marginRight="20dp" |
| 36 | 46 | android:textSize="@dimen/big_text_p5" /> |
| 37 | 47 | |
| ... | ... | @@ -95,6 +105,7 @@ |
| 95 | 105 | android:alpha="0.9" |
| 96 | 106 | android:background="@drawable/gray_alpha" |
| 97 | 107 | android:visibility="visible"> |
| 108 | + | |
| 98 | 109 | <Button |
| 99 | 110 | android:id="@+id/election_btn_confirm" |
| 100 | 111 | android:layout_width="@dimen/button_width" |
| ... | ... | @@ -123,20 +134,20 @@ |
| 123 | 134 | |
| 124 | 135 | <LinearLayout |
| 125 | 136 | android:id="@+id/title_layout" |
| 126 | - android:layout_below="@id/election_pannal_OX" | |
| 127 | 137 | android:layout_width="fill_parent" |
| 128 | 138 | android:layout_height="60dp" |
| 129 | - android:paddingRight="100dp" | |
| 139 | + android:layout_below="@id/election_pannal_OX" | |
| 130 | 140 | android:background="@color/white" |
| 131 | - android:orientation="horizontal"> | |
| 141 | + android:orientation="horizontal" | |
| 142 | + android:paddingRight="100dp"> | |
| 132 | 143 | |
| 133 | 144 | <TextView |
| 134 | 145 | android:id="@+id/seq" |
| 135 | 146 | android:layout_width="120dp" |
| 136 | 147 | android:layout_height="wrap_content" |
| 148 | + android:layout_gravity="center_vertical" | |
| 137 | 149 | android:layout_marginLeft="150dp" |
| 138 | 150 | android:gravity="center" |
| 139 | - android:layout_gravity="center_vertical" | |
| 140 | 151 | android:text="序号" |
| 141 | 152 | android:textColor="@color/gray" |
| 142 | 153 | android:textSize="@dimen/big_text_p6" /> |
| ... | ... | @@ -146,8 +157,8 @@ |
| 146 | 157 | android:layout_width="0dp" |
| 147 | 158 | android:layout_height="wrap_content" |
| 148 | 159 | android:layout_gravity="center_vertical" |
| 149 | - android:layout_weight="1" | |
| 150 | 160 | android:layout_marginLeft="40dp" |
| 161 | + android:layout_weight="1" | |
| 151 | 162 | android:gravity="left|center_vertical" |
| 152 | 163 | android:text="侯选人" |
| 153 | 164 | android:textColor="@color/red" |
| ... | ... | @@ -156,39 +167,40 @@ |
| 156 | 167 | <TextView |
| 157 | 168 | android:layout_width="wrap_content" |
| 158 | 169 | android:layout_height="wrap_content" |
| 159 | - android:textColor="@color/red" | |
| 160 | - android:textSize="@dimen/big_text_p6" | |
| 161 | - android:layout_marginLeft="@dimen/button_to_content" | |
| 162 | 170 | android:layout_gravity="center_vertical" |
| 163 | - android:text="@string/agree"/> | |
| 171 | + android:layout_marginLeft="@dimen/button_to_content" | |
| 172 | + android:text="@string/agree" | |
| 173 | + android:textColor="@color/red" | |
| 174 | + android:textSize="@dimen/big_text_p6" /> | |
| 164 | 175 | |
| 165 | 176 | <TextView |
| 166 | 177 | android:layout_width="wrap_content" |
| 167 | 178 | android:layout_height="wrap_content" |
| 168 | - android:textColor="@color/red" | |
| 169 | - android:textSize="@dimen/big_text_p6" | |
| 170 | - android:layout_marginLeft="@dimen/button_to_content" | |
| 171 | 179 | android:layout_gravity="center_vertical" |
| 172 | - android:text="@string/oppose"/> | |
| 180 | + android:layout_marginLeft="@dimen/button_to_content" | |
| 181 | + android:text="@string/oppose" | |
| 182 | + android:textColor="@color/red" | |
| 183 | + android:textSize="@dimen/big_text_p6" /> | |
| 173 | 184 | |
| 174 | 185 | <TextView |
| 175 | 186 | android:layout_width="wrap_content" |
| 176 | 187 | android:layout_height="wrap_content" |
| 177 | - android:textColor="@color/red" | |
| 178 | - android:textSize="@dimen/big_text_p6" | |
| 179 | - android:layout_marginLeft="@dimen/button_to_content" | |
| 180 | 188 | android:layout_gravity="center_vertical" |
| 189 | + android:layout_marginLeft="@dimen/button_to_content" | |
| 181 | 190 | android:text="@string/delete" |
| 182 | - android:visibility="gone"/> | |
| 191 | + android:textColor="@color/red" | |
| 192 | + android:textSize="@dimen/big_text_p6" | |
| 193 | + android:visibility="gone" /> | |
| 183 | 194 | |
| 184 | 195 | </LinearLayout> |
| 185 | 196 | |
| 186 | 197 | <View |
| 187 | 198 | android:id="@+id/line" |
| 188 | - android:layout_below="@id/title_layout" | |
| 189 | 199 | android:layout_width="match_parent" |
| 190 | 200 | android:layout_height="2dp" |
| 191 | - android:background="@color/votebakground"/> | |
| 201 | + android:layout_below="@id/title_layout" | |
| 202 | + android:background="@color/votebakground" /> | |
| 203 | + | |
| 192 | 204 | <ListView |
| 193 | 205 | android:id="@+id/election_listview" |
| 194 | 206 | android:layout_width="fill_parent" |
| ... | ... | @@ -214,8 +226,8 @@ |
| 214 | 226 | android:id="@+id/election_pageup" |
| 215 | 227 | android:layout_width="wrap_content" |
| 216 | 228 | android:layout_height="0dp" |
| 217 | - android:padding="10dp" | |
| 218 | 229 | android:layout_weight="1" |
| 230 | + android:padding="10dp" | |
| 219 | 231 | android:src="@drawable/page_up" /> |
| 220 | 232 | |
| 221 | 233 | <ImageView |
| ... | ... | @@ -236,107 +248,56 @@ |
| 236 | 248 | |
| 237 | 249 | </LinearLayout> |
| 238 | 250 | |
| 239 | - <LinearLayout | |
| 251 | + <RelativeLayout | |
| 240 | 252 | android:id="@+id/election_add_other_panel" |
| 241 | 253 | android:layout_width="match_parent" |
| 242 | 254 | android:layout_height="match_parent" |
| 243 | - android:background="@color/black" | |
| 244 | - android:orientation="vertical" | |
| 245 | - android:visibility="gone"> | |
| 255 | + android:layout_below="@id/line_panel" | |
| 256 | + android:visibility="gone" | |
| 257 | + android:background="#E5E5E5"> | |
| 246 | 258 | |
| 247 | - <!--输入框--> | |
| 248 | 259 | <LinearLayout |
| 249 | - android:layout_width="match_parent" | |
| 250 | - android:layout_height="match_parent" | |
| 251 | - android:layout_weight="0.2" | |
| 260 | + android:id="@+id/name_layout" | |
| 261 | + android:layout_width="wrap_content" | |
| 262 | + android:layout_height="wrap_content" | |
| 263 | + android:layout_marginLeft="20dp" | |
| 264 | + android:layout_marginTop="20dp" | |
| 252 | 265 | android:orientation="horizontal"> |
| 253 | 266 | |
| 254 | - <LinearLayout | |
| 255 | - android:layout_width="match_parent" | |
| 256 | - android:layout_height="match_parent" | |
| 257 | - android:layout_margin="50dp" | |
| 258 | - android:layout_weight="1" | |
| 259 | - android:background="@drawable/shape" | |
| 260 | - android:gravity="center" | |
| 261 | - android:orientation="vertical"> | |
| 262 | - | |
| 263 | - <TextView | |
| 264 | - android:layout_width="wrap_content" | |
| 265 | - android:layout_height="wrap_content" | |
| 266 | - android:layout_centerHorizontal="true" | |
| 267 | - android:layout_marginBottom="20dp" | |
| 268 | - android:text="@string/input_other" | |
| 269 | - android:textColor="@color/white" | |
| 270 | - android:textSize="@dimen/big_text_p5" /> | |
| 271 | - | |
| 272 | - <com.sunvote.xpadapp.base.ZanyEditText | |
| 273 | - android:id="@+id/election_add_edit" | |
| 274 | - android:layout_width="200dp" | |
| 275 | - android:layout_height="60dp" | |
| 276 | - android:layout_marginTop="40dp" | |
| 277 | - android:background="#e8e8e8" | |
| 278 | - android:gravity="center" | |
| 279 | - android:imeOptions="flagNoExtractUi" | |
| 280 | - android:lines="1" | |
| 281 | - android:textSize="@dimen/big_text_p4" /> | |
| 282 | - </LinearLayout> | |
| 283 | - | |
| 284 | - <LinearLayout | |
| 285 | - android:layout_width="match_parent" | |
| 286 | - android:layout_height="match_parent" | |
| 287 | - android:layout_margin="30dp" | |
| 288 | - android:layout_weight="1" | |
| 289 | - android:background="@drawable/shape" | |
| 290 | - android:gravity="center" | |
| 291 | - android:orientation="vertical"> | |
| 292 | - | |
| 293 | - <TextView | |
| 294 | - android:layout_width="match_parent" | |
| 295 | - android:layout_height="50px" | |
| 296 | - android:layout_centerHorizontal="true" | |
| 297 | - android:gravity="center" | |
| 298 | - android:text="@string/input_other" | |
| 299 | - android:textColor="@color/white" | |
| 300 | - android:textSize="@dimen/big_text_p5" /> | |
| 301 | - | |
| 302 | - <FrameLayout | |
| 303 | - android:layout_width="match_parent" | |
| 304 | - android:layout_height="match_parent" | |
| 305 | - android:layout_margin="5dp" | |
| 306 | - android:background="@drawable/shape"> | |
| 307 | - | |
| 308 | - <com.sunvote.xpadapp.base.PaletteView | |
| 309 | - android:id="@+id/draw_view" | |
| 310 | - android:layout_width="match_parent" | |
| 311 | - android:layout_height="match_parent" /> | |
| 312 | - | |
| 313 | - <ImageView | |
| 314 | - android:id="@+id/clear_img" | |
| 315 | - android:layout_width="wrap_content" | |
| 316 | - android:layout_height="wrap_content" | |
| 317 | - android:layout_gravity="bottom|right" | |
| 318 | - android:layout_marginBottom="20dp" | |
| 319 | - android:layout_marginRight="20dp" | |
| 320 | - android:src="@drawable/ic_clear" /> | |
| 321 | - </FrameLayout> | |
| 322 | - | |
| 323 | - </LinearLayout> | |
| 267 | + <TextView | |
| 268 | + android:layout_width="wrap_content" | |
| 269 | + android:layout_height="60dp" | |
| 270 | + android:text="@string/input_other" | |
| 271 | + android:textColor="@color/gray" | |
| 272 | + android:textSize="@dimen/big_text_p5" /> | |
| 273 | + | |
| 274 | + <com.sunvote.xpadapp.base.ZanyEditText | |
| 275 | + android:id="@+id/election_add_edit" | |
| 276 | + android:layout_width="200dp" | |
| 277 | + android:layout_height="60dp" | |
| 278 | + android:layout_marginLeft="20dp" | |
| 279 | + android:background="@color/white" | |
| 280 | + android:imeOptions="flagNoExtractUi" | |
| 281 | + android:lines="1" | |
| 282 | + android:textSize="@dimen/big_text_p4" /> | |
| 324 | 283 | </LinearLayout> |
| 325 | 284 | |
| 326 | 285 | <!--按钮--> |
| 327 | 286 | <LinearLayout |
| 328 | - android:layout_width="match_parent" | |
| 329 | - android:layout_height="match_parent" | |
| 330 | - android:layout_weight="0.8" | |
| 331 | - android:gravity="center|right" | |
| 287 | + android:id="@+id/bottom_linear" | |
| 288 | + android:layout_width="wrap_content" | |
| 289 | + android:layout_height="wrap_content" | |
| 290 | + android:layout_alignParentBottom="true" | |
| 291 | + android:layout_centerHorizontal="true" | |
| 292 | + android:layout_marginBottom="20dp" | |
| 332 | 293 | android:orientation="horizontal"> |
| 333 | 294 | |
| 334 | 295 | <Button |
| 335 | 296 | android:id="@+id/election_add_edit_btn_cancel" |
| 336 | 297 | android:layout_width="@dimen/button_width" |
| 337 | 298 | android:layout_height="@dimen/button_heigh" |
| 338 | - android:layout_marginRight="@dimen/content_margin" | |
| 339 | - android:background="@drawable/btn_signin_d" | |
| 299 | + android:layout_marginRight="80dp" | |
| 300 | + android:background="@drawable/oppos_selector" | |
| 340 | 301 | android:text="@string/cancel" |
| 341 | 302 | android:textColor="@color/white" |
| 342 | 303 | android:textSize="@dimen/big_text_p4" |
| ... | ... | @@ -346,7 +307,7 @@ |
| 346 | 307 | android:id="@+id/election_add_edit_btn_ok" |
| 347 | 308 | android:layout_width="@dimen/button_width" |
| 348 | 309 | android:layout_height="@dimen/button_heigh" |
| 349 | - android:layout_marginRight="@dimen/content_margin" | |
| 310 | + android:layout_marginLeft="80dp" | |
| 350 | 311 | android:background="@drawable/btn_agree" |
| 351 | 312 | android:text="@string/ok" |
| 352 | 313 | android:textColor="@color/white" |
| ... | ... | @@ -354,7 +315,44 @@ |
| 354 | 315 | android:textStyle="bold" /> |
| 355 | 316 | </LinearLayout> |
| 356 | 317 | |
| 357 | - </LinearLayout> | |
| 318 | + <RelativeLayout | |
| 319 | + android:layout_width="match_parent" | |
| 320 | + android:layout_height="match_parent" | |
| 321 | + android:layout_below="@id/name_layout" | |
| 322 | + android:layout_above="@id/bottom_linear" | |
| 323 | + android:layout_margin="20dp" | |
| 324 | + android:background="@color/white" | |
| 325 | + android:gravity="center" | |
| 326 | + android:orientation="vertical"> | |
| 327 | + | |
| 328 | + <TextView | |
| 329 | + android:layout_width="wrap_content" | |
| 330 | + android:layout_height="wrap_content" | |
| 331 | + android:layout_centerInParent="true" | |
| 332 | + android:text="另选代表姓名(手写)" | |
| 333 | + android:textSize="@dimen/big_text_p5" | |
| 334 | + android:textColor="@color/darkgrey"/> | |
| 335 | + | |
| 336 | + <com.sunvote.xpadapp.base.PaletteView | |
| 337 | + android:id="@+id/draw_view" | |
| 338 | + android:layout_width="match_parent" | |
| 339 | + android:layout_height="match_parent" /> | |
| 340 | + | |
| 341 | + <ImageView | |
| 342 | + android:id="@+id/clear_img" | |
| 343 | + android:layout_width="wrap_content" | |
| 344 | + android:layout_height="wrap_content" | |
| 345 | + android:layout_alignParentRight="true" | |
| 346 | + android:layout_alignParentTop="true" | |
| 347 | + android:layout_marginTop="20dp" | |
| 348 | + android:layout_marginRight="20dp" | |
| 349 | + android:src="@drawable/ic_clear" /> | |
| 350 | + | |
| 351 | + </RelativeLayout> | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + </RelativeLayout> | |
| 358 | 356 | |
| 359 | 357 | <RelativeLayout |
| 360 | 358 | android:id="@+id/singlevote_confirm_panel" | ... | ... |
C5/app/src/main/res/layout/list_custom_election_item.xml
| ... | ... | @@ -7,7 +7,8 @@ |
| 7 | 7 | <RelativeLayout |
| 8 | 8 | android:layout_width="match_parent" |
| 9 | 9 | android:layout_height="match_parent" |
| 10 | - android:background="@color/white" | |
| 10 | + android:paddingLeft="20dp" | |
| 11 | + android:paddingRight="20dp" | |
| 11 | 12 | android:layout_alignParentTop="true" |
| 12 | 13 | android:layout_alignParentLeft="true" |
| 13 | 14 | android:layout_alignParentStart="true"> |
| ... | ... | @@ -23,29 +24,29 @@ |
| 23 | 24 | android:textColor="@color/black" |
| 24 | 25 | android:textSize="26px" /> |
| 25 | 26 | |
| 26 | - <View | |
| 27 | + <!-- <View | |
| 27 | 28 | android:id="@+id/election_item_middle" |
| 28 | 29 | android:layout_width="2px" |
| 29 | 30 | android:layout_height="match_parent" |
| 30 | 31 | android:background="@color/votebakground" |
| 31 | 32 | android:layout_toRightOf="@id/list_election_item_num"/> |
| 32 | - | |
| 33 | +--> | |
| 33 | 34 | <TextView |
| 34 | 35 | android:id="@+id/list_election_item_name" |
| 35 | 36 | android:layout_width="400dp" |
| 36 | 37 | android:layout_height="wrap_content" |
| 37 | 38 | android:layout_centerVertical="true" |
| 38 | - android:layout_toRightOf="@id/election_item_middle" | |
| 39 | + android:layout_toRightOf="@id/list_election_item_num" | |
| 39 | 40 | android:gravity="center" |
| 40 | 41 | android:text="" |
| 41 | 42 | android:textColor="@color/black" |
| 42 | 43 | android:textSize="@dimen/big_text_p5" /> |
| 43 | 44 | |
| 44 | - <View | |
| 45 | + <!-- <View | |
| 45 | 46 | android:layout_width="2px" |
| 46 | 47 | android:layout_height="match_parent" |
| 47 | 48 | android:background="@color/votebakground" |
| 48 | - android:layout_toRightOf="@id/list_election_item_name"/> | |
| 49 | + android:layout_toRightOf="@id/list_election_item_name"/>--> | |
| 49 | 50 | |
| 50 | 51 | <RadioGroup |
| 51 | 52 | android:id="@+id/list_election_item_radio_group" | ... | ... |