I have some API response as below:
[
{
accountType: a,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas1
}, {
accountType: b,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas2
}, {
accountType: c,
accountId: 1,
accountStatus: active,
isDefault: true,
accountName: texas4
}, {
accountType: a,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas5
}, {
accountType: b,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas6
},
{
accountType: a,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas7
}, {
accountType: b,
accountId: 1,
accountStatus: active,
isDefault: false,
accountName: texas9
} ]
I want the isDefault
true account to be shown as first cardview
with accountType
as c
then account type sorting should be done like account type a and its all account list and the account type b
and all its account list. over all my card should like this
- account type
c
- below default card
- then account type
a
- all cards
- then account type
b
- all cards
I always want isDefault
card to be on top irrespective of its account type then I want to sort cardView
based on accountType
as a,b,c etc.
I m displaying account type then cardView
below in xml
layout
How to achieve this on Bindview
? any help is appreciated