AmosKorir / Lipa-Na-Mpesa-Android-Widget

Floating Lipa Na Mpesa Widget. Promote UX to avoid user errors when making mpesa payments

Home Page:https://medium.com/@koriramos/android-lipa-na-mpesa-floating-widget-library-51be4ddc6464

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lipa-Na-Mpesa-Android-Widget

Floating Lipa na Mpesa Widget Download

This a simple android library that helps to create a floating widget with mpesa payment details or any payment gateway that has the same payment format. This offers great user experience when making payment manually. The user should not cram the payment details, the widget floats in all the screens and the can click and copy the details they need.

How to use

Gradle:

 implementation 'com.lipanampesa:LipaNaMpesa:0.1.1'

Ask for permission to show a floating widget.

 //ask for permission
 private fun askPermission() {
   val intent = Intent(
     Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
     Uri.parse("package:$packageName")
   )
   ActivityCompat.startActivityForResult(
     this,
     intent,
     LipaNaMpesaConstants.SYSTEM_ALERT_WINDOW_PERMISSION,
     null
   )
 }

Show the widget. a Full example

 var intent = Intent(this@MainActivity, FloatingService::class.java)
      var lipaNaMpesa =
        LipaNaMpesa(
          "34545455",
          "0712345678",
          "2000"
        )
      intent.putExtra(LipaNaMpesaConstants.LIPANAMPESA, lipaNaMpesa)
      startService(intent)

About

Floating Lipa Na Mpesa Widget. Promote UX to avoid user errors when making mpesa payments

https://medium.com/@koriramos/android-lipa-na-mpesa-floating-widget-library-51be4ddc6464


Languages

Language:Kotlin 100.0%