Skip to content

Commit

Permalink
Fixed openMF#169 setting is empty and white
Browse files Browse the repository at this point in the history
  • Loading branch information
MJACodeR committed Jun 25, 2022
1 parent 2dd8750 commit 6f949f0
Show file tree
Hide file tree
Showing 14 changed files with 326 additions and 151 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,6 +15,7 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {

Expand Down
52 changes: 28 additions & 24 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mifos.mobile.cn">
package="org.mifos.mobile.cn" >

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:name=".MifosApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".MifosApplication"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.mifos.launcher.LauncherActivity"
android:theme="@style/LauncherTheme">
android:theme="@style/AppTheme" >

<activity
android:name=".ui.mifos.launcher.LauncherActivity"
android:theme="@style/LauncherTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".ui.mifos.DashboardActivity" />
<activity android:name=".ui.mifos.login.LoginActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.mifos.passcode.PasscodeActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.mifos.loanApplication.loanActivity.LoanApplicationActivity"/>
<activity android:name=".ui.mifos.customerDetails.CustomerDetailsActivity"/>
<activity android:name=".ui.mifos.customerActivities.CustomerActivitiesActivity"/>
<activity android:name=".ui.mifos.identificationlist.IdentificationsActivity"/>
<activity android:name=".ui.mifos.viewScanCard.ViewScanCardActivity"/>
<activity android:name=".ui.mifos.customerProfile.CustomerProfileActivity"/>
<activity android:name=".ui.mifos.plannedPlayment.PlannedPaymentActivity"/>
<activity android:name=".ui.mifos.debtincomereport.DebtIncomeReportActivity"/>
<activity android:name=".ui.mifos.aboutus.AboutUsActivity"/>
<activity android:name=".ui.mifos.privacypolicy.PrivacyPolicyActivity"/>
<activity
android:name=".ui.mifos.login.LoginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.mifos.passcode.PasscodeActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.mifos.settings.SettingActivity"/>
<activity android:name=".ui.mifos.loanApplication.loanActivity.LoanApplicationActivity" />
<activity android:name=".ui.mifos.customerDetails.CustomerDetailsActivity" />
<activity android:name=".ui.mifos.customerActivities.CustomerActivitiesActivity" />
<activity android:name=".ui.mifos.identificationlist.IdentificationsActivity" />
<activity android:name=".ui.mifos.viewScanCard.ViewScanCardActivity" />
<activity android:name=".ui.mifos.customerProfile.CustomerProfileActivity" />
<activity android:name=".ui.mifos.plannedPlayment.PlannedPaymentActivity" />
<activity android:name=".ui.mifos.debtincomereport.DebtIncomeReportActivity" />
<activity android:name=".ui.mifos.aboutus.AboutUsActivity" />
<activity android:name=".ui.mifos.privacypolicy.PrivacyPolicyActivity" />
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/white"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />
</vector>
Loading

0 comments on commit 6f949f0

Please sign in to comment.