diff --git a/app/build.gradle b/app/build.gradle index 9b0025d6..c7cae6d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'com.android.application' -apply from: '../config/quality/quality.gradle' +//apply from: '../config/quality/quality.gradle' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' -apply plugin: 'com.google.android.gms.oss-licenses-plugin' +//apply plugin: 'com.google.android.gms.oss-licenses-plugin' android { compileSdkVersion 28 @@ -15,6 +15,7 @@ android { versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true + multiDexEnabled true } buildTypes { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 42c9f1bd..ad07aff0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,43 +1,47 @@ + package="org.mifos.mobile.cn" > - - + + - + android:theme="@style/AppTheme" > + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/DashboardActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/DashboardActivity.kt index 14a6d82f..7f6ddf23 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/DashboardActivity.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/DashboardActivity.kt @@ -27,15 +27,15 @@ import org.mifos.mobile.cn.ui.mifos.customerAccounts.CustomerAccountFragment import org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity.LoanApplicationActivity import org.mifos.mobile.cn.ui.mifos.products.ProductFragment import org.mifos.mobile.cn.ui.mifos.recentTransactions.RecentTransactionsFragment -import org.mifos.mobile.cn.ui.mifos.settings.SettingsFragment import org.mifos.mobile.cn.ui.utils.CircularImageView import org.mifos.mobile.cn.ui.utils.Toaster import android.widget.Toast +import org.mifos.mobile.cn.ui.mifos.settings.SettingActivity class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationView.OnNavigationItemSelectedListener { - @Inject - internal lateinit var preferencesHelper: PreferencesHelper +// @Inject +// internal lateinit var preferencesHelper: PreferencesHelper private lateinit var tvUsername: TextView private lateinit var ivCircularUserProfilePicture: CircularImageView @@ -60,24 +60,24 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV /** * Asks users to confirm whether he want to logout or not */ - private fun showLogoutDialog() { - MaterialDialog.Builder().init(this) - .setMessage(R.string.dialog_logout) - .setPositiveButton(getString(R.string.logout), - DialogInterface.OnClickListener { dialog, which -> - preferencesHelper.clear() - val intent = Intent(this, LoginActivity::class.java) - intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK - startActivity(intent) - finish() - //Show successful logout Toast. - Toast.makeText(applicationContext, "Logged Out Successfully", Toast.LENGTH_SHORT).show() - }) - .setNegativeButton(getString(R.string.cancel), - DialogInterface.OnClickListener { dialog, which -> setNavigationViewSelectedItem(R.id.item_home) }) - .createMaterialDialog() - .show() - } +// private fun showLogoutDialog() { +// MaterialDialog.Builder().init(this) +// .setMessage(R.string.dialog_logout) +// .setPositiveButton(getString(R.string.logout), +// DialogInterface.OnClickListener { dialog, which -> +// preferencesHelper.clear() +// val intent = Intent(this, LoginActivity::class.java) +// intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK +// startActivity(intent) +// finish() +// //Show successful logout Toast. +// Toast.makeText(applicationContext, "Logged Out Successfully", Toast.LENGTH_SHORT).show() +// }) +// .setNegativeButton(getString(R.string.cancel), +// DialogInterface.OnClickListener { dialog, which -> setNavigationViewSelectedItem(R.id.item_home) }) +// .createMaterialDialog() +// .show() +// } private fun setNavigationViewSelectedItem(id: Int) { @@ -163,31 +163,28 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV replaceFragment(DashboardFragment.newInstance(), true, R.id.container) } R.id.item_accounts -> { - replaceFragment(CustomerAccountFragment.newInstance(AccountType.DEPOSIT), true, - R.id.container) - } - R.id.item_logout -> { - showLogoutDialog() + replaceFragment( + CustomerAccountFragment.newInstance(AccountType.DEPOSIT), true, + R.id.container + ) } + R.id.item_product -> { - replaceFragment(ProductFragment.Companion.newInstance(), true, - R.id.container) + replaceFragment( + ProductFragment.Companion.newInstance(), true, + R.id.container + ) } - R.id.item_recent_transactions -> { - replaceFragment(RecentTransactionsFragment.Companion.newInstance(),true,R.id.container) - } - R.id.item_about_us -> { - showAboutUs() + R.id.item_recent_transactions -> { + replaceFragment( + RecentTransactionsFragment.Companion.newInstance(), + true, + R.id.container + ) } + R.id.item_settings -> { - replaceFragment(SettingsFragment.newInstance(), true, R.id.container) - } - R.id.item_share -> { - val sharingIntent = Intent(android.content.Intent.ACTION_SEND) - sharingIntent.type = "text/plain" - sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.app_link)) - sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, getString(R.string.share_message)) - startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_the_app_link))) + settingClicked() } } // close the drawer @@ -220,8 +217,8 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV super.onBackPressed() } } - fun showAboutUs(){ - val intent = Intent(this, AboutUsActivity::class.java) + fun settingClicked() { + val intent = Intent(this, SettingActivity::class.java) startActivity(intent) } diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt index 66d67927..30f51e6a 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt @@ -9,6 +9,7 @@ import android.view.View import android.view.ViewGroup import com.github.therajanmaurya.sweeterror.SweetUIErrorHandler import kotlinx.android.synthetic.main.fragment_accounts.* +import kotlinx.android.synthetic.main.layout_exception_handler.* import org.mifos.mobile.cn.R import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount @@ -19,7 +20,6 @@ import org.mifos.mobile.cn.ui.base.MifosBaseFragment import org.mifos.mobile.cn.ui.utils.ConstantKeys import org.mifos.mobile.cn.ui.utils.Network import javax.inject.Inject -import kotlinx.android.synthetic.main.layout_sweet_exception_handler.* import org.mifos.mobile.cn.data.models.CheckboxStatus import org.mifos.mobile.cn.ui.base.OnItemClickListener import org.mifos.mobile.cn.ui.mifos.customerDepositDetails.CustomerDepositDetailsFragment diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt new file mode 100644 index 00000000..e21f4719 --- /dev/null +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt @@ -0,0 +1,80 @@ +package org.mifos.mobile.cn.ui.mifos.settings + + +import android.content.DialogInterface +import android.content.Intent +import android.os.Build +import android.os.Bundle +import android.provider.MediaStore +import android.view.Menu +import android.view.MenuItem +import android.view.View +import android.widget.Toast +import android.widget.Toolbar +import androidx.annotation.RequiresApi +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import kotlinx.android.synthetic.main.activity_customer_profile.* +import kotlinx.android.synthetic.main.toolbar.* +import org.mifos.mobile.cn.ui.utils.* +import org.mifos.mobile.cn.R +import org.mifos.mobile.cn.data.local.PreferencesHelper +import org.mifos.mobile.cn.ui.mifos.DashboardActivity +import org.mifos.mobile.cn.ui.mifos.aboutus.AboutUsActivity +import org.mifos.mobile.cn.ui.mifos.customerProfile.CustomerProfileContract +import org.mifos.mobile.cn.ui.mifos.login.LoginActivity +import javax.inject.Inject + + +class SettingActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_setting) + } + + fun notificationAct(view: View) { + + } + fun about_ac(view: View) { + val intent = Intent(this, AboutUsActivity::class.java) + startActivity(intent) + } + fun helpAc(view: View) { + + } + fun logout(view: View) { + MaterialDialog.Builder().init(this) + .setMessage(R.string.dialog_logout) + .setPositiveButton(getString(R.string.logout), + DialogInterface.OnClickListener { dialog, which -> + val intent = Intent(this, LoginActivity::class.java) + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + finish() + //Show successful logout Toast. + Toast.makeText(applicationContext, "Logged Out Successfully", Toast.LENGTH_SHORT).show() + }) + .setNegativeButton(getString(R.string.cancel), + DialogInterface.OnClickListener { dialog, which -> + Toast.makeText(applicationContext, "Canceled Successfully!", Toast.LENGTH_SHORT).show() + + }) + .createMaterialDialog() + .show() + } + + fun share(view: View) { + val sharingIntent = Intent(android.content.Intent.ACTION_SEND) + sharingIntent.type = "text/plain" + sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.app_link)) + sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, getString(R.string.share_message)) + startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_the_app_link))) + } + + fun back(view: View) { + val intent = Intent(this, DashboardActivity::class.java) + intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + startActivity(intent) + } +} + diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingsFragment.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingsFragment.kt deleted file mode 100644 index 21f01cec..00000000 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingsFragment.kt +++ /dev/null @@ -1,41 +0,0 @@ -package org.mifos.mobile.cn.ui.mifos.settings - -import android.content.Context -import android.net.Uri -import android.os.Bundle -import androidx.fragment.app.Fragment -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import org.mifos.mobile.cn.R - -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" - -/** - * A simple [Fragment] subclass. - * Activities that contain this fragment must implement the - * [SettingsFragment.OnFragmentInteractionListener] interface - * to handle interaction events. - * Use the [SettingsFragment.newInstance] factory method to - * create an instance of this fragment. - */ -class SettingsFragment : Fragment() { - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_settings, container, false) - } - - companion object { - fun newInstance(): SettingsFragment { - val fragment = SettingsFragment() - val args = Bundle() - fragment.arguments = args - return fragment - } - } -} diff --git a/app/src/main/res/drawable/ic_baseline_keyboard_backspace_24.xml b/app/src/main/res/drawable/ic_baseline_keyboard_backspace_24.xml new file mode 100644 index 00000000..9662a266 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_keyboard_backspace_24.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_setting.xml b/app/src/main/res/layout/activity_setting.xml new file mode 100644 index 00000000..f1cdb71e --- /dev/null +++ b/app/src/main/res/layout/activity_setting.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +