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 #170 Useless profile icon multiple times #214

Closed
wants to merge 5 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,6 +3,7 @@ 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
Expand Down Expand Up @@ -32,6 +33,7 @@ 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.customerDetails.CustomerDetailsFragment
import org.mifos.mobile.cn.ui.mifos.passcode.PasscodeActivity
import org.mifos.mobile.cn.ui.utils.ConstantKeys

Expand All @@ -43,7 +45,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,10 +140,23 @@ 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() {
supportFragmentManager.addOnBackStackChangedListener {
val fragment = supportFragmentManager.findFragmentById(R.id.container)
Expand Down Expand Up @@ -193,6 +209,15 @@ class DashboardActivity : MifosBaseActivity(), View.OnClickListener, NavigationV
R.id.item_about_us -> {
showAboutUs()
}
R.id.report_or_bug -> {
val i = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(i)
}
R.id.item_help -> {
val i = Intent(Intent.ACTION_VIEW, Uri.parse(url1))
startActivity(i)
}

R.id.item_settings -> {
replaceFragment(SettingsFragment.newInstance(), true, R.id.container)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
package org.mifos.mobile.cn.ui.mifos.signup

import android.content.Intent
import android.os.Bundle
import android.view.View
import kotlinx.android.synthetic.main.activity_login.*
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_signup.*
import org.mifos.mobile.cn.R
import org.mifos.mobile.cn.ui.base.MifosBaseActivity
import org.mifos.mobile.cn.ui.mifos.login.LoginContract
import org.mifos.mobile.cn.ui.mifos.login.LoginActivity

class SignupActivity: MifosBaseActivity(){
var login: TextView? = null


override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signup)
login = findViewById(R.id.already_have_an_account)

already_have_an_account.setOnClickListener(View.OnClickListener {
val R = Intent(this@SignupActivity, LoginActivity::class.java)
startActivity(R)
finish()
})

}
}
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>
15 changes: 15 additions & 0 deletions app/src/main/res/layout/activity_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@
android:backgroundTint="@color/white"
android:textColor="@color/grey_redesign"
android:fontFamily="@font/productsans"/>
<TextView
android:id="@+id/already_have_an_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="@string/already_have_an_account"
android:layout_gravity="center"
android:textColor="@color/white"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnSignup"
app:layout_constraintVertical_bias="0.0" />

</LinearLayout>

</androidx.core.widget.NestedScrollView>
Expand Down
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/report_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
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<string name="error_logging_in">Error logging in</string>
<string name="login_using_password_confirmation">Are you sure you want to login using Password?
</string>

<string name="already_have_an_account">Already have an account? login</string>

<!--Dashboard Activity-->
<string name="home">Home</string>
Expand Down Expand Up @@ -69,6 +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>
Expand Down