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


Java DetailsOverviewRow.addAction方法代码示例

本文整理汇总了Java中android.support.v17.leanback.widget.DetailsOverviewRow.addAction方法的典型用法代码示例。如果您正苦于以下问题:Java DetailsOverviewRow.addAction方法的具体用法?Java DetailsOverviewRow.addAction怎么用?Java DetailsOverviewRow.addAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v17.leanback.widget.DetailsOverviewRow的用法示例。


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

示例1: doInBackground

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
protected DetailsOverviewRow doInBackground(Movie... movies) {
    mSelectedMovie = movies[0];

    DetailsOverviewRow row = new DetailsOverviewRow(mSelectedMovie);
    try {
        Bitmap poster = Picasso.with(getActivity())
                               .load(mSelectedMovie.getCardImageUrl())
                               .resize(Utils.convertDpToPixel(getActivity().getApplicationContext(),
                                               DETAIL_THUMB_WIDTH),
                                       Utils.convertDpToPixel(getActivity().getApplicationContext(),
                                               DETAIL_THUMB_HEIGHT))
                               .centerCrop()
                               .get();
        row.setImageBitmap(getActivity(), poster);
    } catch (IOException e) {
    }

    row.addAction(new Action(ACTION_WATCH_TRAILER, getResources().getString(
            R.string.watch_trailer_1), getResources().getString(R.string.watch_trailer_2)));
    row.addAction(new Action(ACTION_RENT, getResources().getString(R.string.rent_1),
            getResources().getString(R.string.rent_2)));
    row.addAction(new Action(ACTION_BUY, getResources().getString(R.string.buy_1),
            getResources().getString(R.string.buy_2)));
    return row;
}
 
开发者ID:CesarValiente,项目名称:tldrlegal,代码行数:27,代码来源:VideoDetailsFragment.java

示例2: doInBackground

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
protected DetailsOverviewRow doInBackground(Movie... movies) {
    mSelectedMovie = movies[0];

    DetailsOverviewRow row = new DetailsOverviewRow(mSelectedMovie);
    try {
        Bitmap poster = Picasso.with(getActivity())
                .load(mSelectedMovie.getCardImageUrl())
                .resize(Utils.convertDpToPixel(getActivity().getApplicationContext(), DETAIL_THUMB_WIDTH),
                        Utils.convertDpToPixel(getActivity().getApplicationContext(), DETAIL_THUMB_HEIGHT))
                .centerCrop()
                .get();
        row.setImageBitmap(getActivity(), poster);
    } catch (IOException e) {
    }

    row.addAction(new Action(ACTION_WATCH_TRAILER, getResources().getString(
            R.string.watch_trailer_1), getResources().getString(R.string.watch_trailer_2)));
    row.addAction(new Action(ACTION_RENT, getResources().getString(R.string.rent_1),
            getResources().getString(R.string.rent_2)));
    row.addAction(new Action(ACTION_BUY, getResources().getString(R.string.buy_1),
            getResources().getString(R.string.buy_2)));
    return row;
}
 
开发者ID:MizzleDK,项目名称:Mizuu-Android-TV,代码行数:25,代码来源:VideoDetailsFragment.java

示例3: doInBackground

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
protected DetailsOverviewRow doInBackground(Movie... movies) {
    selectedMovie = movies[0];

    DetailsOverviewRow row = new DetailsOverviewRow(selectedMovie);
    try {
        Bitmap poster = Picasso.with(getActivity())
                .load(selectedMovie.getCardImageUrl())
                .resize(dpToPx(DETAIL_THUMB_WIDTH, getActivity().getApplicationContext()),
                        dpToPx(DETAIL_THUMB_HEIGHT, getActivity().getApplicationContext()))
                .centerCrop()
                .get();
        row.setImageBitmap(getActivity(), poster);
    } catch (IOException e) {
    }

    row.addAction(new Action(ACTION_WATCH_TRAILER, getResources().getString(
            R.string.watch_trailer_1), getResources().getString(R.string.watch_trailer_2)));
    row.addAction(new Action(ACTION_RENT, getResources().getString(R.string.rent_1),
            getResources().getString(R.string.rent_2)));
    row.addAction(new Action(ACTION_BUY, getResources().getString(R.string.buy_1),
            getResources().getString(R.string.buy_2)));
    return row;
}
 
开发者ID:dextorer,项目名称:BuildingForAndroidTV,代码行数:25,代码来源:TVVideoDetailsFragment.java

示例4: setupDetailsOverviewRow

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
private void setupDetailsOverviewRow() {
    Log.d(TAG, "doInBackground: " + mSelectedMovie.toString());
    final DetailsOverviewRow row = new DetailsOverviewRow(mSelectedMovie);
    row.setImageDrawable(getResources().getDrawable(R.drawable.default_background));
    int width = Utils.convertDpToPixel(getActivity()
            .getApplicationContext(), DETAIL_THUMB_WIDTH);
    int height = Utils.convertDpToPixel(getActivity()
            .getApplicationContext(), DETAIL_THUMB_HEIGHT);
    Glide.with(getActivity())
            .load(mSelectedMovie.getCardImageUrl())
            .centerCrop()
            .error(R.drawable.default_background)
            .into(new SimpleTarget<GlideDrawable>(width, height) {
                @Override
                public void onResourceReady(GlideDrawable resource,
                                            GlideAnimation<? super GlideDrawable>
                                                    glideAnimation) {
                    Log.d(TAG, "details overview card image url ready: " + resource);
                    row.setImageDrawable(resource);
                    mAdapter.notifyArrayItemRangeChanged(0, mAdapter.size());
                }
            });

    row.addAction(new Action(ACTION_WATCH_TRAILER, getResources().getString(
            R.string.watch_trailer_1), getResources().getString(R.string.watch_trailer_2)));
    row.addAction(new Action(ACTION_RENT, getResources().getString(R.string.rent_1),
            getResources().getString(R.string.rent_2)));
    row.addAction(new Action(ACTION_BUY, getResources().getString(R.string.buy_1),
            getResources().getString(R.string.buy_2)));

    mAdapter.add(row);
}
 
开发者ID:bassaer,项目名称:HelloTV,代码行数:33,代码来源:VideoDetailsFragment.java

示例5: addActions

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
public void addActions(DetailsOverviewRow detailRow){
    detailRow.addAction(new Action(ACTION_OPEN, getResources().getString(R.string.open_indexed_folder)));
    if(ShortcutDbAdapter.VIDEO.isShortcut(getActivity(), mShortcut.getUri().toString())<0) {
        detailRow.addAction(new Action(ACTION_ADD_INDEX, getResources().getString(R.string.add_to_indexed_folders)));
    }
    else
        detailRow.addAction(new Action(ACTION_REINDEX, getResources().getString(R.string.network_reindex)));
    detailRow.addAction(new Action(ACTION_REMOVE, getResources().getString(R.string.remove_from_shortcuts)));
    detailRow.setImageDrawable(getResources().getDrawable(R.drawable.filetype_new_server));
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:12,代码来源:FtpShortcutDetailsFragment.java

示例6: configureDetailsOverviewRow

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
private DetailsOverviewRow configureDetailsOverviewRow(CardInfo cardInfo, Bitmap bitmap) {
  final DetailsOverviewRow row = new DetailsOverviewRow(cardInfo);
  row.setImageBitmap(getActivity(), bitmap);
  row.addAction(new Action(VD_CALL_ACTION_ID, getString(R.string.vd_call_action_title)));
  row.addAction(new Action(CALL_ACTION_ID, getString(R.string.call_action_title)));
  row.addAction(new Action(CHAT_ACTION_ID, getString(R.string.chat_action_title)));
  row.addAction(new Action(EDIT_ACTION_ID, getString(R.string.edit_action_title)));
  return row;
}
 
开发者ID:pedrovgs,项目名称:TuentiTV,代码行数:10,代码来源:DetailFragment.java

示例7: generateAboutGDGRow

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
private Row generateAboutGDGRow() {
    AboutItem aboutItem = new AboutItem();
    aboutItem.setTitle(getString(R.string.about_gdg_title));
    aboutItem.setSubtitle(getString(R.string.about_gdg_subtitle));
    aboutItem.setBody(getString(R.string.about_gdg_body));

    DetailsOverviewRow overviewRow = new DetailsOverviewRow(aboutItem);
    overviewRow.setImageDrawable(getResources().getDrawable(R.drawable.about_gdg_photo));
    overviewRow.addAction(new Action(JOIN_GDG, getString(R.string.about_gdg_action_one)));

    return overviewRow;
}
 
开发者ID:wildsmith,项目名称:TickTank_old,代码行数:13,代码来源:AboutDetailsFragment.java

示例8: doInBackground

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
protected DetailsOverviewRow doInBackground(Video... videos) {
    mVideo = videos[0];

    DetailsOverviewRow row = new DetailsOverviewRow(mVideo);
    try {
        Bitmap poster = Picasso.with(mActivity)
                .load(mVideo.getCardImageUrl())
                .resize(Utils.dpToPx(DETAIL_THUMB_WIDTH, mActivity.getApplicationContext()),
                        Utils.dpToPx(DETAIL_THUMB_HEIGHT, mActivity.getApplicationContext()))
                .centerCrop()
                .get();
        row.setImageBitmap(mActivity, poster);
    } catch (IOException e) {
        e.printStackTrace();
    }

    if (mShowPlayButton) {
        row.addAction(new Action(ACTION_PLAY, mActivity.getString(R.string.play)));
    }

    if (mVideo.getMovie() != null && !TextUtils.isEmpty(mVideo.getMovie().getTrailer())) {
        row.addAction(
                new Action(ACTION_VIEW_TRAILER, mActivity.getString(R.string.watch_trailer)));
    }

    return row;
}
 
开发者ID:jerrellmardis,项目名称:Amphitheatre,代码行数:29,代码来源:DetailRowBuilderTask.java

示例9: onCreate

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final String displayNumber = getActivity().getIntent().getStringExtra(
            RichFeedUtil.EXTRA_DISPLAY_NUMBER);

    DetailsOverviewRowPresenter dorPresenter = new DetailsOverviewRowPresenter(
            new DetailsDescriptionPresenter());
    dorPresenter.setSharedElementEnterTransition(getActivity(), "RichAppLinkDetailsFragment");

    DetailsOverviewRow row = new DetailsOverviewRow(displayNumber);
    Resources res = getResources();
    Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.nejnettv);
    int length = Math.min(bitmap.getWidth(), bitmap.getHeight());
    Bitmap croppedBitmap = Bitmap.createBitmap(bitmap,
            (bitmap.getWidth() - length) / 2,
            (bitmap.getHeight() - length) / 2,
            length, length);
    row.setImageBitmap(getActivity(), croppedBitmap);

    Action action1 = new Action(0, res.getString(R.string.details_fragment_action_1));
    Action action2 = new Action(1, res.getString(R.string.details_fragment_action_2));
    row.addAction(action1);
    row.addAction(action2);

    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    dorPresenter.setBackgroundColor(res.getColor(R.color.detail_background));
    dorPresenter.setStyleLarge(true);

    dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
        @Override
        public void onActionClicked(Action action) {
            getActivity().finish();
        }
    });

    presenterSelector.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
    presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
    ArrayObjectAdapter adapter = new ArrayObjectAdapter(presenterSelector);
    adapter.add(row);

    setAdapter(adapter);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:44,代码来源:RichAppLinkDetailsFragment.java

示例10: initUIs

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
private void initUIs(Bitmap bitmap) {
    DetailsOverviewRowPresenter dorPresenter =
            new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
    dorPresenter.setSharedElementEnterTransition(getActivity(), "SetUpFragment");

    mAddChannelAction = new Action(ACTION_ADD_CHANNELS,
            getResources().getString(R.string.rich_setup_add_channel));
    Action cancelAction = new Action(ACTION_CANCEL,
            getResources().getString(R.string.rich_setup_cancel));
    mInProgressAction = new Action(ACTION_IN_PROGRESS,
            getResources().getString(R.string.rich_setup_in_progress));

    DetailsOverviewRow row = new DetailsOverviewRow(mTvListing);
    if (bitmap != null) {
        int length = Math.min(bitmap.getWidth(), bitmap.getHeight());
        Bitmap croppedBitmap = Bitmap.createBitmap(bitmap,
                (bitmap.getWidth() - length) / 2,
                (bitmap.getHeight() - length) / 2,
                length, length);
        row.setImageBitmap(getActivity(), croppedBitmap);
    }
    row.addAction(mAddChannelAction);
    row.addAction(cancelAction);

    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    // set detail background and style
    dorPresenter.setBackgroundColor(getResources().getColor(R.color.detail_background));
    dorPresenter.setStyleLarge(true);

    dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
        @Override
        public void onActionClicked(Action action) {
            if (action.getId() == ACTION_ADD_CHANNELS) {
                setupChannels(mInputId);
            } else if (action.getId() == ACTION_CANCEL) {
                getActivity().finish();
            }
        }
    });

    presenterSelector.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
    presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
    mAdapter = new ArrayObjectAdapter(presenterSelector);
    mAdapter.add(row);

    setAdapter(mAdapter);

    BackgroundManager backgroundManager = BackgroundManager.getInstance(getActivity());
    backgroundManager.attach(getActivity().getWindow());
    if (bitmap != null) {
        backgroundManager.setBitmap(bitmap);
    } else {
        backgroundManager.setDrawable(
                getActivity().getDrawable(R.drawable.default_background));
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:57,代码来源:RichSetupFragment.java

示例11: addActions

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
public void addActions(DetailsOverviewRow detailRow){
    detailRow.addAction(new Action(ACTION_OPEN, getResources().getString(R.string.open_indexed_folder)));
    detailRow.addAction(new Action(ACTION_REINDEX, getResources().getString(R.string.network_reindex)));
    detailRow.addAction(new Action(ACTION_REMOVE, getResources().getString(R.string.remove_from_indexed_folders)));
    detailRow.setImageDrawable(getResources().getDrawable(R.drawable.filetype_new_folder_indexed));
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:7,代码来源:NetworkShortcutDetailsFragment.java

示例12: addAction

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
protected void addAction(Action action) {
	DetailsOverviewRow detailRow = (DetailsOverviewRow) mAdapter.get(0);
	detailRow.addAction(action);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:5,代码来源:PTVBaseDetailsFragment.java

示例13: doInBackground

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
protected DetailsOverviewRow doInBackground(BaseItemDto... baseItem) {


    DetailsOverviewRow row = new DetailsOverviewRow(mBaseItem);
    try {
        Bitmap poster = Picasso.with(getActivity())
                .load(Utils.getPrimaryImageUrl(mBaseItem, mApiClient, true, false, Utils.convertDpToPixel(mApplication, DETAIL_THUMB_HEIGHT)))
                        .resize(Utils.convertDpToPixel(mApplication,DETAIL_THUMB_WIDTH),
                                Utils.convertDpToPixel(mApplication, DETAIL_THUMB_HEIGHT))
                        .centerInside()
                        .get();
        row.setImageBitmap(getActivity(), poster);
    } catch (IOException e) {
    }

    UserItemDataDto userData = mBaseItem.getUserData();
    if (userData != null && userData.getPlaybackPositionTicks() > 0) {
        row.addAction(new Action(ACTION_RESUME, "Resume"));
    }

    switch (mBaseItem.getType()) {
        case "Person":
        case "Photo":
            break;
        default:
            if (mBaseItem.getIsFolder() && Utils.CanPlay(mBaseItem)) {
                row.addAction(new Action(ACTION_PLAY, "Play All"));
                row.addAction(new Action(ACTION_SHUFFLE, "Shuffle All"));

            } else  {
                if (Utils.CanPlay(mBaseItem)) row.addAction(new Action(ACTION_PLAY, "Play"));
                if (mProgramInfo != null && TvApp.getApplication().getCurrentUser().getPolicy().getEnableLiveTvManagement()) {
                    //Add record buttons
                    if (mProgramInfo.getTimerId() != null) {
                        //existing recording
                        row.addAction(new Action(ACTION_CANCEL_RECORD, "Cancel"));
                    } else {
                        row.addAction(new Action(ACTION_RECORD, "Record"));
                    }
                }
                row.addAction(new Action(ACTION_DETAILS, "Details"));
            }

    }
    return row;
}
 
开发者ID:henrytrager,项目名称:MediaBrowser.AndroidTv,代码行数:48,代码来源:BaseItemDetailsFragment.java

示例14: onCreate

import android.support.v17.leanback.widget.DetailsOverviewRow; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final String displayNumber = getActivity().getIntent().getStringExtra(
            RichFeedUtil.EXTRA_DISPLAY_NUMBER);

    DetailsOverviewRowPresenter dorPresenter = new DetailsOverviewRowPresenter(
            new DetailsDescriptionPresenter());
    dorPresenter.setSharedElementEnterTransition(getActivity(), "RichAppLinkDetailsFragment");

    DetailsOverviewRow row = new DetailsOverviewRow(displayNumber);
    Resources res = getResources();
    Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.your_company);
    int length = Math.min(bitmap.getWidth(), bitmap.getHeight());
    Bitmap croppedBitmap = Bitmap.createBitmap(bitmap,
            (bitmap.getWidth() - length) / 2,
            (bitmap.getHeight() - length) / 2,
            length, length);
    row.setImageBitmap(getActivity(), croppedBitmap);

    Action action1 = new Action(0, res.getString(R.string.details_fragment_action_1));
    Action action2 = new Action(1, res.getString(R.string.details_fragment_action_2));
    row.addAction(action1);
    row.addAction(action2);

    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    dorPresenter.setBackgroundColor(ContextCompat.getColor(getActivity(),
            R.color.detail_background));
    dorPresenter.setStyleLarge(true);

    dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
        @Override
        public void onActionClicked(Action action) {
            getActivity().finish();
        }
    });

    presenterSelector.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
    presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
    ArrayObjectAdapter adapter = new ArrayObjectAdapter(presenterSelector);
    adapter.add(row);

    setAdapter(adapter);
}
 
开发者ID:googlesamples,项目名称:androidtv-sample-inputs,代码行数:45,代码来源:RichAppLinkDetailsFragment.java


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