瀏覽代碼

Fixed wrong checked drawer button when changing location

develop
Robin Thoni 6 年之前
父節點
當前提交
e856fc0e38
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      app/src/main/java/com/rthoni/camotion/ui/MainActivity.java

+ 3
- 0
app/src/main/java/com/rthoni/camotion/ui/MainActivity.java 查看文件

@@ -203,10 +203,13 @@ public class MainActivity extends AppCompatActivity
203 203
         }
204 204
         CamotionFragment fragment;
205 205
         if (view == R.id.nav_cameras) {
206
+            _navigationView.getMenu().findItem(R.id.nav_cameras).setChecked(true);
206 207
             fragment = new CamerasFragment();
207 208
         } else if (view == R.id.nav_commands) {
209
+            _navigationView.getMenu().findItem(R.id.nav_commands).setChecked(true);
208 210
             fragment = new CommandsFragment();
209 211
         } else if (view == R.id.nav_sensors) {
212
+            _navigationView.getMenu().findItem(R.id.nav_sensors).setChecked(true);
210 213
             fragment = new SensorsFragment();
211 214
         } /*else if (view == -1) {
212 215
             fragment = new DefaultFragment();

Loading…
取消
儲存