A method and system for displaying long data based on android terminal
A technology for displaying systems and long data, applied in digital data processing, input/output process of data processing, instruments, etc., can solve the problem of easily misleading users, and improve user experience and reduce operation difficulty , good user experience effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0039] Based on the method of the present invention, if the parent View is a ScrollView, and the direction is to slide left and right, then define a method smoothScrollToMid that slides to the middle, and pass in parameters: a focusable sub-View, bind a focus monitoring event to the sub-View, and when the sub-View is focused , call this method.
[0040] The smoothScrollToMid method is: first obtain the visible width width in the left and right directions of the ScrollView, then obtain the distance left (getLeft) from the child View to the visible left part of the parent View, and then calculate the width vWidth (getWidth) of the child View, and calculate the left at this time The value of +vWidth / 2-width / 2 (the difference between the center of the sub-Viw and the center of the screen), this value is the distance that the sub-View needs to move (smoothScrollBy) on the X-axis of fatherView, that is, the middle position of the screen, so the visible area It will always be the cen...
Embodiment 2
[0042] Based on the method of the present invention, if the parent View is ScrollView, and the direction is to slide up and down, then define a method smoothScrollToMid that slides to the middle, and pass in parameters: a focusable sub-View, bind a focus monitoring event to the sub-View, when the sub-View is focused , call this method.
[0043]The smoothScrollToMid method is as follows: first obtain the height of the visible area in the upper and lower directions of the ScrollView, and then obtain the upper margin of the visible area from the child View to the parent View and the height vheight (getheight) of the child View. At this time, calculate upper+vheight / 2 -height / 2 (the width difference between the center of the sub-Viw and the center of the screen), this value is the distance that the sub-View needs to move (smoothScrollBy) on the Y-axis of fatherView, that is, the middle position of the screen, so that the visible area is always the sub-View The center position of t...
Embodiment 3
[0045] Based on the method of the present invention, if the parent View is a list View such as RecyclerView, take RecyclerView as an example to illustrate the implementation method of the invention: first, define a method for moving through the coordinate position of the item, and also take left and right movement as an example smoothScrollToMid, while maintaining the child View Under the premise of being in the middle position, the calculation is performed in the focus change event of the item. The calculation method is similar to that of ScrollView. First, calculate the distance left between the item and the leftmost part of RecyclerView, and then obtain the width vwidth of the item, and the left and right directions of the RecyclerView displayable area. Width, and finally calculate the distance that the item needs to move distance=left+vwidth / 2-Width / 2, then you can call the movement method (smoothScrollBy) to move the item on the X axis. In this way, the target View is alwa...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

