Skip to content

Commit e02f53e

Browse files
committed
version 2.0.0-BETA-5
- update support libs - remove XML profile from profile chooser
1 parent 72d44c5 commit e02f53e

3 files changed

Lines changed: 34 additions & 28 deletions

File tree

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ buildscript {
3030
buildTools: "25.0.2",
3131
minSdk : 11,
3232
targetSdk : 25,
33-
version : "2.0.0-BETA-4",
34-
supportLib: "25.1.0"
33+
version : "2.0.0-BETA-5",
34+
supportLib: "25.1.1"
3535
]
3636
}
3737

library/src/main/java/rebus/header/view/ProfileChooser.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,24 @@ public void onClick(View v) {
7575
}
7676
});
7777
for (int i = 0; i < profileSparseArray.size(); i++) {
78-
RowProfileView profileView = new RowProfileView(context);
79-
profileView.setProfile(profileSparseArray.valueAt(i), i == 0);
80-
profileView.setAccent(accent);
81-
profileView.setOnClickListener(new View.OnClickListener() {
82-
@Override
83-
public void onClick(View v) {
84-
RowProfileView rowProfileView = (RowProfileView) v;
85-
if (callback != null) {
86-
if (callback.onSelect(rowProfileView.getProfile().getId(), rowProfileView.isActive())) {
87-
dismiss();
78+
Profile profile = profileSparseArray.valueAt(i);
79+
if (profile.getId() != 1) {
80+
RowProfileView profileView = new RowProfileView(context);
81+
profileView.setProfile(profile, i == 0);
82+
profileView.setAccent(accent);
83+
profileView.setOnClickListener(new View.OnClickListener() {
84+
@Override
85+
public void onClick(View v) {
86+
RowProfileView rowProfileView = (RowProfileView) v;
87+
if (callback != null) {
88+
if (callback.onSelect(rowProfileView.getProfile().getId(), rowProfileView.isActive())) {
89+
dismiss();
90+
}
8891
}
8992
}
90-
}
91-
});
92-
linearLayout.addView(profileView);
93+
});
94+
linearLayout.addView(profileView);
95+
}
9396
}
9497
int padding = context.getResources().getDimensionPixelSize(R.dimen.hv_item_padding);
9598
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

library/src/main/java/rebus/header/view/ProfileChooserFragment.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,24 @@ public void onClick(View v) {
112112
});
113113
if (profileSparseArray != null) {
114114
for (int i = 0; i < profileSparseArray.size(); i++) {
115-
RowProfileView profileView = new RowProfileView(getActivity());
116-
profileView.setProfile(profileSparseArray.valueAt(i), i == 0);
117-
profileView.setAccent(accent);
118-
profileView.setOnClickListener(new View.OnClickListener() {
119-
@Override
120-
public void onClick(View v) {
121-
RowProfileView rowProfileView = (RowProfileView) v;
122-
if (callback != null) {
123-
if (callback.onSelect(rowProfileView.getProfile().getId(), rowProfileView.isActive())) {
124-
dismiss();
115+
Profile profile = profileSparseArray.valueAt(i);
116+
if (profile.getId() != 1) {
117+
RowProfileView profileView = new RowProfileView(getActivity());
118+
profileView.setProfile(profile, i == 0);
119+
profileView.setAccent(accent);
120+
profileView.setOnClickListener(new View.OnClickListener() {
121+
@Override
122+
public void onClick(View v) {
123+
RowProfileView rowProfileView = (RowProfileView) v;
124+
if (callback != null) {
125+
if (callback.onSelect(rowProfileView.getProfile().getId(), rowProfileView.isActive())) {
126+
dismiss();
127+
}
125128
}
126129
}
127-
}
128-
});
129-
linearLayout.addView(profileView);
130+
});
131+
linearLayout.addView(profileView);
132+
}
130133
}
131134
}
132135
if (items != null) {

0 commit comments

Comments
 (0)