Commit 6a5053e0771cb5f4e17fd1a1538e9a7e4c2d0504
1 parent
18faef8d
修复bug -- 选举
Showing
12 changed files
with
33 additions
and
23 deletions
C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java
| @@ -293,7 +293,7 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -293,7 +293,7 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 293 | if(statusBarView!=null){ | 293 | if(statusBarView!=null){ | 
| 294 | statusBarView.setStatusSignal(0); | 294 | statusBarView.setStatusSignal(0); | 
| 295 | statusBarView.setStatusBarBaseId(0); | 295 | statusBarView.setStatusBarBaseId(0); | 
| 296 | - //statusBarView.setStatusCH(0); | 296 | + statusBarView.setStatusCH(0); | 
| 297 | statusBarView.setStatusWifi(0); | 297 | statusBarView.setStatusWifi(0); | 
| 298 | statusBarView.setStatusKeyId(0); | 298 | statusBarView.setStatusKeyId(0); | 
| 299 | } | 299 | } | 
| @@ -1377,6 +1377,9 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -1377,6 +1377,9 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 1377 | @Override | 1377 | @Override | 
| 1378 | public void run() { | 1378 | public void run() { | 
| 1379 | service.setVisibility(View.GONE); | 1379 | service.setVisibility(View.GONE); | 
| 1380 | + if(servicePresent != null){ | ||
| 1381 | + servicePresent.dismiss(); | ||
| 1382 | + } | ||
| 1380 | } | 1383 | } | 
| 1381 | }); | 1384 | }); | 
| 1382 | } | 1385 | } | 
| @@ -1651,9 +1654,16 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -1651,9 +1654,16 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 1651 | } | 1654 | } | 
| 1652 | 1655 | ||
| 1653 | @Override | 1656 | @Override | 
| 1654 | - public void onKeyPadEvent(KeypadInfo info) { | 1657 | + public void onKeyPadEvent(final KeypadInfo info) { | 
| 1655 | LogUtil.i(TAG, "onKeyPadEvent"); | 1658 | LogUtil.i(TAG, "onKeyPadEvent"); | 
| 1656 | mKeypadInfo = info; | 1659 | mKeypadInfo = info; | 
| 1660 | + runOnUiThread(new Runnable() { | ||
| 1661 | + @Override | ||
| 1662 | + public void run() { | ||
| 1663 | + statusBarView.setStatusKeyId(info.keyId); | ||
| 1664 | + statusBarView.setStatusCH(info.chan); | ||
| 1665 | + } | ||
| 1666 | + }); | ||
| 1657 | XPadSystem.setStatusBarPadID(this, info.keyId); | 1667 | XPadSystem.setStatusBarPadID(this, info.keyId); | 
| 1658 | XPadSystem.setStatusBarChannel(this, info.chan); | 1668 | XPadSystem.setStatusBarChannel(this, info.chan); | 
| 1659 | if (info.cmd1 == 8 || info.cmd1 == 9) { | 1669 | if (info.cmd1 == 8 || info.cmd1 == 9) { | 
| @@ -1666,7 +1676,7 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -1666,7 +1676,7 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 1666 | } | 1676 | } | 
| 1667 | 1677 | ||
| 1668 | @Override | 1678 | @Override | 
| 1669 | - public void onOnLineEvent(OnLineInfo info) { | 1679 | + public void onOnLineEvent(final OnLineInfo info) { | 
| 1670 | 1680 | ||
| 1671 | if (info.comError == 1) { | 1681 | if (info.comError == 1) { | 
| 1672 | if (info.comError != mOnlineInfo.comError) { | 1682 | if (info.comError != mOnlineInfo.comError) { | 
| @@ -1707,7 +1717,10 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -1707,7 +1717,10 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 1707 | runOnUiThread(new Runnable() { | 1717 | runOnUiThread(new Runnable() { | 
| 1708 | @Override | 1718 | @Override | 
| 1709 | public void run() { | 1719 | public void run() { | 
| 1710 | - if(mOnlineInfo != null){ | 1720 | + if(mOnlineInfo != null) { | 
| 1721 | + statusBarView.setStatusBarBaseId(mOnlineInfo.baseId); | ||
| 1722 | + statusBarView.setStatusCH(mOnlineInfo.chan); | ||
| 1723 | + statusBarView.setStatusSignal(mOnlineInfo.rssi); | ||
| 1711 | setTerminalId(mOnlineInfo.keyId); | 1724 | setTerminalId(mOnlineInfo.keyId); | 
| 1712 | } | 1725 | } | 
| 1713 | } | 1726 | } | 
| @@ -1717,7 +1730,6 @@ public class MainActivity extends BaseActivity implements ComListener { | @@ -1717,7 +1730,6 @@ public class MainActivity extends BaseActivity implements ComListener { | ||
| 1717 | XPadSystem.setStatusBarBaseId(this, getString(R.string.base_id) + ":" + info.baseId); | 1730 | XPadSystem.setStatusBarBaseId(this, getString(R.string.base_id) + ":" + info.baseId); | 
| 1718 | XPadSystem.setStatusBarSingal(this, info.rssi); | 1731 | XPadSystem.setStatusBarSingal(this, info.rssi); | 
| 1719 | 1732 | ||
| 1720 | - | ||
| 1721 | } | 1733 | } | 
| 1722 | 1734 | ||
| 1723 | 1735 | 
C5/app/src/main/java/com/sunvote/xpadapp/fragments/ElectionCustomFragment.java
| @@ -397,15 +397,16 @@ public class ElectionCustomFragment extends BaseFragment { | @@ -397,15 +397,16 @@ public class ElectionCustomFragment extends BaseFragment { | ||
| 397 | convertView.setBackgroundColor(position % 2 == 0 ? Color.WHITE : Color.parseColor("#E5E5E5")); | 397 | convertView.setBackgroundColor(position % 2 == 0 ? Color.WHITE : Color.parseColor("#E5E5E5")); | 
| 398 | holder.tvNum.setText(String.valueOf(it.No)); | 398 | holder.tvNum.setText(String.valueOf(it.No)); | 
| 399 | holder.tvName.setText(String.valueOf(it.title)); | 399 | holder.tvName.setText(String.valueOf(it.title)); | 
| 400 | - if (it.result == 4) { | ||
| 401 | - holder.RG.clearCheck(); | ||
| 402 | - } else if (it.result == 1) { | 400 | + if (it.result == 1) { | 
| 403 | holder.RG.check(R.id.list_election_item_oo); | 401 | holder.RG.check(R.id.list_election_item_oo); | 
| 404 | - } else if (it.result == 2) { | ||
| 405 | - holder.RG.check(R.id.list_election_item_xx); | ||
| 406 | - }else if (it.result == 3) { | ||
| 407 | - holder.RG.check(R.id.list_election_item_abstain); | 402 | + } else { | 
| 403 | + holder.RG.clearCheck(); | ||
| 408 | } | 404 | } | 
| 405 | +// else if (it.result == 2) { | ||
| 406 | +// holder.RG.check(R.id.list_election_item_xx); | ||
| 407 | +// }else if (it.result == 3) { | ||
| 408 | +// holder.RG.check(R.id.list_election_item_abstain); | ||
| 409 | +// } | ||
| 409 | 410 | ||
| 410 | if(it.modifyModel){ | 411 | if(it.modifyModel){ | 
| 411 | holder.btnO.setEnabled(false); | 412 | holder.btnO.setEnabled(false); | 
| @@ -417,11 +418,11 @@ public class ElectionCustomFragment extends BaseFragment { | @@ -417,11 +418,11 @@ public class ElectionCustomFragment extends BaseFragment { | ||
| 417 | holder.btnAbstain.setEnabled(true); | 418 | holder.btnAbstain.setEnabled(true); | 
| 418 | } | 419 | } | 
| 419 | 420 | ||
| 420 | - if(it.result == 1){ | 421 | + /*if(it.result == 1){ | 
| 421 | holder.btnO.setChecked(true); | 422 | holder.btnO.setChecked(true); | 
| 422 | }else { | 423 | }else { | 
| 423 | holder.btnO.setChecked(false); | 424 | holder.btnO.setChecked(false); | 
| 424 | - } | 425 | + }*/ | 
| 425 | 426 | ||
| 426 | holder.btnO.setOnClickListener(new OnClickListener() { | 427 | holder.btnO.setOnClickListener(new OnClickListener() { | 
| 427 | @Override | 428 | @Override | 
C5/app/src/main/java/com/sunvote/xpadapp/fragments/ElectionFragment.java
| @@ -306,7 +306,7 @@ public class ElectionFragment extends BaseFragment { | @@ -306,7 +306,7 @@ public class ElectionFragment extends BaseFragment { | ||
| 306 | listview.setVisibility(View.VISIBLE); | 306 | listview.setVisibility(View.VISIBLE); | 
| 307 | hideConfirm(); | 307 | hideConfirm(); | 
| 308 | hideResult(); | 308 | hideResult(); | 
| 309 | - showVote(); | 309 | +// showVote(); | 
| 310 | } | 310 | } | 
| 311 | }); | 311 | }); | 
| 312 | 312 | 
C5/app/src/main/java/com/sunvote/xpadapp/presenter/XPadPresenter.java
| @@ -236,7 +236,7 @@ public class XPadPresenter implements ComListener { | @@ -236,7 +236,7 @@ public class XPadPresenter implements ComListener { | ||
| 236 | 236 | ||
| 237 | @Override | 237 | @Override | 
| 238 | public void onServiceSubmitSuccess() { | 238 | public void onServiceSubmitSuccess() { | 
| 239 | - | 239 | + cl.onServiceSubmitSuccess(); | 
| 240 | } | 240 | } | 
| 241 | 241 | ||
| 242 | private IntentFilter batteryLevelFilter; | 242 | private IntentFilter batteryLevelFilter; | 
C5/app/src/main/java/com/sunvote/xpadcomm/XPadApi.java
| @@ -1523,9 +1523,9 @@ public class XPadApi implements XPadApiInterface { | @@ -1523,9 +1523,9 @@ public class XPadApi implements XPadApiInterface { | ||
| 1523 | info.dataPos = dt[4] & 0xff; | 1523 | info.dataPos = dt[4] & 0xff; | 
| 1524 | info.mode = dt[5] & 0xff; | 1524 | info.mode = dt[5] & 0xff; | 
| 1525 | info.mode1_msgType = dt[6] & 0xff; | 1525 | info.mode1_msgType = dt[6] & 0xff; | 
| 1526 | - if (info.mode != VoteType_Stop) { | ||
| 1527 | - serialNumber = 0; | ||
| 1528 | - } | 1526 | +// if (info.mode != VoteType_Stop) { | 
| 1527 | +// serialNumber = 0; | ||
| 1528 | +// } | ||
| 1529 | 1529 | ||
| 1530 | if (info.mode == VoteType_Stop) { // 停止 | 1530 | if (info.mode == VoteType_Stop) { // 停止 | 
| 1531 | if (info.mode1_msgType == 2) { // 有结果 | 1531 | if (info.mode1_msgType == 2) { // 有结果 | 
C5/app/src/main/res/layout/list_multi_vote_result_item.xml
| @@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
| 29 | android:layout_gravity="center_vertical" | 29 | android:layout_gravity="center_vertical" | 
| 30 | android:layout_marginLeft="10dp" | 30 | android:layout_marginLeft="10dp" | 
| 31 | android:layout_weight="1" | 31 | android:layout_weight="1" | 
| 32 | - android:gravity="center" | 32 | + android:gravity="left|center_vertical" | 
| 33 | android:text="表决标题表决标题表决标题表决标题表决标题表决标题表决标题表决标题" | 33 | android:text="表决标题表决标题表决标题表决标题表决标题表决标题表决标题表决标题" | 
| 34 | android:textColor="@color/white" | 34 | android:textColor="@color/white" | 
| 35 | android:textSize="@dimen/px40dp" /> | 35 | android:textSize="@dimen/px40dp" /> | 
C5/app/src/main/res/layout/status_icon_view.xml
| @@ -17,7 +17,6 @@ | @@ -17,7 +17,6 @@ | ||
| 17 | android:layout_height="match_parent" | 17 | android:layout_height="match_parent" | 
| 18 | android:gravity="left|center_vertical" | 18 | android:gravity="left|center_vertical" | 
| 19 | android:layout_weight="1" | 19 | android:layout_weight="1" | 
| 20 | - android:visibility="invisible" | ||
| 21 | android:text="" | 20 | android:text="" | 
| 22 | android:textColor="@android:color/white"/> | 21 | android:textColor="@android:color/white"/> | 
| 23 | <com.sunvote.statusbar.view.BarItem | 22 | <com.sunvote.statusbar.view.BarItem | 
| @@ -25,7 +24,6 @@ | @@ -25,7 +24,6 @@ | ||
| 25 | android:layout_width="wrap_content" | 24 | android:layout_width="wrap_content" | 
| 26 | android:layout_height="match_parent" | 25 | android:layout_height="match_parent" | 
| 27 | android:gravity="left" | 26 | android:gravity="left" | 
| 28 | - android:visibility="invisible" | ||
| 29 | android:text="" | 27 | android:text="" | 
| 30 | android:layout_weight="0.1" | 28 | android:layout_weight="0.1" | 
| 31 | android:textColor="@android:color/white"/> | 29 | android:textColor="@android:color/white"/> | 
| @@ -35,7 +33,6 @@ | @@ -35,7 +33,6 @@ | ||
| 35 | android:layout_height="match_parent" | 33 | android:layout_height="match_parent" | 
| 36 | android:gravity="right" | 34 | android:gravity="right" | 
| 37 | android:text="" | 35 | android:text="" | 
| 38 | - android:visibility="invisible" | ||
| 39 | android:layout_weight="1" | 36 | android:layout_weight="1" | 
| 40 | android:textColor="@android:color/white"/> | 37 | android:textColor="@android:color/white"/> | 
| 41 | <com.sunvote.statusbar.view.BarItem | 38 | <com.sunvote.statusbar.view.BarItem | 
C5/app/src/main/res/mipmap-hdpi/signal_1.png deleted
16.1 KB
C5/app/src/main/res/mipmap-hdpi/signal_2.png deleted
16.2 KB
C5/app/src/main/res/mipmap-hdpi/signal_3.png deleted
16.2 KB
C5/app/src/main/res/mipmap-hdpi/signal_4.png deleted
16.2 KB
C5/app/src/main/res/mipmap-hdpi/signal_5.png deleted
15.7 KB
