Skip to content

Commit f674419

Browse files
authored
Merge pull request #81 from PiyushSharma99/master
Handled Settings click in Nav drawer and seperate fragment for it
2 parents a06f924 + 3a2f68a commit f674419

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

Diff for: app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/DashboardActivity.kt

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import org.mifos.mobile.cn.ui.mifos.customerAccounts.CustomerAccountFragment
2727
import org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity.LoanApplicationActivity
2828
import org.mifos.mobile.cn.ui.mifos.products.ProductFragment
2929
import org.mifos.mobile.cn.ui.mifos.recentTransactions.RecentTransactionsFragment
30+
import org.mifos.mobile.cn.ui.mifos.settings.SettingsFragment
3031
import org.mifos.mobile.cn.ui.utils.CircularImageView
3132
import org.mifos.mobile.cn.ui.utils.Toaster
3233

@@ -178,6 +179,9 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
178179
R.id.item_about_us -> {
179180
showAboutUs()
180181
}
182+
R.id.item_settings -> {
183+
replaceFragment(SettingsFragment.newInstance(), true, R.id.container)
184+
}
181185
}
182186

183187
// close the drawer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.mifos.mobile.cn.ui.mifos.settings
2+
3+
import android.content.Context
4+
import android.net.Uri
5+
import android.os.Bundle
6+
import androidx.fragment.app.Fragment
7+
import android.view.LayoutInflater
8+
import android.view.View
9+
import android.view.ViewGroup
10+
import org.mifos.mobile.cn.R
11+
12+
// TODO: Rename parameter arguments, choose names that match
13+
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
14+
private const val ARG_PARAM1 = "param1"
15+
private const val ARG_PARAM2 = "param2"
16+
17+
/**
18+
* A simple [Fragment] subclass.
19+
* Activities that contain this fragment must implement the
20+
* [SettingsFragment.OnFragmentInteractionListener] interface
21+
* to handle interaction events.
22+
* Use the [SettingsFragment.newInstance] factory method to
23+
* create an instance of this fragment.
24+
*/
25+
class SettingsFragment : Fragment() {
26+
27+
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
28+
savedInstanceState: Bundle?): View? {
29+
// Inflate the layout for this fragment
30+
return inflater.inflate(R.layout.fragment_settings, container, false)
31+
}
32+
33+
companion object {
34+
fun newInstance(): SettingsFragment {
35+
val fragment = SettingsFragment()
36+
val args = Bundle()
37+
fragment.arguments = args
38+
return fragment
39+
}
40+
}
41+
}

Diff for: app/src/main/res/layout/fragment_settings.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
tools:context=".ui.mifos.settings.SettingsFragment">
7+
8+
<!-- TODO: Update empty settings page -->
9+
10+
</FrameLayout>

0 commit comments

Comments
 (0)