Skip to content
View in the app

A better way to browse. Learn more.

Loyverse Town

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automatic counter of the modifiers for create your own meal

Featured Replies

Hi I have posted before about this which you can visit my posts and have a read about again but I have been having issues with customers wanting to order a meal of their head which leads me to pick any item amount but I might be wrong so I will have to go back delete the order and pick all the add-ons again. So I have myself being graduated from computer science degree could not deal with it all everything so I gone ahead and wrote the Android version of the code for you that is because I am using an Android tablet. So please bring this feature onto the Android version of app. Here is the code.

// Get the RecyclerView that displays the items

val recyclerView = findViewById<RecyclerView>(R.id.items_recyclerview)

 

// Get the adapter used to populate the RecyclerView

val adapter = recyclerView.adapter

 

// Create a variable to track the number of selected items

var selectedCount = 0

 

// Set a listener to track changes to the adapter

adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {

    override fun onItemRangeChanged(positionStart: Int, itemCount: Int) {

        // Loop through each item in the adapter

        for (i in positionStart until positionStart + itemCount) {

            // Check if the item is selected

            if (adapter.isSelected(i)) {

                // Increment the selected count

                selectedCount++

            } else {

                // Decrement the selected count

                selectedCount--

            }

        }

    }

})

 

// Create an extension function to check if an item is selected

fun RecyclerView.Adapter<*>.isSelected(position: Int): Boolean {

    val item = getItem(position)

    // Check if the item is selected

    return item.isSelected

}

 

Simple as that. 😄

Screenshot_20230223_223520_Loyverse POS.jpg

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.