Commit 19e4f834018d6088c3d779d270ae6965e03baf0e
Merge branch 'C58寸' of http://120.78.57.84/Elvis/VoteC5 into C58寸
Showing
3 changed files
with
29 additions
and
14 deletions
C5/app/src/main/java/com/sunvote/xpadapp/MainActivity.java
| ... | ... | @@ -286,6 +286,7 @@ public class MainActivity extends BaseActivity implements ComListener { | 
| 286 | 286 | statusBarView.setStatusSignal(0); | 
| 287 | 287 | statusBarView.setStatusBarBaseId(0); | 
| 288 | 288 | //statusBarView.setStatusCH(0); | 
| 289 | + statusBarView.setStatusWifi(0); | |
| 289 | 290 | statusBarView.setStatusKeyId(0); | 
| 290 | 291 | } | 
| 291 | 292 | |
| ... | ... | @@ -307,7 +308,8 @@ public class MainActivity extends BaseActivity implements ComListener { | 
| 307 | 308 | runOnUiThread(new Runnable() { | 
| 308 | 309 | @Override | 
| 309 | 310 | public void run() { | 
| 310 | - statusBarView.setStatusSignal(netWork_receiver.getRssiLevel()); | |
| 311 | + //statusBarView.setStatusSignal(netWork_receiver.getRssiLevel()); | |
| 312 | + statusBarView.setStatusWifi(netWork_receiver.getRssiLevel()); | |
| 311 | 313 | } | 
| 312 | 314 | }); | 
| 313 | 315 | } | ... | ... | 
C5/app/src/main/java/com/sunvote/xpadapp/widget/StatusBarView.java
| ... | ... | @@ -15,8 +15,8 @@ import com.sunvote.xpadapp.R; | 
| 15 | 15 | |
| 16 | 16 | public class StatusBarView extends LinearLayout { | 
| 17 | 17 | Context mContext; | 
| 18 | - //信号图标,基站编号,CH,终端ID,电池电量图标,系统时间 | |
| 19 | - BarItem barSignal,barBasestation,barCh,barTerminalId,barBattery,barSystemtime; | |
| 18 | + //信号图标,基站编号,CH,终端ID,电池电量图标,系统时间,wifi | |
| 19 | + BarItem barSignal,barBasestation,barCh,barTerminalId,barBattery,barSystemtime,barWifi; | |
| 20 | 20 | |
| 21 | 21 | public StatusBarView(Context context) { | 
| 22 | 22 | this(context, null); | 
| ... | ... | @@ -46,6 +46,7 @@ public class StatusBarView extends LinearLayout { | 
| 46 | 46 | barTerminalId = (BarItem) view.findViewById(R.id.bar_terminalId); | 
| 47 | 47 | barBattery = (BarItem) view.findViewById(R.id.bar_battery); | 
| 48 | 48 | barSystemtime = (BarItem) view.findViewById(R.id.bar_systemtime); | 
| 49 | + barWifi= (BarItem) view.findViewById(R.id.bar_wifi); | |
| 49 | 50 | addView(view); | 
| 50 | 51 | } | 
| 51 | 52 | |
| ... | ... | @@ -57,7 +58,7 @@ public class StatusBarView extends LinearLayout { | 
| 57 | 58 | * @param rssi | 
| 58 | 59 | */ | 
| 59 | 60 | public void setStatusSignal(int rssi){ | 
| 60 | - /* barSignal.setIcon(R.mipmap.signal); | |
| 61 | + barSignal.setIcon(R.mipmap.signal); | |
| 61 | 62 | if (rssi < 95){ | 
| 62 | 63 | barSignal.setIcon(R.mipmap.signal_1); | 
| 63 | 64 | } | 
| ... | ... | @@ -72,16 +73,19 @@ public class StatusBarView extends LinearLayout { | 
| 72 | 73 | } | 
| 73 | 74 | if (rssi < 55) { | 
| 74 | 75 | barSignal.setIcon(R.mipmap.signal_5); | 
| 75 | - }*/ | |
| 76 | - | |
| 77 | - if(rssi > -100) { | |
| 78 | - barSignal.setVisibility(VISIBLE); | |
| 79 | - barSignal.setIcon(R.mipmap.wifi); | |
| 80 | - }else { | |
| 81 | - barSignal.setVisibility(INVISIBLE); | |
| 82 | - } | |
| 76 | + } | |
| 83 | 77 | } | 
| 84 | 78 | |
| 79 | + public void setStatusWifi(int wifi){ | |
| 80 | + if(wifi > -100) { | |
| 81 | + barWifi.setVisibility(VISIBLE); | |
| 82 | + barWifi.setIcon(R.mipmap.wifi); | |
| 83 | + }else { | |
| 84 | + barWifi.setVisibility(GONE); | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 88 | + | |
| 85 | 89 | /** | 
| 86 | 90 | * 设置基站编号 | 
| 87 | 91 | * @param value | ... | ... | 
C5/app/src/main/res/layout/status_icon_view.xml
| ... | ... | @@ -17,6 +17,7 @@ | 
| 17 | 17 | android:layout_height="match_parent" | 
| 18 | 18 | android:gravity="left|center_vertical" | 
| 19 | 19 | android:layout_weight="1" | 
| 20 | + android:visibility="invisible" | |
| 20 | 21 | android:text="" | 
| 21 | 22 | android:textColor="@android:color/white"/> | 
| 22 | 23 | <com.sunvote.statusbar.view.BarItem | 
| ... | ... | @@ -43,7 +44,7 @@ | 
| 43 | 44 | android:layout_height="match_parent" | 
| 44 | 45 | android:gravity="center" | 
| 45 | 46 | android:text="" | 
| 46 | - android:layout_weight="8" | |
| 47 | + android:layout_weight="7" | |
| 47 | 48 | android:textColor="@android:color/white"/> | 
| 48 | 49 | <com.sunvote.statusbar.view.BarItem | 
| 49 | 50 | android:id="@+id/bar_systemtime" | 
| ... | ... | @@ -51,7 +52,15 @@ | 
| 51 | 52 | android:layout_height="match_parent" | 
| 52 | 53 | android:gravity="right|center" | 
| 53 | 54 | android:text="" | 
| 54 | - android:layout_weight="2" | |
| 55 | + android:layout_weight="1" | |
| 56 | + android:textColor="@android:color/white"/> | |
| 57 | + <com.sunvote.statusbar.view.BarItem | |
| 58 | + android:id="@+id/bar_wifi" | |
| 59 | + android:layout_width="wrap_content" | |
| 60 | + android:layout_height="match_parent" | |
| 61 | + android:gravity="right|center_vertical" | |
| 62 | + android:layout_weight="0.1" | |
| 63 | + android:text="" | |
| 55 | 64 | android:textColor="@android:color/white"/> | 
| 56 | 65 | <com.sunvote.statusbar.view.BarItem | 
| 57 | 66 | android:id="@+id/bar_battery" | ... | ... | 
