Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #208 at navigation drawer,report a bug option is missing #210

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@ package org.mifos.mobile.cn.ui.mifos
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import com.google.android.material.navigation.NavigationView
import androidx.core.view.GravityCompat
import androidx.appcompat.app.ActionBarDrawerToggle
import android.view.MenuItem
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.core.view.GravityCompat
import com.google.android.material.navigation.NavigationView
import com.mifos.mobile.passcode.utils.PasscodePreferencesHelper
import kotlinx.android.synthetic.main.activity_main.*
import org.mifos.mobile.cn.R
import org.mifos.mobile.cn.data.local.PreferencesHelper
import org.mifos.mobile.cn.ui.base.MifosBaseActivity
import org.mifos.mobile.cn.ui.mifos.dashboard.DashboardFragment
import org.mifos.mobile.cn.ui.mifos.login.LoginActivity
import org.mifos.mobile.cn.ui.utils.MaterialDialog
import javax.inject.Inject
import kotlinx.android.synthetic.main.activity_main.*
import org.mifos.mobile.cn.enums.AccountType
import org.mifos.mobile.cn.ui.base.MifosBaseActivity
import org.mifos.mobile.cn.ui.mifos.aboutus.AboutUsActivity
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.dashboard.DashboardFragment
import org.mifos.mobile.cn.ui.mifos.login.LoginActivity
import org.mifos.mobile.cn.ui.mifos.passcode.PasscodeActivity
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 com.mifos.mobile.passcode.utils.PasscodePreferencesHelper
import org.mifos.mobile.cn.ui.mifos.passcode.PasscodeActivity
import org.mifos.mobile.cn.ui.utils.ConstantKeys
import org.mifos.mobile.cn.ui.utils.MaterialDialog
import org.mifos.mobile.cn.ui.utils.Toaster
import javax.inject.Inject

class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationView.OnNavigationItemSelectedListener {

Expand All @@ -43,7 +43,8 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
private lateinit var tvUsername: TextView
private lateinit var ivCircularUserProfilePicture: CircularImageView
private lateinit var ivTextDrawableUserProfilePicture: ImageView

var url = "https://github.com/openMF/mifos-mobile-cn/issues/new"
var url1= "https://gitter.im/openMF/mifos-mobile-cn"
private var menuItem = -1
private var doubleBackToExitPressedOnce = false

Expand Down Expand Up @@ -137,8 +138,20 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
ivCircularUserProfilePicture.setOnClickListener(this)
}

override fun onClick(v: View) {
override fun onClick(view: View?) {
// Click Header to view full profile of User

when(view?.id) {
R.id.iv_circular_user_image->{
replaceFragment(CustomerDetailsFragment.newInstance("customer_identifier"), true,
R.id.container)

}
R.id.iv_user_image->{
replaceFragment(CustomerDetailsFragment.newInstance("customer_identifier"), true,
R.id.container)
}
}
}

private fun setUpBackStackListener() {
Expand Down Expand Up @@ -172,7 +185,7 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
R.id.item_logout -> {
showLogoutDialog()
}
R.id.item_passcode ->{
R.id.item_passcode -> {
if (this != null) {
passcodePreferencesHelper = PasscodePreferencesHelper(this)
val currentPass: String = passcodePreferencesHelper!!.getPassCode()
Expand All @@ -187,12 +200,20 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
replaceFragment(ProductFragment.Companion.newInstance(), true,
R.id.container)
}
R.id.item_recent_transactions -> {
replaceFragment(RecentTransactionsFragment.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_help -> {
val i = Intent(Intent.ACTION_VIEW, Uri.parse(url1))
startActivity(i)
}
R.id.item_repot_or_bug -> {
val i = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(i)
}
R.id.item_settings -> {
replaceFragment(SettingsFragment.newInstance(), true, R.id.container)
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_baseline_bug_report_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/menu/menu_nav_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
android:checked="false"
android:icon="@drawable/ic_info_black_24dp"
android:title="@string/about_us"/>
<item
android:id="@+id/item_repot_or_bug"
android:checked="false"
android:icon="@drawable/ic_baseline_bug_report_24"
android:title="@string/report_or_bug_"/>
<item
android:id="@+id/item_help"
android:checked="false"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<string name="close_drawer">Close Drawer</string>
<string name="exit_message">Press back again to exit</string>
<string name="notification">Notifications</string>

<string name="report_or_bug_">Report Or Bug</string>
<!--Loan application Details fragment-->
<string name="create_new_loan">Create New Loan</string>
<string name="products">Products</string>
Expand Down