当前位置: 首页>>代码示例>>Java>>正文


Java AlphabetIndexer类代码示例

本文整理汇总了Java中android.widget.AlphabetIndexer的典型用法代码示例。如果您正苦于以下问题:Java AlphabetIndexer类的具体用法?Java AlphabetIndexer怎么用?Java AlphabetIndexer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AlphabetIndexer类属于android.widget包,在下文中一共展示了AlphabetIndexer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: QuickConversationAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
public QuickConversationAdapter(final Context context, List<Message> messageList, EmojiconHandler emojiconHandler) {
    this.context = context;
    this.emojiconHandler = emojiconHandler;
    this.contactService = new AppContactService(context);
    this.messageDatabaseService = new MessageDatabaseService(context);
    this.messageList = messageList;
    contactImageLoader = new ImageLoader(context, ImageUtils.getLargestScreenDimension((Activity) context)) {
        @Override
        protected Bitmap processBitmap(Object data) {
            return contactService.downloadContactImage((Activity) context, (Contact) data);
        }
    };
    contactImageLoader.addImageCache(((FragmentActivity) context).getSupportFragmentManager(), 0.1f);
    contactImageLoader.setImageFadeIn(false);
    channelImageLoader = new ImageLoader(context, ImageUtils.getLargestScreenDimension((Activity) context)) {
        @Override
        protected Bitmap processBitmap(Object data) {
            return contactService.downloadGroupImage((Activity) context, (Channel) data);
        }
    };
    channelImageLoader.addImageCache(((FragmentActivity) context).getSupportFragmentManager(), 0.1f);
    channelImageLoader.setImageFadeIn(false);
    final String alphabet = context.getString(R.string.alphabet);
    mAlphabetIndexer = new AlphabetIndexer(null, 1, alphabet);
    highlightTextSpan = new TextAppearanceSpan(context, R.style.searchTextHiglight);
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:27,代码来源:QuickConversationAdapter.java

示例2: ChannelAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
/**
 * Instantiates a new Contacts Adapter.
 *
 * @param context A context that has access to the app's layout.
 */
public ChannelAdapter(Context context) {
    super(context, null, 0);
    this.context = context;
    // Stores inflater for use later
    mInflater = LayoutInflater.from(context);
    final String alphabet = context.getString(R.string.alphabet);

    // Instantiates a new AlphabetIndexer bound to the column used to sort contact names.
    // The cursor is left null, because it has not yet been retrieved.
    mAlphabetIndexer = new AlphabetIndexer(null, 1, alphabet);

    // Defines a span for highlighting the part of a display name that matches the search
    // string
    highlightTextSpan = new TextAppearanceSpan(getActivity(), R.style.searchTextHiglight);
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:21,代码来源:ChannelFragment.java

示例3: ContactsAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
/**
 * Instantiates a new Contacts Adapter.
 *
 * @param context A context that has access to the app's layout.
 */
public ContactsAdapter(Context context) {
    super(context, null, 0);

    // Stores inflater for use later
    mInflater = LayoutInflater.from(context);

    // Loads a string containing the English alphabet. To fully localize the app, provide a
    // strings.xml file in res/values-<x> directories, where <x> is a locale. In the file,
    // define a string with android:name="alphabet" and contents set to all of the
    // alphabetic characters in the language in their proper sort order, in upper case if
    // applicable.
    final String alphabet = context.getString(R.string.alphabet);

    // Instantiates a new AlphabetIndexer bound to the column used to sort contact names.
    // The cursor is left null, because it has not yet been retrieved.
    mAlphabetIndexer = new AlphabetIndexer(null, ContactsQuery.SORT_KEY, alphabet);

    // Defines a span for highlighting the part of a display name that matches the search
    // string
    highlightTextSpan = new TextAppearanceSpan(getActivity(), R.style.searchTextHiglight);
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:27,代码来源:ContactsListFragment.java

示例4: ContactsAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
/**
 * Instantiates a new Contacts Adapter.
 *
 * @param context A context that has access to the app's layout.
 */
public ContactsAdapter(Context context) {
    super(context, null, 0);
    this.context = context;
    userIdList = new ArrayList<String>();
    // Stores inflater for use later
    mInflater = LayoutInflater.from(context);
    // Loads a string containing the English alphabet. To fully localize the app, provide a
    // strings.xml file in res/values-<x> directories, where <x> is a locale. In the file,
    // define a string with android:name="alphabet" and contents set to all of the
    // alphabetic characters in the language in their proper sort order, in upper case if
    // applicable.
    final String alphabet = context.getString(R.string.alphabet);

    // Instantiates a new AlphabetIndexer bound to the column used to sort contact names.
    // The cursor is left null, because it has not yet been retrieved.
    mAlphabetIndexer = new AlphabetIndexer(null, 1, alphabet);

    // Defines a span for highlighting the part of a display name that matches the search
    // string
    highlightTextSpan = new TextAppearanceSpan(context, R.style.searchTextHiglight);
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:27,代码来源:ContactSelectionFragment.java

示例5: ContactsAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
/**
 * Instantiates a new Contacts Adapter.
 *
 * @param context A context that has access to the app's layout.
 */
public ContactsAdapter(Context context) {
    super(context, null, 0);
    this.context = context;
    // Stores inflater for use later
    mInflater = LayoutInflater.from(context);
    // Loads a string containing the English alphabet. To fully localize the app, provide a
    // strings.xml file in res/values-<x> directories, where <x> is a locale. In the file,
    // define a string with android:name="alphabet" and contents set to all of the
    // alphabetic characters in the language in their proper sort order, in upper case if
    // applicable.
    final String alphabet = context.getString(R.string.alphabet);

    // Instantiates a new AlphabetIndexer bound to the column used to sort contact names.
    // The cursor is left null, because it has not yet been retrieved.
    mAlphabetIndexer = new AlphabetIndexer(null, 1, alphabet);

    // Defines a span for highlighting the part of a display name that matches the search
    // string
    highlightTextSpan = new TextAppearanceSpan(getActivity(), R.style.searchTextHiglight);
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:26,代码来源:AppContactFragment.java

示例6: ContactsAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
/**
 * Instantiates a new Contacts Adapter.
 * @param context A context that has access to the app's layout.
 */
public ContactsAdapter(Context context) {
    super(context, null, 0);

    // Stores inflater for use later
    mInflater = LayoutInflater.from(context);

    // Loads a string containing the English alphabet. To fully localize the app, provide a
    // strings.xml file in res/values-<x> directories, where <x> is a locale. In the file,
    // define a string with android:name="alphabet" and contents set to all of the
    // alphabetic characters in the language in their proper sort order, in upper case if
    // applicable.
    final String alphabet = context.getString(R.string.alphabet);

    // Instantiates a new AlphabetIndexer bound to the column used to sort contact names.
    // The cursor is left null, because it has not yet been retrieved.
    mAlphabetIndexer = new AlphabetIndexer(null, ContactsQuery.SORT_KEY, alphabet);

    // Defines a span for highlighting the part of a display name that matches the search
    // string
    highlightTextSpan = new TextAppearanceSpan(getActivity(), R.style.searchTextHiglight);
}
 
开发者ID:mojo1643,项目名称:margarita,代码行数:26,代码来源:ContactFragment.java

示例7: getContactArray

import android.widget.AlphabetIndexer; //导入依赖的package包/类
private List<Contact> getContactArray() {
	Cursor cursor = getContentResolver().query(URI,
			new String[] { "display_name", "sort_key", "phonebook_label" },
			null, null, "phonebook_label");
	Contact contact;
	if (cursor.moveToFirst()) {
		do {
			contact = new Contact();
			String contact_name = cursor.getString(0);
			String phonebook_label = cursor.getString(2);
			contact.setPhonebookLabel(getPhonebookLabel(phonebook_label));
			contact.setPinyinName(PinYin.getPinYin(contact_name));
			contact.setName(contact_name);
			list.add(contact);
		} while (cursor.moveToNext());
	}
	// 实例化indexer
	mIndexer = new AlphabetIndexer(cursor, 2, alphabet);
	return list;
}
 
开发者ID:yuqirong,项目名称:ContactPicker,代码行数:21,代码来源:MainActivity.java

示例8: index

import android.widget.AlphabetIndexer; //导入依赖的package包/类
public Cursor index(Cursor cursor){
	if(cursor != null){
		mRowStates = new int[cursor.getCount()];
		mAlphaIndexer = new AlphabetIndexer(cursor, 
		    		1, 
		    		mAlphabet);
		mAlphaIndexer.setCursor(cursor);
        Arrays.fill(mRowStates, STATE_UNKNOWN);
	} else {
		mRowStates = new int[0];
		mAlphaIndexer = null;
	}
    if(mRowStates.length > 0)
        mRowStates[0] = STATE_LABELED;
    return cursor;
}
 
开发者ID:SanaMobile,项目名称:sana.mobile,代码行数:17,代码来源:PatientListFragment.java

示例9: updateIndexer

import android.widget.AlphabetIndexer; //导入依赖的package包/类
private void updateIndexer(Cursor cursor) {
            if (mIndexer == null) {
                mIndexer = getNewIndexer(cursor);
            } else {
                if (Locale.getDefault().equals(Locale.JAPAN)) {
//                    if (mIndexer instanceof JapaneseContactListIndexer) {
//                        ((JapaneseContactListIndexer)mIndexer).setCursor(cursor);
//                    } else {
                        mIndexer = getNewIndexer(cursor);
//                    }
                } else {
                    if (mIndexer instanceof AlphabetIndexer) {
                        ((AlphabetIndexer)mIndexer).setCursor(cursor);
                    } else {
                        mIndexer = getNewIndexer(cursor);
                    }
                }
            }
        }
 
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:20,代码来源:ContactsListActivity.java

示例10: updateContactsData

import android.widget.AlphabetIndexer; //导入依赖的package包/类
public void updateContactsData(String belongId) {
        mIndexer = new AlphabetIndexer(ChatDB.create().getSortedKeyCursor(), 0, alphabet);
        adapter.setSectionIndexer(mIndexer);
        User user=UserCacheManager.getInstance().getUser(belongId);
        LogUtil.e("这里添加的好友星星如下");
        LogUtil.e(user);
        adapter.addData(user);
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:9,代码来源:ContactsFragment.java

示例11: initData

import android.widget.AlphabetIndexer; //导入依赖的package包/类
@Override
public void initData() {
        mLinearLayoutManager = new LinearLayoutManager(this);
        display.setLayoutManager(mLinearLayoutManager);
        display.addItemDecoration(new ListViewDecoration(this));
        display.setItemAnimator(new DefaultItemAnimator());
        mMyLetterView.setTextView(middle);
        adapter = new ContactsAdapter(UserCacheManager.getInstance().getAllContacts(),R.layout.fragment_contacts_list_item);
        adapter.setOnCheckedChangeListener(this);
        mIndexer = new AlphabetIndexer(ChatDB.create().getSortedKeyCursor(), 0, alphabet);
        adapter.setSectionIndexer(mIndexer);
        display.setAdapter(adapter);
        initActionBar();
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:15,代码来源:SelectedFriendsActivity.java

示例12: MyAdapter

import android.widget.AlphabetIndexer; //导入依赖的package包/类
public MyAdapter(final Context context, final int layout, final Cursor c,
        final String[] from, final int[] to) {
    super(context, layout, c, from, to, 0 /* flags */);

    if (null != c) {
        final String alphabet = context.getString(R.string.user_dict_fast_scroll_alphabet);
        final int wordColIndex = c.getColumnIndexOrThrow(UserDictionary.Words.WORD);
        mIndexer = new AlphabetIndexer(c, wordColIndex, alphabet);
    }
    setViewBinder(mViewBinder);
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:12,代码来源:UserDictionarySettings.java

示例13: swapCursor

import android.widget.AlphabetIndexer; //导入依赖的package包/类
@Override
public Cursor swapCursor(Cursor newCursor) {
    Cursor oldCursor = super.swapCursor(newCursor);

    // Create an indexer for the first time, indexing on domain.
    if (newCursor != null) {
        mAlphabetIndexer = new AlphabetIndexer(newCursor, newCursor.getColumnIndex(Secret.DOMAIN), ALPHABET);
    }
    // Update an existing indexer with the latest cursor.
    if (mAlphabetIndexer != null) {
        mAlphabetIndexer.setCursor(newCursor);
    }

    return oldCursor;
}
 
开发者ID:cpoppema,项目名称:pass-mobile-android,代码行数:16,代码来源:SecretsAdapter.java

示例14: swapCursor

import android.widget.AlphabetIndexer; //导入依赖的package包/类
@Override
public Cursor swapCursor(Cursor c) {
	if (c != null) {
		alphaIndexer = new AlphabetIndexer(c,
				c.getColumnIndex(Contacts.DISPLAY_NAME),
				" ABCDEFGHIJKLMNOPQRSTUVWXYZ");
	}

	return super.swapCursor(c);
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:11,代码来源:ContactsListFragment.java

示例15: swapCursor

import android.widget.AlphabetIndexer; //导入依赖的package包/类
@Override
public Cursor swapCursor(Cursor newCursor) {
    if(newCursor != null && !newCursor.isClosed()){

        indexer = new AlphabetIndexer(newCursor,
                newCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME),
                " ABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789");
    }else{
        indexer.setCursor(newCursor);
    }
    return super.swapCursor(newCursor);
}
 
开发者ID:Ioane5,项目名称:GeoSMS-Release,代码行数:13,代码来源:ContactsCursorAdapter.java


注:本文中的android.widget.AlphabetIndexer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。