• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java R类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ViewHolder

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Constructor for the ViewHolder.
 *
 * @param rootView The root View that this view holder will be attached
 *        to.
 */
public ViewHolder(View rootView, Presenter detailsPresenter) {
    super(rootView);
    mOverviewFrame = (FrameLayout) rootView.findViewById(R.id.details_frame);
    mOverviewView = (ViewGroup) rootView.findViewById(R.id.details_overview);
    mImageView = (ImageView) rootView.findViewById(R.id.details_overview_image);
    mRightPanel = (ViewGroup) rootView.findViewById(R.id.details_overview_right_panel);
    mDetailsDescriptionFrame =
            (FrameLayout) mRightPanel.findViewById(R.id.details_overview_description);
    mActionsRow =
            (HorizontalGridView) mRightPanel.findViewById(R.id.details_overview_actions);
    mActionsRow.setHasOverlappingRendering(false);
    mActionsRow.setOnScrollListener(mScrollListener);
    mActionsRow.setAdapter(mActionBridgeAdapter);
    mActionsRow.setOnChildSelectedListener(mChildSelectedListener);

    final int fadeLength = rootView.getResources().getDimensionPixelSize(
            R.dimen.lb_details_overview_actions_fade_size);
    mActionsRow.setFadingRightEdgeLength(fadeLength);
    mActionsRow.setFadingLeftEdgeLength(fadeLength);
    mDetailsDescriptionViewHolder =
            detailsPresenter.onCreateViewHolder(mDetailsDescriptionFrame);
    mDetailsDescriptionFrame.addView(mDetailsDescriptionViewHolder.view);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:30,代码来源:PTVDetailsOverviewRowPresenter.java


示例2: ViewHolder

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Constructor for the ViewHolder.
 *
 * @param rootView The root View that this view holder will be attached
 *        to.
 */
public ViewHolder(View rootView, Presenter detailsPresenter) {
    super(rootView);
    mOverviewFrame = (FrameLayout) rootView.findViewById(R.id.details_frame);
    mOverviewView = (ViewGroup) rootView.findViewById(R.id.details_overview);
    mImageView = (ImageView) rootView.findViewById(R.id.details_overview_image);
    mRightPanel = (ViewGroup) rootView.findViewById(R.id.details_overview_right_panel);
    mDetailsDescriptionFrame =
            (FrameLayout) mRightPanel.findViewById(R.id.details_overview_description);
    mActionsRow =
            (HorizontalGridView) mRightPanel.findViewById(R.id.details_overview_actions);
    mActionsRow.setHasOverlappingRendering(false);
    mActionsRow.setOnScrollListener(mScrollListener);
    mActionsRow.setAdapter(mActionBridgeAdapter);
    mActionsRow.setOnChildSelectedListener(mChildSelectedListener);

    final int fadeLength = rootView.getResources().getDimensionPixelSize(
            R.dimen.lb_details_overview_actions_fade_size);
    mActionsRow.setFadingRightEdgeLength(fadeLength);
    mActionsRow.setFadingLeftEdgeLength(fadeLength);
    mDetailsDescriptionViewHolder =
            detailsPresenter.onCreateViewHolder(mDetailsDescriptionFrame);
    mDetailsDescriptionFrame.addView(mDetailsDescriptionViewHolder.view);

    mActionBridgeAdapter.setAdapterListener(mAdapterListener);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:32,代码来源:DetailsOverviewRowPresenter.java


示例3: initialize

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Initialize shadows, color overlay, and rounded corners.  All are optional.
 */
public void initialize(boolean hasShadow, boolean hasColorDimOverlay, boolean roundedCorners) {
    if (mInitialized) {
        throw new IllegalStateException();
    }
    mInitialized = true;
    if (hasShadow) {
        mShadowImpl = ShadowHelper.getInstance().addShadow(this, roundedCorners);
    } else if (roundedCorners) {
        RoundedRectHelper.getInstance().setRoundedRectBackground(this,
                android.graphics.Color.TRANSPARENT);
    }
    if (hasColorDimOverlay) {
        mColorDimOverlay = LayoutInflater.from(getContext())
                .inflate(R.layout.lb_card_color_overlay, this, false);
        addView(mColorDimOverlay);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:21,代码来源:ShadowOverlayContainer.java


示例4: createAnimation

import android.support.v17.leanback.R; //导入依赖的package包/类
private Animator createAnimation(final View view, Property<View, Float> property,
        float start, float end, float terminalValue, TimeInterpolator interpolator,
        int finalVisibility) {
    float[] startPosition = (float[]) view.getTag(R.id.lb_slide_transition_value);
    if (startPosition != null) {
        start = View.TRANSLATION_Y == property ? startPosition[1] : startPosition[0];
        view.setTag(R.id.lb_slide_transition_value, null);
    }
    final ObjectAnimator anim = ObjectAnimator.ofFloat(view, property, start, end);

    SlideAnimatorListener listener = new SlideAnimatorListener(view, property, terminalValue, end,
            finalVisibility);
    anim.addListener(listener);
    anim.addPauseListener(listener);
    anim.setInterpolator(interpolator);
    return anim;
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:18,代码来源:Slide.java


示例5: BackgroundManager

import android.support.v17.leanback.R; //导入依赖的package包/类
private BackgroundManager(Activity activity, boolean isSupportFragmentActivity) {
    mContext = activity;
    mService = BackgroundContinuityService.getInstance();
    mHeightPx = mContext.getResources().getDisplayMetrics().heightPixels;
    mWidthPx = mContext.getResources().getDisplayMetrics().widthPixels;
    mHandler = new Handler();

    TypedArray ta = activity.getTheme().obtainStyledAttributes(new int[] {
            android.R.attr.windowBackground });
    mThemeDrawableResourceId = ta.getResourceId(0, -1);
    if (mThemeDrawableResourceId < 0) {
        if (DEBUG) Log.v(TAG, "BackgroundManager no window background resource!");
    }
    ta.recycle();

    if (isSupportFragmentActivity) {
        createSupportFragment((FragmentActivity) activity);
    } else {
        createFragment(activity);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:22,代码来源:BackgroundManager.java


示例6: lazyInit

import android.support.v17.leanback.R; //导入依赖的package包/类
private void lazyInit() {
    if (mLayerDrawable != null) {
        return;
    }

    mLayerDrawable = (LayerDrawable) ContextCompat.getDrawable(mContext,
            R.drawable.lb_background).mutate();
    mBgView.setBackground(mLayerDrawable);

    mLayerDrawable.setDrawableByLayerId(R.id.background_imageout, createEmptyDrawable());

    mDimWrapper = new DrawableWrapper(
            mLayerDrawable.findDrawableByLayerId(R.id.background_dim));

    mLayerWrapper = new DrawableWrapper(mLayerDrawable);

    mColorWrapper = new DrawableWrapper(
            mLayerDrawable.findDrawableByLayerId(R.id.background_color));
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:20,代码来源:BackgroundManager.java


示例7: updateImmediate

import android.support.v17.leanback.R; //导入依赖的package包/类
private void updateImmediate() {
    lazyInit();

    mColorWrapper.setColor(mBackgroundColor);
    if (mDimWrapper != null) {
        mDimWrapper.setAlpha(mBackgroundColor == Color.TRANSPARENT ? 0 : DIM_ALPHA_ON_SOLID);
    }
    showWallpaper(mBackgroundColor == Color.TRANSPARENT);

    mThemeDrawable = getThemeDrawable();
    mLayerDrawable.setDrawableByLayerId(R.id.background_theme, mThemeDrawable);

    if (mBackgroundDrawable == null) {
        mLayerDrawable.setDrawableByLayerId(R.id.background_imagein, createEmptyDrawable());
    } else {
        if (DEBUG) Log.v(TAG, "Background drawable is available");
        mImageInWrapper = new DrawableWrapper(mBackgroundDrawable);
        mLayerDrawable.setDrawableByLayerId(R.id.background_imagein, mBackgroundDrawable);
        if (mDimWrapper != null) {
            mDimWrapper.setAlpha(FULL_ALPHA);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:24,代码来源:BackgroundManager.java


示例8: loadBgAnimator

import android.support.v17.leanback.R; //导入依赖的package包/类
private void loadBgAnimator() {
    AnimatorUpdateListener listener = new AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator arg0) {
            setBgAlpha((Integer) arg0.getAnimatedValue());
        }
    };

    mBgFadeInAnimator = loadAnimator(getActivity(), R.animator.lb_playback_bg_fade_in);
    mBgFadeInAnimator.addUpdateListener(listener);
    mBgFadeInAnimator.addListener(mFadeListener);

    mBgFadeOutAnimator = loadAnimator(getActivity(), R.animator.lb_playback_bg_fade_out);
    mBgFadeOutAnimator.addUpdateListener(listener);
    mBgFadeOutAnimator.addListener(mFadeListener);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:17,代码来源:PlaybackOverlaySupportFragment.java


示例9: ShuffleAction

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Constructor
 * @param context Context used for loading resources.
 * @param highlightColor Color for the highlighted icon state.
 */
public ShuffleAction(Context context, int highlightColor) {
    super(R.id.lb_control_shuffle);
    BitmapDrawable uncoloredDrawable = (BitmapDrawable) getStyledDrawable(context,
            R.styleable.lbPlaybackControlsActionIcons_shuffle);
    Drawable[] drawables = new Drawable[2];
    drawables[OFF] = uncoloredDrawable;
    drawables[ON] = new BitmapDrawable(context.getResources(),
            createBitmap(uncoloredDrawable.getBitmap(), highlightColor));
    setDrawables(drawables);

    String[] labels = new String[drawables.length];
    labels[OFF] = context.getString(R.string.lb_playback_controls_shuffle_enable);
    labels[ON] = context.getString(R.string.lb_playback_controls_shuffle_disable);
    setLabels(labels);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:21,代码来源:PlaybackControlsRow.java


示例10: RepeatAction

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Constructor
 * @param context Context used for loading resources
 * @param repeatAllColor Color to display the repeat-all icon.
 * @param repeatOneColor Color to display the repeat-one icon.
 */
public RepeatAction(Context context, int repeatAllColor, int repeatOneColor) {
    super(R.id.lb_control_repeat);
    Drawable[] drawables = new Drawable[3];
    BitmapDrawable repeatDrawable = (BitmapDrawable) getStyledDrawable(context,
            R.styleable.lbPlaybackControlsActionIcons_repeat);
    BitmapDrawable repeatOneDrawable = (BitmapDrawable) getStyledDrawable(context,
            R.styleable.lbPlaybackControlsActionIcons_repeat_one);
    drawables[NONE] = repeatDrawable;
    drawables[ALL] = new BitmapDrawable(context.getResources(),
            createBitmap(repeatDrawable.getBitmap(), repeatAllColor));
    drawables[ONE] = new BitmapDrawable(context.getResources(),
            createBitmap(repeatOneDrawable.getBitmap(), repeatOneColor));
    setDrawables(drawables);

    String[] labels = new String[drawables.length];
    // Note, labels denote the action taken when clicked
    labels[NONE] = context.getString(R.string.lb_playback_controls_repeat_all);
    labels[ALL] = context.getString(R.string.lb_playback_controls_repeat_one);
    labels[ONE] = context.getString(R.string.lb_playback_controls_repeat_none);
    setLabels(labels);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:28,代码来源:PlaybackControlsRow.java


示例11: onStart

import android.support.v17.leanback.R; //导入依赖的package包/类
@Override
public void onStart() {
    super.onStart();

    VerticalGridView list = mRowsSupportFragment.getVerticalGridView();
    int mContainerListAlignTop =
            getResources().getDimensionPixelSize(R.dimen.lb_search_browse_rows_align_top);
    list.setItemAlignmentOffset(0);
    list.setItemAlignmentOffsetPercent(VerticalGridView.ITEM_ALIGN_OFFSET_PERCENT_DISABLED);
    list.setWindowAlignmentOffset(mContainerListAlignTop);
    list.setWindowAlignmentOffsetPercent(VerticalGridView.WINDOW_ALIGN_OFFSET_PERCENT_DISABLED);
    list.setWindowAlignment(VerticalGridView.WINDOW_ALIGN_NO_EDGE);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:14,代码来源:SearchSupportFragment.java


示例12: onCreateView

import android.support.v17.leanback.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.lb_details_fragment, container, false);
    mRowsSupportFragment = (RowsSupportFragment) getChildFragmentManager().findFragmentById(
            R.id.fragment_dock); 
    if (mRowsSupportFragment == null) {
        mRowsSupportFragment = new RowsSupportFragment();
        getChildFragmentManager().beginTransaction()
                .replace(R.id.fragment_dock, mRowsSupportFragment).commit();
    }
    mRowsSupportFragment.setAdapter(mAdapter);
    mRowsSupportFragment.setOnItemSelectedListener(mExternalOnItemSelectedListener);
    mRowsSupportFragment.setOnItemViewSelectedListener(mExternalOnItemViewSelectedListener);
    mRowsSupportFragment.setOnItemClickedListener(mOnItemClickedListener);
    mRowsSupportFragment.setOnItemViewClickedListener(mOnItemViewClickedListener);
    return view;
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:19,代码来源:DetailsSupportFragment.java


示例13: onCreateView

import android.support.v17.leanback.R; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.lb_details_fragment, container, false);
    mRowsFragment = (RowsFragment) getChildFragmentManager().findFragmentById(
            R.id.fragment_dock); 
    if (mRowsFragment == null) {
        mRowsFragment = new RowsFragment();
        getChildFragmentManager().beginTransaction()
                .replace(R.id.fragment_dock, mRowsFragment).commit();
    }
    mRowsFragment.setAdapter(mAdapter);
    mRowsFragment.setOnItemSelectedListener(mExternalOnItemSelectedListener);
    mRowsFragment.setOnItemViewSelectedListener(mExternalOnItemViewSelectedListener);
    mRowsFragment.setOnItemClickedListener(mOnItemClickedListener);
    mRowsFragment.setOnItemViewClickedListener(mOnItemViewClickedListener);
    return view;
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:19,代码来源:DetailsFragment.java


示例14: ClosedCaptioningAction

import android.support.v17.leanback.R; //导入依赖的package包/类
/**
 * Constructor
 * @param context Context used for loading resources.
 * @param highlightColor Color for the highlighted icon state.
 */
public ClosedCaptioningAction(Context context, int highlightColor) {
    super(R.id.lb_control_high_quality);
    BitmapDrawable uncoloredDrawable = (BitmapDrawable) getStyledDrawable(context,
            R.styleable.lbPlaybackControlsActionIcons_closed_captioning);
    Drawable[] drawables = new Drawable[2];
    drawables[OFF] = uncoloredDrawable;
    drawables[ON] = new BitmapDrawable(context.getResources(),
            createBitmap(uncoloredDrawable.getBitmap(), highlightColor));
    setDrawables(drawables);

    String[] labels = new String[drawables.length];
    labels[OFF] = context.getString(R.string.lb_playback_controls_closed_captioning_enable);
    labels[ON] = context.getString(R.string.lb_playback_controls_closed_captioning_disable);
    setLabels(labels);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:21,代码来源:PlaybackControlsRow.java


示例15: SpeechOrbView

import android.support.v17.leanback.R; //导入依赖的package包/类
public SpeechOrbView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    Resources resources = context.getResources();
    mSoundLevelMaxZoom =
            resources.getFraction(R.fraction.lb_search_bar_speech_orb_max_level_zoom, 1, 1);

    mNotListeningOrbColors = new Colors(resources.getColor(R.color.lb_speech_orb_not_recording),
            resources.getColor(R.color.lb_speech_orb_not_recording_pulsed),
            resources.getColor(R.color.lb_speech_orb_not_recording_icon));
    mListeningOrbColors = new Colors(resources.getColor(R.color.lb_speech_orb_recording),
            resources.getColor(R.color.lb_speech_orb_recording),
            Color.TRANSPARENT);

    showNotListening();
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:17,代码来源:SpeechOrbView.java


示例16: onCreateDrawableState

import android.support.v17.leanback.R; //导入依赖的package包/类
@Override
protected int[] onCreateDrawableState(int extraSpace) {
    // filter out focus states,  since leanback does not fade foreground on focus.
    final int[] s = super.onCreateDrawableState(extraSpace);
    final int N = s.length;
    boolean pressed = false;
    boolean enabled = false;
    for (int i = 0; i < N; i++) {
        if (s[i] == android.R.attr.state_pressed) {
            pressed = true;
        }
        if (s[i] == android.R.attr.state_enabled) {
            enabled = true;
        }
    }
    if (pressed && enabled) {
        return View.PRESSED_ENABLED_STATE_SET;
    } else if (pressed) {
        return LB_PRESSED_STATE_SET;
    } else if (enabled) {
        return View.ENABLED_STATE_SET;
    } else {
        return View.EMPTY_STATE_SET;
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:26,代码来源:BaseCardView.java


示例17: ImageCardView

import android.support.v17.leanback.R; //导入依赖的package包/类
public ImageCardView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    LayoutInflater inflater = LayoutInflater.from(context);
    View v = inflater.inflate(R.layout.lb_image_card_view, this);

    mImageView = (ImageView) v.findViewById(R.id.main_image);
    mImageView.setVisibility(View.INVISIBLE);
    mInfoArea = v.findViewById(R.id.info_field);
    mTitleView = (TextView) v.findViewById(R.id.title_text);
    mContentView = (TextView) v.findViewById(R.id.content_text);
    mBadgeImage = (ImageView) v.findViewById(R.id.extra_badge);
    mBadgeFadeMask = (ImageView) v.findViewById(R.id.fade_mask);

    if (mInfoArea != null) {
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.lbImageCardView,
                defStyle, 0);
        try {
            setInfoAreaBackground(
                    a.getDrawable(R.styleable.lbImageCardView_infoAreaBackground));
        } finally {
            a.recycle();
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:26,代码来源:ImageCardView.java


示例18: ViewHolder

import android.support.v17.leanback.R; //导入依赖的package包/类
ViewHolder(View rootView, Presenter descriptionPresenter) {
    super(rootView);
    mCard = (ViewGroup) rootView.findViewById(R.id.controls_card);
    mImageView = (ImageView) rootView.findViewById(R.id.image);
    mDescriptionDock = (ViewGroup) rootView.findViewById(R.id.description_dock);
    mControlsDock = (ViewGroup) rootView.findViewById(R.id.controls_dock);
    mSecondaryControlsDock =
            (ViewGroup) rootView.findViewById(R.id.secondary_controls_dock);
    mSpacer = rootView.findViewById(R.id.spacer);
    mBottomSpacer = rootView.findViewById(R.id.bottom_spacer);
    mDescriptionViewHolder = descriptionPresenter == null ? null :
            descriptionPresenter.onCreateViewHolder(mDescriptionDock);
    if (mDescriptionViewHolder != null) {
        mDescriptionDock.addView(mDescriptionViewHolder.view);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:17,代码来源:PlaybackControlsRowPresenter.java


示例19: addShadow

import android.support.v17.leanback.R; //导入依赖的package包/类
public static Object addShadow(ViewGroup shadowContainer) {
    shadowContainer.setLayoutMode(ViewGroup.LAYOUT_MODE_OPTICAL_BOUNDS);
    LayoutInflater inflater = LayoutInflater.from(shadowContainer.getContext());
    inflater.inflate(R.layout.lb_shadow, shadowContainer, true);
    ShadowImpl impl = new ShadowImpl();
    impl.mNormalShadow = shadowContainer.findViewById(R.id.lb_shadow_normal);
    impl.mFocusShadow = shadowContainer.findViewById(R.id.lb_shadow_focused);
    return impl;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:ShadowHelperJbmr2.java


示例20: getOutline

import android.support.v17.leanback.R; //导入依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    if (sCornerRadius == 0) {
        sCornerRadius = view.getResources().getDimensionPixelSize(
                R.dimen.lb_rounded_rect_corner_radius);
    }
    outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), sCornerRadius);
    outline.setAlpha(1f);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:RoundedRectHelperApi21.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResourcePersistence类代码示例发布时间:2022-05-22
下一篇:
Java GPF类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap