Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Neeloy Ghosh
/
CustomerApp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4fdda50c
authored
Sep 06, 2017
by
Neeloy Ghosh
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
neeloy_commit
parent
6842f41b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
86 additions
and
11 deletions
app/src/main/java/com/bbps/fragment/AddBillerByCategory.java
app/src/main/java/com/bbps/interfaces/ApiInterface.java
app/src/main/java/com/bbps/utils/ApiClient.java
app/src/main/java/com/bbps/utils/AppConstant.java
app/src/main/res/layout/addbiller_category.xml
app/src/main/res/layout/addbiller_coverage.xml
app/src/main/res/layout/complaint_status.xml
app/src/main/res/layout/raise_complaint_by_biller_details.xml
app/src/main/res/layout/raise_complaint_service_based.xml
app/src/main/res/layout/raise_complaint_transaction_based.xml
app/src/main/res/values/dimens.xml
app/src/main/java/com/bbps/fragment/AddBillerByCategory.java
View file @
4fdda50c
...
...
@@ -25,12 +25,25 @@ import com.bbps.fragment.pojo.BillersDataBySearch;
import
com.bbps.fragment.pojo.RegisteredBillersPojo
;
import
com.bbps.fragment.pojo.TransactionData
;
import
com.bbps.interfaces.ApiInterface
;
import
com.bbps.interfaces.IDataListener
;
import
com.bbps.utils.ApiClient
;
import
com.bbps.utils.AppConstant
;
import
com.bbps.utils.ExpandableHeightListView
;
import
com.bbps.utils.JsonUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonParser
;
import
com.google.gson.JsonSyntaxException
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.stream.JsonReader
;
import
org.json.JSONObject
;
import
java.io.Reader
;
import
java.io.StringReader
;
import
java.lang.reflect.Type
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -160,6 +173,18 @@ public class AddBillerByCategory extends BaseFragment {
if
(
AppConstant
.
isNetworkAvailable
(
getActivity
()))
{
ApiInterface
apiService
=
ApiClient
.
getClient
().
create
(
ApiInterface
.
class
);
// Call<Object> call = apiService.getBillerCategoryObject();
// AppConstant.getDataFromServer(getActivity(), call, new IDataListener() {
// @Override
// public void getResult(String errorMessage, Response<Object> response) {
// Object object=response.body();
// BillerCategory output = JsonUtils.get(object, BillerCategory.class);
// Log.e("output",output.getCategory()[0].toString());
//
//
//
// }
// });
Call
<
BillerCategory
>
call
=
apiService
.
getBillerCategory
();
call
.
enqueue
(
new
Callback
<
BillerCategory
>()
{
@Override
...
...
@@ -192,4 +217,5 @@ public class AddBillerByCategory extends BaseFragment {
}
}
app/src/main/java/com/bbps/interfaces/ApiInterface.java
View file @
4fdda50c
...
...
@@ -55,6 +55,9 @@ public interface ApiInterface {
@GET
(
"biller/categories"
)
Call
<
BillerCategory
>
getBillerCategory
();
@GET
(
"biller/categories"
)
Call
<
Object
>
getBillerCategoryObject
();
@GET
(
"biller/states"
)
Call
<
StatePojo
>
getStates
();
...
...
app/src/main/java/com/bbps/utils/ApiClient.java
View file @
4fdda50c
...
...
@@ -5,6 +5,8 @@ import android.os.Build;
import
android.support.annotation.RequiresApi
;
import
com.bbps.R
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -58,9 +60,12 @@ public class ApiClient {
});
OkHttpClient
client
=
httpClient
.
build
();
if
(
retrofit
==
null
)
{
Gson
gson
=
new
GsonBuilder
()
.
setLenient
()
.
create
();
retrofit
=
new
Retrofit
.
Builder
()
.
baseUrl
(
BASE_URL
)
.
addConverterFactory
(
GsonConverterFactory
.
create
())
.
addConverterFactory
(
GsonConverterFactory
.
create
(
gson
))
.
client
(
client
)
.
build
();
}
...
...
app/src/main/java/com/bbps/utils/AppConstant.java
View file @
4fdda50c
...
...
@@ -7,9 +7,14 @@ import android.net.NetworkInfo;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewAnimationUtils
;
import
android.widget.ArrayAdapter
;
import
android.widget.Toast
;
import
com.bbps.R
;
import
com.bbps.fragment.pojo.BillerCategory
;
import
com.bbps.fragment.pojo.BillerRegistrations
;
import
com.bbps.fragment.pojo.BillerRegistrationsSave
;
import
com.bbps.interfaces.IDataListener
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpHeaders
;
...
...
@@ -32,6 +37,10 @@ import org.json.JSONObject;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
retrofit2.Call
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
/**
* Created by neeloyg on 08-08-2017.
*/
...
...
@@ -330,5 +339,34 @@ public class AppConstant {
return
jsonObject
;
}
public
static
void
getDataFromServer
(
final
Context
context
,
Call
<
Object
>
call
,
final
IDataListener
iDataListener
)
{
call
.
enqueue
(
new
Callback
<
Object
>()
{
@Override
public
void
onResponse
(
Call
<
Object
>
call
,
Response
<
Object
>
response
)
{
if
(
response
!=
null
&&
response
.
body
()
!=
null
)
{
iDataListener
.
getResult
(
""
,
response
);
}
else
{
//if (response.body().getErrorMessages() != null) {
// if(context!=null)
// Toast.makeText(context, response.body().getErrorMessages().get(0).getErrorDtl(), Toast.LENGTH_SHORT).show();
// }
}
}
@Override
public
void
onFailure
(
Call
<
Object
>
call
,
Throwable
t
)
{
Log
.
e
(
"error"
,
t
.
toString
());
if
(
context
!=
null
)
Toast
.
makeText
(
context
,
context
.
getString
(
R
.
string
.
txt_networkcheck
),
Toast
.
LENGTH_SHORT
).
show
();
iDataListener
.
getResult
(
"ERROR"
,
null
);
}
});
}
}
app/src/main/res/layout/addbiller_category.xml
View file @
4fdda50c
...
...
@@ -30,7 +30,7 @@
<Spinner
android:id=
"@+id/spinner_billercategory"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
...
...
app/src/main/res/layout/addbiller_coverage.xml
View file @
4fdda50c
...
...
@@ -24,7 +24,7 @@
<Spinner
android:id=
"@+id/spinner_onlyselect"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@drawable/selectbox"
/>
...
...
@@ -44,7 +44,7 @@
<Spinner
android:id=
"@+id/spinner_biller"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
@@ -63,7 +63,7 @@
<Spinner
android:id=
"@+id/spinner_subbiller"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
app/src/main/res/layout/complaint_status.xml
View file @
4fdda50c
...
...
@@ -32,10 +32,11 @@
<Spinner
android:id=
"@+id/spinner_reasons"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:layout_marginLeft=
"@dimen/dp_20"
android:layout_marginRight=
"@dimen/dp_20"
android:background=
"@drawable/selectbox"
/>
android:background=
"@drawable/selectbox"
/>
<ScrollView
...
...
app/src/main/res/layout/raise_complaint_by_biller_details.xml
View file @
4fdda50c
...
...
@@ -304,7 +304,7 @@
<Spinner
android:id=
"@+id/spinner_reasons"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
app/src/main/res/layout/raise_complaint_service_based.xml
View file @
4fdda50c
...
...
@@ -44,7 +44,7 @@
<Spinner
android:id=
"@+id/spinner_agent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
@@ -62,7 +62,7 @@
<Spinner
android:id=
"@+id/spinner_reasons"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
app/src/main/res/layout/raise_complaint_transaction_based.xml
View file @
4fdda50c
...
...
@@ -86,7 +86,7 @@
<Spinner
android:id=
"@+id/spinner_agent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/spinner_heigh
t"
android:background=
"@drawable/selectbox"
/>
<com.bbps.utils.CustomTextView
...
...
app/src/main/res/values/dimens.xml
View file @
4fdda50c
...
...
@@ -48,4 +48,6 @@
<dimen
name=
"activity_horizontal_margin"
>
16dp
</dimen>
<dimen
name=
"activity_vertical_margin"
>
16dp
</dimen>
<dimen
name=
"fab_margin"
>
16dp
</dimen>
<dimen
name=
"spinner_height"
>
40dp
</dimen>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment