當前位置: 首頁>>代碼示例>>Java>>正文


Java SearchManager.FLAG_QUERY_REFINEMENT屬性代碼示例

本文整理匯總了Java中android.app.SearchManager.FLAG_QUERY_REFINEMENT屬性的典型用法代碼示例。如果您正苦於以下問題:Java SearchManager.FLAG_QUERY_REFINEMENT屬性的具體用法?Java SearchManager.FLAG_QUERY_REFINEMENT怎麽用?Java SearchManager.FLAG_QUERY_REFINEMENT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.app.SearchManager的用法示例。


在下文中一共展示了SearchManager.FLAG_QUERY_REFINEMENT屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bindView

@Override
public void bindView(View view, Context context, Cursor cursor) {
    ChildViewCache views = (ChildViewCache) view.getTag();

    int flags = 0;
    if (mFlagsCol != INVALID_INDEX) {
        flags = cursor.getInt(mFlagsCol);
    }
    if (views.mText1 != null) {
        String text1 = getStringOrNull(cursor, mText1Col);
        setViewText(views.mText1, text1);
    }
    if (views.mText2 != null) {
        // First check TEXT_2_URL
        CharSequence text2 = getStringOrNull(cursor, mText2UrlCol);
        if (text2 != null) {
            text2 = formatUrl(text2);
        } else {
            text2 = getStringOrNull(cursor, mText2Col);
        }

        // If no second line of text is indicated, allow the first line of text
        // to be up to two lines if it wants to be.
        if (TextUtils.isEmpty(text2)) {
            if (views.mText1 != null) {
                views.mText1.setSingleLine(false);
                views.mText1.setMaxLines(2);
            }
        } else {
            if (views.mText1 != null) {
                views.mText1.setSingleLine(true);
                views.mText1.setMaxLines(1);
            }
        }
        setViewText(views.mText2, text2);
    }

    if (views.mIcon1 != null) {
        setViewDrawable(views.mIcon1, getIcon1(cursor), View.INVISIBLE);
    }
    if (views.mIcon2 != null) {
        setViewDrawable(views.mIcon2, getIcon2(cursor), View.GONE);
    }
    if (mQueryRefinement == REFINE_ALL
            || (mQueryRefinement == REFINE_BY_ENTRY
            && (flags & SearchManager.FLAG_QUERY_REFINEMENT) != 0)) {
        views.mIconRefine.setVisibility(View.VISIBLE);
        views.mIconRefine.setTag(views.mText1.getText());
        views.mIconRefine.setOnClickListener(this);
    } else {
        views.mIconRefine.setVisibility(View.GONE);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:53,代碼來源:SuggestionsAdapter.java


注:本文中的android.app.SearchManager.FLAG_QUERY_REFINEMENT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。