Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Обзор Google Nexus Player

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for GDG Samara GDG Samara
February 27, 2016

Обзор Google Nexus Player

Обзор Google Nexus Player и примеры кода для быстрого старта.
Автор: Дмитрий Кудренко

Avatar for GDG Samara

GDG Samara

February 27, 2016

More Decks by GDG Samara

Other Decks in Programming

Transcript

  1. Фильтрация в Google Play <uses-feature android:name="com.google.android.tv" android:required="false" /> <uses-feature android:name="android.software.leanback"

    android:required="false" /> <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  2. Home screen и запуск <application android:banner="@drawable/tv_banner"> <activity android:name=".ui.tv.TvSplashActivity_" android:theme="@style/Theme.Leanback"> <intent-filter>

    <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> </intent-filter> </activity>
  3. Загружаем данные //создаем карточки Presenter productCardPresenter = new ProductCardPresenter(); ArrayObjectAdapter

    productsItems = new ArrayObjectAdapter(productCardPresenter); productsItems.addAll(0, products); //данные будем отображать в горизонтальном списке ArrayObjectAdapter mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter()); //создаем раздел HeaderItem productsHeaderItem = new HeaderItem(0, getString(R.string.products)); mRowsAdapter.add(new ListRow(productsHeaderItem, productsItems)); //отображаем setAdapter(mRowsAdapter);