Search in sources :

Example 1 with DetailsOverviewRowTarget

use of cx.ring.tv.views.DetailsOverviewRowTarget in project ring-client-android by savoirfairelinux.

the class TVContactRequestFragment method setupDetailsOverviewRow.

private void setupDetailsOverviewRow() {
    final DetailsOverviewRow row = new DetailsOverviewRow(mSelectedContactRequest);
    Drawable contactPicture = AvatarFactory.getAvatar(getActivity(), mSelectedContactRequest.getPhoto(), mSelectedContactRequest.getDisplayName(), mSelectedContactRequest.getContactId());
    Glide.with(this).load(contactPicture).apply(AvatarFactory.getGlideOptions(false, true)).into(new DetailsOverviewRowTarget(row, contactPicture));
    SparseArrayObjectAdapter adapter = new SparseArrayObjectAdapter();
    adapter.set(ACTION_ACCEPT, new Action(ACTION_ACCEPT, getResources().getString(R.string.accept)));
    adapter.set(ACTION_REFUSE, new Action(ACTION_REFUSE, getResources().getString(R.string.refuse)));
    adapter.set(ACTION_BLOCK, new Action(ACTION_BLOCK, getResources().getString(R.string.block)));
    row.setActionsAdapter(adapter);
    mAdapter.add(row);
}
Also used : SparseArrayObjectAdapter(android.support.v17.leanback.widget.SparseArrayObjectAdapter) Action(android.support.v17.leanback.widget.Action) DetailsOverviewRowTarget(cx.ring.tv.views.DetailsOverviewRowTarget) Drawable(android.graphics.drawable.Drawable) DetailsOverviewRow(android.support.v17.leanback.widget.DetailsOverviewRow)

Aggregations

Drawable (android.graphics.drawable.Drawable)1 Action (android.support.v17.leanback.widget.Action)1 DetailsOverviewRow (android.support.v17.leanback.widget.DetailsOverviewRow)1 SparseArrayObjectAdapter (android.support.v17.leanback.widget.SparseArrayObjectAdapter)1 DetailsOverviewRowTarget (cx.ring.tv.views.DetailsOverviewRowTarget)1