From 31ec0dfe4069f5c6863d6ac8b9f7f9e3a7ceaee9 Mon Sep 17 00:00:00 2001 From: Samwel Date: Thu, 4 Jul 2024 22:16:13 +0300 Subject: [PATCH] code optimization --- .../mpesaintegrationandroid/MainActivity.java | 9 ++++++++- app/src/main/res/values/colors.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MainActivity.java b/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MainActivity.java index a235fce..41ed21e 100644 --- a/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MainActivity.java +++ b/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MainActivity.java @@ -1,18 +1,25 @@ package com.mpesaandroidintegration.mpesaintegrationandroid; import androidx.appcompat.app.AppCompatActivity; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import android.app.ProgressDialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; +import com.afollestad.materialdialogs.GravityEnum; +import com.afollestad.materialdialogs.MaterialDialog; import com.mpesaandroidintegration.mpesa.Mpesa; import com.mpesaandroidintegration.mpesa.interfaces.AuthListener; import com.mpesaandroidintegration.mpesa.interfaces.MpesaListener; @@ -111,7 +118,7 @@ private void showDialog(String title, String message,int code){ .positiveText("OK") .cancelable(false) .widgetColorRes(R.color.colorPrimary) - .callback(new ButtonCallback() { + .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { super.onPositive(dialog); diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4a52022..ac19c16 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,6 +1,7 @@ #FFBB86FC + #3F51B5 #FF6200EE #FF3700B3 #FF03DAC5