CN111836095B - Mode for circularly displaying programs at TV (television) end - Google Patents

Mode for circularly displaying programs at TV (television) end Download PDF

Info

Publication number
CN111836095B
CN111836095B CN202010649569.6A CN202010649569A CN111836095B CN 111836095 B CN111836095 B CN 111836095B CN 202010649569 A CN202010649569 A CN 202010649569A CN 111836095 B CN111836095 B CN 111836095B
Authority
CN
China
Prior art keywords
data
list
index
focus
data set
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010649569.6A
Other languages
Chinese (zh)
Other versions
CN111836095A (en
Inventor
魏代邦
徐民
王�琦
***
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haikan Network Technology Shandong Co ltd
Original Assignee
Haikan Network Technology Shandong Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haikan Network Technology Shandong Co ltd filed Critical Haikan Network Technology Shandong Co ltd
Priority to CN202010649569.6A priority Critical patent/CN111836095B/en
Publication of CN111836095A publication Critical patent/CN111836095A/en
Application granted granted Critical
Publication of CN111836095B publication Critical patent/CN111836095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/482End-user interface for program selection
    • H04N21/4826End-user interface for program selection using recommendation lists, e.g. of programs or channels sorted out according to their score

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a mode for circularly displaying programs at a TV end, which is characterized in that list configuration is set, wherein a list inherits a linear layout container of an Android system, and the contents of the list are longitudinally arranged from top to bottom; the list container comprises a plurality of fixed occupied layouts; each space occupying layout is used for displaying a piece of program content, one list comprises a plurality of space occupying layouts, and the space occupying layouts in the same list have the same style; a circular list is formed when the display is performed. The invention occupies less resources and has simpler realization process; the method is applied in a low-performance environment, and provides a faster sliding speed and a smoother rolling effect with extremely low Android system resource consumption, so that better operation experience is brought to a user; while providing focus handling and providing the user with a variety of placeholder layout styles, the focus will be fixed in the center of the list as the list scrolls, i.e. the content item in the focus position is always the vertically centered one in the list.

Description

Mode for circularly displaying programs at TV (television) end
Technical Field
The invention relates to the technical field of network televisions, in particular to a mode for circularly displaying programs by a TV (television) end.
Background
The hardware configuration of the television set-top box is generally inferior to that of touch screen devices such as a mobile phone and a tablet computer, and the version of an operating system is laggard by generations, especially the IPTV set-top box device. Compared with the development of a common mobile terminal, the application development on the IPTV terminal set-top box brings more limitations and requirements on the use of the Android native control. Especially, on the equipment with low performance and low operating system, how to realize a set of smooth circular lists is very important to improve the user interaction experience.
The list tool components ListView and RecycleView provided by the Android system can achieve the common list effect in applications based on Android native development. They have many advantages, such as view multiplexing function of reclerview, which can recycle/multiplex views through internal multi-level buffer pool, and reduce resource consumption of list when the data volume is large. The ListView and RecyclerView still have good display effect when the list structure is complex, the layout style is various and the data volume is large.
However, in some application scenarios, such as a program list of an IPTV live broadcast application, the data size is small, the layout of a single program is single, the content of the single program is small, and usually only text and simple icons are included. But the application has higher requirements on the scrolling and rendering speed of the list, and simultaneously, the list per se is required to occupy less resources. Therefore, it is necessary to maintain multiple cache pools and implement ListView and RecyclerView processes that contain multiple internal components, which are "heavy". It is an object of the present invention to create a custom list assembly that satisfies the desired results while being lightweight and flexible.
Disclosure of Invention
To overcome the disadvantages, the invention aims to provide a mode for displaying programs on a TV end in a circulating way.
The technical scheme adopted by the invention for solving the technical problems is as follows: a mode of circularly displaying programs at a TV end is provided, wherein list configuration is set, wherein a list inherits a linear layout container of an Android system, and the contents of the list are longitudinally arranged from top to bottom; the list container comprises a plurality of fixed occupied layouts; each space occupying layout is used for displaying a piece of program content, one list comprises a plurality of space occupying layouts, and the space occupying layouts in the same list have the same style; when the focus content is displayed to the last piece of data, the next focus content displays the first piece of data, namely, a recyclable list is formed, and the method specifically comprises the following steps:
s1, page initialization
When a page is initialized, reading configuration information of the list, acquiring an XML layout file of an occupied layout and the number N of the occupied layouts contained in the list, wherein N is an odd number, acquiring a corresponding view object by analyzing the XML layout file of the occupied layout, circularly adding the view object into the list, and finishing the initialization of the list;
s2 list rendering
Reading configuration information, acquiring a list rendering data set, acquiring a focus and non-focus style, completing list layout loading, acquiring a group of information from a data source, namely the rendered data set, filling the rendered data set into a list, wherein a data structure of the data source to be agreed is an ordered list, and when the data set is acquired, searching (N-1)/2 data respectively before and after the ordered list by taking an index position of data where the current focus is located as a center;
if the list layout loading is completed, rendering the list content, circularly reading the data set information by the list after obtaining the rendered data set, corresponding the data to the occupied layout through the index position, binding the corresponding data to the occupied layout by the list, and completing the rendering of the list content;
s3, moving focal point
When the focus moves, the rendering data set is obtained again, if the focus content is positioned at the tail part of the data source list, corresponding data can be obtained from the tail part and the head part of the data source list respectively when the data is obtained, and when the data is displayed, the content of the tail part and the head part of the data source is contained in the screen, so that the circular display of the list is realized;
because the index of the focus data is located in the middle of the acquired rendering data set, the focus content is located at the middle position in the vertical direction of the list after the rendering is finished.
Specifically, when the list is initialized, the method may select to modify the style of the placeholder layout according to the configuration information, where the index position of the list starts from 0, the placeholder layout at the (N-1)/2 th position is the layout of the focus content, the list may set the focus style for the layout, and the other layouts set the non-focus styles.
Specifically, the S1 page initialization includes the following steps:
s11, loading custom list by application
When the application loads the custom list, the initialization of the list is executed, and the list inherits the LinearLayout layout of the Android, so that a layout container is obtained after the initialization;
s12, in the process of list initialization, reading the configuration information of the list, obtaining the number N of the content items displayed in one screen of the list, appointing the value as an odd number, and simultaneously obtaining the XML layout of the list content.
Specifically, the method for arranging and loading the list in S2 includes:
s221, analyzing the layout file to generate a view object and adding the view object to the list, analyzing the XML layout file by using an Android LayoutInflate tool through the custom list to obtain a corresponding view object, and adding the object to the list as a sub-view;
s222, in the process of adding the sub-views to the list, style information is set, whether the sub-views are focal point occupied layouts is judged according to whether the index number is equal to (N-1)/2, if the sub-views are focal point occupied layouts, the step S223 is carried out, and if the sub-views are not focal point station layouts, the step S218 is carried out;
s223, adding a focus pattern for the current view;
s224, adding a non-focus pattern for the current view;
the above steps complete the loading of the list layout.
Specifically, the method for rendering the list content in S2 includes:
s231, acquiring N pieces of rendering data from a data source by the content;
s232, judging whether the rendering data are place-occupying data or not, carrying out data binding on N pieces of data obtained from a data source and N place-occupying sub-layouts in a list according to the data, sequentially obtaining each piece of data from a rendering data set, if the current data are place-occupying data agreed in advance, not filling the data into the place-occupying layout at the corresponding index, and if the current data are not place-occupying data, carrying out the step S233;
and S233, if the current data is not the placeholder data, filling the corresponding placeholder layout with rendering data, namely filling the placeholder layout at the corresponding index with the rendering data, completing data binding, and repeating the process until all data traversal is finished.
Specifically, the step of obtaining the rendering data set for the first time includes:
s41, the application transmits the original data set to a custom list;
s42, creating a rendering data set by the user-defined list;
s43, detecting the length of the original data set by the user-defined list, if the length of the original data set is smaller than the number N of configured display items, inserting position-occupying data, and then performing the step S44, otherwise performing the step S411;
s44, step S43, wherein the list data items are longer than the original data, the original data are located in the middle of the list, the content of the beginning and the end of the list is empty, the empty content is realized by inserting position occupying data into the list, whether the position occupying data are position occupying data is identified through a flag bit, when the data are bound, if the position occupying data are found, the data are not processed, firstly, the position occupying data are inserted into the head of the rendering data set, and because the original data are displayed in the middle, the position occupying data inserted into the head of the queue are (N-K)/2, N is the number displayed by the list, and K is the number of the original data;
s45, following the step S44, inserting original data into the tail of the rendering data set queue in sequence;
s46, judging whether the data volume K of the original data is an odd number, if so, performing a step S47, otherwise, performing a step S48;
s47, if K is an odd number, the middle content of the original data is located in the middle of the list, and to achieve the effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, wherein the odd number is (N-K)/2 pieces of data;
s48, if K is an even number, the middle of the list is the content of the original data middle index plus one, to achieve this effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, when the number is an even number, (N-K)/2+1 pieces of data need to be inserted, at this time, (N-K)/2 needs to be rounded, for example, N is 7, K is 4, (N-K)/2 is 1.5, 1 is rounded to 1.5, at this time, 1+1 is 2 pieces of data are inserted;
s49, the index position of the current focus in the original data set needs to be saved, the index is (k-1)/2 when the number is odd, and then the step S13 is carried out;
s410, the index position of the current focus in the original data set needs to be stored, and the index is k/2-1 in the case of even number, and then the step S13 is carried out;
s411, when the length of the original data is larger than N, reading the first N pieces of data from the original data, and writing the data into a rendering data set;
s412, the index position of the current focus in the original data set needs to be stored, and the index is (N-1)/2 when the number is odd;
and S413, finally returning the rendering data set.
Specifically, the method for moving the focus downward includes:
s31 moving the focus from the current focus position of the list, the custom list will try to retrieve the rendering data set;
s32, in the obtaining process, calculating an index of a new focus, that is, X ═ X +1, according to the index position X of the previously stored focus in the original data set, obtaining previous and subsequent data according to the new focus index, and then rendering an interface;
s33, when the focus moves downwards, the index value X of the new focus is the old focus value plus one, at this time, whether the index value X of the new focus exceeds the maximum length value K of the original data list needs to be judged, if yes, the step S35 is carried out, the new focus needs to be moved to the position of the first content of the original data, and therefore circular display of the list is achieved;
s34, when the new focus index X is less than or equal to the number K of the original data, the new focus index is kept unchanged;
s35, when the new focus index X is larger than the number K of the original data, setting the new focus index to be 0, and realizing the circulation of the list;
s36, judging whether the length of the original data set is smaller than the number N of the content items configured by the list, if so, performing the step S37, and if not, performing the step S316;
s37, inserting (N-K)/2 place-occupying data into the head of the rendering data set list queue;
s38, taking the focus index as a demarcation point, inserting the index and elements behind the focus index into the rendering data set, then inserting the elements before the index, and under the condition that the length of the original data is smaller than the list configuration N, calculating a cutting demarcation point index L of the original data according to the position of a new focus, inserting the demarcation point index L and the data behind the demarcation point index L into the head of the rendering data set, inserting the data before the demarcation point into the tail of the rendering data set, and performing the step S39 or S310;
s39, when the new focus is positioned at the back half part, the index of the demarcation point is K- (2X +1-K)/2, and the step S311 is carried out;
s310, when the new focus is positioned at the front half part, the index of the demarcation point is (2X + 1-K)/2;
s311, inserting the clipping point index L and the subsequent element data into a rendering data set;
s312, inserting the element data before the clipping point index L into the rendering data set;
s313, judging whether the length K of the original data set is an odd number, if so, performing step S314, and if so, performing step S15;
s314, inserting (N-K)/2 pieces of occupancy data into the tail of a rendering data set queue, and then returning to the rendering data set;
s315, inserting (N-K)/2+1 pieces of occupied data into the tail of a rendering data set queue, and then returning to the rendering data set;
s316, when the length of the original data set is larger than the list configuration item N, all data in front of a focus index X are obtained, and elements of the focus index X in the original data set are inserted into a rendering data set; all data after the focus index X is then obtained, and the rendered data set is returned.
Specifically, in the focus movement, the step of obtaining all data before the focus index includes:
judging whether the index of an element in front of the acquired focus element is less than zero, namely judging that X-Y is less than 0, if so, executing corresponding logic of circulation, and filling data at the tail of the original data into a rendering data set;
if X-Y is not less than zero, representing that the index of the data is not less than 0, directly acquiring a corresponding element, namely acquiring an element with the index of X-Y in the element data set, inserting the element into the tail part of the rendering data set, and subtracting one from the value of Y, namely Y-1;
if X-Y is smaller than zero, the index representing the data is smaller than 0, corresponding elements need to be obtained from the tail of the queue of the original data, namely, the elements with the index of X-Y + K in the element data set are obtained and inserted into the tail of the rendering data set, and the value of Y is reduced by one, namely Y is equal to Y-1;
and judging whether the value of Y is larger than zero, if so, indicating that all data before the focus index is not acquired, and continuing to execute the steps until the value of Y is larger than zero.
Specifically, in the focus movement, the step of obtaining all data after the focus index includes:
searching backwards from the position of the focus index, and acquiring an element through X-Z, wherein Z is the offset of the data index after the focus index and the focus index, the initial value of Z is 1, and the initial value corresponds to the content of the first piece of data after the focus data;
judging whether the element index behind the acquired focus element exceeds the maximum number K of the original data;
if X + Z is not larger than K, the index representing the data does not exceed the maximum number K of the original data set, directly acquiring corresponding elements, namely acquiring elements with the index of X + Z in the element data set, inserting the elements into the tail of the rendering data set, and adding one to the value of Z, namely Z is Z + 1;
if X + Z is larger than K, representing that the index of the data is larger than the maximum value K, acquiring a corresponding element from the head of the original data, namely acquiring an element with an index of X + Z-K in the element data set, inserting the element into the tail of the rendering data set, and adding one to the value of Z, namely Z is Z + 1;
and judging that the value of Z is less than or equal to (N-1)/2, if the value of Z is less than or equal to (N-1)/2, indicating that all data after the focus index is not acquired, and continuing to execute the steps until the value of Z is greater than (N-1)/2.
The invention has the following beneficial effects: compared with the list components ListView, RecyclerView and the like of the system, the method has similar functions with the ListView components ListView, RecyclerView and the like, but occupies less resources and is simpler in implementation process; the method is applied in a low-performance environment, and provides a faster sliding speed and a smoother rolling effect with extremely low Android system resource consumption, so that better operation experience is brought to a user; the method also provides a focus processing method and provides a plurality of placeholder layout styles for users, and the focus is fixed at the central position of the list when the list is scrolled, namely the content item at the focus position is always the vertically central content item in the list.
Drawings
Fig. 1 is a schematic view of an effective live program list according to the present invention.
FIG. 2 is a flow chart of list rendering according to the present invention.
FIG. 3 is a flowchart of the focus shift time list of the present invention.
FIG. 4 is a flow chart of the present invention for first obtaining a rendering data set.
Detailed Description
The present invention will now be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, 2, 3 and 4, in a manner that the TV end circularly displays programs,
s1, page initialization
As shown in fig. 1, the live program list using the effect of the present invention, in which the list configuration has 5 content items displayed in one screen, the layout of each content item of the list uses a predefined placeholder layout, the placeholder layout of each content item of the same list is the same, and the focus item is in the vertically central position of the list, includes the following steps:
s11, loading custom list by application
When the application loads the custom list, the initialization of the list is executed, and the list inherits the LinearLayout layout of the Android, so that a layout container is obtained after the initialization;
s12, in the list initialization process, reading the configuration information of the list, obtaining the number N of content items displayed in a screen of the list, appointing the value to be an odd number, and simultaneously obtaining the XML layout of the list content;
s2 list rendering
As shown in the list rendering flowchart of fig. 2, the method includes the following steps:
s21, acquiring a list rendering data set, reading configuration information, and acquiring the styles of the focus and non-focus states of the list content items; judging whether list layout loading is completed or not, judging whether the number of the content items already added is greater than N or not, performing step S23, and if the number of the content items already added is less than or equal to N or not, performing step S22 to complete list layout loading;
s22, loading the list layout, judging whether the number of the added content items is less than or equal to N, repeating the process of the step S23, and circularly adding the sub-views to the list until the list has N sub-views, wherein the method comprises the following steps:
s221, analyzing the layout file to generate a view object and adding the view object to the list, analyzing the XML layout file by using an Android LayoutInflate tool through the custom list to obtain a corresponding view object, and adding the object to the list as a sub-view;
s222, in the process of adding the sub-views to the list, style information is set, whether the sub-views are focal point occupied layouts is judged according to whether the index number is equal to (N-1)/2, if the sub-views are focal point occupied layouts, the step S223 is carried out, and if the sub-views are not focal point station layouts, the step S218 is carried out;
s223, adding a focus pattern for the current view;
s224, adding a non-focus pattern for the current view;
the above steps complete the loading of the list layout.
S23, if the number of content items that have been added is greater than N, performing list content rendering, including
S231, acquiring N pieces of rendering data from a data source by the content;
s232, judging whether the rendering data are place-occupying data or not, carrying out data binding on N pieces of data obtained from a data source and N place-occupying sub-layouts in a list according to the data, sequentially obtaining each piece of data from a rendering data set, if the current data are place-occupying data agreed in advance, not filling the data into the place-occupying layout at the corresponding index, and if the current data are not place-occupying data, carrying out the step S233;
s233, if the current data is not the placeholder data, filling the corresponding placeholder layout with rendering data, namely filling the placeholder layout at the corresponding index with data, completing data binding, and repeating the process until all data traversal is finished;
s3 Focus movement
As shown in the flowchart of fig. 3, the list-when-focus-moving flowchart describes the rendering process of the list when the focus moves downwards, and includes the following steps:
s31, the focus moves downwards from the current focus position of the list, and the custom list tries to acquire the rendering data set again;
s32, in the obtaining process, calculating an index of a new focus, that is, X ═ X +1, according to the index position X of the previously stored focus in the original data set, obtaining previous and subsequent data according to the new focus index, and then rendering an interface;
s33, when the focus moves downwards, the index value X of the new focus is the old focus value plus one, at this time, whether the index value X of the new focus exceeds the maximum length value K of the original data list needs to be judged, if yes, the step S35 is carried out, the new focus needs to be moved to the position of the first content of the original data, and therefore circular display of the list is achieved;
s34, when the new focus index X is less than or equal to the number K of the original data, the new focus index is kept unchanged;
s35, when the new focus index X is larger than the number K of the original data, setting the new focus index to be 0, and realizing the circulation of the list;
s36, determining whether the length of the original data set is smaller than the number N of content items configured by the list, which is the same as step S43 in fig. 4, if it is smaller than the number N of content items configured by the configuration item list, then step S37 is performed, if it is not smaller than the number N of content items configured by the list, then step S316 is performed;
s37, inserting (N-K)/2 place occupying data into the head of the rendering data set list queue, which is the same as the step S44 in the FIG. 4;
s38, taking the focus index as a demarcation point, inserting the index and elements behind the focus index into the rendering data set, then inserting the elements before the index, and under the condition that the length of the original data is smaller than the list configuration N, calculating a cutting demarcation point index L of the original data according to the position of a new focus, inserting the demarcation point index L and the data behind the demarcation point index L into the head of the rendering data set, inserting the data before the demarcation point into the tail of the rendering data set, and performing the step S39 or S310;
s39, when the new focus is positioned at the back half part, the index of the demarcation point is K- (2X +1-K)/2, and the step S311 is carried out;
s310, when the new focus is positioned at the front half part, the index of the demarcation point is (2X + 1-K)/2;
s311, inserting the clipping point index L and the subsequent element data into a rendering data set;
s312, inserting the element data before the clipping point index L into the rendering data set;
s313, judging whether the length K of the original data set is an odd number, if so, performing the step S314, and if so, performing the step S15, which is similar to the steps S46, S47 and S48 in FIG. 4;
s314, inserting (N-K)/2 pieces of position occupying data into the tail of a rendering data set queue, and then returning the rendering data set in the step 329;
s315, inserting (N-K)/2+1 pieces of position occupying data into the tail of a rendering data set queue, and then returning the rendering data set in the step 329;
s316, when the length of the original data set is greater than the list configuration item N, indexing L in the original data from the new focus, respectively obtaining (N-1)/2 elements in the front and back directions of the original data, firstly searching forwards from the position of the focus index, and obtaining the elements through X-Y, wherein Y is the offset between the data index before the focus index and the focus index, the initial value of Y is (N-1)/2, and the initial value corresponds to the data content of the first element in display;
s317, judging whether the index of an element in front of the acquired focus element is less than zero, namely judging that X-Y is less than 0, if so, executing corresponding logic of circulation, and filling the data at the tail of the original data to a rendering data set;
s318, if the X-Y is not less than zero, the index representing the data is not less than 0, directly acquiring the corresponding element, namely acquiring the element with the index of X-Y in the element data set, inserting the element into the tail of the rendering data set, and performing the step S320;
s319, if X-Y is smaller than zero, the index of the data is smaller than 0, corresponding elements need to be obtained from the tail of the original data queue, namely, the elements with the index of X-Y + K in the element data set are obtained and inserted into the tail of the rendering data set, and step S320 is carried out;
s320, subtracting one from the value of Y, i.e. Y-1;
s321, judging whether the value of Y is greater than zero, if so, indicating that all data before the focus index is not obtained, continuing to execute step S316, otherwise, continuing to obtain the focus index and data behind the focus index, and executing step S322;
s322, inserting elements of a focus index X in the original data set into the rendering data set;
s323, similar to the step S316, searching backwards from the position of the focus index, and acquiring an element through X-Z, wherein Z is the offset of the data index after the focus index and the focus index, the initial value of Z is 1, and the initial value corresponds to the content of the first piece of data after the focus data;
s324, similar to the step S317, whether the element index behind the acquired focus element exceeds the maximum number K of the original data needs to be judged, if yes, corresponding logic of circulation needs to be executed, and data at the head of the original data is filled into the rendering data set, namely if X + Z is not larger than K, the step S325 is carried out, and if X + Z is larger than K, the step S326 is carried out;
s325, if X + Z is not more than K, the index of the data does not exceed the maximum number K of the original data set, directly acquiring corresponding elements, namely acquiring the elements with the index of X + Z in the element data set, inserting the elements into the tail of the rendering data set, and performing step S327;
s326, if X + Z is larger than K, the index representing the data is larger than the maximum value K, and corresponding elements need to be obtained from the head of the original data, namely, the elements with the index of X + Z-K in the element data set are obtained and inserted into the tail of the rendering data set, and step S327 is performed;
s327, the value of Z is incremented by one, i.e., Z ═ Z + 1;
s328, judging that the value of Z is less than or equal to (N-1)/2, if the value of Z is less than or equal to (N-1)/2, indicating that all data after the focus index is not acquired yet, continuing to execute the step S323, otherwise, executing the step S329;
s329, the rendering data set is returned.
Specifically, the step of obtaining the rendering data set for the first time, as shown in fig. 4, includes:
s41, the application transmits the original data set to a custom list;
s42, creating a rendering data set by the user-defined list;
s43, detecting the length of the original data set by the user-defined list, if the length of the original data set is smaller than the number N of configured display items, inserting position-occupying data, and then performing the step S44, otherwise performing the step S411;
s44, step S43, wherein the list data items are longer than the original data, the original data are located in the middle of the list, the content of the beginning and the end of the list is empty, the empty content is realized by inserting position occupying data into the list, whether the position occupying data are position occupying data is identified through a flag bit, when the data are bound, if the position occupying data are found, the data are not processed, firstly, the position occupying data are inserted into the head of the rendering data set, and because the original data are displayed in the middle, the position occupying data inserted into the head of the queue are (N-K)/2, N is the number displayed by the list, and K is the number of the original data;
s45, following the step S44, inserting original data into the tail of the rendering data set queue in sequence;
s46, judging whether the data volume K of the original data is an odd number, if so, performing a step S47, otherwise, performing a step S48;
s47, if K is an odd number, the middle content of the original data is located in the middle of the list, and to achieve the effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, wherein the odd number is (N-K)/2 pieces of data;
s48, if K is an even number, the middle of the list is the content of the original data middle index plus one, and to achieve the effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, and if the even number is (N-K)/2+1 data are inserted;
s49, the index position of the current focus in the original data set needs to be saved, the index is (k-1)/2 when the number is odd, and then the step S13 is carried out;
s410, the index position of the current focus in the original data set needs to be stored, and the index is k/2-1 in the case of even number, and then the step S13 is carried out;
s411, when the length of the original data is larger than N, reading the first N pieces of data from the original data, and writing the data into a rendering data set;
s412, the index position of the current focus in the original data set needs to be stored, and the index is (N-1)/2 when the number is odd;
and S413, finally returning the rendering data set.
The present invention is not limited to the above embodiments, and any structural changes made under the teaching of the present invention shall fall within the protection scope of the present invention, which is similar or similar to the technical solutions of the present invention.
The techniques, shapes, and configurations not described in detail in the present invention are all known techniques.

Claims (9)

1. A mode for circularly displaying programs on a TV end is characterized in that: setting list configuration, wherein the list inherits a linear layout container of an Android system, and the contents of the list are longitudinally arranged from top to bottom; the list container comprises a plurality of fixed occupied layouts; each space occupying layout is used for displaying a piece of program content, one list comprises a plurality of space occupying layouts, and the space occupying layouts in the same list have the same style; during display, the focus content is always located in the middle position in the vertical direction of the list, when the focus content displays the last piece of data, the next piece of focus content displays the first piece of data, namely, a recyclable list is formed, and the method specifically comprises the following steps:
s1, page initialization
When a page is initialized, reading configuration information of the list, acquiring an XML layout file of an occupied layout and the number N of the occupied layouts contained in the list, wherein N is an odd number, acquiring a corresponding view object by analyzing the XML layout file of the occupied layout, circularly adding the view object into the list, and finishing the initialization of the list;
s2 list rendering
Reading configuration information, acquiring a list rendering data set, acquiring a focus and non-focus style, completing list layout loading, acquiring a group of information from a data source, namely the rendered data set, filling the rendered data set into a list, wherein a data structure of the data source to be agreed is an ordered list, and when the data set is acquired, searching (N-1)/2 data respectively before and after the ordered list by taking an index position of data where the current focus is located as a center;
if the list layout loading is completed, rendering the list content, circularly reading the data set information by the list after obtaining the rendered data set, corresponding the data to the occupied layout through the index position, binding the corresponding data to the occupied layout by the list, and completing the rendering of the list content;
s3, moving focal point
When the focus moves, the rendering data set is obtained again, if the focus content is positioned at the tail part of the data source list, corresponding data can be obtained from the tail part and the head part of the data source list respectively when the data is obtained, and when the data is displayed, the content of the tail part and the head part of the data source is contained in the screen, so that the circular display of the list is realized;
because the index of the focus data is located in the middle of the acquired rendering data set, the focus content is located at the middle position in the vertical direction of the list after the rendering is finished.
2. A method for cyclically displaying programs on a TV end according to claim 1, wherein: when the list is initialized, the method can select to modify the style of the placeholder layout according to the configuration information, wherein the index position of the list starts from 0, the placeholder layout at the (N-1)/2 th position is the layout of the focus content, the list can set the focus style for the layout, and other layouts set the non-focus styles.
3. A method for cyclically displaying programs on a TV end according to claim 1, wherein: the S1 page initialization includes the following steps:
s11, loading custom list by application
When the application loads the custom list, the initialization of the list is executed, and the list inherits the LinearLayout layout of the Android, so that a layout container is obtained after the initialization;
s12, in the list initialization process, reading the configuration information of the list, obtaining the number N of the content items displayed in one screen of the list, wherein the appointed number N is an odd number, and simultaneously obtaining the XML layout of the list content.
4. A method for cyclically displaying programs on a TV end according to claim 1, wherein: the method for arranging and loading the list in the S2 comprises the following steps:
s221, analyzing the layout file to generate a view object and adding the view object to the list, analyzing the XML layout file by using an Android LayoutInflate tool through the custom list to obtain a corresponding view object, and adding the object to the list as a sub-view;
s222, in the process of adding the sub-views to the list, style information is set, whether the sub-views are focal point occupied layouts is judged according to whether the index number is equal to (N-1)/2, if the sub-views are focal point occupied layouts, the step S223 is carried out, and if the sub-views are not focal point station layouts, the step S218 is carried out;
s223, adding a focus pattern for the current view;
s224, adding a non-focus pattern for the current view;
the above steps complete the loading of the list layout.
5. A method for cyclically displaying programs on a TV end according to claim 1, wherein: the method for rendering the list contents in the step S2 includes:
s231, acquiring N pieces of rendering data from a data source by the content;
s232, judging whether the rendering data are place-occupying data or not, carrying out data binding on N pieces of data obtained from a data source and N place-occupying sub-layouts in a list according to the data, sequentially obtaining each piece of data from a rendering data set, if the current data are place-occupying data agreed in advance, not filling the data into the place-occupying layout at the corresponding index, and if the current data are not place-occupying data, carrying out the step S233;
and S233, if the current data is not the placeholder data, filling the corresponding placeholder layout with rendering data, namely filling the placeholder layout at the corresponding index with the rendering data, completing data binding, and repeating the process until all data traversal is finished.
6. A method for cyclically displaying programs on a TV end according to claim 1, wherein: the step of first obtaining a rendering data set comprises:
s41, the application transmits the original data set to a custom list;
s42, creating a rendering data set by the user-defined list;
s43, detecting the length of the original data set by the user-defined list, if the length of the original data set is smaller than the number N of configured display items, inserting position-occupying data, and then performing the step S44, otherwise performing the step S411;
s44, step S43, wherein the list data items are longer than the original data, the original data are located in the middle of the list, the content of the beginning and the end of the list is empty, the empty content is realized by inserting position occupying data into the list, whether the position occupying data are position occupying data is identified through a flag bit, when the data are bound, if the position occupying data are found, the data are not processed, firstly, the position occupying data are inserted into the head of the rendering data set, and because the original data are displayed in the middle, the position occupying data inserted into the head of the queue are (N-K)/2, N is the number displayed by the list, and K is the number of the original data;
s45, following the step S44, inserting original data into the tail of the rendering data set queue in sequence;
s46, judging whether the data volume K of the original data is an odd number, if so, performing a step S47, otherwise, performing a step S48;
s47, if K is an odd number, the middle content of the original data is located in the middle of the list, and to achieve the effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, wherein the odd number is (N-K)/2 pieces of data;
s48, if K is an even number, the middle of the list is the content of the original data middle index plus one, and to achieve the effect, different placeholder data needs to be inserted into the rendering data set according to the parity of the original data, and if the even number is (N-K)/2+1 data are inserted;
s49, the index position of the current focus in the original data set needs to be saved, the index is (k-1)/2 when the number is odd, and then the step S13 is carried out;
s410, the index position of the current focus in the original data set needs to be stored, and the index is k/2-1 in the case of even number, and then the step S13 is carried out;
s411, when the length of the original data is larger than N, reading the first N pieces of data from the original data, and writing the data into a rendering data set;
s412, the index position of the current focus in the original data set needs to be stored, and the index is (N-1)/2 when the number is odd;
and S413, finally returning the rendering data set.
7. A method for cyclically displaying programs on a TV end according to claim 1, wherein: the method for moving the focus downwards comprises the following steps:
s31 moving the focus from the current focus position of the list, the custom list will try to retrieve the rendering data set;
s32, in the obtaining process, calculating an index of a new focus, that is, X ═ X +1, according to the index position X of the previously stored focus in the original data set, obtaining previous and subsequent data according to the new focus index, and then rendering an interface;
s33, when the focus moves downwards, the index value X of the new focus is the old focus value plus one, at this time, whether the index value X of the new focus exceeds the maximum length value K of the original data list needs to be judged, if yes, the step S35 is carried out, the new focus needs to be moved to the position of the first content of the original data, and therefore circular display of the list is achieved;
s34, when the new focus index X is less than or equal to the number K of the original data, the new focus index is kept unchanged;
s35, when the new focus index X is larger than the number K of the original data, setting the new focus index to be 0, and realizing the circulation of the list;
s36, judging whether the length of the original data set is smaller than the number N of the content items configured by the list, if so, performing the step S37, and if not, performing the step S316;
s37, inserting (N-K)/2 place-occupying data into the head of the rendering data set list queue;
s38, taking the focus index as a demarcation point, inserting the index and elements behind the focus index into the rendering data set, then inserting the elements before the index, and under the condition that the length of the original data is smaller than the list configuration N, calculating a cutting demarcation point index L of the original data according to the position of a new focus, inserting the demarcation point index L and the data behind the demarcation point index L into the head of the rendering data set, inserting the data before the demarcation point into the tail of the rendering data set, and performing the step S39 or S310;
s39, when the new focus is positioned at the back half part, the index of the demarcation point is K- (2X +1-K)/2, and the step S311 is carried out;
s310, when the new focus is positioned at the front half part, the index of the demarcation point is (2X + 1-K)/2;
s311, inserting the clipping point index L and the subsequent element data into a rendering data set;
s312, inserting the element data before the clipping point index L into the rendering data set;
s313, judging whether the length K of the original data set is an odd number, if so, performing step S314, and if so, performing step S15;
s314, inserting (N-K)/2 pieces of occupied data into the tail of a rendering data set queue, and returning to the rendering data set;
s315, inserting (N-K)/2+1 pieces of occupied data into the tail of a rendering data set queue, and returning to the rendering data set;
s316, when the length of the original data set is larger than the list configuration item N, all data in front of a focus index X are obtained, and elements of the focus index X in the original data set are inserted into a rendering data set; all data after the focus index X is then obtained, and the rendered data set is returned.
8. A method for cyclically displaying programs on a TV end according to claim 1, wherein: in the focus moving, the step of obtaining all data before the focus index is as follows:
judging whether the index of an element in front of the acquired focus element is less than zero, namely judging that X-Y is less than 0, if so, executing corresponding logic of circulation, and filling data at the tail of the original data into a rendering data set;
if X-Y is not less than zero, representing that the index of the data is not less than 0, directly acquiring a corresponding element, namely acquiring an element with the index of X-Y in the element data set, inserting the element into the tail part of the rendering data set, and subtracting one from the value of Y, namely Y-1;
if X-Y is smaller than zero, the index representing the data is smaller than 0, corresponding elements need to be obtained from the tail of the queue of the original data, namely, the elements with the index of X-Y + K in the element data set are obtained and inserted into the tail of the rendering data set, and the value of Y is reduced by one, namely Y is equal to Y-1;
and judging whether the value of Y is larger than zero, if so, indicating that all data before the focus index is not acquired, and continuing to execute the steps until the value of Y is larger than zero.
9. A method for cyclically displaying programs on a TV end according to claim 1, wherein: in the focus moving, the step of obtaining all data after the focus index is as follows:
searching backwards from the position of the focus index, and acquiring an element through X-Z, wherein Z is the offset of the data index after the focus index and the focus index, the initial value of Z is 1, and the initial value corresponds to the content of the first piece of data after the focus data;
judging whether the element index behind the acquired focus element exceeds the maximum number K of the original data;
if X + Z is not larger than K, the index representing the data does not exceed the maximum number K of the original data set, directly acquiring corresponding elements, namely acquiring elements with the index of X + Z in the element data set, inserting the elements into the tail of the rendering data set, and adding one to the value of Z, namely Z is Z + 1;
if X + Z is larger than K, representing that the index of the data is larger than the maximum value K, acquiring a corresponding element from the head of the original data, namely acquiring an element with an index of X + Z-K in the element data set, inserting the element into the tail of the rendering data set, and adding one to the value of Z, namely Z is Z + 1;
and judging that the value of Z is less than or equal to (N-1)/2, if the value of Z is less than or equal to (N-1)/2, indicating that all data after the focus index is not acquired, and continuing to execute the steps until the value of Z is greater than (N-1)/2.
CN202010649569.6A 2020-07-08 2020-07-08 Mode for circularly displaying programs at TV (television) end Active CN111836095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010649569.6A CN111836095B (en) 2020-07-08 2020-07-08 Mode for circularly displaying programs at TV (television) end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010649569.6A CN111836095B (en) 2020-07-08 2020-07-08 Mode for circularly displaying programs at TV (television) end

Publications (2)

Publication Number Publication Date
CN111836095A CN111836095A (en) 2020-10-27
CN111836095B true CN111836095B (en) 2022-03-15

Family

ID=72901261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010649569.6A Active CN111836095B (en) 2020-07-08 2020-07-08 Mode for circularly displaying programs at TV (television) end

Country Status (1)

Country Link
CN (1) CN111836095B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112770169B (en) * 2020-12-29 2023-02-17 海信视像科技股份有限公司 List circulating page turning method and display device
CN113535307A (en) * 2021-07-23 2021-10-22 深圳小湃科技有限公司 Interface loading method and device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11266409A (en) * 1998-03-16 1999-09-28 Sony Corp Program contents display device and program contents display method
CN107509103A (en) * 2017-08-29 2017-12-22 四川长虹电器股份有限公司 A kind of method of storage management and page layout for intelligent television EPG data
CN108471552A (en) * 2012-04-17 2018-08-31 夏普株式会社 Manu displaying device includes the television receiver and menu display method of manu displaying device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11266409A (en) * 1998-03-16 1999-09-28 Sony Corp Program contents display device and program contents display method
CN108471552A (en) * 2012-04-17 2018-08-31 夏普株式会社 Manu displaying device includes the television receiver and menu display method of manu displaying device
CN107509103A (en) * 2017-08-29 2017-12-22 四川长虹电器股份有限公司 A kind of method of storage management and page layout for intelligent television EPG data

Also Published As

Publication number Publication date
CN111836095A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN107861784B (en) Desktop icon sorting method and device and mobile terminal
CN111836095B (en) Mode for circularly displaying programs at TV (television) end
CN101795322A (en) Preview method, device and cell phone
CN104239305A (en) Electronic document generating and displaying method and apparatus
CN105786435A (en) Wallpaper picture display method and device
CN105898520A (en) Video frame interception method and device
CN106649639A (en) Page display method and device
US8789098B2 (en) Information processing apparatus, information processing method and program
CN102609194A (en) User interface with vertical text elements for an east-asian defined layout
CN105335036A (en) Input interaction method and input method system
CN104571877A (en) Display processing method and device for pages
US20120166943A1 (en) Electronic device having page division display function and page display method
EP4242839A1 (en) Page switching display method and apparatus, storage medium, and electronic device
CN111432264A (en) Content display method, device and equipment based on media information stream and storage medium
CN107147940A (en) Method, device, electronic equipment and the storage medium of content carousel
KR20220127334A (en) Table browsing methods, devices, electronic devices and storage media in documents
US20230117213A1 (en) Page display method and electronic device
CN105122244A (en) A multi-panel view interface for a browser operating on a computing device
CN108509241B (en) Full-screen display method and device for image and mobile terminal
CN115658209A (en) Notification message display method and device and electronic equipment
CN109683760B (en) Recent content display method, device, terminal and storage medium
CN113050861B (en) Display interface control method, electronic device and storage medium
CN111324398A (en) Recent content processing method, device, terminal and storage medium
CN113791853A (en) Method, system, device and medium for self-defining editing dial interface
US20240007515A1 (en) Audio playing method, apparatus and non-transitory computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant