CN105117154A - Application method of Android list view component - Google Patents

Application method of Android list view component Download PDF

Info

Publication number
CN105117154A
CN105117154A CN201510483519.4A CN201510483519A CN105117154A CN 105117154 A CN105117154 A CN 105117154A CN 201510483519 A CN201510483519 A CN 201510483519A CN 105117154 A CN105117154 A CN 105117154A
Authority
CN
China
Prior art keywords
display module
list
touch event
list items
detailed content
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.)
Pending
Application number
CN201510483519.4A
Other languages
Chinese (zh)
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.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510483519.4A priority Critical patent/CN105117154A/en
Publication of CN105117154A publication Critical patent/CN105117154A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides an application method of an Android list view component. The application method is suitable for a list item view component in an intelligent terminal with an Android system. The method comprises the steps as follows: when a user clicks a touch screen of the intelligent terminal to send out a touch event, a list display component monitors the touch event; position changes of two touch points in the touch event are calculated; whether the list display component or a list item display component intercepts the touch event is judged according to the position changes; and a corresponding treatment is carried out on the touch event. The application method has the advantages that for the condition that a return key of a large-screen mobile phone or a tablet computer is inconvenient to press, browsing and reading of text messages can be finished through operations of double fingers in the middle of the screen; the fingers do not need to frequently move between the middle of the screen and the return key; meanwhile, the requirements of users who like operations with the double fingers are met; and the diversity of finger operations is enriched.

Description

A kind of using method of Android List View assembly
Technical field
The present invention relates to android system field operation, particularly relate to a kind of using method of Android List View assembly.
Background technology
See news at present or stroll mhkc, what first see is all title and the summary of list display, and want to see that detailed content needs to click title and then jump to next Activity could read, there is temporary transient pause centre, affects continuity and the fluency of reading.And want to turn back to title page when reading detailed content and also through the redirect of Activity, for large-screen mobile phone, will press the distance that return key finger needs movement longer frequently.
In the text display of current mobile phone application, generally the title and the summary that show text in the form of a list, jumping to by clicking operation the display that a first Activity realizes text detailed content again, to again check title and summary, needing by return key.Above process is all the preview and the display that are realized text by click view component or button.Operate more single, and there will be temporary transient pause when redirect Activity, the continuity that impact is read.Time for large-screen mobile phone or leisure, some user likes two and refers to operating handset, and above scheme cannot meet the experience of this kind of user.
Summary of the invention
In view of the above problems, the application describes the using method of a kind of Android (i.e. Android operation system) List View assembly, and be applicable to have List View assembly in the intelligent terminal of android system, described method comprises step:
When the touch-screen that user clicks described intelligent terminal sends touch event, described touch event monitored by list display module;
Calculate the change in location of two touch points in described touch event;
Judge that described touch event tackled by described list display module or list items display module according to described change in location;
Respective handling is carried out to described touch event.
Preferably, each described touch point comprises original point and end point; Step is comprised when touch event terminates the change in location of touch point described in latter two in calculating:
Recording user presses the position of the original point on when described display screen for the first time;
Calculate the first distance between two described original point;
The position of end point when recording user leaves described display screen;
Calculate the second distance between two described end point;
Judge the size of second distance described in described first Distance geometry, when described first distance is greater than described second distance, the distance of two described touch points increases; When described first distance is greater than described second distance, the distance of two described touch points reduces.
Preferably, when the position of two described touch points becomes large and described list items display module into visual attribute, before execution step carries out respective handling to described touch event, also need whether multiple list items is crossed over to described touch event and judge.
Preferably, step is comprised whether crossing over the process that multiple described list items judges to described touch event:
Judge two described original point and two described end point whether in the position range of same list items, if so, then described touch action only crosses over a described list items; Otherwise described touch action spans a more than described list items.
Preferably, when described touch event only spans a list items, be visible by the setup of attribute of the detailed content display module corresponding to described list items.
Preferably, be that visible process comprises step by the setup of attribute of the detailed content display module corresponding to described list items:
Positional information according to two described original point and two described end point judges the described list items that described touch action is crossed over;
Inquire about the described detailed content display module corresponding to described list items in a database;
Adapter loads the described detailed content of described list items to correspondence;
Described detailed content is tied on described detailed content display module.
Preferably, by the setup of attribute of the detailed content display module corresponding to described list items for seeing below, hide removing described detailed content display module outside other display module.
Preferably, when the position of two described touch points diminishes and the attribute that detailed content display module is is hiding, hide described detailed content display module, described list items display module is set to visible.
Preferably, when described touch event spans multiple list items, judge described touch event mistake, described intelligent terminal does not perform any operation.
Preferably, when described touch event spans multiple list items, judge described touch event mistake, described intelligent terminal does not perform any operation.
Preferably, described touch event comprises and two refer to push aside operation and twoly refer to union operation.
Technique scheme tool has the following advantages or beneficial effect: advantage of the present invention is for large-screen mobile phone or flat board, when being inconvenient to by return key, can browsing of text message be completed at screen intermediary operation by two finger and read, need not moveable finger in the middle of screen and between return key frequently.Meet simultaneously and like two demand referring to operation user, enriched the diversity of finger manipulation.
Accompanying drawing explanation
With reference to appended accompanying drawing, to describe embodiments of the invention more fully.But, appended accompanying drawing only for illustration of and elaboration, do not form limitation of the scope of the invention.
Fig. 1 is the overview flow chart of the using method of a kind of Android List View of the present invention assembly;
Fig. 2 is the process flow diagram of touch point change in location in the using method of a kind of Android List View of the present invention assembly;
Fig. 3 is the process flow diagram carrying out respective handling after judging touch event in the using method of a kind of Android List View of the present invention assembly;
Fig. 4 is two process flow diagram referring to push aside operation in the using method of a kind of Android List View of the present invention assembly;
Fig. 5 is two process flow diagram referring to union operation in the using method of a kind of Android List View of the present invention assembly.
Embodiment
Be described in detail below in conjunction with the using method of the drawings and specific embodiments to Android List View assembly of the present invention.
List display module comprises list items display module, and list items display module comprises front page display module and detailed content display module.The ListView of list display module inheritance system display module, the ViewGroup from system inherited by list items display module.The structure of list items display module is defined in layout xml file.Obtain data by list adapter from database or network when list loads and be tied to list items, from the attribute configuration list items assembly layout xml file when adapter generates list items first.The front page display module configured in xml is Visible attribute (visual attribute), namely open just display first, and the attribute configuration of detailed content display module is Gone (hiding attribute), default hidden when namely opening first.After being configured with these attributes, when opening list display module first, an acquiescence display column list item, hides detailed content.Adapter only can load heading message when loading data and be tied on title display module, does not temporarily process the data of detailed content.
The present invention needs the android.widget.ListView class used in Android system, has rewritten the event interception monitor method of ListView, has carried out customization to touch event.Also need to use list adapter Adapter, such is the bridge between view and data source, and its effect has the data source preparing list and need, and data source is tied on the sub-component list items of list.Last list loads this adapter and shows.Layout xml file is each the corresponding layout in list, comprises the detailed content of title and default hidden.The title of text and detailed content are preserved in a database.
List display module belongs to Android system assembly, and it has oneself sub-component, namely list items assembly.They not only have the function of displaying contents information, can also monitor operation thereon and process, and it utilizes the touch event of system to monitor interface, after registered events audiomonitor, can monitor touch event.The event type that touch event audiomonitor can be monitored has multiple, comprises single-point touch event and multiple point touching event etc., can process in the present invention to multiple point touching event.In multiple point touching event, touch-screen can record initial position and the final position of each point, namely puts position when disappearing from screen, can record the real time position of each point in this process simultaneously.If touch event is at 2 and the spacing continuous enlargement of 2, corresponding two operation referring to push aside, now, list items display module and list display module all can listen to this event, but can only be processed this event by one of them.Because this event pushes operation aside at two finger, the main body that program comprehension performs this event needs to open the content of list items, so tackled by list display module and process this touch event, after list tackles this event by the interface that system provides, will process accordingly event, then destroy this event to process it to stop other display module, cause abnormal occurrence.
As shown in Figure 1, a kind of using method of Android List View assembly, is applicable to have List View assembly in the intelligent terminal of android system, comprises:
When the touch-screen that user clicks described intelligent terminal sends touch event, described touch event monitored by list display module;
Calculate the change in location of two touch points in described touch event;
Judge that described touch event tackled by list display module or list items display module according to described change in location;
Described touch event carries out respective handling.
Specifically, described touch event comprises two kinds: two finger pushes operation and two finger union operation aside.When user send two refer to push operation aside time, i.e. two differences of user simultaneously on touch display screen carry out paddling operation respectively, the distance between two described touch points becomes large; When user sends two finger union operation, two differences namely while of user on touch display screen also carry out paddling operation respectively, and the distance between two described touch points diminishes.
If described touch event is two finger push operation aside, so list items display module is tackled and is processed this touch event, and respective handling is for opening the detailed content display module corresponding to list items; If described touch event is two finger union operations, so list display module is tackled and is processed this touch event, and respective handling is for opening list display module.
After list element interception event, first can be further analyzed this event, in 2 touch events, when the event that first point and second point press down, the action listener interface that system provides can import event argument into, this parameter contains the information such as the type of event and the position of touch point, and program can record and position at 2 and the distance calculated between 2 when point presses down, and is kept in the built-in variable of process.Equally, when case point leaves touch-screen, program also records corresponding position, when two points all frame out, analyze contrast touch event occur and at the end of, the change in location between two touch points.The first situation: the distance between two touch points expands, and namely two finger pushes operation aside; The second situation: the distance between two points reduces, i.e. two finger union operation.List element can locate the particular location that this event occurs, and that list items of namely touch event generation, there will be several situation here, when touch event crosses over multiple list items, program can not process this event, is defaulted as invalid operation.Only have and just can process when touch event only occurs in an independent list items.Push operation aside for two finger, program needs the detailed content of display column list item, needs the display module of detailed content here, determines that assembly is with text display assembly or picture display module etc. according to the data type of detailed content.The display module of this detailed content is included in this list items assembly, and default situations is hiding, only has and just there will be when needs display detailed content.When listen to two refer to push operation aside after, the attribute of detailed content display module is re-set as Visible.The respective column list item position in lists that list can find this operation to occur by the parameter that the action listener interface of system returns, by the information database that this positional information utilizes list adapter to find list items corresponding, obtain the information content by the details table in Query Database, give new display module by the delivery of content that obtains.Then detailed content corresponding for this list items is presented on screen, and hides in list other display modules all gone beyond detailed content display module.After this process, all can the detailed content of display column list item on whole screen.
As shown in Figure 2, the process calculating the change in location of two touch points in described touch event comprises step:
Recording user presses the position of the original point on when described display screen for the first time;
Calculate the first distance between two described original point;
The position of end point when recording user leaves described display screen;
Calculate the second distance between two described end point;
Judge the size of second distance described in described first Distance geometry, when described first distance is greater than described second distance, the distance of two described touch points increases; When described first distance is greater than described second distance, the distance of two described touch points reduces.
Residing touch point for user touch in paddling process in display screen summation a little, comprise original point and end point.Two original point and two end point and user in paddling process draw positional information a little be all recorded in built-in variable.
After the change in location calculating two touch points, judge that the process that described touch event tackled by list display module or list items display module comprises step according to described change in location:
When described touch point distance increase and described list items display module be visual attribute time, described touch event tackled by described list items display module;
When described touch point distance reduce and described detailed content display module be visual attribute time, described touch event tackled by described list display module;
Other situation judges that described touch event is made mistakes, and does not process.
As shown in Figure 3, after judging that described touch event tackled by list items display module, the process of described touch event being carried out to respective handling comprises step:
Judge two described original point and two described end point whether in the position range of same list items;
If two described original point and two described end point are in the position range of same list items, then described touch action only crosses over a described list items;
Detailed content display module corresponding to described list items is set to visual attribute, hides other display module;
Otherwise described touch action spans a more than described list items, judges described touch event mistake, does not perform any operation.
As shown in Figure 4, the detailed content display module corresponding to described list items is set to visual attribute and the process hiding other display module comprises step in step:
Positional information according to two described original point and two described end point judges the described list items that described touch action is crossed over;
Inquire about the described detailed content display module corresponding to described list items in a database;
Adapter loads described detailed content corresponding to described list items;
Described detailed content is tied on described detailed content display module.
When user completes the reading of detailed content, when wanting to turn back to title page, two finger union operation can be performed at the detailed content page.Two finger union operation also belongs to multiple point touching event, and program record two touch point contact screens and position when frameing out, compare the change of distance between two points.Now, the distance of point-to-point transmission reduces.After content display component listens to this event, can process in the event handling interface of system.Because two finger union operation needs other assembly of hiding content display component display list again, thus final this event of interception or list element.After list element listens to this event, corresponding detailed content display module is hidden according to system interface return parameters, the display properties of content components is set to Gone, and again show the front page of list items corresponding to this content components, display properties is set to Visible.List items display module can destroy this event after completing this event handling.After this process, the detailed content on screen will disappear immediately, again shows front page.
As shown in Figure 5, after judging that described touch event tackled by list display module, the process of described touch event being carried out to respective handling comprises step:
Hide described detailed content display module;
Described list items display module is set to visual attribute;
Described touch event destroyed by described list items display module.
The present invention, by identifying pushing aside and union operation of user, realizes the quick switching of text header preview and detailed content display.Reduce the number of times of user's moveable finger in the middle of screen and between return key, meet simultaneously and like with two user's request referring to operating handset.In the application of mobile phone or mobile terminal device, by two, user can refer to that operating handset complete browsing of text message and switch fast between reading.
Advantage of the present invention is for large-screen mobile phone or flat board, when being inconvenient to by return key, can being completed browsing of text message at screen intermediary operation by two finger and be read, need not moveable finger in the middle of screen and between return key frequently.Meet simultaneously and like two demand referring to operation user, enriched the diversity of finger manipulation.
Substance of the present invention comprises two aspects: launch detailed content below title after 1, operation is pushed in the execution of two finger aside on title; 2, after in detailed content, two finger performs union operation, detailed content is hidden, and again presents title page.Display module default conditions of the present invention are display title page, inherit from android.widget.ListView, present front page in the form of a list.Detailed content is included in specific ViewGroup, is in below title, and default conditions are hiding.When user perform on a certain item of list two refer to push operation aside after, corresponding ListItem tackles this operation and performs method for processing interception, is shown by the ViewGroup comprising detailed content originally hidden.After user reads detailed content, title page is turned back to want, directly can perform two finger union operation in detailed content, corresponding ListItem intercepts this operation and performs method for processing interception, is re-set as hiding by the detailed content being in visual attribute.Such user can see title page again immediately.
For a person skilled in the art, after reading above-mentioned explanation, various changes and modifications undoubtedly will be apparent.Therefore, appending claims should regard the whole change and correction of containing true intention of the present invention and scope as.In Claims scope, the scope of any and all equivalences and content, all should think and still belong to the intent and scope of the invention.

Claims (11)

1. a using method for Android List View assembly, is characterized in that, be applicable to have List View assembly in the intelligent terminal of android system, described method comprises step:
When the touch-screen that user clicks described intelligent terminal sends touch event, described touch event monitored by list display module;
Calculate the change in location of two touch points in described touch event;
Judge that described touch event tackled by described list display module or list items display module according to described change in location;
Respective handling is carried out to described touch event.
2. want the using method of the Android List View assembly described in 1 according to right, it is characterized in that, each described touch point comprises original point and end point; Step is comprised when touch event terminates the change in location of touch point described in latter two in calculating:
Recording user presses the position of the original point on when described display screen for the first time;
Calculate the first distance between two described original point;
The position of end point when recording user leaves described display screen;
Calculate the second distance between two described end point;
Judge the size of second distance described in described first Distance geometry, when described first distance is greater than described second distance, the distance of two described touch points increases; When described first distance is greater than described second distance, the distance of two described touch points reduces.
3. the using method of Android List View assembly according to claim 2, it is characterized in that, when the position of two described touch points becomes large and described list items display module into visual attribute, before execution step carries out respective handling to described touch event, also need whether multiple list items is crossed over to described touch event and judge.
4. the using method of Android List View assembly according to claim 3, is characterized in that, comprises step whether crossing over the process that multiple described list items judges to described touch event:
Judge two described original point and two described end point whether in the position range of same list items, if so, then described touch action only crosses over a described list items; Otherwise described touch action spans a more than described list items.
5. the using method of Android List View assembly according to claim 3, is characterized in that, when described touch event only spans a list items, is visible by the setup of attribute of the detailed content display module corresponding to described list items.
6. the using method of Android List View assembly according to claim 5, is characterized in that, is being that visible process comprises step by the setup of attribute of the detailed content display module corresponding to described list items:
Positional information according to two described original point and two described end point judges the described list items that described touch action is crossed over;
Inquire about the described detailed content display module corresponding to described list items in a database;
Adapter loads the described detailed content of described list items to correspondence;
Described detailed content is tied on described detailed content display module.
7. the using method of Android List View assembly according to claim 5, it is characterized in that, by the setup of attribute of the detailed content display module corresponding to described list items for seeing below, hide removing described detailed content display module outside other display module.
8. the using method of Android List View assembly according to claim 7, it is characterized in that, when the position of two described touch points diminishes and the attribute that detailed content display module is is hiding, hide described detailed content display module, described list items display module is set to visible.
9. the using method of Android List View assembly according to claim 7, is characterized in that, be set to see below by described list items display module when hiding described detailed content display module, described touch event destroyed by described list items display module.
10. the using method of Android List View assembly according to claim 4, is characterized in that, when described touch event spans multiple list items, judge described touch event mistake, described intelligent terminal does not perform any operation.
The using method of 11. Android List View assemblies according to claim 1, is characterized in that, described touch event comprises pair finger and pushes operation and two finger union operation aside.
CN201510483519.4A 2015-08-07 2015-08-07 Application method of Android list view component Pending CN105117154A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510483519.4A CN105117154A (en) 2015-08-07 2015-08-07 Application method of Android list view component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510483519.4A CN105117154A (en) 2015-08-07 2015-08-07 Application method of Android list view component

Publications (1)

Publication Number Publication Date
CN105117154A true CN105117154A (en) 2015-12-02

Family

ID=54665159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510483519.4A Pending CN105117154A (en) 2015-08-07 2015-08-07 Application method of Android list view component

Country Status (1)

Country Link
CN (1) CN105117154A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107153528A (en) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 The method and apparatus that mixed model list items are reused
CN108647072A (en) * 2018-05-04 2018-10-12 武汉极意网络科技有限公司 A kind of method, apparatus and equipment of action listener

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102768605A (en) * 2011-05-05 2012-11-07 联想移动通信科技有限公司 Display method for mobile terminal and mobile terminal
CN103064609A (en) * 2011-10-21 2013-04-24 联想(北京)有限公司 Display method and device of extended information
CN104077104A (en) * 2014-07-11 2014-10-01 上海斐讯数据通信技术有限公司 Notification display and check method for notification bar of mobile terminal
CN104102416A (en) * 2013-04-15 2014-10-15 腾讯科技(深圳)有限公司 Method and device for displaying summary information list in touch terminal
US20150177932A1 (en) * 2011-02-11 2015-06-25 Linkedin Corporation Methods and systems for navigating a list with gestures

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150177932A1 (en) * 2011-02-11 2015-06-25 Linkedin Corporation Methods and systems for navigating a list with gestures
CN102768605A (en) * 2011-05-05 2012-11-07 联想移动通信科技有限公司 Display method for mobile terminal and mobile terminal
CN103064609A (en) * 2011-10-21 2013-04-24 联想(北京)有限公司 Display method and device of extended information
CN104102416A (en) * 2013-04-15 2014-10-15 腾讯科技(深圳)有限公司 Method and device for displaying summary information list in touch terminal
CN104077104A (en) * 2014-07-11 2014-10-01 上海斐讯数据通信技术有限公司 Notification display and check method for notification bar of mobile terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107153528A (en) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 The method and apparatus that mixed model list items are reused
US10691427B2 (en) 2016-03-02 2020-06-23 Alibab Group Holding Limited Method and apparatus reusing listcell in hybrid application
US10789051B1 (en) 2016-03-02 2020-09-29 Alibaba Group Holding Limited Method and apparatus reusing ListCell in hybrid application
CN108647072A (en) * 2018-05-04 2018-10-12 武汉极意网络科技有限公司 A kind of method, apparatus and equipment of action listener
CN108647072B (en) * 2018-05-04 2021-11-30 武汉极意网络科技有限公司 Event monitoring method, device and equipment

Similar Documents

Publication Publication Date Title
US20200396191A1 (en) Efficient processing of unread messages
CN106156066B (en) Page switching method, device and client
CN107066188B (en) A kind of method and terminal sending screenshot picture
US20140002396A1 (en) Information processing method, information processing apparatus and electronic device
CN104133828A (en) Drag-and-drop clipboard for HTML documents
CN105302458B (en) A kind of message display method and device
US20150301730A1 (en) Object Suspension Realizing Method and Device
CN107404576B (en) Screen-locked magazine browsing method, mobile terminal and computer-readable storage medium
WO2018119905A1 (en) Control method and control device for multisystem mobile terminal, and electronic device
WO2011146544A1 (en) System and method for monitoring changes in databases and websites
CN105095374A (en) Method and device for browsing mobile terminal news
WO2019129161A1 (en) Method and apparatus for viewing background application on mobile terminal
CN107273111A (en) A kind of multi-screen display method and terminal
JP2020161135A (en) Method and system for displaying chat thread
EP2731011A1 (en) Shared instant media access for mobile devices
TW201403384A (en) System, method, and computer program product for using eye movement tracking for retrieval of observed information and of related specific context
CN113268182B (en) Application icon management method and electronic device
US11112938B2 (en) Method and apparatus for filtering object by using pressure
CN105117154A (en) Application method of Android list view component
CN104516618B (en) Interface function analysis display method and device
WO2022253132A1 (en) Information display method and apparatus, and electronic device
CN106375190B (en) instant messaging software interface splitting and merging display method and system
CN107168600B (en) Push message checking method and device
CN110837335A (en) Method and device for displaying page tag in application, terminal and storage medium
CN114090896A (en) Information display method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151202

RJ01 Rejection of invention patent application after publication