diff --git a/code/src/Fitbot/.idea/misc.xml b/code/src/Fitbot/.idea/misc.xml index 4496bac..6d5e29f 100644 --- a/code/src/Fitbot/.idea/misc.xml +++ b/code/src/Fitbot/.idea/misc.xml @@ -16,25 +16,32 @@ - + + + + - + + + + - - + + + diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java index b311917..371e169 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java @@ -40,7 +40,6 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall FitnessCycle.playVideo(videoView, this); ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class); - ButtonNavigation.setupButtonNavigation(this, R.id.buttonComplete, EndScreenActivity.class); // Implement your logic when the robot focus is gained GesturePath.Builder gesturePathBuilder = new GesturePath.Builder(); diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/MainActivity.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/MainActivity.java index b2fa7ba..50c6df2 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/MainActivity.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/MainActivity.java @@ -11,6 +11,8 @@ import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; +import android.view.View; +import android.view.WindowManager; import android.widget.Button; import com.example.fitbot.R; @@ -18,20 +20,26 @@ import com.example.fitbot.util.ButtonNavigation; public class MainActivity extends AppCompatActivity { - //Variables + // Variables DrawerLayout drawerLayout; NavigationView navigationView; Toolbar toolbar; Button startButton; @SuppressLint("WrongViewCast") - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - Button startButton = findViewById(R.id.startButton); + // Set full screen mode + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + + // Hide system UI + hideSystemUI(); + + startButton = findViewById(R.id.startButton); startButton.setOnClickListener(v -> { Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo); Intent intent = new Intent(MainActivity.this, FitnessActivity.class); @@ -49,29 +57,63 @@ public class MainActivity extends AppCompatActivity { toolbar = findViewById(R.id.toolbar); startButton = findViewById(R.id.startButton); + // Hide the action bar + if (getSupportActionBar() != null) { + getSupportActionBar().hide(); + } ButtonNavigation.setupButtonNavigation(this, R.id.startButton, FitnessActivity.class); ButtonNavigation.setupButtonNavigation(this, R.id.helpButton, HelpActivity.class); /*---Tool Bar---*/ setSupportActionBar(toolbar); // Make the toolbar act as the action bar - getSupportActionBar().setDisplayShowTitleEnabled(false); // Remove the title from the toolbar + if (getSupportActionBar() != null) { + getSupportActionBar().setDisplayShowTitleEnabled(false); // Remove the title from the toolbar + } /*---Navigation Drawer Menu---*/ navigationView.bringToFront(); // Make the navigation drawer menu clickable - ActionBarDrawerToggle toggle=new // Create a toggle for the navigation drawer - ActionBarDrawerToggle(this,drawerLayout,toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + ActionBarDrawerToggle toggle = new // Create a toggle for the navigation drawer + ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) { + @Override + public void onDrawerOpened(View drawerView) { + super.onDrawerOpened(drawerView); + hideSystemUI(); + } + + @Override + public void onDrawerClosed(View drawerView) { + super.onDrawerClosed(drawerView); + hideSystemUI(); + } + }; drawerLayout.addDrawerListener(toggle); toggle.syncState(); // Synchronize the state of the navigation drawer } + private void hideSystemUI() { + View decorView = getWindow().getDecorView(); + // Hide the status bar and navigation bar + int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + decorView.setSystemUiVisibility(uiOptions); + } + @Override - public void onBackPressed(){ // Close the navigation drawer when the back button is pressed - if(drawerLayout.isDrawerOpen(GravityCompat.START)){ - drawerLayout.closeDrawer(GravityCompat.START); + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + if (hasFocus) { + hideSystemUI(); } - else - {super.onBackPressed(); + } + + @Override + public void onBackPressed() { // Close the navigation drawer when the back button is pressed + if (drawerLayout.isDrawerOpen(GravityCompat.START)) { + drawerLayout.closeDrawer(GravityCompat.START); + } else { + super.onBackPressed(); } } } diff --git a/code/src/Fitbot/app/src/main/res/drawable/box_background.xml b/code/src/Fitbot/app/src/main/res/drawable/box_background.xml new file mode 100644 index 0000000..53f8ad7 --- /dev/null +++ b/code/src/Fitbot/app/src/main/res/drawable/box_background.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml b/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml index 0ade340..6dce505 100644 --- a/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml +++ b/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml @@ -2,11 +2,11 @@ \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/drawable/help2_background.xml b/code/src/Fitbot/app/src/main/res/drawable/help2_background.xml new file mode 100644 index 0000000..0fb955b --- /dev/null +++ b/code/src/Fitbot/app/src/main/res/drawable/help2_background.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/drawable/help_background.xml b/code/src/Fitbot/app/src/main/res/drawable/help_background.xml new file mode 100644 index 0000000..7ea69e6 --- /dev/null +++ b/code/src/Fitbot/app/src/main/res/drawable/help_background.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_check_48.xml b/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_check_48.xml new file mode 100644 index 0000000..c4f67b4 --- /dev/null +++ b/code/src/Fitbot/app/src/main/res/drawable/ic_baseline_check_48.xml @@ -0,0 +1,5 @@ + + + diff --git a/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml b/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml deleted file mode 100644 index 20ab824..0000000 --- a/code/src/Fitbot/app/src/main/res/drawable/rectangle.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/drawable/red_button_gradient.xml b/code/src/Fitbot/app/src/main/res/drawable/red_button_gradient.xml index 7190f99..a087a43 100644 --- a/code/src/Fitbot/app/src/main/res/drawable/red_button_gradient.xml +++ b/code/src/Fitbot/app/src/main/res/drawable/red_button_gradient.xml @@ -9,4 +9,5 @@ android:startColor="#990000" android:endColor="#FF0000" android:angle="90"/> + \ No newline at end of file diff --git a/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml b/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml index b07bcad..ab53096 100644 --- a/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml +++ b/code/src/Fitbot/app/src/main/res/layout/activity_end_screen.xml @@ -1,77 +1,108 @@ + android:background="@color/darkBlue" + tools:context=".ui.activities.HelpActivity"> - + app:layout_constraintTop_toTopOf="parent"> + + + + + + + + + + + + + + + + +