Home > Mobile >  The android TV development BrowseFragment related
The android TV development BrowseFragment related

Time:09-16

BrowseFragment about TV, recently had a demand to can adjust the width of the sidebar, everyone again meet this demand?
I analyzed the train of thought:
1, check the API to see is there a way to expose, eventually did not find,
2, the side open closed have corresponding animation, through animation to modify the width of the view, but don't know how to get the view/viewGroup

Bosses have to do the dalai???

/* *
* A fragment for creating Leanback browse screens. It is composed of A
* RowsFragment and a HeadersFragment.
*


* A BrowseFragment renders the elements of its {@ link ObjectAdapter} as A set of
* of rows in a vertical list. The elements in this adapter must be subclasses
* of {@ link Row}.
*


* The HeadersFragment can be set to be either to The or hidden by default, or
* may be disabled entirely. See {@ # setHeadersState} link for details.
*


* By default the BrowseFragment includes support for returning to the headers
* when the user presses Back. For the Activities that customize {@ the link
* Activity# onBackPressed ()}, you must disable this default Back key support by
* calling {@ # link setHeadersTransitionOnBackEnabled (Boolean)} with false and
* use {@ link BrowseFragment. BrowseTransitionListener} and
* {@ # link startHeadersTransition (Boolean)}.
*


* The it theme to use with a BrowseFragment is
* {@ link androidx. Leanback. R.s tyle# Theme_Leanback_Browse}.
*


* @ deprecated use {@ link BrowseSupportFragment}
*/

CodePudding user response:

Your custom ViewGroup in onMeasure set width, in ontouch draw you to set the width of the implement requestLayout and invalidate, when you modify the width
  • Related