Commit cadc1d8f90958c9e001b7debffe3763a1f7c7c68

Authored by wutaian
1 parent e3db4ced

新增资源

C5/app/src/main/java/com/sunvote/xpadapp/fragments/ResultElectionCustomFragment.java 0 → 100644
  1 +package com.sunvote.xpadapp.fragments;
  2 +
  3 +import android.annotation.SuppressLint;
  4 +import android.app.FragmentManager;
  5 +import android.app.FragmentTransaction;
  6 +import android.content.Context;
  7 +import android.graphics.Color;
  8 +import android.os.Bundle;
  9 +import android.text.TextUtils;
  10 +import android.util.DisplayMetrics;
  11 +import android.util.Log;
  12 +import android.view.LayoutInflater;
  13 +import android.view.View;
  14 +import android.view.View.OnClickListener;
  15 +import android.view.ViewGroup;
  16 +import android.widget.BaseAdapter;
  17 +import android.widget.ImageButton;
  18 +import android.widget.ListView;
  19 +import android.widget.TextView;
  20 +
  21 +import com.sunvote.util.LogUtil;
  22 +import com.sunvote.xpadapp.MainActivity;
  23 +import com.sunvote.xpadapp.R;
  24 +import com.sunvote.xpadapp.base.BaseFragment;
  25 +import com.sunvote.xpadapp.base.TextViewUtils;
  26 +import com.sunvote.xpadapp.db.modal.BillInfo;
  27 +import com.sunvote.xpadapp.db.modal.MultiTitleItem;
  28 +import com.sunvote.xpadcomm.XPadApiInterface;
  29 +import com.ycanfunc.util.StringUtils;
  30 +
  31 +import java.io.UnsupportedEncodingException;
  32 +import java.util.ArrayList;
  33 +
  34 +import static com.sunvote.xpadapp.utils.MyStringUtil.replaceBlank;
  35 +
  36 +public class ResultElectionCustomFragment extends BaseFragment {
  37 +
  38 + public byte[] data;
  39 + public BillInfo bill;
  40 + public XPadApiInterface.VoteInfo voteInfo;
  41 + String TAG = "ResultMultiVoteFragment";
  42 +
  43 + public ArrayList<BillInfo> subInfo;
  44 + String[] options;
  45 +
  46 + private ArrayList<ListItem> aryContent = null;
  47 +
  48 + private TextView tvTitle;
  49 + private TextView titleAbstain;
  50 + private TextView titleUnvote;
  51 + private TextView titleResult;
  52 +
  53 + private ListView listview;
  54 + private MyAdapter mAdapter;
  55 + private int resultBits;
  56 +
  57 + int fenmu;
  58 + int yindao;
  59 + int shidao;
  60 +
  61 + @SuppressLint("NewApi")
  62 + @Override
  63 + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  64 + LogUtil.d(TAG, "onCreateView");
  65 + View view = inflater.inflate(R.layout.fragment_result_multi_vote, container, false);
  66 + final MainActivity mact = (MainActivity) getActivity();
  67 +
  68 + view.setOnClickListener(new OnClickListener() {
  69 + @Override
  70 + public void onClick(View v) {
  71 + ;
  72 + }
  73 + });
  74 +
  75 + listview = (ListView) view.findViewById(R.id.multi_vote_result_listview);
  76 + options = bill.billOptions.split("/");
  77 +
  78 + try {
  79 + initData();
  80 + }catch (Exception ex){ex.printStackTrace();}
  81 +
  82 + mAdapter = new MyAdapter(getActivity());
  83 + listview.setAdapter(mAdapter);
  84 +
  85 + tvTitle = (TextView) view.findViewById(R.id.multi_vote_result_tv_title);
  86 + if (bill != null) {
  87 + tvTitle.setText( replaceBlank(bill.title));
  88 + }
  89 +
  90 + titleAbstain = (TextView) view.findViewById(R.id.multi_vote_result_title_abstan);
  91 + titleUnvote = (TextView) view.findViewById(R.id.multi_vote_result_title_unvote);
  92 + titleResult = (TextView) view.findViewById(R.id.multi_vote_result_title_result);
  93 +
  94 + if (resultBits == 0xffff) {
  95 + titleResult.setVisibility(View.GONE);
  96 + } else {
  97 + titleResult.setVisibility(View.VISIBLE);
  98 + }
  99 + if (options.length == 2) {
  100 + titleAbstain.setVisibility(View.GONE);
  101 + } else {
  102 + titleAbstain.setVisibility(View.VISIBLE);
  103 + }
  104 + TextView tvYindao = (TextView) view.findViewById(R.id.multi_vote_result_yindao);
  105 + TextView tvShidao = (TextView) view.findViewById(R.id.multi_vote_result_shidao);
  106 + if (yindao == 0xff || yindao == 0xffff) {
  107 + tvYindao.setVisibility(View.GONE);
  108 + } else {
  109 + tvYindao.setText("" + + yindao);
  110 + tvYindao.setVisibility(View.VISIBLE);
  111 + }
  112 +
  113 + if (shidao == 0xff || shidao == 0xffff) {
  114 + tvShidao.setVisibility(View.GONE);
  115 + } else {
  116 + tvShidao.setText("" + shidao);
  117 + tvShidao.setVisibility(View.VISIBLE);
  118 + }
  119 +
  120 + return view;
  121 + }
  122 +
  123 + private void initData() {
  124 +
  125 + int bitNum = data[2] & 0xf;
  126 + int digiters = data[2] >> 4 & 0xf;
  127 + int voteNo = data[3] & 0xff;
  128 + int startNo = ((data[4] & 0xff) << 8) | (data[5] & 0xff) ;
  129 + int endNo = ((data[6] & 0xff) << 8) | (data[7] & 0xff) ;
  130 + int rH = data[8] & 0xff;
  131 + int rL = data[9] & 0xff;
  132 + resultBits = rH << 8 | rL;
  133 +
  134 + // resultBits = ((data[8] << 8) | data[9]) & 0xff;
  135 +
  136 + // Log.d(TAG, "data len:" + data.length);
  137 + // Toast.makeText(mMainActivity, "data len:" + data.length,
  138 + // Toast.LENGTH_LONG).show();
  139 + subInfo = mMainActivity.dbm.getSubBillItems(mMainActivity.meetingId, bill.billId);
  140 + aryContent = new ArrayList<ListItem>();
  141 +
  142 + if (bitNum == 0) {
  143 + // 0 单字节数值(数值范围0-254) 现按一次最多显示5个事项
  144 + fenmu = data[10] & 0xff;
  145 + yindao = data[11] & 0xff;
  146 + shidao = data[12] & 0xff;
  147 + int pos = 13;
  148 + for (int i = startNo; i <= endNo; i++) {
  149 + ListItem it = new ListItem();
  150 + it.No = i;
  151 + it.title = getTitle(i);
  152 + it.agree = data[pos++] & 0xff;
  153 + it.oppose = data[pos++] & 0xff;
  154 + if (pos == data.length - 1) {
  155 + aryContent.add(it);
  156 + break;
  157 + }
  158 + if (options.length == 3) {
  159 + it.abstain = data[pos++] & 0xff;
  160 + }
  161 + if (pos == data.length - 1) {
  162 + aryContent.add(it);
  163 + break;
  164 + }
  165 + it.unvote = data[pos++] & 0xff;
  166 + if (resultBits == 0xffff) {
  167 +// it.pass = data[pos++] & 0xff;
  168 + it.pass = 0xffff;
  169 + } else {
  170 + int moveBits = 15 - (i - startNo);
  171 + it.pass = (resultBits >> moveBits) & 1;
  172 + }
  173 + aryContent.add(it);
  174 + }
  175 + } else if(bitNum == 1){
  176 + // 1 双字节数值(数值范围0-65534) 现按一次最多显示5个事项
  177 + fenmu = (data[10] << 8 | data[11]) & 0xffff;
  178 + yindao = (data[12] << 8 | data[13]) & 0xffff;
  179 + shidao = (data[14] << 8 | data[15]) & 0xffff;
  180 + int pos = 16;
  181 + for (int i = startNo; i <= endNo; i++) {
  182 + ListItem it = new ListItem();
  183 + it.No = i;
  184 + it.title = getTitle(i);
  185 + it.agree = (data[pos++] << 8 | data[pos++]) & 0xffff;
  186 + it.oppose = (data[pos++] << 8 | data[pos++]) & 0xffff;
  187 + if (options.length == 3) {
  188 + it.abstain = (data[pos++] << 8 | data[pos++]) & 0xffff;
  189 + }
  190 + it.unvote = (data[pos++] << 8 | data[pos++]) & 0xffff;
  191 + if (resultBits == 0xffff) {
  192 + it.pass = 0xffff;
  193 + } else {
  194 + int moveBits = 15 - (i - startNo);
  195 + it.pass = (resultBits >> moveBits) & 1;
  196 + }
  197 + aryContent.add(it);
  198 + }
  199 + }else if(bitNum == 2){
  200 + // 0 单字节数值(数值范围0-254) 现按一次最多显示5个事项
  201 + fenmu = data[10] & 0xff;
  202 + yindao = data[11] & 0xff;
  203 + shidao = data[12] & 0xff;
  204 + int pos = 13;
  205 + for (int i = startNo; i <= endNo; i++) {
  206 + ListItem it = new ListItem();
  207 + it.No = data[pos++] & 0xff;
  208 + it.title = getTitle(it.No);
  209 + it.agree = data[pos++] & 0xff;
  210 + it.oppose = data[pos++] & 0xff;
  211 + if (pos == data.length - 1) {
  212 + aryContent.add(it);
  213 + break;
  214 + }
  215 + if (options.length == 3) {
  216 + it.abstain = data[pos++] & 0xff;
  217 + }
  218 + if (pos == data.length - 1) {
  219 + aryContent.add(it);
  220 + break;
  221 + }
  222 + it.unvote = data[pos++] & 0xff;
  223 + if (resultBits == 0xffff) {
  224 + it.pass = 0xffff;
  225 + } else {
  226 + int moveBits = 15 - (i - startNo);
  227 + it.pass = (resultBits >> moveBits) & 1;
  228 + }
  229 + aryContent.add(it);
  230 + }
  231 + }else if(bitNum == 3){
  232 + // 双字节数值制定表决事项编号(数值范围0-65534)现按一次最多显示5个事项
  233 + // 单字节数值制定表决事项编号(数值范围0-254)现按一次最多显示5个事项
  234 + // 1 双字节数值(数值范围0-65534) 现按一次最多显示5个事项
  235 + fenmu = (data[10] << 8 | data[11]) & 0xffff;
  236 + yindao = (data[12] << 8 | data[13]) & 0xffff;
  237 + shidao = (data[14] << 8 | data[15]) & 0xffff;
  238 + int pos = 16;
  239 + for (int i = startNo; i <= endNo; i++) {
  240 + ListItem it = new ListItem();
  241 + it.No = (data[pos++] << 8 | data[pos++]) & 0xffff;
  242 + it.title = getTitle(it.No);
  243 + it.agree = (data[pos++] << 8 | data[pos++]) & 0xffff;
  244 + it.oppose = (data[pos++] << 8 | data[pos++]) & 0xffff;
  245 + if (options.length == 3) {
  246 + it.abstain = (data[pos++] << 8 | data[pos++]) & 0xffff;
  247 + }
  248 + it.unvote = (data[pos++] << 8 | data[pos++]) & 0xffff;
  249 + if (resultBits == 0xffff) {
  250 + it.pass = 0xffff;
  251 + } else {
  252 + int moveBits = 15 - (i - startNo);
  253 + it.pass = (resultBits >> moveBits) & 1;
  254 + }
  255 + aryContent.add(it);
  256 + }
  257 + }
  258 +
  259 + }
  260 +
  261 + private String getTitle(int billNo) {
  262 + for (int i = 0; i < subInfo.size(); i++) {
  263 + BillInfo subItem = subInfo.get(i);
  264 + if (subItem.billNo == billNo) {
  265 + return subItem.title;
  266 + }
  267 + }
  268 + return "";
  269 + }
  270 +
  271 + public class ListItem {
  272 + int No;
  273 + String title;
  274 + int agree;
  275 + int oppose;
  276 + int abstain;
  277 + int unvote;
  278 + int pass;
  279 + }
  280 +
  281 + /*
  282 + * MyAdapter
  283 + *
  284 + */
  285 + private class MyAdapter extends BaseAdapter {
  286 +
  287 + private LayoutInflater mInflater;
  288 +
  289 + public MyAdapter(Context context) {
  290 + this.mInflater = LayoutInflater.from(context);
  291 + }
  292 +
  293 + @Override
  294 + public int getCount() {
  295 + // TODO Auto-generated method stub
  296 + return aryContent.size();
  297 + }
  298 +
  299 + @Override
  300 + public Object getItem(int position) {
  301 + // TODO Auto-generated method stub
  302 + return aryContent.get(position);
  303 + }
  304 +
  305 + @Override
  306 + public long getItemId(int position) {
  307 + // TODO Auto-generated method stub
  308 + return position;
  309 + }
  310 +
  311 + @Override
  312 + public boolean isEnabled(int position) {
  313 + // TODO Auto-generated method stub
  314 +
  315 + return super.isEnabled(position);
  316 + }
  317 +
  318 + @Override
  319 + public View getView(final int position, View convertView, ViewGroup parent) {
  320 + ViewHolder holder;
  321 + LogUtil.v("BaseAdapterTest", "getView " + position + " " + convertView);
  322 +
  323 + if (convertView == null) {
  324 + convertView = mInflater.inflate(R.layout.list_multi_vote_result_item, null);
  325 + holder = new ViewHolder();
  326 +
  327 + holder.tvNum = (TextView) convertView.findViewById(R.id.list_multi_result_item_num);
  328 + holder.tvTitle = (TextView) convertView.findViewById(R.id.list_multi_result_item_name);
  329 + holder.tvAgree = (TextView) convertView.findViewById(R.id.list_multi_result_item_agree);
  330 + holder.tvOppose = (TextView) convertView.findViewById(R.id.list_multi_result_item_oppose);
  331 + holder.tvAbstain = (TextView) convertView.findViewById(R.id.list_multi_result_item_abstan);
  332 + holder.tvUnvote = (TextView) convertView.findViewById(R.id.list_multi_result_item_unvote);
  333 + holder.tvResult = (TextView) convertView.findViewById(R.id.list_multi_result_item_result);
  334 +
  335 + convertView.setTag(holder);
  336 + } else {
  337 + holder = (ViewHolder) convertView.getTag();
  338 + }
  339 +
  340 +
  341 +
  342 + ListItem it = aryContent.get(position);
  343 + holder.tvNum.setText(String.valueOf(it.No));
  344 + holder.tvTitle.setText(it.title);
  345 +
  346 +
  347 + holder.tvOppose.setText(String.valueOf(it.oppose));
  348 + holder.tvAbstain.setText(String.valueOf(it.abstain));
  349 + if(it.agree != 0xff && it.agree != 0xffff){
  350 + holder.tvAgree.setVisibility(View.VISIBLE);
  351 + holder.tvAgree.setText(String.valueOf(it.agree));
  352 + }else{
  353 + holder.tvAgree.setVisibility(View.INVISIBLE);
  354 + holder.tvAgree.setText("");
  355 + }
  356 + if(it.oppose != 0xff && it.oppose != 0xffff){
  357 + holder.tvOppose.setVisibility(View.VISIBLE);
  358 + holder.tvOppose.setText(String.valueOf(it.oppose));
  359 + }else{
  360 + holder.tvOppose.setVisibility(View.INVISIBLE);
  361 + holder.tvOppose.setText("");
  362 + }
  363 + if(it.abstain != 0xff && it.abstain != 0xffff){
  364 + holder.tvAbstain.setVisibility(View.VISIBLE);
  365 + holder.tvAbstain.setText(String.valueOf(it.abstain));
  366 + }else{
  367 + holder.tvAbstain.setVisibility(View.INVISIBLE);
  368 + holder.tvAbstain.setText("");
  369 + }
  370 +
  371 + if (it.unvote != 0xff && it.unvote != 0xffff) {
  372 + titleUnvote.setVisibility(View.VISIBLE);
  373 + holder.tvUnvote.setVisibility(View.VISIBLE);
  374 + holder.tvUnvote.setText(String.valueOf(it.unvote));
  375 + } else {
  376 + titleUnvote.setVisibility(View.INVISIBLE);
  377 + holder.tvUnvote.setVisibility(View.INVISIBLE);
  378 + holder.tvUnvote.setText("");
  379 +
  380 + }
  381 +
  382 + String strPass = "";
  383 +
  384 + if (it.pass == 0) {
  385 + strPass = getString(R.string.no_pass);
  386 + } else if (it.pass == 1) {
  387 + strPass = getString(R.string.pass);
  388 + }
  389 +
  390 + holder.tvResult.setText(strPass);
  391 + if (it.pass == 0xffff) {
  392 + holder.tvResult.setVisibility(View.GONE);
  393 + } else {
  394 + holder.tvResult.setVisibility(View.VISIBLE);
  395 + }
  396 +
  397 + if (options.length == 2) {
  398 + holder.tvAbstain.setVisibility(View.GONE);
  399 +
  400 + } else {
  401 + holder.tvAbstain.setVisibility(View.VISIBLE);
  402 + }
  403 +
  404 + return convertView;
  405 + }
  406 +
  407 +
  408 + public final class ViewHolder {
  409 + public TextView tvNum;
  410 + public TextView tvTitle;
  411 + public TextView tvAgree;
  412 + public TextView tvOppose;
  413 + public TextView tvAbstain;
  414 + public TextView tvUnvote;
  415 + public TextView tvResult;
  416 + }
  417 + }
  418 +}
... ...
C5/app/src/main/res/drawable/ic_btn_oo.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="78"
  2 + android:viewportWidth="78" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#DFDFDF" android:pathData="M39,78C17.5,78 0,60.5 0,39S17.5,0 39,0s39,17.5 39,39S60.5,78 39,78zM39,10c-16,0 -29,13 -29,29s13,29 29,29s29,-13 29,-29S55,10 39,10z"/>
  4 +</vector>
... ...
C5/app/src/main/res/drawable/ic_btn_oo_s.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="78"
  2 + android:viewportWidth="78" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#9AC243" android:pathData="M39,78C17.5,78 0,60.5 0,39S17.5,0 39,0s39,17.5 39,39S60.5,78 39,78zM39,10c-16,0 -29,13 -29,29s13,29 29,29s29,-13 29,-29S55,10 39,10z"/>
  4 +</vector>
... ...
C5/app/src/main/res/drawable/ic_btn_xx.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="182.5"
  2 + android:viewportWidth="182.6" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#DFDFDF" android:pathData="M177.7,177.6c-6.5,6.5 -17,6.5 -23.5,0L5,28.5c-6.5,-6.5 -6.5,-17 0,-23.5c6.5,-6.5 17,-6.5 23.6,0L177.7,154C184.2,160.6 184.2,171.1 177.7,177.6L177.7,177.6zM177.5,28.4L28.4,177.5c-6.5,6.5 -17.1,6.5 -23.6,0c-6.5,-6.5 -6.5,-17 0,-23.5L154,4.9c6.5,-6.5 17.1,-6.5 23.5,0C184.1,11.4 184,21.9 177.5,28.4L177.5,28.4zM177.5,28.4"/>
  4 +</vector>
... ...
C5/app/src/main/res/drawable/ic_btn_xx_s.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="182.5"
  2 + android:viewportWidth="182.6" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#D31A1A" android:pathData="M177.7,177.6c-6.5,6.5 -17,6.5 -23.5,0L5,28.5c-6.5,-6.5 -6.5,-17 0,-23.5c6.5,-6.5 17,-6.5 23.6,0L177.7,154C184.2,160.6 184.2,171.1 177.7,177.6L177.7,177.6zM177.5,28.4L28.4,177.5c-6.5,6.5 -17.1,6.5 -23.6,0c-6.5,-6.5 -6.5,-17 0,-23.5L154,4.9c6.5,-6.5 17.1,-6.5 23.5,0C184.1,11.4 184,21.9 177.5,28.4L177.5,28.4zM177.5,28.4"/>
  4 +</vector>
... ...
C5/app/src/main/res/drawable/ic_delete.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="182.1"
  2 + android:viewportWidth="168.8" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#ABABAB" android:pathData="M69.5,142.3v-50c0,-3.9 -3.2,-7.1 -7.1,-7.1s-7.1,3.2 -7.1,7.1v50c0,3.9 3.2,7.1 7.1,7.1S69.5,146.2 69.5,142.3L69.5,142.3zM113,142.3v-50c-0.6,-3.9 -3.9,-6.5 -7.8,-6.5c-3.2,0 -5.8,3.2 -6.5,6.5v50c0.6,3.9 3.9,6.5 7.8,6.5C109.7,148.8 112.3,145.6 113,142.3L113,142.3zM161.7,33.9h-36.4V21.5c0,-12.3 -9.7,-21.4 -22.1,-21.4H63c-11.7,0 -21.4,9.7 -21.4,21.4v12.3H7.1C3.2,33.9 0,37.1 0,41c0,3.9 3.2,7.1 7.1,7.1h154.5c3.9,0 7.1,-3.2 7.1,-7.1C168.8,37.1 165.6,33.9 161.7,33.9L161.7,33.9zM111,33.9H55.2V21.5c0,-4.5 3.2,-7.8 7.8,-7.8h40.3c4.5,0 7.8,3.2 7.8,7.8V33.9zM111,33.9"/>
  4 + <path android:fillColor="#ABABAB" android:pathData="M148.7,58.6c-3.9,0 -7.1,2.6 -7.1,6.5v94.2c0,5.2 -4.5,9.1 -9.7,9.1H37c-5.2,0 -9.7,-3.9 -9.7,-9.1V65c0,-3.9 -3.2,-6.5 -7.1,-6.5c-3.9,0 -7.1,2.6 -7.1,6.5v94.2c0.6,13 11,22.7 24,22.7h95.5c13,0 23.4,-9.7 23.4,-22.7V65C155.8,61.2 152.6,58.6 148.7,58.6L148.7,58.6zM148.7,58.6"/>
  5 +</vector>
... ...
C5/app/src/main/res/drawable/ic_gray_selected.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="199.9"
  2 + android:viewportWidth="201.7" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#CCCCCC" android:pathData="M83.2,136.7l-32.9,-32.9c-4,-4 -10.4,-4 -14.4,0c-4,4 -4,10.4 0,14.4L71.7,154c3.4,3.4 8,5.3 12.8,5.3c4.9,0 9.6,-1.9 13.1,-5.4l95,-94.9c2.6,-2.6 3.6,-6.3 2.7,-9.8c-0.9,-3.5 -3.7,-6.3 -7.2,-7.2c-3.5,-0.9 -7.3,0 -9.8,2.6l-92.1,92.1C85.3,137.5 84,137.5 83.2,136.7L83.2,136.7zM83.2,136.7"/>
  4 + <path android:fillColor="#CCCCCC" android:pathData="M190.7,98.8c-5.5,0 -11,4.6 -11,10.2v57.4c0,7.8 -5.9,15.2 -13.9,15.2h-131c-7.9,0 -16.5,-7.3 -16.5,-15.2V35.3c0,-7.9 8.5,-15.1 16.5,-15.1h90c2.7,0 5.3,-1 7.2,-2.9c1.9,-1.9 3,-4.5 3,-7.2C135,4.5 130.4,0 124.8,0h-90C15.5,0.3 0,16 0,35.3v131.1c0,19.1 15.7,33.5 34.8,33.5h131c19.1,0 35.9,-14.4 35.9,-33.5V109C201.7,103.3 196.3,98.8 190.7,98.8L190.7,98.8zM190.7,98.8"/>
  5 +</vector>
... ...
C5/app/src/main/res/drawable/ic_green_selected.xml 0 → 100644
  1 +<vector android:height="24dp" android:viewportHeight="199.9"
  2 + android:viewportWidth="201.7" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <path android:fillColor="#95BA46" android:pathData="M83.2,136.7l-32.9,-32.9c-4,-4 -10.4,-4 -14.4,0c-4,4 -4,10.4 0,14.4L71.7,154c3.4,3.4 8,5.3 12.8,5.3c4.9,0 9.6,-1.9 13.1,-5.4l95,-94.9c2.6,-2.6 3.6,-6.3 2.7,-9.8c-0.9,-3.5 -3.7,-6.3 -7.2,-7.2c-3.5,-0.9 -7.3,0 -9.8,2.6l-92.1,92.1C85.3,137.5 84,137.5 83.2,136.7L83.2,136.7zM83.2,136.7"/>
  4 + <path android:fillColor="#95BA46" android:pathData="M190.7,98.8c-5.5,0 -11,4.6 -11,10.2v57.4c0,7.8 -5.9,15.2 -13.9,15.2h-131c-7.9,0 -16.5,-7.3 -16.5,-15.2V35.3c0,-7.9 8.5,-15.1 16.5,-15.1h90c2.7,0 5.3,-1 7.2,-2.9c1.9,-1.9 3,-4.5 3,-7.2C135,4.5 130.4,0 124.8,0h-90C15.5,0.3 0,16 0,35.3v131.1c0,19.1 15.7,33.5 34.8,33.5h131c19.1,0 35.9,-14.4 35.9,-33.5V109C201.7,103.3 196.3,98.8 190.7,98.8L190.7,98.8zM190.7,98.8"/>
  5 +</vector>
... ...
C5/app/src/main/res/drawable/selected_selector.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android" >
  3 +
  4 + <item android:state_checked="true" android:state_window_focused="false"
  5 + android:drawable="@drawable/ic_green_selected" />
  6 + <item android:state_checked="false" android:state_window_focused="false"
  7 + android:drawable="@drawable/ic_gray_selected" />
  8 +
  9 + <item android:state_checked="true" android:state_window_focused="true"
  10 + android:drawable="@drawable/ic_green_selected" />
  11 + <item android:state_checked="false" android:state_window_focused="true"
  12 + android:drawable="@drawable/ic_gray_selected" />
  13 +
  14 + <item android:state_checked="true" android:state_pressed="true"
  15 + android:drawable="@drawable/ic_green_selected" />
  16 + <item android:state_checked="false" android:state_pressed="true"
  17 + android:drawable="@drawable/ic_gray_selected" />
  18 +
  19 + <item android:state_checked="true" android:state_focused="true"
  20 + android:drawable="@drawable/ic_green_selected" />
  21 + <item android:state_checked="false" android:state_focused="true"
  22 + android:drawable="@drawable/ic_gray_selected" />
  23 +
  24 + <item android:state_checked="true" android:state_focused="false"
  25 + android:drawable="@drawable/ic_green_selected" />
  26 + <item android:state_checked="false" android:state_focused="false"
  27 + android:drawable="@drawable/ic_gray_selected" />
  28 +
  29 + <item android:state_checked="false" android:drawable="@drawable/ic_gray_selected" />
  30 + <item android:state_checked="true" android:drawable="@drawable/ic_green_selected" />
  31 +
  32 +
  33 +
  34 +
  35 +
  36 +
  37 +</selector>
... ...
C5/app/src/main/res/layout/fragment_result_election_custom.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:background="#0952b5"
  6 + android:orientation="vertical">
  7 +
  8 + <RelativeLayout
  9 + android:id="@+id/title_linear"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:layout_marginTop="@dimen/px110dp">
  13 +
  14 + <ImageButton
  15 + android:id="@+id/fragment_result_election_btn_back"
  16 + android:layout_width="wrap_content"
  17 + android:layout_height="wrap_content"
  18 + android:layout_marginLeft="@dimen/content_margin"
  19 + android:background="@drawable/back_white_selector"
  20 + android:visibility="invisible" />
  21 +
  22 + <TextView
  23 + android:id="@+id/fragment_result_election_bill_title"
  24 + android:layout_width="fill_parent"
  25 + android:layout_height="wrap_content"
  26 + android:layout_centerHorizontal="true"
  27 + android:layout_marginLeft="@dimen/content_margin"
  28 + android:layout_marginRight="@dimen/content_margin"
  29 + android:ellipsize="end"
  30 + android:gravity="center"
  31 + android:lines="1"
  32 + android:text="@string/vote_election"
  33 + android:textColor="@color/white"
  34 + android:textSize="@dimen/big_text_p3"
  35 + android:textStyle="bold" />
  36 + </RelativeLayout>
  37 +
  38 + <LinearLayout
  39 + android:id="@+id/bottom_linear"
  40 + android:layout_width="400dp"
  41 + android:layout_height="wrap_content"
  42 + android:layout_marginTop="@dimen/px60dp"
  43 + android:layout_centerHorizontal="true"
  44 + android:layout_below="@id/title_linear"
  45 + android:orientation="horizontal">
  46 +
  47 + <TextView
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:layout_weight="1"
  51 + android:gravity="right"
  52 + android:text="@string/yindao1"
  53 + android:textColor="@color/white"
  54 + android:textSize="@dimen/px60dp"
  55 + android:textStyle="bold" />
  56 +
  57 + <TextView
  58 + android:id="@+id/yingdaoresult"
  59 + android:layout_width="wrap_content"
  60 + android:layout_height="wrap_content"
  61 + android:layout_marginLeft="10dp"
  62 + android:layout_marginRight="60dp"
  63 + android:layout_weight="1"
  64 + android:gravity="left"
  65 + android:text="150"
  66 + android:textColor="@color/white"
  67 + android:textSize="@dimen/px60dp"/>
  68 +
  69 + <TextView
  70 + android:layout_width="wrap_content"
  71 + android:layout_height="wrap_content"
  72 + android:gravity="right"
  73 + android:text="@string/shidao1"
  74 + android:textColor="@color/white"
  75 + android:textSize="@dimen/px60dp"
  76 + android:textStyle="bold" />
  77 +
  78 + <TextView
  79 + android:id="@+id/shidaoresult"
  80 + android:layout_width="wrap_content"
  81 + android:layout_height="wrap_content"
  82 + android:layout_marginLeft="10dp"
  83 + android:layout_weight="1"
  84 + android:gravity="left"
  85 + android:text="150"
  86 + android:textColor="@color/white"
  87 + android:textSize="@dimen/px60dp"/>
  88 +
  89 + </LinearLayout>
  90 +
  91 + <LinearLayout
  92 + android:id="@+id/data_title_layout"
  93 + android:layout_width="match_parent"
  94 + android:layout_height="wrap_content"
  95 + android:layout_below="@id/bottom_linear"
  96 + android:layout_marginTop="@dimen/px91dp"
  97 + android:orientation="horizontal"
  98 + android:paddingRight="80dp">
  99 +
  100 + <TextView
  101 + android:id="@+id/fragment_result_election_num"
  102 + android:layout_width="140dp"
  103 + android:layout_height="match_parent"
  104 + android:gravity="center"
  105 + android:paddingLeft="@dimen/content_margin"
  106 + android:text="@string/number"
  107 + android:textColor="@color/white"
  108 + android:textSize="@dimen/px48dp"
  109 + android:textStyle="bold" />
  110 +
  111 + <TextView
  112 + android:id="@+id/fragment_result_election_name"
  113 + android:layout_width="0dp"
  114 + android:layout_height="match_parent"
  115 + android:layout_weight="1"
  116 + android:gravity="center"
  117 + android:text="@string/item"
  118 + android:textColor="@color/white"
  119 + android:textSize="@dimen/px48dp"
  120 + android:textStyle="bold" />
  121 +
  122 + <TextView
  123 + android:id="@+id/fragment_result_election_agree_num"
  124 + android:layout_width="140dp"
  125 + android:layout_height="match_parent"
  126 + android:gravity="center"
  127 + android:text="@string/vote_num"
  128 + android:textColor="@color/white"
  129 + android:textSize="@dimen/px48dp"
  130 + android:textStyle="bold" />
  131 + </LinearLayout>
  132 +
  133 + <ListView
  134 + android:id="@+id/fragment_result_election_list"
  135 + android:layout_width="match_parent"
  136 + android:layout_height="match_parent"
  137 + android:layout_below="@id/data_title_layout"
  138 + android:layout_marginBottom="@dimen/content_margin"
  139 + android:layout_marginTop="@dimen/px20dp"
  140 + android:divider="@color/blue1"
  141 + android:dividerHeight="1dp" />
  142 +
  143 +</RelativeLayout>
0 144 \ No newline at end of file
... ...
C5/app/src/main/res/layout/list_result_election_custom_item.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="@dimen/px110dp"
  5 + android:layout_marginBottom="@dimen/content_margin"
  6 + android:layout_marginTop="@dimen/content_margin"
  7 + android:minHeight="@dimen/px110dp"
  8 + android:paddingRight="80dp">
  9 +
  10 + <TextView
  11 + android:id="@+id/item_result_election_num"
  12 + android:layout_width="140dp"
  13 + android:layout_height="match_parent"
  14 + android:layout_centerVertical="true"
  15 + android:gravity="center"
  16 + android:paddingLeft="@dimen/content_margin"
  17 + android:text="@string/name_index"
  18 + android:textColor="@color/white"
  19 + android:textSize="@dimen/px48dp"
  20 + android:textStyle="bold"/>
  21 +
  22 + <TextView
  23 + android:id="@+id/item_result_election_name"
  24 + android:layout_width="0dp"
  25 + android:layout_height="match_parent"
  26 + android:layout_weight="1"
  27 + android:text="@string/name_xpad"
  28 + android:textColor="@color/white"
  29 + android:gravity="center"
  30 + android:textSize="@dimen/px48dp"
  31 + android:textStyle="bold" />
  32 +
  33 + <TextView
  34 + android:id="@+id/item_result_election_agree"
  35 + android:layout_width="140dp"
  36 + android:layout_height="match_parent"
  37 + android:gravity="center"
  38 + android:text="@string/agree_num"
  39 + android:textColor="@color/white"
  40 + android:textSize="@dimen/px48dp"
  41 + android:textStyle="bold" />
  42 +</LinearLayout>
... ...