Skip to content

Commit

Permalink
Drawer Navigation option selection
Browse files Browse the repository at this point in the history
  • Loading branch information
whyfoo committed Dec 16, 2021
1 parent 5ad58ba commit 34f7d37
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
22 changes: 22 additions & 0 deletions app/src/main/java/com/trolle/trolleapp/ui/home/HomeActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.trolle.trolleapp.ui.home

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
Expand All @@ -15,6 +16,10 @@ import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.trolle.trolleapp.R
import com.trolle.trolleapp.databinding.ActivityHomeBinding
import com.trolle.trolleapp.ui.side_menu.AboutActivity
import com.trolle.trolleapp.ui.side_menu.EditProfileActivity
import com.trolle.trolleapp.ui.side_menu.HelpActivity
import com.trolle.trolleapp.ui.signin.SignInActivity

class HomeActivity : AppCompatActivity() {

Expand All @@ -32,6 +37,21 @@ class HomeActivity : AppCompatActivity() {

binding.navigationView.setNavigationItemSelectedListener { menuItem ->
// Handle menu item selected
when(menuItem.itemId){
R.id.item_edit_profile ->
startActivity(Intent(this, EditProfileActivity::class.java))
R.id.item_see_shopping_history ->
Toast.makeText(this, "shopping history", Toast.LENGTH_SHORT).show()
R.id.item_about ->
startActivity(Intent(this, AboutActivity::class.java))
R.id.item_help ->
startActivity(Intent(this, HelpActivity::class.java))
R.id.item_sign_out -> {
startActivity(Intent(this, SignInActivity::class.java))
finish()
}

}
menuItem.isChecked = true
binding.drawerLayout.close()
true
Expand All @@ -42,6 +62,8 @@ class HomeActivity : AppCompatActivity() {
val navController: NavController = navHostFragment.navController

binding.bottomNavigation.setupWithNavController(navController)


}

override fun onBackPressed() {
Expand Down
23 changes: 13 additions & 10 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,19 @@
<string name="member_4">Member 4 : M. As\'ad Muyassir</string>
<string name="member_5">Member 5 : Jonathan Elloy S.</string>
<string name="help_text">
<li>First, the buyer must connect the application with the cart used through the Home page of the application. This can be done in 2 ways as follows.</li>
\t\t\t\t\t\u25BA By scanning the barcode on the cart.<br />
\t\t\t\t\t\u25BA By entering the trolley ID manually.<br /><br />
<li>Then, buyers will be directed to the Pay page which will later contain a Shopping List.</li><br />
<li>Next, the buyer must point the barcode at the product he wants to buy on the camera provided on the cart, so the system can scan it.</li><br />
<li>The scanned product will appear on the Shopping List. Repeat step 4 until the buyer has finished shopping.</li><br />
<li>After that, press the Check Out button at the bottom of the Shopping List to see the total price to be paid.</li><br />
<li>Buyers will be directed to the Checkout page. Determine the payment method you want to use and make sure that the total price paid is appropriate and the balance in the digital wallet is sufficient.</li><br />
<li>Press the Pay button to pay for all purchased products. Wait until there is a notification stating that the payment has been successfully made.</li><br />
<li>The shopping process has been completed and the cart connected to the app will be offline after a certain amount of time.</li>
<ul>
<li>First, the buyer must connect the application with the cart used through the Home page of the application. This can be done in 2 ways as follows.</li>
\t\t\t\t\t\u25BA By scanning the barcode on the cart.<br />
\t\t\t\t\t\u25BA By entering the trolley ID manually.<br /><br />
<li>Then, buyers will be directed to the Pay page which will later contain a Shopping List.</li><br />
<li>Next, the buyer must point the barcode at the product he wants to buy on the camera provided on the cart, so the system can scan it.</li><br />
<li>The scanned product will appear on the Shopping List. Repeat step 4 until the buyer has finished shopping.</li><br />
<li>After that, press the Check Out button at the bottom of the Shopping List to see the total price to be paid.</li><br />
<li>Buyers will be directed to the Checkout page. Determine the payment method you want to use and make sure that the total price paid is appropriate and the balance in the digital wallet is sufficient.</li><br />
<li>Press the Pay button to pay for all purchased products. Wait until there is a notification stating that the payment has been successfully made.</li><br />
<li>The shopping process has been completed and the cart connected to the app will be offline after a certain amount of time.</li>
</ul>

</string>
<string name="shopping_list">Shopping List</string>
<string name="pay">Pay</string>
Expand Down

0 comments on commit 34f7d37

Please sign in to comment.