Skip to content

Commit

Permalink
fixed openMF#211 help feature dosen't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant830 committed Jun 25, 2022
1 parent 6f949f0 commit 70cb706
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 6 deletions.
12 changes: 7 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mifos.mobile.cn" >
package="org.mifos.mobile.cn">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -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">
<activity
android:name=".ui.mifos.help.HelpActivity"
android:exported="false" />
<activity
android:name=".ui.mifos.launcher.LauncherActivity"
android:theme="@style/LauncherTheme" >
android:theme="@style/LauncherTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -31,7 +33,7 @@
<activity
android:name=".ui.mifos.passcode.PasscodeActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.mifos.settings.SettingActivity"/>
<activity android:name=".ui.mifos.settings.SettingActivity" />
<activity android:name=".ui.mifos.loanApplication.loanActivity.LoanApplicationActivity" />
<activity android:name=".ui.mifos.customerDetails.CustomerDetailsActivity" />
<activity android:name=".ui.mifos.customerActivities.CustomerActivitiesActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,4 +79,6 @@ interface ActivityComponent {
fun inject(customerDepositDetailsFragment: CustomerDepositDetailsFragment)

fun inject(aboutUsFragment: AboutUsFragment)

fun inject(helpFragment: HelpFragment)
}
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -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)))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/rounded_corner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimary" />
<corners
android:topRightRadius="72dp"
android:bottomRightRadius="72dp"
android:topLeftRadius="72dp"
android:bottomLeftRadius="72dp"/>
</shape>
69 changes: 69 additions & 0 deletions app/src/main/res/layout/fragment_help.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--
~ This project is licensed under the open source MPL V2.
~ See https://github.com/openMF/self-service-app/blob/master/LICENSE.md
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_about"
android:layout_gravity="center"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">

<ImageView
android:layout_width="132dp"
android:layout_height="148dp"
android:layout_gravity="center"
android:layout_margin="@dimen/layout_padding_16dp"
android:src="@drawable/mifos_logo_new" />

<TextView
style="@style/Base.TextAppearance.AppCompat.Small"
android:id="@+id/tv_copy_right"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="@color/black"
android:textSize="25dp"
android:textStyle="bold"
android:text="@string/asking_to_help"/>

<TextView
android:layout_marginTop="@dimen/layout_padding_30dp"
style="@style/Base.TextAppearance.AppCompat.Small"
android:gravity="center"
android:padding="25dp"
android:textSize="25dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/help_discription"/>


<Button
android:id="@+id/want_help"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="@dimen/value_20dp"
android:layout_alignParentBottom="true"
android:gravity="center"
android:layout_marginStart="@dimen/layout_padding_15dp"
android:layout_marginLeft="@dimen/layout_padding_15dp"
android:layout_marginEnd="@dimen/layout_padding_15dp"
android:layout_marginRight="@dimen/layout_padding_15dp"
android:layout_marginBottom="@dimen/layout_padding_10dp"
android:background="@drawable/rounded_corner"
android:text="@string/join_gitter"
android:textColor="@color/white"
/>


</LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,8 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="settigs">Settings</string>
<string name="asking_to_help">Want help?</string>
<string name="help_discription">Want to help, our team can definitely help you, join our gitter channel..</string>
<string name="join_gitter">Ask for help</string>

</resources>

0 comments on commit 70cb706

Please sign in to comment.