fixed activity tab account selection
This commit is contained in:
parent
1a0d3eeb83
commit
c40835b7c9
|
@ -106,6 +106,7 @@ public class ParcelableAccount implements Parcelable {
|
|||
}
|
||||
|
||||
public ParcelableAccount() {
|
||||
is_dummy = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,20 +80,17 @@ public class AccountsSpinnerAdapter extends ArrayAdapter<ParcelableAccount> {
|
|||
final TextView text1 = (TextView) view.findViewById(android.R.id.text1);
|
||||
final TextView text2 = (TextView) view.findViewById(android.R.id.text2);
|
||||
final ImageView icon = (ImageView) view.findViewById(android.R.id.icon);
|
||||
if (text2 != null) {
|
||||
text2.setVisibility(item.is_dummy ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
if (icon != null) {
|
||||
icon.setVisibility(item.is_dummy ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
if (!item.is_dummy) {
|
||||
if (text1 != null) {
|
||||
text1.setVisibility(View.VISIBLE);
|
||||
text1.setText(item.name);
|
||||
}
|
||||
if (text2 != null) {
|
||||
text2.setVisibility(View.VISIBLE);
|
||||
text2.setText(String.format("@%s", item.screen_name));
|
||||
}
|
||||
if (icon != null) {
|
||||
icon.setVisibility(View.VISIBLE);
|
||||
if (mDisplayProfileImage) {
|
||||
mImageLoader.displayProfileImage(icon, item.profile_image_url);
|
||||
} else {
|
||||
|
@ -101,9 +98,18 @@ public class AccountsSpinnerAdapter extends ArrayAdapter<ParcelableAccount> {
|
|||
// icon.setImageResource(R.drawable.ic_profile_image_default);
|
||||
}
|
||||
}
|
||||
} else if (text1 != null) {
|
||||
} else {
|
||||
if (text1 != null) {
|
||||
text1.setVisibility(View.VISIBLE);
|
||||
text1.setText(mDummyItemText);
|
||||
}
|
||||
if (text2 != null) {
|
||||
text2.setVisibility(View.GONE);
|
||||
}
|
||||
if (icon != null) {
|
||||
icon.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class CustomTabUtils implements Constants {
|
|||
CustomTabConfiguration.ACCOUNT_REQUIRED, CustomTabConfiguration.FIELD_TYPE_USER_LIST, 7));
|
||||
CUSTOM_TABS_CONFIGURATION_MAP.put(TAB_TYPE_ACTIVITIES_ABOUT_ME, new CustomTabConfiguration(
|
||||
ActivitiesAboutMeFragment.class, R.string.activities_about_me, R.drawable.ic_action_user,
|
||||
CustomTabConfiguration.ACCOUNT_OPTIONAL, CustomTabConfiguration.FIELD_TYPE_NONE, 8));
|
||||
CustomTabConfiguration.ACCOUNT_REQUIRED, CustomTabConfiguration.FIELD_TYPE_NONE, 8));
|
||||
CUSTOM_TABS_CONFIGURATION_MAP.put(TAB_TYPE_ACTIVITIES_BY_FRIENDS, new CustomTabConfiguration(
|
||||
ActivitiesByFriendsFragment.class, R.string.activities_by_friends,
|
||||
R.drawable.ic_action_accounts, CustomTabConfiguration.ACCOUNT_REQUIRED,
|
||||
|
@ -102,8 +102,6 @@ public class CustomTabUtils implements Constants {
|
|||
CUSTOM_TABS_CONFIGURATION_MAP.put(TAB_TYPE_RETWEETS_OF_ME, new CustomTabConfiguration(
|
||||
RetweetsOfMeFragment.class, R.string.retweets_of_me, R.drawable.ic_action_retweet,
|
||||
CustomTabConfiguration.ACCOUNT_REQUIRED, CustomTabConfiguration.FIELD_TYPE_NONE, 10));
|
||||
if (Utils.hasStaggeredTimeline()) {
|
||||
}
|
||||
|
||||
CUSTOM_TABS_ICON_NAME_MAP.put("accounts", R.drawable.ic_action_accounts);
|
||||
CUSTOM_TABS_ICON_NAME_MAP.put("hashtag", R.drawable.ic_action_hashtag);
|
||||
|
|
Loading…
Reference in New Issue