diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt index 66d67927..e6d25f6d 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/accounts/AccountsFragment.kt @@ -1,14 +1,13 @@ package org.mifos.mobile.cn.ui.mifos.accounts import android.os.Bundle -import android.util.Log -import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.github.therajanmaurya.sweeterror.SweetUIErrorHandler import kotlinx.android.synthetic.main.fragment_accounts.* +import kotlinx.android.synthetic.main.layout_exception_handler.* import org.mifos.mobile.cn.R import org.mifos.mobile.cn.data.models.accounts.deposit.DepositAccount import org.mifos.mobile.cn.data.models.accounts.loan.LoanAccount @@ -19,7 +18,6 @@ import org.mifos.mobile.cn.ui.base.MifosBaseFragment import org.mifos.mobile.cn.ui.utils.ConstantKeys import org.mifos.mobile.cn.ui.utils.Network import javax.inject.Inject -import kotlinx.android.synthetic.main.layout_sweet_exception_handler.* import org.mifos.mobile.cn.data.models.CheckboxStatus import org.mifos.mobile.cn.ui.base.OnItemClickListener import org.mifos.mobile.cn.ui.mifos.customerDepositDetails.CustomerDepositDetailsFragment @@ -115,8 +113,6 @@ class AccountsFragment : MifosBaseFragment(), AccountsContract.View, OnItemClick layoutManager.orientation = LinearLayoutManager.VERTICAL rv_accounts.layoutManager = layoutManager rv_accounts.setHasFixedSize(true) - rv_accounts.addItemDecoration(DividerItemDecoration(activity, - layoutManager.orientation)) btn_try_again.setOnClickListener { retry() } when (accountType) { @@ -265,4 +261,4 @@ class AccountsFragment : MifosBaseFragment(), AccountsContract.View, OnItemClick override fun hideProgress() { hideProgressBar() } -} \ No newline at end of file +} diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerAccounts/CustomerAccountFragment.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerAccounts/CustomerAccountFragment.kt index 36598fc8..f61597e7 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerAccounts/CustomerAccountFragment.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerAccounts/CustomerAccountFragment.kt @@ -2,6 +2,7 @@ package org.mifos.mobile.cn.ui.mifos.customerAccounts import android.app.SearchManager import android.content.Context +import android.content.Intent import android.os.Bundle import androidx.viewpager.widget.ViewPager import androidx.appcompat.widget.SearchView @@ -19,6 +20,7 @@ import org.mifos.mobile.cn.ui.mifos.accounts.AccountsContract import org.mifos.mobile.cn.ui.mifos.accounts.AccountsFragment import org.mifos.mobile.cn.ui.mifos.accounts.AccountsPresenter import org.mifos.mobile.cn.ui.mifos.accountsFilter.AccountsFilterBottomSheet +import org.mifos.mobile.cn.ui.mifos.loanApplication.loanActivity.LoanApplicationActivity import org.mifos.mobile.cn.ui.utils.ConstantKeys import org.mifos.mobile.cn.ui.utils.StatusUtils import javax.inject.Inject @@ -93,6 +95,13 @@ class CustomerAccountFragment : MifosBaseFragment(), AccountsContract.View { AccountType.LOAN -> viewpager.currentItem = 1 } + deposit_toggle_btn.setOnClickListener { + viewpager.currentItem = 0 + } + loan_toggle_btn.setOnClickListener { + viewpager.currentItem = 1 + } + tabs.setupWithViewPager(viewpager) viewpager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { override fun onPageScrolled(position: Int, positionOffset: Float, @@ -157,12 +166,19 @@ class CustomerAccountFragment : MifosBaseFragment(), AccountsContract.View { override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) { inflater?.inflate(R.menu.menu_account, menu) if (viewpager.currentItem == 1) { + loan_toggle_focus_btn.visibility = View.VISIBLE + deposit_toggle_focus_btn.visibility = View.GONE + iv_apply_for_loan.visibility = View.VISIBLE + applyForLoan() menu?.findItem(R.id.menu_filter_loan)?.isVisible = true menu?.findItem(R.id.menu_filter_deposit)?.isVisible = false menu?.findItem(R.id.menu_search_loan)?.isVisible = true menu?.findItem(R.id.menu_search_deposit)?.isVisible = false initSearch(menu!!, AccountType.LOAN) } else if (viewpager.currentItem == 0) { + deposit_toggle_focus_btn.visibility = View.VISIBLE + loan_toggle_focus_btn.visibility = View.GONE + iv_apply_for_loan.visibility = View.GONE menu?.findItem(R.id.menu_filter_loan)?.isVisible = false menu?.findItem(R.id.menu_filter_deposit)?.isVisible = true menu?.findItem(R.id.menu_search_deposit)?.isVisible = true @@ -173,6 +189,14 @@ class CustomerAccountFragment : MifosBaseFragment(), AccountsContract.View { } + private fun applyForLoan() { + iv_apply_for_loan.setOnClickListener(View.OnClickListener { + val intent = Intent(activity, LoanApplicationActivity::class.java) + intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, "customer_identifier") + startActivity(intent) + }) + } + override fun onOptionsItemSelected(item: MenuItem?): Boolean { when (item?.itemId) { R.id.menu_filter_loan -> showFilterDialog(AccountType.LOAN) @@ -267,4 +291,4 @@ class CustomerAccountFragment : MifosBaseFragment(), AccountsContract.View { (activity as MifosBaseActivity).setToolbarElevation() } -} \ No newline at end of file +} diff --git a/app/src/main/res/drawable/more_icon.png b/app/src/main/res/drawable/more_icon.png new file mode 100644 index 00000000..82f45f34 Binary files /dev/null and b/app/src/main/res/drawable/more_icon.png differ diff --git a/app/src/main/res/drawable/rounded_shape.xml b/app/src/main/res/drawable/rounded_shape.xml new file mode 100644 index 00000000..44524075 --- /dev/null +++ b/app/src/main/res/drawable/rounded_shape.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_accounts.xml b/app/src/main/res/layout/fragment_accounts.xml index 0d2e38cc..9616c68a 100644 --- a/app/src/main/res/layout/fragment_accounts.xml +++ b/app/src/main/res/layout/fragment_accounts.xml @@ -2,7 +2,6 @@ @@ -30,7 +29,9 @@ layout="@layout/layout_sweet_exception_handler" android:id="@+id/layout_error" android:visibility="gone"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_client_accounts.xml b/app/src/main/res/layout/fragment_client_accounts.xml index 70b5ceb5..e721cd3e 100644 --- a/app/src/main/res/layout/fragment_client_accounts.xml +++ b/app/src/main/res/layout/fragment_client_accounts.xml @@ -1,38 +1,187 @@ - + android:layout_height="match_parent" + android:background="@color/violet"> - + android:layout_height="@dimen/layout_padding_100dp"> - - + android:layout_centerVertical="true" + android:layout_marginLeft="@dimen/layout_padding_30dp" + android:fontFamily="@font/airbnb_cereal_book" + android:text="@string/accounts" + android:textColor="@color/white" + android:textSize="30sp" + android:textStyle="bold" /> - + + + - - - \ No newline at end of file + android:layout_marginTop="@dimen/layout_padding_100dp" + android:layout_marginBottom="@dimen/layout_padding_n40dp" + android:backgroundTint="@color/offwhite" + app:cardCornerRadius="@dimen/layout_dimen_40dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_view_scan_card.xml b/app/src/main/res/layout/fragment_view_scan_card.xml index c0184489..1be44413 100644 --- a/app/src/main/res/layout/fragment_view_scan_card.xml +++ b/app/src/main/res/layout/fragment_view_scan_card.xml @@ -13,7 +13,6 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:scaleType="fitCenter" - android:visibility="visible" - /> + android:visibility="visible" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_customer_deposit_accounts.xml b/app/src/main/res/layout/item_customer_deposit_accounts.xml index e9c65169..5d4a7bd7 100644 --- a/app/src/main/res/layout/item_customer_deposit_accounts.xml +++ b/app/src/main/res/layout/item_customer_deposit_accounts.xml @@ -1,76 +1,101 @@ - - + android:layout_height="@dimen/layout_padding_70dp" + android:layout_marginLeft="@dimen/layout_padding_20dp" + android:layout_marginRight="@dimen/layout_padding_20dp" + android:layout_marginBottom="@dimen/layout_padding_10dp" + android:backgroundTint="@color/white" + app:cardCornerRadius="@dimen/layout_corner_radius_10dp"> - + + + + + - - + android:orientation="horizontal"> - + android:layout_weight="1" + android:orientation="vertical" + android:paddingLeft="@dimen/layout_padding_10dp" + android:paddingTop="@dimen/layout_padding_12dp" + android:paddingRight="@dimen/layout_padding_24dp" + android:paddingBottom="@dimen/layout_padding_10dp"> + + + + + + + + + + + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginEnd="@dimen/layout_padding_24dp" + android:layout_marginRight="@dimen/layout_padding_24dp" + android:fontFamily="@font/airbnb_cereal_book" + android:textColor="@color/violet" + android:textSize="@dimen/text_size_25sp" + android:textStyle="bold" + tools:text="@string/thirty_dollars" /> - - - - - + - \ No newline at end of file + diff --git a/app/src/main/res/layout/item_customer_loans.xml b/app/src/main/res/layout/item_customer_loans.xml index 1905331e..60440908 100644 --- a/app/src/main/res/layout/item_customer_loans.xml +++ b/app/src/main/res/layout/item_customer_loans.xml @@ -1,77 +1,111 @@ - - + android:layout_height="@dimen/layout_padding_70dp" + android:layout_marginLeft="@dimen/layout_padding_20dp" + android:layout_marginRight="@dimen/layout_padding_20dp" + android:layout_marginBottom="@dimen/layout_padding_10dp" + android:backgroundTint="@color/white" + app:cardCornerRadius="@dimen/layout_corner_radius_10dp"> - + + + + + + + android:orientation="horizontal"> - - - + android:layout_weight="1" + android:orientation="vertical" + android:paddingLeft="@dimen/layout_padding_10dp" + android:paddingTop="@dimen/layout_padding_12dp" + android:paddingRight="@dimen/layout_padding_24dp" + android:paddingBottom="@dimen/layout_padding_10dp"> + + + + + + + + + + + + + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginEnd="@dimen/layout_padding_24dp" + android:layout_marginRight="@dimen/layout_padding_24dp" + android:fontFamily="@font/airbnb_cereal_book" + android:textColor="@color/violet" + android:textSize="@dimen/text_size_25sp" + android:textStyle="bold" + tools:text="@string/thirty_dollars" /> - - - - - + - \ No newline at end of file + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index bf778ce8..77f31a9c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,18 +1,27 @@ + -40dp + 0dp 2dp 4dp 8dp 5dp 7dp 10dp + 12dp 15dp 16dp + 20dp 24dp + 25dp 30dp 50dp 64dp + 70dp 75dp + 100dp + 130dp + 16dp 16dp @@ -25,9 +34,12 @@ 12sp 18sp 14sp + 15sp 16sp 18sp 20sp + 25sp + 35sp 24sp 20sp @@ -46,7 +58,9 @@ 40dp 14dp 14dp + 40dp + 10dp 1dp 48dp - \ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fd45a34e..650d2de8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -50,6 +50,7 @@ support@mifos.org 8000000000 Contact Us + $30 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 2e27cfe8..70357779 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -68,5 +68,8 @@ @dimen/layout_padding_7dp +