diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ad07aff0..0ac6b6d1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="org.mifos.mobile.cn"> @@ -13,11 +13,13 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/AppTheme" > - + android:theme="@style/AppTheme"> + + android:theme="@style/LauncherTheme"> @@ -31,7 +33,7 @@ - + diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ActivityComponent.kt b/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ActivityComponent.kt index 13cbf11c..f0009257 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ActivityComponent.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/injection/component/ActivityComponent.kt @@ -20,6 +20,7 @@ import org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity.LoanApplication import org.mifos.mobile.cn.ui.mifos.loanApplication.loanDetails.LoanDetailsFragment import org.mifos.mobile.cn.ui.mifos.customerLoanDetails.CustomerLoanDetailsFragment import org.mifos.mobile.cn.ui.mifos.debtincomereport.DebtIncomeReportFragment +import org.mifos.mobile.cn.ui.mifos.help.HelpFragment 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.plannedPlayment.PlannedPaymentFragment @@ -78,4 +79,6 @@ interface ActivityComponent { fun inject(customerDepositDetailsFragment: CustomerDepositDetailsFragment) fun inject(aboutUsFragment: AboutUsFragment) + + fun inject(helpFragment: HelpFragment) } diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpActivity.kt new file mode 100644 index 00000000..90fbcc09 --- /dev/null +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpActivity.kt @@ -0,0 +1,17 @@ +package org.mifos.mobile.cn.ui.mifos.help + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import org.mifos.mobile.cn.R +import org.mifos.mobile.cn.ui.base.MifosBaseActivity + +class HelpActivity : MifosBaseActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_toolbar_container) + + setToolbarTitle(getString(R.string.help)) + showBackButton() + replaceFragment(HelpFragment.newInstance(),false,R.id.container) + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpFragment.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpFragment.kt new file mode 100644 index 00000000..2b863af6 --- /dev/null +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpFragment.kt @@ -0,0 +1,58 @@ +package org.mifos.mobile.cn.ui.mifos.help + +import android.content.Intent +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 android.widget.Button +import com.google.android.gms.oss.licenses.OssLicensesMenuActivity +import kotlinx.android.synthetic.main.fragment_about_us.* +import kotlinx.android.synthetic.main.fragment_help.view.* +import org.mifos.mobile.cn.BuildConfig +import org.mifos.mobile.cn.R +import org.mifos.mobile.cn.ui.base.MifosBaseActivity +import org.mifos.mobile.cn.ui.base.MifosBaseFragment +import org.mifos.mobile.cn.ui.mifos.aboutus.AboutUsFragment +import org.mifos.mobile.cn.ui.mifos.privacypolicy.PrivacyPolicyActivity +import java.util.* + +// TODO: Rename parameter arguments, choose names that match + +class HelpFragment : MifosBaseFragment(){ + + lateinit var rootview: View + var url: String = "https://gitter.im/openMF/mifos-mobile-cn" + + lateinit var button: Button + + companion object { + fun newInstance(): Fragment { + val fragment: Fragment = HelpFragment() + val args = Bundle() + fragment.arguments = args + return fragment + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + rootview = inflater.inflate(R.layout.fragment_help, container, false) + (activity as MifosBaseActivity).activityComponent.inject(this) + setToolbarTitle(getString(R.string.help)) + rootview.want_help.setOnClickListener { + openGitter() + } + return rootview + } + + private fun openGitter() { + startActivity(Intent(Intent.ACTION_VIEW ,Uri.parse(url))) + } + +} \ No newline at end of file diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt index e21f4719..a78d6b54 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/settings/SettingActivity.kt @@ -22,6 +22,8 @@ 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.help.HelpActivity +import org.mifos.mobile.cn.ui.mifos.help.HelpFragment import org.mifos.mobile.cn.ui.mifos.login.LoginActivity import javax.inject.Inject @@ -40,8 +42,10 @@ class SettingActivity : AppCompatActivity() { startActivity(intent) } fun helpAc(view: View) { - + val intent = Intent(this, HelpActivity::class.java) + startActivity(intent) } + fun logout(view: View) { MaterialDialog.Builder().init(this) .setMessage(R.string.dialog_logout) diff --git a/app/src/main/res/drawable/rounded_corner.xml b/app/src/main/res/drawable/rounded_corner.xml new file mode 100644 index 00000000..ad00b260 --- /dev/null +++ b/app/src/main/res/drawable/rounded_corner.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_help.xml b/app/src/main/res/layout/fragment_help.xml new file mode 100644 index 00000000..5b0829a9 --- /dev/null +++ b/app/src/main/res/layout/fragment_help.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + +