Search code examples
androidlistviewandroid-tvsmart-tv

navigation in Android TV


navigation in Android TV.

How do I create just the navigation android tv. I do not care to use the entire theme, it provides android studio. And I do not understand much of what is in the example given by android studio. I understand that is something the String. I looked on the internet examples, but right now, android tv has no further information at this time.

I'm interested only create menu navigation side, nothing more.

Thank you very much. enter image description here


Solution

  • I found a really nice tutorial : http://corochann.com/browsefragment-header-customization-android-tv-application-hands-on-tutorial-17-697.html

    it shows you how to create a custom navigation side with an image and a text

    Here what a tried in my application : copy his IconHeaderItem class and in your loadRows paste

    IconHeaderItem gridItemPresenterHeader = new IconHeaderItem(0, BEWELL_THERMO, R.drawable.bewell_thermo);
        GridItemPresenter mGridPresenter = new GridItemPresenter();
        ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
        gridRowAdapter.add(DERNIERE_MESURE);
        gridRowAdapter.add(GRID_STRING_GUIDED_STEP_FRAGMENT);
        gridRowAdapter.add(GRID_STRING_RECOMMENDATION);
        gridRowAdapter.add(GRID_STRING_SPINNER);
        mGridItemListRow = new ListRow(gridItemPresenterHeader, gridRowAdapter);
        mRowsAdapter.add(mGridItemListRow);
        setAdapter(mRowsAdapter);