Skip to content

Commit

Permalink
Merge pull request #81 from PiyushSharma99/master
Browse files Browse the repository at this point in the history
Handled Settings click in Nav drawer and seperate fragment for it
  • Loading branch information
AbhilashG97 authored Dec 4, 2019
2 parents a06f924 + 3a2f68a commit f674419
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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

Expand Down Expand Up @@ -178,6 +179,9 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
R.id.item_about_us -> {
showAboutUs()
}
R.id.item_settings -> {
replaceFragment(SettingsFragment.newInstance(), true, R.id.container)
}
}

// close the drawer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
}
}
}
10 changes: 10 additions & 0 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.mifos.settings.SettingsFragment">

<!-- TODO: Update empty settings page -->

</FrameLayout>

0 comments on commit f674419

Please sign in to comment.