forked from openMF/mifos-mobile-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed openMF#211 help feature dosen't work
- Loading branch information
1 parent
6f949f0
commit 70cb706
Showing
8 changed files
with
171 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/help/HelpFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters