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


Java R类代码示例

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


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

示例1: ListMenuItemView

import com.actionbarsherlock.R; //导入依赖的package包/类
public ListMenuItemView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs);
    mContext = context;

    TypedArray a =
        context.obtainStyledAttributes(
            attrs, R.styleable.SherlockMenuView, defStyle, 0);

    mBackground = a.getDrawable(R.styleable.SherlockMenuView_itemBackground);
    mTextAppearance = a.getResourceId(R.styleable.
                                      SherlockMenuView_itemTextAppearance, -1);
    mPreserveIconSpacing = a.getBoolean(
            R.styleable.SherlockMenuView_preserveIconSpacing, false);
    mTextAppearanceContext = context;

    a.recycle();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:18,代码来源:ListMenuItemView.java

示例2: getResources_getInteger

import com.actionbarsherlock.R; //导入依赖的package包/类
/**
 * Support implementation of {@code getResources().getInteger()} that we
 * can use to simulate filtering based on width qualifiers on pre-3.2.
 *
 * @param context Context to load integers from on 3.2+ and to fetch the
 * display metrics.
 * @param id Id of integer to load.
 * @return Associated integer value as reflected by the current display
 * metrics.
 */
public static int getResources_getInteger(Context context, int id) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
        return context.getResources().getInteger(id);
    }

    DisplayMetrics metrics = context.getResources().getDisplayMetrics();
    float widthDp = metrics.widthPixels / metrics.density;

    if (id == R.integer.abs__max_action_buttons) {
        if (widthDp >= 600) {
            return 5; //values-w600dp
        }
        if (widthDp >= 500) {
            return 4; //values-w500dp
        }
        if (widthDp >= 360) {
            return 3; //values-w360dp
        }
        return 2; //values
    }

    throw new IllegalArgumentException("Unknown integer resource ID " + id);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:34,代码来源:ResourcesCompat.java

示例3: createTabView

import com.actionbarsherlock.R; //导入依赖的package包/类
private TabView createTabView(ActionBar.Tab tab, boolean forAdapter) {
    //Workaround for not being able to pass a defStyle on pre-3.0
    final TabView tabView = (TabView)mInflater.inflate(R.layout.abs__action_bar_tab, null);
    tabView.init(this, tab, forAdapter);

    if (forAdapter) {
        tabView.setBackgroundDrawable(null);
        tabView.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT,
                mContentHeight));
    } else {
        tabView.setFocusable(true);

        if (mTabClickListener == null) {
            mTabClickListener = new TabClickListener();
        }
        tabView.setOnClickListener(mTabClickListener);
    }
    return tabView;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:20,代码来源:ScrollingTabContainerView.java

示例4: ActionBarContainer

import com.actionbarsherlock.R; //导入依赖的package包/类
public ActionBarContainer(Context context, AttributeSet attrs) {
    super(context, attrs);

    setBackgroundDrawable(null);

    TypedArray a = context.obtainStyledAttributes(attrs,
            R.styleable.SherlockActionBar);
    mBackground = a.getDrawable(R.styleable.SherlockActionBar_background);
    mStackedBackground = a.getDrawable(
            R.styleable.SherlockActionBar_backgroundStacked);

    //Fix for issue #379
    if (mStackedBackground instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        mStackedBackground = new IcsColorDrawable((ColorDrawable) mStackedBackground);
    }

    if (getId() == R.id.abs__split_action_bar) {
        mIsSplit = true;
        mSplitBackground = a.getDrawable(
                R.styleable.SherlockActionBar_backgroundSplit);
    }
    a.recycle();

    setWillNotDraw(mIsSplit ? mSplitBackground == null :
            mBackground == null && mStackedBackground == null);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:27,代码来源:ActionBarContainer.java

示例5: onConfigurationChanged

import com.actionbarsherlock.R; //导入依赖的package包/类
@Override
public void onConfigurationChanged(Configuration newConfig) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
        super.onConfigurationChanged(newConfig);
    } else if (mMenuView != null) {
        mMenuView.onConfigurationChanged(newConfig);
    }

    // Action bar can change size on configuration changes.
    // Reread the desired height from the theme-specified style.
    TypedArray a = getContext().obtainStyledAttributes(null, R.styleable.SherlockActionBar,
            R.attr.actionBarStyle, 0);
    setContentHeight(a.getLayoutDimension(R.styleable.SherlockActionBar_height, 0));
    a.recycle();
    if (mSplitWhenNarrow) {
        setSplitActionBar(getResources_getBoolean(getContext(),
                R.bool.abs__split_action_bar_is_narrow));
    }
    if (mActionMenuPresenter != null) {
        mActionMenuPresenter.onConfigurationChanged(newConfig);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:23,代码来源:AbsActionBarView.java

示例6: makeText

import com.actionbarsherlock.R; //导入依赖的package包/类
public static Toast makeText(Context context, CharSequence s, int duration) {
    if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
        return Toast.makeText(context, s, duration);
    }
    IcsToast toast = new IcsToast(context);
    toast.setDuration(duration);
    TextView view = new TextView(context);
    view.setText(s);
    // Original AOSP using reference on @android:color/bright_foreground_dark
    // bright_foreground_dark - reference on @android:color/background_light
    // background_light - 0xffffffff
    view.setTextColor(0xffffffff);
    view.setGravity(Gravity.CENTER);
    view.setBackgroundResource(R.drawable.abs__toast_frame);
    toast.setView(view);
    return toast;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:18,代码来源:IcsToast.java

示例7: ActionBarContextView

import com.actionbarsherlock.R; //导入依赖的package包/类
public ActionBarContextView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SherlockActionMode, defStyle, 0);
    setBackgroundDrawable(a.getDrawable(
            R.styleable.SherlockActionMode_background));
    mTitleStyleRes = a.getResourceId(
            R.styleable.SherlockActionMode_titleTextStyle, 0);
    mSubtitleStyleRes = a.getResourceId(
            R.styleable.SherlockActionMode_subtitleTextStyle, 0);

    mContentHeight = a.getLayoutDimension(
            R.styleable.SherlockActionMode_height, 0);

    mSplitBackground = a.getDrawable(
            R.styleable.SherlockActionMode_backgroundSplit);

    a.recycle();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:20,代码来源:ActionBarContextView.java

示例8: getSearchIconId

import com.actionbarsherlock.R; //导入依赖的package包/类
/**
 * For a given suggestion and a given cursor row, get the action message. If
 * not provided by the specific row/column, also check for a single
 * definition (for the action key).
 *
 * @param c The cursor providing suggestions
 * @param actionKey The actionkey record being examined
 *
 * @return Returns a string, or null if no action key message for this
 *         suggestion
 */
// TODO private static String getActionKeyMessage(Cursor c, SearchableInfo.ActionKeyInfo actionKey) {
// TODO     String result = null;
// TODO     // check first in the cursor data, for a suggestion-specific message
// TODO     final String column = actionKey.getSuggestActionMsgColumn();
// TODO     if (column != null) {
// TODO         result = SuggestionsAdapter.getColumnString(c, column);
// TODO     }
// TODO     // If the cursor didn't give us a message, see if there's a single
// TODO     // message defined
// TODO     // for the actionkey (for all suggestions)
// TODO     if (result == null) {
// TODO         result = actionKey.getSuggestActionMsg();
// TODO     }
// TODO     return result;
// TODO }

private int getSearchIconId() {
    TypedValue outValue = new TypedValue();
    getContext().getTheme().resolveAttribute(R.attr.searchViewSearchIcon,
            outValue, true);
    return outValue.resourceId;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:34,代码来源:SearchView.java

示例9: adjustDropDownSizeAndPosition

import com.actionbarsherlock.R; //导入依赖的package包/类
private void adjustDropDownSizeAndPosition() {
    if (mDropDownAnchor.getWidth() > 1) {
        Resources res = getContext().getResources();
        int anchorPadding = mSearchPlate.getPaddingLeft();
        Rect dropDownPadding = new Rect();
        int iconOffset = mIconifiedByDefault
                ? res.getDimensionPixelSize(R.dimen.abs__dropdownitem_icon_width)
                + res.getDimensionPixelSize(R.dimen.abs__dropdownitem_text_padding_left)
                : 0;
        mQueryTextView.getDropDownBackground().getPadding(dropDownPadding);
        mQueryTextView.setDropDownHorizontalOffset(-(dropDownPadding.left + iconOffset)
                + anchorPadding);
        mQueryTextView.setDropDownWidth(mDropDownAnchor.getWidth() + dropDownPadding.left
                + dropDownPadding.right + iconOffset - (anchorPadding));
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:17,代码来源:SearchView.java

示例10: onCreateActionView

import com.actionbarsherlock.R; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public View onCreateActionView() {
    // Create the view and set its data model.
    ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mShareHistoryFileName);
    ActivityChooserView activityChooserView = new ActivityChooserView(mContext);
    activityChooserView.setActivityChooserModel(dataModel);

    // Lookup and set the expand action icon.
    TypedValue outTypedValue = new TypedValue();
    mContext.getTheme().resolveAttribute(R.attr.actionModeShareDrawable, outTypedValue, true);
    Drawable drawable = mContext.getResources().getDrawable(outTypedValue.resourceId);
    activityChooserView.setExpandActivityOverflowButtonDrawable(drawable);
    activityChooserView.setProvider(this);

    // Set content description.
    activityChooserView.setDefaultActionButtonContentDescription(
            R.string.abs__shareactionprovider_share_with_application);
    activityChooserView.setExpandActivityOverflowButtonContentDescription(
            R.string.abs__shareactionprovider_share_with);

    return activityChooserView;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:26,代码来源:ShareActionProvider.java

示例11: ListMenuItemView

import com.actionbarsherlock.R; //导入依赖的package包/类
public ListMenuItemView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs);
    mContext = context;

    TypedArray a =
            context.obtainStyledAttributes(
                    attrs, R.styleable.SherlockMenuView, defStyle, 0);

    mBackground = a.getDrawable(R.styleable.SherlockMenuView_itemBackground);
    mTextAppearance = a.getResourceId(R.styleable.
            SherlockMenuView_itemTextAppearance, -1);
    mPreserveIconSpacing = a.getBoolean(
            R.styleable.SherlockMenuView_preserveIconSpacing, false);
    mTextAppearanceContext = context;

    a.recycle();
}
 
开发者ID:ivanovpv,项目名称:darksms,代码行数:18,代码来源:ListMenuItemView.java

示例12: getThemedContext

import com.actionbarsherlock.R; //导入依赖的package包/类
public Context getThemedContext() {
    if (mThemedContext == null) {
        TypedValue outValue = new TypedValue();
        Resources.Theme currentTheme = mContext.getTheme();
        currentTheme.resolveAttribute(R.attr.actionBarWidgetTheme,
                outValue, true);
        final int targetThemeRes = outValue.resourceId;

        if (targetThemeRes != 0) { //XXX && mContext.getThemeResId() != targetThemeRes) {
            mThemedContext = new ContextThemeWrapper(mContext, targetThemeRes);
        } else {
            mThemedContext = mContext;
        }
    }
    return mThemedContext;
}
 
开发者ID:zhangxiaomenglin,项目名称:PalmCampus,代码行数:17,代码来源:ActionBarImpl.java

示例13: getResources_getInteger

import com.actionbarsherlock.R; //导入依赖的package包/类
/**
 * Support implementation of {@code getResources().getInteger()} that we
 * can use to simulate filtering based on width qualifiers on pre-3.2.
 *
 * @param context Context to load integers from on 3.2+ and to fetch the
 *                display metrics.
 * @param id      Id of integer to load.
 * @return Associated integer value as reflected by the current display
 *         metrics.
 */
public static int getResources_getInteger(Context context, int id) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
        return context.getResources().getInteger(id);
    }

    DisplayMetrics metrics = context.getResources().getDisplayMetrics();
    float widthDp = metrics.widthPixels / metrics.density;

    if (id == R.integer.abs__max_action_buttons) {
        if (widthDp >= 600) {
            return 5; //values-w600dp
        }
        if (widthDp >= 500) {
            return 4; //values-w500dp
        }
        if (widthDp >= 360) {
            return 3; //values-w360dp
        }
        return 2; //values
    }

    throw new IllegalArgumentException("Unknown integer resource ID " + id);
}
 
开发者ID:ivanovpv,项目名称:darksms,代码行数:34,代码来源:ResourcesCompat.java

示例14: initTitle

import com.actionbarsherlock.R; //导入依赖的package包/类
private void initTitle() {
    if (mTitleLayout == null) {
        LayoutInflater inflater = LayoutInflater.from(getContext());
        inflater.inflate(R.layout.abs__action_bar_title_item, this);
        mTitleLayout = (LinearLayout) getChildAt(getChildCount() - 1);
        mTitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_title);
        mSubtitleView = (TextView) mTitleLayout.findViewById(R.id.abs__action_bar_subtitle);
        if (mTitleStyleRes != 0) {
            mTitleView.setTextAppearance(mContext, mTitleStyleRes);
        }
        if (mSubtitleStyleRes != 0) {
            mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes);
        }
    }

    mTitleView.setText(mTitle);
    mSubtitleView.setText(mSubtitle);

    final boolean hasTitle = !TextUtils.isEmpty(mTitle);
    final boolean hasSubtitle = !TextUtils.isEmpty(mSubtitle);
    mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE);
    mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE);
    if (mTitleLayout.getParent() == null) {
        addView(mTitleLayout);
    }
}
 
开发者ID:ivanovpv,项目名称:darksms,代码行数:27,代码来源:ActionBarContextView.java

示例15: initializePanelMenu

import com.actionbarsherlock.R; //导入依赖的package包/类
private boolean initializePanelMenu() {
    Context context = mActivity;//getContext();

    // If we have an action bar, initialize the menu with a context themed for it.
    if (wActionBar != null) {
        TypedValue outValue = new TypedValue();
        Resources.Theme currentTheme = context.getTheme();
        currentTheme.resolveAttribute(R.attr.actionBarWidgetTheme,
                outValue, true);
        final int targetThemeRes = outValue.resourceId;

        if (targetThemeRes != 0 /*&& context.getThemeResId() != targetThemeRes*/) {
            context = new ContextThemeWrapper(context, targetThemeRes);
        }
    }

    mMenu = new MenuBuilder(context);
    mMenu.setCallback(this);

    return true;
}
 
开发者ID:zhangxiaomenglin,项目名称:PalmCampus,代码行数:22,代码来源:ActionBarSherlockCompat.java


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