public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
public final class AccountTypesProvider { public static List<AccountType> accountTypes = Collections.unmodifiableList(Arrays.asList( new AccountType(AccountType.TWITTER_ACCOUNT, "Twitter" , R.drawable.twitter_icon_big), new AccountType(AccountType.FACEBOOK_ACCOUNT, "Facebook" , R.drawable.facebook_icon_big), new AccountType(AccountType.BUZZ_ACCOUNT, "Google Buzz" , R.drawable.buzz_icon_big), new AccountType(AccountType.LINKEDIN_ACCOUNT, "LinkedIn" , R.drawable.linkedin_icon_big), new AccountType(AccountType.VKONTAKTE_ACOUNT, "" , R.drawable.vkontakte_icon_big) )); } * This source code was highlighted with Source Code Highlighter .
* This source code was highlighted with Source Code Highlighter .
- public final class AccountsTypesListAdapter extends ArrayAdapter <AccountType> {
- private Activity context;
- private List <AccountType> accountTypes;
- public AccountsTypesListAdapter (Activity context, List <AccountType> accountTypes) {
- super (context, R.layout.select_account_item, accountTypes);
- this .context = context;
- this .accountTypes = accountTypes;
- }
- @Override
- public View getView ( int position, View convertView, ViewGroup parent) {
- LayoutInflater inflater = context.getLayoutInflater ();
- View row = inflater.inflate (R.layout.select_account_item, parent, false );
- TextView label = (TextView) row.findViewById (R.id.text_item);
- label.setText (accountTypes.get (position) .title);
- ImageView icon = (ImageView) row.findViewById (R.id.icon_item);
- icon.setImageResource (accountTypes.get (position) .bigIconId);
- return row;
- }
- }
* This source code was highlighted with Source Code Highlighter .
- <? xml version = "1.0" encoding = "utf-8" ? >
- < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
- android: orientation = "horizontal" android: layout_width = "fill_parent"
- android: layout_height = "fill_parent" android: padding = "10px" >
- < ImageView android: id = "@ + id / icon_item" android: layout_width = "wrap_content"
- android: layout_height = "fill_parent" />
- < TextView android: id = "@ + id / text_item" android: layout_width = "wrap_content"
- android: layout_height = "fill_parent" android: paddingLeft = "10px"
- android: paddingTop = "5px" android: textStyle = "bold"
- android: textColor = "# 000000" />
- </ LinearLayout >
* This source code was highlighted with Source Code Highlighter .
- public static void showSelectAccountTypeDialog (Activity context, String title, OnClickListener dialogListener) {
- AlertDialog.Builder builder = new AlertDialog.Builder (context);
- builder.setTitle (title);
- builder.setAdapter ( new AccountsTypesListAdapter (context, AccountTypesProvider.accountTypes), dialogListener);
- builder.create (). show ();
- }
* This source code was highlighted with Source Code Highlighter .
- private void displaySelectAccountTypeDialog () {
- ApplicationDialogs.showSelectAccountTypeDialog ( this , "Select network" , new OnClickListener () {
- @Override
- public void onClick (DialogInterface dialogInterface, int selectedItemId) {
- setupAccount (selectedItemId);
- }
- });
- }
Source: https://habr.com/ru/post/103347/
All Articles