Skip to content

Commit

Permalink
fix: Migrate Settings from XML to compose openMF#2570
Browse files Browse the repository at this point in the history
    fix: Migrate Settings from XML to compose openMF#2570

fix: Migrate Settings from XML to compose openMF#2570

refactor: Migrate Settings from XML to compose openMF#2570

fix: Migrate Settings from XML to compose openMF#2570

migrate Settings to compose openMF#2570
  • Loading branch information
itsPronay committed Jun 14, 2024
1 parent d46ab72 commit f8250e9
Show file tree
Hide file tree
Showing 14 changed files with 838 additions and 220 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
android:name=".utils.fcm.RegistrationIntentService"
android:exported="false" />

<activity android:name=".ui.activities.SettingsActivity" />
<activity android:name="org.mifos.mobile.ui.settings.SettingsActivity" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/java/org/mifos/mobile/MifosSelfServiceApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.raizlabs.android.dbflow.config.FlowConfig
import com.raizlabs.android.dbflow.config.FlowManager
import dagger.hilt.android.HiltAndroidApp
import org.mifos.mobile.api.local.PreferencesHelper
import org.mifos.mobile.ui.fragments.applySavedTheme
import org.mifos.mobile.ui.settings.applySavedTheme
import org.mifos.mobile.utils.LanguageHelper
import org.mifos.mobile.utils.LanguageHelper.onAttach
import java.util.Locale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.text.TextUtils
import dagger.hilt.android.qualifiers.ApplicationContext
import org.mifos.mobile.api.BaseURL
import org.mifos.mobile.api.SelfServiceInterceptor
import org.mifos.mobile.ui.fragments.AppTheme
import org.mifos.mobile.ui.settings.AppTheme
import javax.inject.Inject
import javax.inject.Singleton

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import org.mifos.mobile.ui.getThemeAttributeColor
import org.mifos.mobile.ui.help.HelpActivity
import org.mifos.mobile.ui.home.HomeOldFragment
import org.mifos.mobile.ui.login.LoginActivity
import org.mifos.mobile.ui.settings.SettingsActivity
import org.mifos.mobile.ui.third_party_transfer.ThirdPartyTransferComposeFragment
import org.mifos.mobile.ui.notification.NotificationFragment
import org.mifos.mobile.ui.recent_transactions.RecentTransactionsComposeFragment
import org.mifos.mobile.utils.Constants
import org.mifos.mobile.utils.TextDrawable
import org.mifos.mobile.utils.Toaster
Expand Down
197 changes: 0 additions & 197 deletions app/src/main/java/org/mifos/mobile/ui/fragments/SettingsFragment.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package org.mifos.mobile.ui.guarantor.guarantor_details

import android.util.Log
import android.widget.Toast
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand All @@ -23,14 +17,12 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import org.mifos.mobile.R
import org.mifos.mobile.core.ui.component.FloatingActionButtonContent
import org.mifos.mobile.core.ui.component.MFScaffold
import org.mifos.mobile.core.ui.component.MifosAlertDialog
import org.mifos.mobile.core.ui.component.MifosErrorComponent
import org.mifos.mobile.core.ui.component.MifosProgressIndicatorOverlay
import org.mifos.mobile.core.ui.theme.MifosMobileTheme
import org.mifos.mobile.models.guarantor.GuarantorPayload
import org.mifos.mobile.ui.guarantor.guarantor_list.GuarantorListContent
import org.mifos.mobile.utils.Network

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package org.mifos.mobile.ui.activities
package org.mifos.mobile.ui.settings

import android.content.Intent
import android.os.Bundle
import androidx.core.app.ActivityCompat
import org.mifos.mobile.R
import org.mifos.mobile.databinding.ActivitySettingsBinding
import org.mifos.mobile.databinding.ActivityUserProfileBinding
import org.mifos.mobile.ui.activities.HomeActivity
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.fragments.SettingsFragment
import org.mifos.mobile.utils.Constants

class SettingsActivity : BaseActivity() {
private lateinit var binding: ActivitySettingsBinding
private var hasSettingsChanged = false
private lateinit var binding: ActivityUserProfileBinding
var hasSettingsChanged = false

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySettingsBinding.inflate(layoutInflater)
binding = ActivityUserProfileBinding.inflate(layoutInflater)
setContentView(binding.root)
setToolbarTitle(getString(R.string.settings))
showBackButton()

replaceFragment(SettingsFragment.newInstance(), false, R.id.container)
if (intent.hasExtra(Constants.HAS_SETTINGS_CHANGED)) {
hasSettingsChanged = intent.getBooleanExtra(
Expand All @@ -27,6 +27,7 @@ class SettingsActivity : BaseActivity() {
}
}

@Deprecated("Deprecated in Java")
override fun onBackPressed() {
if (supportFragmentManager.backStackEntryCount == 0) {
super.onBackPressed()
Expand All @@ -38,4 +39,4 @@ class SettingsActivity : BaseActivity() {
supportFragmentManager.popBackStack()
}
}
}
}
Loading

0 comments on commit f8250e9

Please sign in to comment.