本文整理汇总了Java中android.support.v17.leanback.widget.DetailsOverviewRowPresenter.setStyleLarge方法的典型用法代码示例。如果您正苦于以下问题:Java DetailsOverviewRowPresenter.setStyleLarge方法的具体用法?Java DetailsOverviewRowPresenter.setStyleLarge怎么用?Java DetailsOverviewRowPresenter.setStyleLarge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.DetailsOverviewRowPresenter
的用法示例。
在下文中一共展示了DetailsOverviewRowPresenter.setStyleLarge方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
DetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackOverlayActivity.class);
intent.putExtra(DetailsActivity.MOVIE, mSelectedMovie);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例2: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
MovieDetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackActivity.class);
intent.putExtra(MovieDetailsActivity.MOVIE, mSelectedMovie);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例3: onCreate
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTopOffsetRatio(0.6f);
final Intent intent = getActivity().getIntent();
mShowId = intent.getLongExtra(EXTRA_TVSHOW_ID, -1);
mColor = ContextCompat.getColor(getActivity(), R.color.leanback_details_background);
mOverviewRowPresenter = new DetailsOverviewRowPresenter(new TvshowMoreDetailsDescriptionPresenter());
mOverviewRowPresenter.setSharedElementEnterTransition(getActivity(), SHARED_ELEMENT_NAME, 1000);
mOverviewRowPresenter.setBackgroundColor(getResources().getColor(R.color.leanback_details_background));
mOverviewRowPresenter.setStyleLarge(false);
mOverviewRowPresenter.setOnActionClickedListener(null);
setOnItemViewClickedListener(new OnItemViewClickedListener() {
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
if (item instanceof ScraperImage) {
if (row == mPostersRow) {
mShowPosterSaverTask = new ShowPosterSaverTask().execute((ScraperImage) item);
}
else if (row == mBackdropsRow) {
mBackdropSaverTask = new BackdropSaverTask().execute((ScraperImage) item);
}
}
else if (item instanceof WebPageLink) {
WebPageLink link = (WebPageLink)item;
WebUtils.openWebLink(getActivity(), link.getUrl());
}
}
});
// WORKAROUND: at least one instance of BackdropTask must be created soon in the process (onCreate ?)
// else it does not work later.
// --> This instance of BackdropTask() will not be used but it must be created here!
mBackdropTask = new BackdropTask(getActivity(), VideoInfoCommonClass.getDarkerColor(mColor));
}
示例4: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter(getActivity()));
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
DetailsActivity.SHARED_ELEMENT_NAME);
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例5: setupFragment
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
private void setupFragment() {
mDetailsPresenter = new DetailsOverviewRowPresenter(getDetailsPresenter());
mDetailsPresenter.setStyleLarge(false);
ClassPresenterSelector ps = new ClassPresenterSelector();
ps.addClassPresenter(DetailsOverviewRow.class, mDetailsPresenter);
ps.addClassPresenter(TracksHeaderRow.class, new TracksHeaderRowPresenter());
OnItemViewClickedListener onTrackRowItemClicked = new OnItemViewClickedListener() {
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
if (item instanceof TrackSimple) {
playFromTrack(((TrackSimple) item));
}
}
};
ps.addClassPresenter(TrackRow.class, getTrackRowPresenter(onTrackRowItemClicked));
mRowsAdapter = new ArrayObjectAdapter(ps);
setAdapter(mRowsAdapter);
setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
TracksDetailsFragment.this.onActionClicked(action);
}
});
}
示例6: onPostExecute
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
@Override
protected void onPostExecute( DetailsOverviewRow detailRow ) {
if( detailRow == null )
return;
ClassPresenterSelector ps = new ClassPresenterSelector();
DetailsOverviewRowPresenter dorPresenter =
new DetailsOverviewRowPresenter( new DetailsDescriptionPresenter() );
// 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_WATCH ) {
Intent intent = new Intent( getActivity(), PlayerActivity.class );
intent.putExtra( EXTRA_MOVIE, mSelectedMovie );
intent.putExtra( EXTRA_SHOULD_AUTO_START, true );
startActivity( intent );
}
}
});
ps.addClassPresenter( DetailsOverviewRow.class, dorPresenter );
ps.addClassPresenter( ListRow.class,
new ListRowPresenter() );
ArrayObjectAdapter adapter = new ArrayObjectAdapter( ps );
adapter.add( detailRow );
loadRelatedMedia( adapter );
setAdapter( adapter );
}
示例7: onPostExecute
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
@Override
protected void onPostExecute(DetailsOverviewRow detailRow) {
ClassPresenterSelector ps = new ClassPresenterSelector();
DetailsOverviewRowPresenter dorPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter(mActivity));
dorPresenter.setBackgroundColor(mActivity.getResources().getColor(R.color.fastlane_background));
dorPresenter.setStyleLarge(true);
dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_PLAY) {
VideoUtils.playVideo(new WeakReference<Activity>(mActivity), mVideo);
}
else if (action.getId() == ACTION_VIEW_TRAILER) {
Uri trailerUri = Uri.parse(mVideo.getMovie().getTrailer());
mActivity.startActivity(new Intent(Intent.ACTION_VIEW, trailerUri));
}
else {
Toast.makeText(mActivity, action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
ps.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
ps.addClassPresenter(ListRow.class, new ListRowPresenter());
ArrayObjectAdapter adapter = new ArrayObjectAdapter(ps);
adapter.add(detailRow);
addGroups(adapter);
if (mRowBuilderTaskListener != null) {
mRowBuilderTaskListener.taskCompleted(adapter);
}
}
示例8: onCreate
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的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);
}
示例9: initUIs
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的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));
}
}
示例10: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
DetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if(action.getId() == ACTION_EDIT) {
ActivityUtils.editChannel(getActivity(), jsonChannel.getMediaUrl());
} else if(action.getId() == ACTION_WATCH) {
Log.d(TAG, ChannelDatabase.getInstance(getActivity()).getHashMap().toString());
if (ChannelDatabase.getInstance(getActivity()).getHashMap()
.containsKey(jsonChannel.getMediaUrl())) {
// Open in Live Channels
Uri liveChannelsUri =
TvContract.buildChannelUri(
ChannelDatabase.getInstance(
getActivity()).getHashMap()
.get(jsonChannel.getMediaUrl()));
getActivity().startActivity(
new Intent(Intent.ACTION_VIEW, liveChannelsUri));
} else {
ActivityUtils.openStream(getActivity(), jsonChannel.getMediaUrl());
}
} else if(action.getId() == ACTION_ADD) {
Log.d(TAG, "Adding " + jsonChannel.toString());
ActivityUtils
.addChannel(getActivity(), gapi, jsonChannel);
getActivity().setResult(LeanbackActivity.RESULT_CODE_REFRESH_UI);
getActivity().finish();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例11: onCreate
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的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);
}
示例12: onPostExecute
import android.support.v17.leanback.widget.DetailsOverviewRowPresenter; //导入方法依赖的package包/类
@Override
protected void onPostExecute(DetailsOverviewRow detailRow) {
ClassPresenterSelector ps = new ClassPresenterSelector();
DetailsOverviewRowPresenter dorPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
// 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_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlayerActivity.class);
intent.putExtra(getResources().getString(R.string.movie), selectedMovie);
intent.putExtra(getResources().getString(R.string.should_start), true);
startActivity(intent);
}
else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
ps.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
ps.addClassPresenter(ListRow.class,
new ListRowPresenter());
ArrayObjectAdapter adapter = new ArrayObjectAdapter(ps);
adapter.add(detailRow);
String subcategories[] = {
getString(R.string.related_movies)
};
List<Movie> list = MovieList.list;
Collections.shuffle(list);
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter());
for (int j = 0; j < NUM_COLS; j++) {
listRowAdapter.add(list.get(j % 5));
}
HeaderItem header = new HeaderItem(0, subcategories[0], null);
adapter.add(new ListRow(header, listRowAdapter));
setAdapter(adapter);
}