CN108664309B - Android terminal-based long data display method and system - Google Patents

Android terminal-based long data display method and system Download PDF

Info

Publication number
CN108664309B
CN108664309B CN201810466915.XA CN201810466915A CN108664309B CN 108664309 B CN108664309 B CN 108664309B CN 201810466915 A CN201810466915 A CN 201810466915A CN 108664309 B CN108664309 B CN 108664309B
Authority
CN
China
Prior art keywords
view
distance
parent
child
acquiring
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
CN201810466915.XA
Other languages
Chinese (zh)
Other versions
CN108664309A (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.)
Chengdu Surfing Space Technology Co ltd
Original Assignee
Chengdu Surfing Space Technology 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 Chengdu Surfing Space Technology Co ltd filed Critical Chengdu Surfing Space Technology Co ltd
Priority to CN201810466915.XA priority Critical patent/CN108664309B/en
Publication of CN108664309A publication Critical patent/CN108664309A/en
Application granted granted Critical
Publication of CN108664309B publication Critical patent/CN108664309B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a long data display method and system based on an Android terminal, and the method specifically comprises the following steps: (1) the sub-View acquires a focus, and when the focus is not at the head or the tail, the step (2) is executed; (2) acquiring the position of a currently focused child View, judging whether the current position of the child View is positioned in the middle position of the visible area of the parent View, and if not, executing the step (3); (3) calculating the moving distance of the parent View; (4) and moving the parent View according to the distance to enable the child View to be positioned in the middle of the visual area of the parent View. The invention solves the problem that the illusion that the tail part of the user is reached is easily misled when long data is displayed, reduces the operation difficulty and enhances the user experience effect.

Description

Android terminal-based long data display method and system
Technical Field
The invention belongs to the technical field of terminal application display, and particularly relates to a long data display method and system based on an Android terminal.
Background
The existing Android terminal long data display method mainly comprises two modes:
1. and dividing the data into blocks by adopting ListView, GridView, RecycleView and other list views of reusable sub-items, respectively putting the blocks into the corresponding items, so that the sub-items can acquire the focus, and scrolling the data by continuously moving the focus. Generally, such views are used for displaying data in a similar format, the data is displayed in a list mode, the number of items is adapted according to the number of the data, because the width and the height of the items are specified in advance, some styles of tables are easy to make, then the formatted beans are analyzed and placed at each position of the items according to the corresponding relation, but in terms of the table format, when several items just occupy one page, the biggest problem is that a user is suggested that the table is only the page, or the form should be turned left and right or turned up and down, designers mostly design that each item is completely displayed in one page for aesthetic appearance, and at this time, up and down buttons or progress bars are needed to be assisted, and the problems corresponding to the up and down buttons also occur: the user performs one more operation; the code needs to compute exactly what each page shows. With great limitations, the appearance of the progress bar also affects the aesthetic design.
2. Adopting the parent layout as ScrollView also allows the child View to acquire focus and move the focus to change the displayed data. The method adopts ScrollView as a parent layout mode, only one child View is available, usually GroupView, the child views are flexible and changeable, the used scenes are more, and the child views also need to be child views which can be focused if click events exist.
The ScrollView is different from the list View, has no larger paging trend, processes more sliding events, is more flexible, so that when the sub-views appear neatly, a user is more easily misled to feel that the tail of the user is reached, the ScrollView also depends on progress display brought by a progress bar, the design style of the progress bar is influenced, and unexpected bugs can be generated during nesting.
In summary, in the existing display method, the sliding of View is controlled by moving the focus when displaying data, when the focus moves to the corner of the current page, the user is given the illusion that there is no next page of data at all, paging loading increases the operation difficulty of the user for the terminal, reduces the usability of software, and brings bad experience to the user.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a long data display method and system based on an Android terminal.
In order to achieve the above object, on the one hand, the invention provides a long data display method based on an Android terminal, which specifically comprises the following steps:
(1) the sub-View acquires a focus, and when the focus is not at the head or the tail, the step (2) is executed;
(2) acquiring the position of a currently focused child View, judging whether the current position of the child View is positioned in the middle position of the visible area of the parent View, and if not, executing the step (3);
(3) calculating the moving distance of the parent View;
(4) and moving the parent View according to the distance to enable the child View to be positioned in the middle of the visual area of the parent View.
The invention has the beneficial effects that: the method comprises the steps of dragging the sliding distance of a parent View by switching a child View which can be focused, judging whether the child View is in the middle of a visual area each time the child View acquires a focus, if not, calculating the distance that the parent View needs to move, enabling the child View to be located in the middle of the parent View, and enabling the child View to be located in the non-middle part of the parent View when the focus appears at the head or the tail. The method and the device solve the problem that the illusion that the tail part of the user is reached is easily misled when long data are displayed, reduce the operation steps of the user, reduce the operation difficulty and provide better use experience for the user.
Further, the step (3) is implemented as follows:
acquiring the width of a visual area in the left and right directions of a parent View; acquiring the left distance left from the child View to the visible area of the parent View and the width vWidth of the child View, and according to a formula:
distance is left + vWidth/2-width/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
The beneficial effects of the above further scheme are as follows: the code amount is reduced and the user experience is improved while the efficiency is ensured.
Further, the step (3) is implemented as follows:
acquiring height of a visual area in the up-down direction of a parent View; acquiring the upper edge distance upper from the child View to the visual area of the parent View and the height vhight of the child View, and according to a formula:
distance upper + vhight/2-height/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
The beneficial effects of the above further scheme are as follows: the code amount is reduced and the user experience is improved while the efficiency is ensured.
On the other hand, the invention also provides a long data display system based on the Android terminal, which comprises the following components:
the focusing module is used for acquiring a focus of the sub-View;
the position judging module is used for acquiring the position of the currently focused child View and judging whether the current position of the child View is positioned in the middle of the visual area of the parent View;
the distance calculation module is used for calculating the distance of the parent View needing to move;
and the moving module is used for moving the parent View according to the distance so that the child View is positioned in the middle of the visual area of the parent View.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
fig. 2 is a block diagram of the system of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided in order to better understand the present invention for those skilled in the art with reference to the accompanying drawings. It is to be expressly noted that in the following description, a detailed description of known functions and designs will be omitted when it may obscure the subject matter of the present invention.
As shown in fig. 1, in order to solve the problem that the illusion that the user has reached the tail is easily misled when long data is displayed, the invention provides a long data display method based on an Android terminal, which specifically includes the following steps:
(1) the sub-View acquires a focus, and when the focus is not at the head or the tail, the step (2) is executed;
(2) acquiring the position of a currently focused child View, judging whether the current position of the child View is positioned in the middle position of the visible area of the parent View, and if not, executing the step (3);
(3) calculating the moving distance of the parent View;
(4) and moving the parent View according to the distance to enable the child View to be positioned in the middle of the visual area of the parent View.
The method comprises the steps of dragging the sliding distance of a parent View by switching a child View which can be focused, judging whether the child View is in the middle of a visual area each time the child View acquires a focus, if not, calculating the distance that the parent View needs to move, enabling the child View to be located in the middle of the parent View, and enabling the child View to be located in the non-middle part of the parent View when the focus appears at the head or the tail. The invention solves the problem that the illusion that the tail part of the user is reached is easily misled when long data is displayed, reduces the operation difficulty and enhances the user experience effect.
Example 1
Based on the method of the invention, if the father View is ScrollView and the direction is left-right sliding, a method smoothScrollToMid of sliding to the middle is defined, and parameters are introduced: and binding a focus monitoring event to the sub-View, and calling the method when the sub-View is focused.
The smoothScrollToMid method comprises the following steps: firstly, acquiring a visual width in the left-right direction of a ScrollView, then acquiring a distance left (getLeft) from a child View to the visual left part of a parent View, and then calculating a width vWidth (getWidth) of the child View, wherein a value of left + vWidth/2-width/2 (difference between the center of the child Viw and the center of the screen) is calculated at the time, the value is the distance (smoothenScrollBy) that the child View needs to move on the X axis of the fastView, namely the middle position of the screen, so that a visual area is always the center position of the child View, each child View focus calls the method, the child View moves to the center position when focusing each child View, and when the child View does not appear in the center position, the fact that the child View has reached the bottom of data is shown, no operation is needed by a user, and the user finishes the translation of the data when browsing.
Example 2
Based on the method of the invention, if the father View is ScrollView and the direction is up-down sliding, a method smoothScrollToMid of sliding to the middle is defined, and parameters are introduced: and binding a focus monitoring event to the sub-View, and calling the method when the sub-View is focused.
The smoothScrollToMid method comprises the following steps: firstly, acquiring height of a visual area in the up-down direction of a ScrollView, then acquiring the distance between a child View and the upper side of a parent View visual area and the height vhight (getlight) of the child View, and calculating the value of upper + vhight/2-height/2 (difference between the center of the child Viw and the center of the screen), wherein the value is the distance (smoothenScrothScrollBy) that the child View needs to move on the Y axis of the fastview, namely the middle position of the screen, so that the visual area is always the center position of the child View, each child View focus calls the method, the child View moves to the center position of the fastview when focusing each child View, and when the child View does not appear in the center position, the fact that the child View has reached the bottom of data is proved, no operation is needed by a user, and the user finishes moving up and down the data when browsing by the user finishes.
Example 3
Based on the method of the invention, if the father View is a list View such as RecyclerView, the implementation method of the invention is explained by taking RecyclerView as an example: firstly, defining a method for moving the coordinate position of the item, taking left and right movement as an example, smoothScrollToMid, calculating in a focus change event of the item on the premise of keeping the sub-View as a middle position, wherein the calculation method is different from the ScrollView in the same way, firstly calculating the distance left between the item and the leftmost part of the RecyclerView, then acquiring the Width vwidth of the item and the Width Width of the RecyclerView in the left-right direction of a displayable area, and finally calculating the distance that the item needs to move to be left + vwidth/2-Width/2, so that the position of the item on the X axis can be moved by calling a moving method (smoothScrollToMiy). Therefore, the target View is always positioned in the center of the father View, and the effect same as that of the ScrollView is achieved. The efficiency is guaranteed, the code amount is reduced, and the user experience is improved.
Example 4
Based on the method of the invention, if the father View is a list View such as RecyclerView, the implementation method of the invention is explained by taking RecyclerView as an example: firstly, defining a method for moving the coordinate position of the item, taking up and down movement as an example, smoothScrollToMid, calculating in a focus change event of the item on the premise of maintaining a sub-View as an intermediate position, wherein the calculation method is different from the ScrollView in the same way, firstly calculating the height vhight (height) of the upper edge distance of the item from the RecyclerView and the sub-View, and the height of the RecyclerView in the up-down direction of a displayable area, and finally calculating the distance that the item needs to be moved, namely up + vhight/2-height/2, and then calling a moving method (smoothScrollBy) to move the position of the item on the Y axis. Therefore, the target View is always positioned in the center of the father View, and the effect same as that of the ScrollView is achieved. The efficiency is guaranteed, the code amount is reduced, and the user experience is improved.
As shown in fig. 2, the present invention further provides an Android terminal-based long data display system, including:
the focusing module is used for acquiring a focus of the sub-View;
the position judging module is used for acquiring the position of the currently focused child View and judging whether the current position of the child View is positioned in the middle of the visual area of the parent View;
the distance calculation module is used for calculating the distance of the parent View needing to move;
and the moving module is used for moving the parent View according to the distance so that the child View is positioned in the middle of the visual area of the parent View.
As an embodiment of the present invention, the distance calculating module is specifically implemented as:
acquiring the width of a visual area in the left and right directions of a parent View; acquiring the left distance left from the child View to the visible area of the parent View and the width vWidth of the child View, and according to a formula:
distance is left + vWidth/2-width/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
As an embodiment of the present invention, the distance calculating module is specifically implemented as:
acquiring height of a visual area in the up-down direction of a parent View; acquiring the upper edge distance upper from the child View to the visual area of the parent View and the height vhight of the child View, and according to a formula:
distance upper + vhight/2-height/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
The method automatically moves the target View to the middle position, when a user browses data among the slidable views, the parent View sliding distance is dragged by switching the focusable child views, whether the child views are in the middle position of the visual area is judged every time the child views acquire the focus, if not, the sliding distance of the parent View is dynamically moved, the child views are close to the middle of the parent View as much as possible, and the focus is not in the middle of the parent View only when the focus appears at the head or the tail. Therefore, the method and the device solve the problem that the illusion that the tail of the user is reached is easily misled when long data are displayed, reduce operation difficulty and enhance user experience effect.
The Android system-based native control is optimized on the basis, so that the changes of high efficiency and high experience degree are achieved, and the Android system-based native control is suitable for most Android system-based equipment including mobile phones, tablet computers, intelligent set-top boxes and the like.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, and various changes may be made apparent to those skilled in the art as long as they are within the spirit and scope of the present invention as defined and defined by the appended claims, and all matters of the invention which utilize the inventive concepts are protected.

Claims (6)

1. A long data display method based on an Android terminal is characterized by comprising the following steps:
(1) the sub-View acquires a focus, and when the focus is not at the head or the tail, the step (2) is executed;
(2) acquiring the position of a currently focused child View, judging whether the current position of the child View is positioned in the middle position of the visible area of the parent View, and if not, executing the step (3);
(3) calculating the moving distance of the parent View;
(4) and moving the parent View according to the distance to enable the child View to be positioned in the middle of the visual area of the parent View.
2. The Android terminal-based long data display method according to claim 1, wherein the step (3) is implemented by:
acquiring the width of a visual area in the left and right directions of a parent View; acquiring the left distance left from the child View to the visible area of the parent View and the width vWidth of the child View, and according to a formula:
distance is left + vWidth/2-width/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
3. The Android terminal-based long data display method according to claim 1, wherein the step (3) is implemented by:
acquiring height of a visual area in the up-down direction of a parent View; acquiring the upper edge distance upper from the child View to the visual area of the parent View and the height vhight of the child View, and according to a formula:
distance upper + vhight/2-height/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
4. The long data display system based on the Android terminal is characterized by comprising:
the focusing module is used for acquiring a focus of the sub-View;
the position judging module is used for acquiring the position of the currently focused child View and judging whether the current position of the child View is positioned in the middle of the visual area of the parent View;
the distance calculation module is used for calculating the distance of the parent View needing to move;
and the moving module is used for moving the parent View according to the distance so that the child View is positioned in the middle of the visual area of the parent View.
5. The Android terminal-based long data presentation system of claim 4, wherein the distance calculation module is specifically implemented as:
acquiring the width of a visual area in the left and right directions of a parent View; acquiring the left distance left from the child View to the visible area of the parent View and the width vWidth of the child View, and according to a formula:
distance is left + vWidth/2-width/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
6. The Android terminal-based long data presentation system of claim 4, wherein the distance calculation module is specifically implemented as:
acquiring height of a visual area in the up-down direction of a parent View; acquiring the upper edge distance upper from the child View to the visual area of the parent View and the height vhight of the child View, and according to a formula:
distance upper + vhight/2-height/2
The distance that the parent View needs to move, i.e., the screen middle position, is calculated.
CN201810466915.XA 2018-05-16 2018-05-16 Android terminal-based long data display method and system Active CN108664309B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810466915.XA CN108664309B (en) 2018-05-16 2018-05-16 Android terminal-based long data display method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810466915.XA CN108664309B (en) 2018-05-16 2018-05-16 Android terminal-based long data display method and system

Publications (2)

Publication Number Publication Date
CN108664309A CN108664309A (en) 2018-10-16
CN108664309B true CN108664309B (en) 2021-04-06

Family

ID=63779679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810466915.XA Active CN108664309B (en) 2018-05-16 2018-05-16 Android terminal-based long data display method and system

Country Status (1)

Country Link
CN (1) CN108664309B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656639B (en) * 2018-12-25 2022-04-15 深圳创维数字技术有限公司 Interface rolling method, device, equipment and medium
CN109725795A (en) * 2018-12-27 2019-05-07 北京字节跳动网络技术有限公司 A kind of method, apparatus and computer readable medium for Multi-view display

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019678A (en) * 2012-11-16 2013-04-03 Tcl集团股份有限公司 Method and device for focus alternating of list focal plane frame
CN107402700A (en) * 2017-06-21 2017-11-28 北京小度信息科技有限公司 Page display method and device
CN107450915A (en) * 2017-07-18 2017-12-08 四川长虹电器股份有限公司 A kind of method of the quick interception long figure of multi-screen

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2869875T3 (en) * 2011-10-03 2021-10-26 Siemens Schweiz Ag Structure and behavior of a building automation system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019678A (en) * 2012-11-16 2013-04-03 Tcl集团股份有限公司 Method and device for focus alternating of list focal plane frame
CN107402700A (en) * 2017-06-21 2017-11-28 北京小度信息科技有限公司 Page display method and device
CN107450915A (en) * 2017-07-18 2017-12-08 四川长虹电器股份有限公司 A kind of method of the quick interception long figure of multi-screen

Also Published As

Publication number Publication date
CN108664309A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
EP3220249B1 (en) Method, device and terminal for implementing regional screen capture
WO2019085821A1 (en) Processing method, device, apparatus, and machine-readable medium
KR20190136085A (en) On-screen comment display method and electronic device
US10761688B2 (en) Method and apparatus for editing object
CN111443863A (en) Page control method and device, storage medium and terminal
CN111010601B (en) Smart television focus frame control method, smart television and storage medium
WO2019085820A1 (en) Processing method, device, apparatus, and machine-readable medium
KR102373021B1 (en) Global special effect conversion method, conversion device, terminal equipment and storage medium
CN109432775B (en) Split screen display method and device of game map
CN108664309B (en) Android terminal-based long data display method and system
KR20150095537A (en) User terminal device and method for displaying thereof
CN104866182A (en) Movement method of picture data and mobile terminal
CN110251941B (en) Game picture self-adaption method and device, electronic equipment and storage medium
CN106210858A (en) The changing method of a kind of terminal interface and device
CN102662599A (en) Desktop configuration method and desktop switching method of Android touch screen mobile phone
CN105892842A (en) Screen touch method and device
CN103383621B (en) View changing method and device
CN114564263A (en) Page layout adjusting method and device
US20230405460A1 (en) In-game display controlling method, device and electronic equipment
CN104461244A (en) Method for changing interfaces of intelligent mobile phones
CN106201280B (en) Method and device for controlling sliding display
CN104063178A (en) Touch screen-based structured web page displaying and switching method
WO2019085810A1 (en) Processing method, device, apparatus, and machine-readable medium
CN108008894B (en) Content display method and device and terminal equipment
CN108614661B (en) Interactive object display control method based on intelligent terminal and intelligent terminal

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