Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
authentication, client list, navigation drawer, saving and loan accou…
…nt listing added login authentication added Simple login screen added user authentication added authentication completed with removal of existing issues singleton pattern implemented, refactoring client list,navigation drawer, saving and loan account list features added Handle single clientid case and code refactoring
- Loading branch information
Showing
64 changed files
with
2,653 additions
and
74 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,32 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.mifos.selfserviceapp"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
android:theme="@style/MaterialAppTheme"> | ||
<activity | ||
android:name=".login.LoginActivity" | ||
android:label="@string/login" | ||
android:screenOrientation="portrait"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".home.HomeActivity" | ||
android:label="@string/home" | ||
android:screenOrientation="portrait" /> | ||
<activity | ||
android:name=".home.ClientAccountsActivity" | ||
android:label="@string/client_accounts" | ||
android:screenOrientation="portrait" /> | ||
</application> | ||
|
||
</manifest> |
83 changes: 83 additions & 0 deletions
83
app/src/main/java/org/mifos/selfserviceapp/adapters/ClientListAdapter.java
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,83 @@ | ||
package org.mifos.selfserviceapp.adapters; | ||
|
||
import android.content.Context; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import org.mifos.selfserviceapp.R; | ||
import org.mifos.selfserviceapp.data.Client; | ||
|
||
import java.util.List; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
|
||
/** | ||
* @author Vishwajeet | ||
* @since 20/06/16 | ||
*/ | ||
|
||
public class ClientListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||
|
||
LayoutInflater layoutInflater; | ||
List<Client> listItems; | ||
private Context mContext; | ||
|
||
public ClientListAdapter(Context context, List<Client> listItems) { | ||
|
||
layoutInflater = LayoutInflater.from(context); | ||
this.listItems = listItems; | ||
this.mContext = context; | ||
} | ||
|
||
public Client getItem(int position) { | ||
return listItems.get(position); | ||
} | ||
|
||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
RecyclerView.ViewHolder vh; | ||
View v = LayoutInflater.from(parent.getContext()).inflate( | ||
R.layout.row_client_name, parent, false); | ||
vh = new ViewHolder(v); | ||
return vh; | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { | ||
if (holder instanceof RecyclerView.ViewHolder) { | ||
|
||
Client client = getItem(position); | ||
((ViewHolder) holder).tv_clientName.setText(client.getFirstname() + " " + client | ||
.getLastname()); | ||
((ViewHolder) holder).tv_clientAccountNumber.setText(client.getAccountNo().toString()); | ||
|
||
} | ||
} | ||
|
||
@Override | ||
public long getItemId(int i) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return listItems.size(); | ||
} | ||
|
||
|
||
public static class ViewHolder extends RecyclerView.ViewHolder { | ||
@BindView(R.id.tv_clientName) | ||
TextView tv_clientName; | ||
@BindView(R.id.tv_clientAccountNumber) | ||
TextView tv_clientAccountNumber; | ||
|
||
public ViewHolder(View v) { | ||
super(v); | ||
ButterKnife.bind(this, v); | ||
} | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
app/src/main/java/org/mifos/selfserviceapp/adapters/LoanAccountsListAdapter.java
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,74 @@ | ||
package org.mifos.selfserviceapp.adapters; | ||
|
||
import android.content.Context; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import org.mifos.selfserviceapp.R; | ||
import org.mifos.selfserviceapp.data.accounts.LoanAccount; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
|
||
/** | ||
* @author Vishwajeet | ||
* @since 22/6/16. | ||
*/ | ||
public class LoanAccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||
private final Context context; | ||
private final LayoutInflater layoutInflater; | ||
private List<LoanAccount> loanAccountsList = new ArrayList<>(); | ||
|
||
public LoanAccountsListAdapter(Context context, List<LoanAccount> loanAccountsList) { | ||
this.context = context; | ||
layoutInflater = LayoutInflater.from(context); | ||
this.loanAccountsList = loanAccountsList; | ||
} | ||
|
||
public LoanAccount getItem(int position) { | ||
return loanAccountsList.get(position); | ||
} | ||
|
||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
RecyclerView.ViewHolder vh; | ||
View v = LayoutInflater.from(parent.getContext()).inflate( | ||
R.layout.row_loan_account, parent, false); | ||
vh = new ViewHolder(v); | ||
return vh; | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { | ||
if (holder instanceof RecyclerView.ViewHolder) { | ||
|
||
LoanAccount loanAccount = getItem(position); | ||
((ViewHolder) holder).tv_clientLoanAccountNumber.setText(loanAccount.getAccountNo().toString()); | ||
((ViewHolder) holder).tv_loanAccountProductName.setText(loanAccount.getProductName()); | ||
|
||
} | ||
|
||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return loanAccountsList.size(); | ||
} | ||
|
||
public static class ViewHolder extends RecyclerView.ViewHolder { | ||
@BindView(R.id.tv_clientLoanAccountNumber) | ||
TextView tv_clientLoanAccountNumber; | ||
@BindView(R.id.tv_loanAccountProductName) | ||
TextView tv_loanAccountProductName; | ||
|
||
public ViewHolder(View v) { | ||
super(v); | ||
ButterKnife.bind(this, v); | ||
} | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
app/src/main/java/org/mifos/selfserviceapp/adapters/SavingAccountsListAdapter.java
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,75 @@ | ||
package org.mifos.selfserviceapp.adapters; | ||
|
||
import android.content.Context; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import org.mifos.selfserviceapp.R; | ||
import org.mifos.selfserviceapp.data.accounts.SavingAccount; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
|
||
/** | ||
* @author Vishwajeet | ||
* @since 22/6/16. | ||
*/ | ||
public class SavingAccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||
private final Context context; | ||
private final LayoutInflater layoutInflater; | ||
private List<SavingAccount> savingAccountsList = new ArrayList<>(); | ||
|
||
public SavingAccountsListAdapter(Context context, List<SavingAccount> savingAccountsList) { | ||
this.context = context; | ||
layoutInflater = LayoutInflater.from(context); | ||
this.savingAccountsList = savingAccountsList; | ||
} | ||
|
||
public SavingAccount getItem(int position) { | ||
return savingAccountsList.get(position); | ||
} | ||
|
||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
RecyclerView.ViewHolder vh; | ||
View v = LayoutInflater.from(parent.getContext()).inflate( | ||
R.layout.row_saving_account, parent, false); | ||
vh = new ViewHolder(v); | ||
return vh; | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { | ||
if (holder instanceof RecyclerView.ViewHolder) { | ||
|
||
SavingAccount savingAccount = getItem(position); | ||
((ViewHolder) holder).tv_clientSavingAccountNumber.setText(savingAccount.getAccountNo().toString()); | ||
((ViewHolder) holder).tv_savingAccountProductName.setText(savingAccount.getProductName()); | ||
|
||
} | ||
|
||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return savingAccountsList.size(); | ||
} | ||
|
||
public static class ViewHolder extends RecyclerView.ViewHolder { | ||
@BindView(R.id.tv_clientSavingAccountNumber) | ||
TextView tv_clientSavingAccountNumber; | ||
@BindView(R.id.tv_savingAccountProductName) | ||
TextView tv_savingAccountProductName; | ||
|
||
public ViewHolder(View v) { | ||
super(v); | ||
ButterKnife.bind(this, v); | ||
} | ||
} | ||
} |
Oops, something went wrong.