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

authentication, client list, navigation drawer, saving and loan account listing added #2

Merged
merged 2 commits into from
Jul 10, 2016
Merged
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
7 changes: 1 addition & 6 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 1 addition & 45 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

10 changes: 10 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
compileSdkVersion 23
Expand All @@ -20,7 +21,16 @@ android {
}

dependencies {
final RETROFIT_VERSION = '2.0.0-beta3'

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.jakewharton:butterknife:8.0.1'
compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
compile 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}
21 changes: 20 additions & 1 deletion app/src/main/AndroidManifest.xml
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=".ui.activities.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=".ui.activities.HomeActivity"
android:label="@string/home"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activities.ClientAccountsActivity"
android:label="@string/client_accounts"
android:screenOrientation="portrait" />
</application>

</manifest>
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);
}
}
}
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);
}
}
}
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);
}
}
}
Loading