US20200319858A1 - Method and apparatus reusing listcell in hybrid application - Google Patents

Method and apparatus reusing listcell in hybrid application Download PDF

Info

Publication number
US20200319858A1
US20200319858A1 US16/904,031 US202016904031A US2020319858A1 US 20200319858 A1 US20200319858 A1 US 20200319858A1 US 202016904031 A US202016904031 A US 202016904031A US 2020319858 A1 US2020319858 A1 US 2020319858A1
Authority
US
United States
Prior art keywords
listcell
computer
content data
prototype
layer
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.)
Granted
Application number
US16/904,031
Other versions
US10789051B1 (en
Inventor
Weigang Guan
Danxia SHI
Wenhong Chen
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.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to US16/904,031 priority Critical patent/US10789051B1/en
Assigned to ALIBABA GROUP HOLDING LIMITED reassignment ALIBABA GROUP HOLDING LIMITED ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: CHEN, WENHONG, GUAN, Weigang, SHI, Danxia
Assigned to ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD. reassignment ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: ALIBABA GROUP HOLDING LIMITED
Assigned to Advanced New Technologies Co., Ltd. reassignment Advanced New Technologies Co., Ltd. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Application granted granted Critical
Publication of US10789051B1 publication Critical patent/US10789051B1/en
Publication of US20200319858A1 publication Critical patent/US20200319858A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/312List processing, e.g. LISP programming language
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02WCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO WASTEWATER TREATMENT OR WASTE MANAGEMENT
    • Y02W30/00Technologies for solid waste management
    • Y02W30/50Reuse, recycling or recovery technologies
    • Y02W30/82Recycling of waste of electrical or electronic equipment [WEEE]
    • Y02W30/826

Definitions

  • the present application relates to the computer field, and in particular, to a method and an apparatus reusing a ListCell in a hybrid application.
  • Hybrid development is developing programs by using both front-end development and native development.
  • the front-end development is developing web pages and web apps based on technologies such as JavaScript, HTML, and CSS.
  • the native development is programming based on native functions of local operating systems of smart devices, such as mobile phones. For example, native interface development based on systems such as iOS and Android.
  • React is a JS framework produced by Facebook, and is a construction system for standardizing front-end development.
  • React Native is launched by Facebook based on React standards, and is a technology implementation framework permitting native applications to be developed by using front-end technologies.
  • Hybrid development is a very popular development mode for current mobile software applications (or APPs).
  • front-end web page development technology is used to develop interfaces and services
  • native development is used to provide native capabilities of various OS, so that an APP can have front-end dynamic capability and a native experience effect.
  • a ListView is the most common presentation form of an APP and it is used to present a page including a list form content, presents a large number of ListCells with the same or similar structure in a list, and usually can support inclusion of various ListCell.
  • the ListCells have basically the same presentation structure, and only information contents to be presented are different.
  • a ListCell is a content presented in each row or each sub cell of the ListView. Because a screen has a limited display area, the screen can present only some ListCell contents of the ListView at the same time. Some of the other ListCells can scroll in the screen display area only by scrolling up and down, and correspondingly, some ListViews scroll out of the display area.
  • FIG. 1 An existing ListView implementation solution on React Native is shown in FIG. 1 . Because a ListCell is defined at a front-end layer, a React Native framework can only map an entire structure of a ListView to a native layer. Therefore, if the ListView has 100 ListCells, 100 ListCells are created at the native layer, and the 100 ListCells are arranged and rendered, which consumes both memory (for example, a computer memory) and time.
  • memory for example, a computer memory
  • a ListCell that has been moved out of the displayable area can be reused to present a ListCell that is to be moved to the displayable area.
  • memory and time needed for creating and arranging new ListCells can be reduced to improve performance.
  • a structure layout and a ListCell class are defined at the front-end, and the front-end triggers the native layer to create a ListCell instance. Therefore, due to limitations of front-end DOM rendering mechanisms, the native layer may not be able to efficiently reuse the ListCell because reconstructing a DOM can require higher computing costs.
  • An objective of the present application is to provide a method and an apparatus reusing a ListCell in a hybrid application, so as to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in hybrid development.
  • a method reusing a ListCell in a hybrid application includes the following: defining a prototype of a ListCell at a front-end of the hybrid application; and obtaining the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reusing the ListCell.
  • the defining a prototype of a ListCell includes the following: defining a structure layout and a class of the prototype of the ListCell.
  • the prototype of the ListCell is a prototype of a single ListCell.
  • the obtaining the ListCell through copying based on the prototype of the ListCell includes the following: creating a ListCell template based on the prototype of the ListCell; obtaining the ListCell by copying the ListCell template; and filling an obtained ListCell content in the copied ListCell, and displaying the ListCell.
  • the obtaining the ListCell by copying the ListCell template includes the following: traversing and obtaining all sub-views of the ListCell template; and creating a ListCell that includes all the sub-views and attributes of the sub-views.
  • the filling an obtained ListCell content in the copied ListCell includes the following: filling the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • the ListCell content is obtained from the front-end.
  • the number of copied ListCells is determined based on the number of ListCells that can be included and displayed in a display area.
  • the reusing the ListCell includes the following: recycling a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determining whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, filling the new ListCell content in the reusable ListCell, and displaying the ListCell; or if no, obtaining the ListCell by copying the ListCell template, filling the new ListCell content in the copied ListCell, and displaying the ListCell.
  • an apparatus reusing a ListCell in a hybrid application includes: a definition apparatus, configured to define a prototype of a ListCell at a front-end of the hybrid application; and a copy and reuse apparatus, configured to obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell.
  • the definition apparatus is configured to define a structure layout and a class of the prototype of the ListCell.
  • the prototype of the ListCell is a prototype of a single ListCell.
  • the copy and reuse apparatus is configured to create a ListCell template based on the prototype of the ListCell, obtain the ListCell by copying the ListCell template, fill an obtained ListCell content in the copied ListCell, and display the ListCell.
  • the copy and reuse apparatus is configured to traverse and obtain all sub-views of the ListCell template, and create a ListCell that includes all the sub-views and attributes of the sub-views.
  • the copy and reuse apparatus is configured to fill the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • the ListCell content is obtained from the front-end.
  • the copy and reuse apparatus is configured to determine the number of copied ListCells based on the number of ListCells that can be included and displayed in a display area.
  • the copy and reuse apparatus is configured to recycle a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determine whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, fill the new ListCell content in the reusable ListCell, and display the ListCell; or if no, obtain the ListCell by copying the ListCell template, fill the new ListCell content in the copied ListCell, and display the ListCell.
  • the prototype of the ListCell is defined at the front-end.
  • the prototype of the ListCell is copied at the native end.
  • the native end reuses an invisible ListCell based on a current list presentation location.
  • the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance.
  • the core of the technical solutions of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid application development, so as to reuse the ListCell on a list page and improve rendering and operation performance.
  • FIG. 1 shows an implementation of an existing ListView
  • FIG. 2 is a flowchart illustrating a method reusing a ListCell in a hybrid application, according to an aspect of the present application
  • FIG. 3 is a principle diagram illustrating an example implementation of the present application.
  • FIG. 4 is a principle diagram illustrating another example implementation of the present application.
  • FIG. 5 is a principle diagram illustrating yet another example implementation of the present application.
  • FIG. 6 is a diagram illustrating modules of an apparatus reusing a ListCell in a hybrid application, according to another aspect of the present application.
  • FIG. 7 is a flowchart illustrating an example of a computer-implemented method for reusing a ListCell in a hybrid application, according to an implementation of the present disclosure.
  • a terminal device, a service network device, and a trusted party each include one or more central processing units (CPU), an input/output interface, a network interface, and a memory.
  • CPU central processing units
  • the memory can include a non-persistent memory, a random access memory (RAM), and/or a nonvolatile memory in a computer readable medium, for example, a read-only memory (ROM) or a flash memory (flash RAM).
  • ROM read-only memory
  • flash RAM flash memory
  • the computer readable medium includes persistent, non-persistent, movable, and unmovable media that can implement information storage by using any method or technology.
  • Information can be a computer readable instruction, a data structure, a program module, or other data.
  • An example of a computer storage medium includes but is not limited to a phase change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a random access memory (RAM) of another type, a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory or another memory technology, a compact disc read-only memory (CD-ROM), a digital versatile disc (DVD) or other optical storage, a cassette magnetic tape, a tape and disk storage or another magnetic storage device, or any other non-transmission media.
  • the computer storage medium can be configured to store information that can be accessed by a computing device. As described in the present specification, the computer readable medium does not include a non-transitory computer
  • a method reusing a ListCell in a hybrid application includes the following steps.
  • Step S 1 Define a prototype of a ListCell at a front-end of the hybrid application.
  • Step S 2 Obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell.
  • the prototype (a parent) of the ListCell is defined at the front-end.
  • the prototype of the ListCell is copied (cloned) at the native end (Native).
  • the native end reuses an invisible ListCell based on a current list presentation location.
  • the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end.
  • the core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid development. As such, the ListCell can be reused on a list page to improve the rendering and operation performance.
  • the present application is applicable to all hybrid APP developments, and has a very good implementation effect in a React Native framework.
  • step S 1 of defining a prototype of a ListCell includes the following: defining a structure layout and a class of the prototype of the ListCell.
  • defining a prototype of a ListCell includes defining a structure and a class of the ListCell.
  • the ListCell can be flexibly defined at the front-end in the hybrid development.
  • the prototype of the ListCell is a prototype of a single ListCell.
  • only one instance that is, the prototype of the ListCell
  • a ListCell template can be created at the native end only based on the prototype.
  • the ListCell template is copied as needed. As such, memory and time needed for creating and arranging new ListCells can be reduced to improve computing performance.
  • obtaining the ListCell through copying based on the prototype of the ListCell includes the following: creating a ListCell template based on the prototype of the ListCell; obtaining the ListCell by copying the ListCell template; and filling an obtained ListCell content in the copied ListCell, and displaying the ListCell.
  • the ListCell template that is, a ListCell prototype instance in the figure, is created at the native end only based on the prototype defined at the front-end. Then, the ListCell template is copied based on the number of ListCell contents that need to be displayed to obtain the corresponding number of ListCells.
  • the ListCell contents that is, ListCell data 1 to n in FIG. 3 , are respectively filled in the corresponding ListCells for rendering and displaying.
  • the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • obtaining the ListCell by copying the ListCell template includes the following: traversing and obtaining all sub-views of the ListCell template; and creating a ListCell that includes all the sub-views and attributes of the sub-views.
  • all the sub-views (view) of the ListCell template are recursively traversed, and then a ListCell is obtained through copying to include all the sub-views and the attributes corresponding to the sub-views.
  • the ListCell can be accurately copied.
  • the ListCell template that is, sub-views of a ListCell prototype in FIG.
  • Copying the ListCell prototype is a process of creating a ListCell that includes all the sub-views of the ListCell prototype and attributes of the sub-views.
  • Sub-views of the obtained ListCell include A′, B′, C′, D′, and E′.
  • filling an obtained ListCell content in the copied ListCell includes the following: filling the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • the ListCell content can be filled in each corresponding sub-view of the copied ListCell based on the ListCell content.
  • the ListCell content can be accurately displayed at a corresponding location in the ListCell.
  • the ListCell contents that is, content data in FIG. 4 , are respectively filled in the corresponding sub-views A′, B′, C′, D′, and E′ of the copied ListCell.
  • the ListCell content is obtained from the front-end.
  • the front-end in addition to defining the prototype of the ListCell, the front-end only needs to transmit the ListCell content, that is, the ListCell data in FIG. 3 , to the native end. As such, memory and time consumed for front-end data processing can be reduced.
  • the number of copied ListCells is determined based on the number of ListCells that can be included and displayed in a display area.
  • the corresponding number of ListCells need to be obtained through copying based on the number of ListCells that can be included and displayed in the display area.
  • the corresponding number of ListCells is determined to be generated based on the number of ListCells that can be displayed on one screen.
  • the ListCell can be copied as needed, and the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • 10 ListCell contents need to be displayed, and a display area can include and display 10 ListCells.
  • 10 ListCells need to be copied.
  • the reusing the ListCell includes the following: recycling a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determining whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, filling the new ListCell content in the reusable ListCell, and displaying the ListCell; or if no, obtaining the ListCell by copying the ListCell template, filling the new ListCell content in the copied ListCell, and displaying the ListCell.
  • the reusable ListCell can be used when a new ListCell content is displayed, that is, the ListCells in the display area are cyclically reused and moved in a list scrolling process. As such, the memory and time needed for creating and arranging new ListCells can be further reduced to improve the performance.
  • the ListCell template needs to be copied based on the new ListCell content to obtain a corresponding data ListCell. For example, 15 ListCell contents need to be displayed, and a display area can include and display 10 ListCells.
  • 10 ListCells need to be copied in the first time of displaying, to display 10 ListCell contents.
  • Five corresponding ListCell contents that have been displayed are moved out of the display area when the other five ListCell contents need to be moved to the display area for displaying.
  • the five ListCells that are moved out of the display area can be recycled as reusable ListCells. Then, the five reusable ListCells can be reused for the other five ListCell contents.
  • Step S 51 A front-end layer defines a structure and a class of a ListCell.
  • Step S 52 The front-end layer obtains list content data, that is, a ListCell content.
  • Step S 53 The front-end layer creates a ListCell prototype based on the defined structure and class of the ListCell, transmits the list content data to a native end, and then goes to step S 56 .
  • Step S 56 A native-end layer creates a ListCell prototype instance, that is, a ListCell template, based on the ListCell prototype created by the front-end layer.
  • Step S 57 The native end determines that a new ListCell is to be moved to a display area, and goes to step S 58 .
  • Step S 62 is performed at the same time as step S 57 : The native end determines that a ListCell is to be moved out of the display area, and goes to step S 63 .
  • Step S 63 The native end uses the ListCell that is in the mobile display area as a reusable ListCell, and then goes to step S 58 .
  • Step S 58 The native end determines whether there is a reusable ListCell.
  • step S 59 The native end directly reuses the reusable ListCell, and then goes to step S 61 .
  • the native end determines ListCells that can be reused based on the number of ListCells that can be included and displayed in the displayable area.
  • step S 60 The native end copies a ListCell from the ListCell prototype instance based on the list content data, and then goes to step S 61 .
  • Step S 61 Render the ListCell, and then go to step S 54 .
  • Step S 54 A front-end layer user scrolls a list.
  • Step S 55 After triggering refreshing, the front-end layer goes to step S 53 .
  • the ListCell prototype does not need to be created again, and only refreshed content data of the list is transmitted to the native end, that is, new list content data to be displayed.
  • an apparatus reusing a ListCell in a hybrid application includes: a definition apparatus 1 , configured to define a prototype of a ListCell at a front-end of the hybrid application; and a copy and reuse apparatus 2 , configured to obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell.
  • the prototype of the ListCell is defined at the front-end.
  • the prototype of the ListCell is copied at a native end (Native). The native end reuses an invisible ListCell based on a current list presentation location.
  • the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance.
  • the core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid development. As such, the ListCell can be reused on a list page to improve the rendering and operation performance.
  • the present application is applicable to all hybrid APP developments, and has a very good implementation effect in a React Native framework.
  • the definition apparatus 1 is configured to define a structure layout and a class of the prototype of the ListCell.
  • defining a prototype of a ListCell includes defining a structure and a class of the ListCell.
  • the ListCell can be flexibly defined at the front-end in the hybrid development.
  • the prototype of the ListCell is a prototype of a single ListCell.
  • only one instance that is, the prototype of the ListCell
  • a ListCell template can be created at the native end only based on the prototype.
  • the ListCell template is copied as needed. As such, memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • the copy and reuse apparatus 2 is configured to create a ListCell template based on the prototype of the ListCell, obtain a ListCell by copying the ListCell template, fill an obtained ListCell content in the copied ListCell, and display the ListCell.
  • the ListCell template that is, a ListCell prototype instance in the figure, is created at the native end only based on the prototype defined at the front-end. Then the ListCell template is copied based on the number of ListCell contents that need to be displayed, to obtain the corresponding number of ListCells.
  • the ListCell contents that is, ListCell data 1 to n in FIG. 3 , are respectively filled in the corresponding ListCells for rendering and displaying.
  • the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • the copy and reuse apparatus 2 is configured to traverse and obtain all sub-views of the ListCell template, and create a ListCell that includes all the sub-views and attributes of the sub-views.
  • all the sub-views (view) of the ListCell template are recursively traversed, and then a ListCell is obtained through copying to include all the sub-views and the attributes corresponding to the sub-views.
  • the ListCell can be accurately copied.
  • the ListCell template that is, sub-views of a ListCell prototype in FIG. 4 , includes A, B, C, D, and E.
  • Copying the ListCell prototype is a process of creating a ListCell that includes all the sub-views of the ListCell prototype and attributes of the sub-views.
  • Sub-views of the obtained ListCell include A′, B′, C′, D′, and E′.
  • the copy and reuse apparatus 2 is configured to fill the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • the ListCell content can be filled in each corresponding sub-view of the copied ListCell based on the ListCell content.
  • the ListCell content can be accurately displayed at a corresponding location in the ListCell.
  • the ListCell contents that is, content data in FIG. 4 , are respectively filled in the corresponding sub-views A′, B′, C′, D′, and E′ of the copied ListCell.
  • the ListCell content is obtained from the front-end.
  • the front-end in addition to defining the prototype of the ListCell, the front-end only needs to transmit the ListCell content, that is, the ListCell data in FIG. 3 , to the native end. As such, memory and time consumed for front-end data processing can be reduced.
  • the copy and reuse apparatus 2 is configured to determine the number of copied ListCells based on the number of ListCells that can be included and displayed in a display area.
  • the corresponding number of ListCells need to be obtained through copying based on the number of ListCells that can be included and displayed in the display area.
  • the corresponding number of ListCells is determined to be generated based on the number of ListCells that can be displayed on one screen.
  • the ListCell can be copied as needed, and the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • 10 ListCell contents need to be displayed, and a display area can include and display 10 ListCells.
  • 10 ListCells need to be copied.
  • the copy and reuse apparatus 2 is configured to recycle a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determine whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, fill the new ListCell content in the reusable ListCell, and display the ListCell; or if no, obtain the ListCell by copying the ListCell template, fill the new ListCell content in the copied ListCell, and display the ListCell.
  • the reusable ListCell can be used when a new ListCell content is displayed, that is, the ListCells in the display area are cyclically reused and moved in a list scrolling process. As such, the memory and time needed for creating and arranging new ListCells can be further reduced to improve the performance.
  • the ListCell template needs to be copied based on the new ListCell content to obtain a corresponding data ListCell. For example, 15 ListCell contents need to be displayed, and a display area can include and display 10 ListCells.
  • 10 ListCells need to be copied in the first time of displaying, to display 10 ListCell contents.
  • Five corresponding ListCell contents that have been displayed are moved out of the display area when the other five ListCell contents need to be moved to the display area for displaying.
  • the five ListCells that are moved out of the display area can be recycled as reusable ListCells.
  • the five reusable ListCells can be reused for the other five ListCell contents.
  • the prototype of the ListCell is defined at the front-end.
  • the prototype of the ListCell is copied at the native end.
  • the native end reuses an invisible ListCell based on a current list presentation location.
  • the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance.
  • the core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid application development, so as to reuse the ListCell on a list page and improve rendering and operation performance.
  • the present application can be implemented in software and/or a combination of software and hardware.
  • the present application can be implemented by using an application-specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • ASIC application-specific integrated circuit
  • a software program in the present application can be executed by a processor, so as to implement the previous steps and functions.
  • the software program in the present application (including a related data structure) can be stored in a computer readable recording medium, for example, a RAM memory, a magnetic or optical drive, or a floppy disk and a similar device.
  • some steps or functions in the present application can be implemented by using hardware, for example, a circuit that cooperates with the processor to execute the steps or the functions.
  • a part of the present application can be implemented as a computer program product, such as a computer program instruction.
  • the methods and/or the technical solutions based on the present application can be invoked or provided by using operations of the computer.
  • the program instruction for invoking the method in the present application can be stored in a fixed or removable recording medium, and/or is transmitted by using broadcast or a data flow in other signal bearer media, and/or is stored in an operating memory of a computer device that operates based on the program instruction.
  • an implementation according to the present application includes an apparatus, and the apparatus includes a memory configured to store a computer program instruction and a processor configured to execute the program instruction. When the computer program instruction is executed by the processor, the computer program instruction triggers the apparatus to operate based on the preceding methods and/or technical solutions in a plurality of implementations according to the present application.
  • FIG. 7 is a flowchart illustrating an example of a computer-implemented method 700 for reusing a ListCell in a hybrid application, according to an implementation of the present disclosure.
  • method 700 can be performed, for example, by any system, environment, software, and hardware, or a combination of systems, environments, software, and hardware, as appropriate.
  • various steps of method 700 can be run in parallel, in combination, in loops, or in any order.
  • a prototype of a ListCell is defined using a front end of a hybrid software application.
  • defining the prototype of the ListCell includes defining a structure layout and a class of the prototype of the ListCell.
  • the prototype of the ListCell is a prototype of a single ListCell. From 702 , method 700 proceeds to 704 .
  • a ListCell template is created based on the prototype of the ListCell. From 704 , method 700 proceeds to 706 .
  • a ListCell is obtained by copying the ListCell template.
  • the ListCell template is copied at a native end of the hybrid software application.
  • obtaining the ListCell comprises: traversing and obtaining all sub-views of the ListCell template and creating a ListCell that comprises all the sub-views and attributes of the sub-views.
  • a number of copied ListCells is determined based on a number of ListCells that can be displayed in a computer display area. From 706 , method 700 proceeds to 708 .
  • the ListCell is filled with obtained ListCell content.
  • filling the ListCell includes filling the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • the obtained ListCell content is obtained from the front end of the hybrid software application. From 708 , method 700 proceeds to 710 . At 710 , display of the ListCell is initiated. After 710 , method 700 stops.
  • the ListCell is reused, where reusing the ListCell includes: 1) recycling a ListCell as a reusable ListCell by removing the ListCell content from the reusable ListCell when the ListCell content of the reusable ListCell is moved out of the computer display area and 2) determining whether there is a reusable ListCell when new ListCell content is to be moved to the computer display area. If it is determined that there is a reusable ListCell, the reusable ListCell is filled with the new ListCell content and displaying the reusable ListCell. Otherwise, if it is determined that there is not a reusable ListCell a new ListCell is obtained by copying the ListCell template, filling the new ListCell with the new ListCell content, and displaying the new ListCell.
  • Embodiments and the operations described in this specification can be implemented in digital electronic circuitry, or in computer software, firmware, or hardware, including the structures disclosed in this specification or in combinations of one or more of them.
  • the operations can be implemented as operations performed by a data processing apparatus on data stored on one or more computer-readable storage devices or received from other sources.
  • a data processing apparatus, computer, or computing device may encompass apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, a system on a chip, or multiple ones, or combinations, of the foregoing.
  • the apparatus can include special purpose logic circuitry, for example, a central processing unit (CPU), a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).
  • CPU central processing unit
  • FPGA field programmable gate array
  • ASIC application-specific integrated circuit
  • the apparatus can also include code that creates an execution environment for the computer program in question, for example, code that constitutes processor firmware, a protocol stack, a database management system, an operating system (for example an operating system or a combination of operating systems), a cross-platform runtime environment, a virtual machine, or a combination of one or more of them.
  • the apparatus and execution environment can realize various different computing model infrastructures, such as web services, distributed computing and grid computing infrastructures.
  • a computer program (also known, for example, as a program, software, software application, software module, software unit, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, object, or other unit suitable for use in a computing environment.
  • a program can be stored in a portion of a file that holds other programs or data (for example, one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (for example, files that store one or more modules, sub-programs, or portions of code).
  • a computer program can be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.
  • processors for execution of a computer program include, by way of example, both general- and special-purpose microprocessors, and any one or more processors of any kind of digital computer.
  • a processor will receive instructions and data from a read-only memory or a random-access memory or both.
  • the essential elements of a computer are a processor for performing actions in accordance with instructions and one or more memory devices for storing instructions and data.
  • a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data.
  • a computer can be embedded in another device, for example, a mobile device, a personal digital assistant (PDA), a game console, a Global Positioning System (GPS) receiver, or a portable storage device.
  • PDA personal digital assistant
  • GPS Global Positioning System
  • Devices suitable for storing computer program instructions and data include non-volatile memory, media and memory devices, including, by way of example, semiconductor memory devices, magnetic disks, and magneto-optical disks.
  • the processor and the memory can be supplemented by, or incorporated in, special-purpose logic circuitry.
  • Mobile devices can include handsets, user equipment (UE), mobile telephones (for example, smartphones), tablets, wearable devices (for example, smart watches and smart eyeglasses), implanted devices within the human body (for example, biosensors, cochlear implants), or other types of mobile devices.
  • the mobile devices can communicate wirelessly (for example, using radio frequency (RF) signals) to various communication networks (described below).
  • RF radio frequency
  • the mobile devices can include sensors for determining characteristics of the mobile device's current environment.
  • the sensors can include cameras, microphones, proximity sensors, GPS sensors, motion sensors, accelerometers, ambient light sensors, moisture sensors, gyroscopes, compasses, barometers, fingerprint sensors, facial recognition systems, RF sensors (for example, Wi-Fi and cellular radios), thermal sensors, or other types of sensors.
  • the cameras can include a forward- or rear-facing camera with movable or fixed lenses, a flash, an image sensor, and an image processor.
  • the camera can be a megapixel camera capable of capturing details for facial and/or iris recognition.
  • the camera along with a data processor and authentication information stored in memory or accessed remotely can form a facial recognition system.
  • the facial recognition system or one-or-more sensors for example, microphones, motion sensors, accelerometers, GPS sensors, or RF sensors, can be used for user authentication.
  • embodiments can be implemented on a computer having a display device and an input device, for example, a liquid crystal display (LCD) or organic light-emitting diode (OLED)/virtual-reality (VR)/augmented-reality (AR) display for displaying information to the user and a touchscreen, keyboard, and a pointing device by which the user can provide input to the computer.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • VR virtual-reality
  • AR pointing device
  • Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, for example, visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input.
  • a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's client device in response
  • Embodiments can be implemented using computing devices interconnected by any form or medium of wireline or wireless digital data communication (or combination thereof), for example, a communication network.
  • interconnected devices are a client and a server generally remote from each other that typically interact through a communication network.
  • a client for example, a mobile device, can carry out transactions itself, with a server, or through a server, for example, performing buy, sell, pay, give, send, or loan transactions, or authorizing the same.
  • Such transactions may be in real time such that an action and a response are temporally proximate; for example an individual perceives the action and the response occurring substantially simultaneously, the time difference for a response following the individual's action is less than 1 millisecond (ms) or less than 1 second (s), or the response is without intentional delay taking into account processing limitations of the system.
  • ms millisecond
  • s 1 second
  • Examples of communication networks include a local area network (LAN), a radio access network (RAN), a metropolitan area network (MAN), and a wide area network (WAN).
  • the communication network can include all or a portion of the Internet, another communication network, or a combination of communication networks.
  • Information can be transmitted on the communication network according to various protocols and standards, including Long Term Evolution (LTE), 5G, IEEE 802, Internet Protocol (IP), or other protocols or combinations of protocols.
  • LTE Long Term Evolution
  • 5G Fifth Generation
  • IEEE 802 Internet Protocol
  • IP Internet Protocol
  • the communication network can transmit voice, video, biometric, or authentication data, or other information between the connected computing devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Digital Computer Display Output (AREA)

Abstract

A prototype of a ListCell is defined using a front end of a hybrid software application. A ListCell template is created based on the prototype of the ListCell. A ListCell is obtained by copying the ListCell template. The ListCell is filled with obtained ListCell content. Display of the ListCell is initiated.

Description

    CROSS-REFERENCE TO RELATED APPLICATIONS
  • This application claims the priority of and is a continuation of U.S. patent application Ser. No. 16/119,224, filed Aug. 31, 2018, which is a continuation of PCT Application No. PCT/CN2017/074178, filed on Feb. 20, 2017, which claims priority to Chinese Patent Application No. 201610116409.9, filed on Mar. 2, 2016, and each application is hereby incorporated by reference in its entirety.
  • TECHNICAL FIELD
  • The present application relates to the computer field, and in particular, to a method and an apparatus reusing a ListCell in a hybrid application.
  • BACKGROUND
  • Hybrid development is developing programs by using both front-end development and native development. The front-end development is developing web pages and web apps based on technologies such as JavaScript, HTML, and CSS. The native development is programming based on native functions of local operating systems of smart devices, such as mobile phones. For example, native interface development based on systems such as iOS and Android. React is a JS framework produced by Facebook, and is a construction system for standardizing front-end development. React Native is launched by Facebook based on React standards, and is a technology implementation framework permitting native applications to be developed by using front-end technologies.
  • Hybrid development is a very popular development mode for current mobile software applications (or APPs). In a hybrid development mode, front-end web page development technology is used to develop interfaces and services, and native development is used to provide native capabilities of various OS, so that an APP can have front-end dynamic capability and a native experience effect.
  • A ListView is the most common presentation form of an APP and it is used to present a page including a list form content, presents a large number of ListCells with the same or similar structure in a list, and usually can support inclusion of various ListCell. The ListCells have basically the same presentation structure, and only information contents to be presented are different. A ListCell is a content presented in each row or each sub cell of the ListView. Because a screen has a limited display area, the screen can present only some ListCell contents of the ListView at the same time. Some of the other ListCells can scroll in the screen display area only by scrolling up and down, and correspondingly, some ListViews scroll out of the display area. Therefore, a number of ListCells that a user can see on the screen is limited. However, in current front-end technology, a front-end needs to trigger a Native framework to create instances and perform rendering for all ListCells. Consequently, computer performance can be wasted by the triggered Native framework. An existing ListView implementation solution on React Native is shown in FIG. 1. Because a ListCell is defined at a front-end layer, a React Native framework can only map an entire structure of a ListView to a native layer. Therefore, if the ListView has 100 ListCells, 100 ListCells are created at the native layer, and the 100 ListCells are arranged and rendered, which consumes both memory (for example, a computer memory) and time.
  • In a list scrolling process, a ListCell that has been moved out of the displayable area can be reused to present a ListCell that is to be moved to the displayable area. As such, memory and time needed for creating and arranging new ListCells can be reduced to improve performance. In current hybrid technology and in ListView development, a structure layout and a ListCell class are defined at the front-end, and the front-end triggers the native layer to create a ListCell instance. Therefore, due to limitations of front-end DOM rendering mechanisms, the native layer may not be able to efficiently reuse the ListCell because reconstructing a DOM can require higher computing costs.
  • In current native development, there are corresponding technologies for reusing ListCells. However, because front-end technology is used to develop pages in the hybrid technology, both a ListView and a ListCell are created at the front-end. If the ListCell is created and reused at the native layer, a ListCell class defined at the front-end cannot be transmitted to the native layer. In other words, an instance cannot be directly created at the native layer for the ListCell class defined by using JavaScript (JS) at the front-end. Therefore, currently, in hybrid development, there is no technology that can be used to reuse a front-end ListCell.
  • SUMMARY
  • An objective of the present application is to provide a method and an apparatus reusing a ListCell in a hybrid application, so as to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in hybrid development.
  • According to an aspect of the present application, a method reusing a ListCell in a hybrid application is provided, where the method includes the following: defining a prototype of a ListCell at a front-end of the hybrid application; and obtaining the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reusing the ListCell.
  • Further, in the method, the defining a prototype of a ListCell includes the following: defining a structure layout and a class of the prototype of the ListCell.
  • Further, in the method, the prototype of the ListCell is a prototype of a single ListCell.
  • Further, in the method, the obtaining the ListCell through copying based on the prototype of the ListCell includes the following: creating a ListCell template based on the prototype of the ListCell; obtaining the ListCell by copying the ListCell template; and filling an obtained ListCell content in the copied ListCell, and displaying the ListCell.
  • Further, in the method, the obtaining the ListCell by copying the ListCell template includes the following: traversing and obtaining all sub-views of the ListCell template; and creating a ListCell that includes all the sub-views and attributes of the sub-views.
  • Further, in the method, the filling an obtained ListCell content in the copied ListCell includes the following: filling the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • Further, in the method, the ListCell content is obtained from the front-end.
  • Further, in the method, during obtaining the ListCell by copying the ListCell template, the number of copied ListCells is determined based on the number of ListCells that can be included and displayed in a display area.
  • Further, in the method, the reusing the ListCell includes the following: recycling a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determining whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, filling the new ListCell content in the reusable ListCell, and displaying the ListCell; or if no, obtaining the ListCell by copying the ListCell template, filling the new ListCell content in the copied ListCell, and displaying the ListCell.
  • According to another aspect of the present application, an apparatus reusing a ListCell in a hybrid application is further provided, where the apparatus includes: a definition apparatus, configured to define a prototype of a ListCell at a front-end of the hybrid application; and a copy and reuse apparatus, configured to obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell.
  • Further, in the apparatus, the definition apparatus is configured to define a structure layout and a class of the prototype of the ListCell.
  • Further, in the apparatus, the prototype of the ListCell is a prototype of a single ListCell.
  • Further, in the apparatus, the copy and reuse apparatus is configured to create a ListCell template based on the prototype of the ListCell, obtain the ListCell by copying the ListCell template, fill an obtained ListCell content in the copied ListCell, and display the ListCell.
  • Further, in the apparatus, the copy and reuse apparatus is configured to traverse and obtain all sub-views of the ListCell template, and create a ListCell that includes all the sub-views and attributes of the sub-views.
  • Further, in the apparatus, the copy and reuse apparatus is configured to fill the obtained ListCell content in each corresponding sub-view of the created ListCell.
  • Further, in the apparatus, the ListCell content is obtained from the front-end.
  • Further, in the apparatus, the copy and reuse apparatus is configured to determine the number of copied ListCells based on the number of ListCells that can be included and displayed in a display area.
  • Further, in the apparatus, the copy and reuse apparatus is configured to recycle a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determine whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, fill the new ListCell content in the reusable ListCell, and display the ListCell; or if no, obtain the ListCell by copying the ListCell template, fill the new ListCell content in the copied ListCell, and display the ListCell.
  • Compared with the existing technology, in the present application, the prototype of the ListCell is defined at the front-end. The prototype of the ListCell is copied at the native end. The native end reuses an invisible ListCell based on a current list presentation location. As such, the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance. The core of the technical solutions of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid application development, so as to reuse the ListCell on a list page and improve rendering and operation performance.
  • BRIEF DESCRIPTION OF DRAWINGS
  • Other features, objectives, and advantages of the present application become more apparent by reading detailed description of the non-limitative implementations with reference to the following accompanying drawings.
  • FIG. 1 shows an implementation of an existing ListView;
  • FIG. 2 is a flowchart illustrating a method reusing a ListCell in a hybrid application, according to an aspect of the present application;
  • FIG. 3 is a principle diagram illustrating an example implementation of the present application;
  • FIG. 4 is a principle diagram illustrating another example implementation of the present application;
  • FIG. 5 is a principle diagram illustrating yet another example implementation of the present application;
  • FIG. 6 is a diagram illustrating modules of an apparatus reusing a ListCell in a hybrid application, according to another aspect of the present application; and
  • FIG. 7 is a flowchart illustrating an example of a computer-implemented method for reusing a ListCell in a hybrid application, according to an implementation of the present disclosure.
  • The same or similar reference numerals in the accompanying drawings represent the same or similar components.
  • DESCRIPTION OF IMPLEMENTATIONS
  • The following describes the implementations of the present application in detail with reference to the accompanying drawings.
  • In a typical configuration of the present application, a terminal device, a service network device, and a trusted party each include one or more central processing units (CPU), an input/output interface, a network interface, and a memory.
  • The memory can include a non-persistent memory, a random access memory (RAM), and/or a nonvolatile memory in a computer readable medium, for example, a read-only memory (ROM) or a flash memory (flash RAM). The memory is an example of the computer readable medium.
  • The computer readable medium includes persistent, non-persistent, movable, and unmovable media that can implement information storage by using any method or technology. Information can be a computer readable instruction, a data structure, a program module, or other data. An example of a computer storage medium includes but is not limited to a phase change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a random access memory (RAM) of another type, a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory or another memory technology, a compact disc read-only memory (CD-ROM), a digital versatile disc (DVD) or other optical storage, a cassette magnetic tape, a tape and disk storage or another magnetic storage device, or any other non-transmission media. The computer storage medium can be configured to store information that can be accessed by a computing device. As described in the present specification, the computer readable medium does not include a non-transitory computer readable medium such as a modulated data signal and a carrier.
  • As shown in FIG. 2, according to an aspect of the present application, a method reusing a ListCell in a hybrid application is provided. The method includes the following steps.
  • Step S1: Define a prototype of a ListCell at a front-end of the hybrid application.
  • Step S2: Obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell. In the present application, the prototype (a parent) of the ListCell is defined at the front-end. The prototype of the ListCell is copied (cloned) at the native end (Native). The native end reuses an invisible ListCell based on a current list presentation location. As such, the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance. The core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid development. As such, the ListCell can be reused on a list page to improve the rendering and operation performance. The present application is applicable to all hybrid APP developments, and has a very good implementation effect in a React Native framework.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, step S1 of defining a prototype of a ListCell includes the following: defining a structure layout and a class of the prototype of the ListCell. Here, defining a prototype of a ListCell includes defining a structure and a class of the ListCell. As such, the ListCell can be flexibly defined at the front-end in the hybrid development.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, the prototype of the ListCell is a prototype of a single ListCell. Here, only one instance (that is, the prototype of the ListCell) is created at a front-end layer. Subsequently, a ListCell template can be created at the native end only based on the prototype. Then the ListCell template is copied as needed. As such, memory and time needed for creating and arranging new ListCells can be reduced to improve computing performance.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, obtaining the ListCell through copying based on the prototype of the ListCell includes the following: creating a ListCell template based on the prototype of the ListCell; obtaining the ListCell by copying the ListCell template; and filling an obtained ListCell content in the copied ListCell, and displaying the ListCell. Here, as shown in FIG. 3, the ListCell template, that is, a ListCell prototype instance in the figure, is created at the native end only based on the prototype defined at the front-end. Then, the ListCell template is copied based on the number of ListCell contents that need to be displayed to obtain the corresponding number of ListCells. Then the ListCell contents, that is, ListCell data 1 to n in FIG. 3, are respectively filled in the corresponding ListCells for rendering and displaying. As such, the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, obtaining the ListCell by copying the ListCell template includes the following: traversing and obtaining all sub-views of the ListCell template; and creating a ListCell that includes all the sub-views and attributes of the sub-views. Here, all the sub-views (view) of the ListCell template are recursively traversed, and then a ListCell is obtained through copying to include all the sub-views and the attributes corresponding to the sub-views. As such, the ListCell can be accurately copied. As shown in FIG. 4, the ListCell template, that is, sub-views of a ListCell prototype in FIG. 4, includes A, B, C, D, and E. Copying the ListCell prototype is a process of creating a ListCell that includes all the sub-views of the ListCell prototype and attributes of the sub-views. Sub-views of the obtained ListCell include A′, B′, C′, D′, and E′.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, filling an obtained ListCell content in the copied ListCell includes the following: filling the obtained ListCell content in each corresponding sub-view of the created ListCell. Here, the ListCell content can be filled in each corresponding sub-view of the copied ListCell based on the ListCell content. As such, the ListCell content can be accurately displayed at a corresponding location in the ListCell. As shown in FIG. 4, in the present implementation, the ListCell contents, that is, content data in FIG. 4, are respectively filled in the corresponding sub-views A′, B′, C′, D′, and E′ of the copied ListCell.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, the ListCell content is obtained from the front-end. Here, as shown in FIG. 3, in addition to defining the prototype of the ListCell, the front-end only needs to transmit the ListCell content, that is, the ListCell data in FIG. 3, to the native end. As such, memory and time consumed for front-end data processing can be reduced.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, during obtaining the ListCell by copying the ListCell template, the number of copied ListCells is determined based on the number of ListCells that can be included and displayed in a display area. Here, especially when a ListCell is displayed in the display area for the first time, because there is no reusable ListCell yet, the corresponding number of ListCells need to be obtained through copying based on the number of ListCells that can be included and displayed in the display area. For example, in FIG. 3, the corresponding number of ListCells is determined to be generated based on the number of ListCells that can be displayed on one screen. As such, the ListCell can be copied as needed, and the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance. For example, 10 ListCell contents need to be displayed, and a display area can include and display 10 ListCells. In this case, 10 ListCells need to be copied.
  • In an example implementation of the method reusing a ListCell in a hybrid application in the present application, the reusing the ListCell includes the following: recycling a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determining whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, filling the new ListCell content in the reusable ListCell, and displaying the ListCell; or if no, obtaining the ListCell by copying the ListCell template, filling the new ListCell content in the copied ListCell, and displaying the ListCell. Here, as shown in FIG. 3, especially when a ListCell is displayed in the display area for the first time, because there may already be a reusable ListCell at this time, the reusable ListCell can be used when a new ListCell content is displayed, that is, the ListCells in the display area are cyclically reused and moved in a list scrolling process. As such, the memory and time needed for creating and arranging new ListCells can be further reduced to improve the performance. Certainly, if there is no reusable ListCell, the ListCell template needs to be copied based on the new ListCell content to obtain a corresponding data ListCell. For example, 15 ListCell contents need to be displayed, and a display area can include and display 10 ListCells. In this case, 10 ListCells need to be copied in the first time of displaying, to display 10 ListCell contents. Five corresponding ListCell contents that have been displayed are moved out of the display area when the other five ListCell contents need to be moved to the display area for displaying. The five ListCells that are moved out of the display area can be recycled as reusable ListCells. Then, the five reusable ListCells can be reused for the other five ListCell contents.
  • As shown in FIG. 5, to better understand the principles and procedures of the present application, a hybrid framework (React Native) is used as an example to explain the implementation principles and procedures of the present application, which are as follows:
  • Step S51: A front-end layer defines a structure and a class of a ListCell.
  • Step S52: The front-end layer obtains list content data, that is, a ListCell content.
  • Step S53: The front-end layer creates a ListCell prototype based on the defined structure and class of the ListCell, transmits the list content data to a native end, and then goes to step S56.
  • Step S56: A native-end layer creates a ListCell prototype instance, that is, a ListCell template, based on the ListCell prototype created by the front-end layer.
  • Step S57: The native end determines that a new ListCell is to be moved to a display area, and goes to step S58.
  • Step S62 is performed at the same time as step S57: The native end determines that a ListCell is to be moved out of the display area, and goes to step S63.
  • Step S63: The native end uses the ListCell that is in the mobile display area as a reusable ListCell, and then goes to step S58.
  • Step S58: The native end determines whether there is a reusable ListCell.
  • If yes, step S59 is performed: The native end directly reuses the reusable ListCell, and then goes to step S61. Here, the native end determines ListCells that can be reused based on the number of ListCells that can be included and displayed in the displayable area.
  • If no, step S60 is performed: The native end copies a ListCell from the ListCell prototype instance based on the list content data, and then goes to step S61. Here, the native end copies other ListCells based on the list content data transmitted from the front-end layer.
  • Step S61: Render the ListCell, and then go to step S54.
  • Step S54: A front-end layer user scrolls a list.
  • Step S55: After triggering refreshing, the front-end layer goes to step S53. In this case, the ListCell prototype does not need to be created again, and only refreshed content data of the list is transmitted to the native end, that is, new list content data to be displayed.
  • As shown in FIG. 6, according to another aspect of the present application, an apparatus reusing a ListCell in a hybrid application is further provided. The apparatus 100 includes: a definition apparatus 1, configured to define a prototype of a ListCell at a front-end of the hybrid application; and a copy and reuse apparatus 2, configured to obtain the ListCell through copying at a native end of the hybrid application based on the prototype of the ListCell, and reuse the ListCell. In the present application, the prototype of the ListCell is defined at the front-end. The prototype of the ListCell is copied at a native end (Native). The native end reuses an invisible ListCell based on a current list presentation location. As such, the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance. The core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid development. As such, the ListCell can be reused on a list page to improve the rendering and operation performance. The present application is applicable to all hybrid APP developments, and has a very good implementation effect in a React Native framework.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the definition apparatus 1 is configured to define a structure layout and a class of the prototype of the ListCell. Here, defining a prototype of a ListCell includes defining a structure and a class of the ListCell. As such, the ListCell can be flexibly defined at the front-end in the hybrid development.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the prototype of the ListCell is a prototype of a single ListCell. Here, only one instance (that is, the prototype of the ListCell) is created at a front-end layer. Subsequently, a ListCell template can be created at the native end only based on the prototype. Then the ListCell template is copied as needed. As such, memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the copy and reuse apparatus 2 is configured to create a ListCell template based on the prototype of the ListCell, obtain a ListCell by copying the ListCell template, fill an obtained ListCell content in the copied ListCell, and display the ListCell. Here, as shown in FIG. 3, the ListCell template, that is, a ListCell prototype instance in the figure, is created at the native end only based on the prototype defined at the front-end. Then the ListCell template is copied based on the number of ListCell contents that need to be displayed, to obtain the corresponding number of ListCells. Then the ListCell contents, that is, ListCell data 1 to n in FIG. 3, are respectively filled in the corresponding ListCells for rendering and displaying. As such, the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the copy and reuse apparatus 2 is configured to traverse and obtain all sub-views of the ListCell template, and create a ListCell that includes all the sub-views and attributes of the sub-views. Here, all the sub-views (view) of the ListCell template are recursively traversed, and then a ListCell is obtained through copying to include all the sub-views and the attributes corresponding to the sub-views. As such, the ListCell can be accurately copied. As shown in FIG. 4, the ListCell template, that is, sub-views of a ListCell prototype in FIG. 4, includes A, B, C, D, and E. Copying the ListCell prototype is a process of creating a ListCell that includes all the sub-views of the ListCell prototype and attributes of the sub-views. Sub-views of the obtained ListCell include A′, B′, C′, D′, and E′.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the copy and reuse apparatus 2 is configured to fill the obtained ListCell content in each corresponding sub-view of the created ListCell. Here, the ListCell content can be filled in each corresponding sub-view of the copied ListCell based on the ListCell content. As such, the ListCell content can be accurately displayed at a corresponding location in the ListCell. As shown in FIG. 4, in the present implementation, the ListCell contents, that is, content data in FIG. 4, are respectively filled in the corresponding sub-views A′, B′, C′, D′, and E′ of the copied ListCell.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the ListCell content is obtained from the front-end. Here, as shown in FIG. 3, in addition to defining the prototype of the ListCell, the front-end only needs to transmit the ListCell content, that is, the ListCell data in FIG. 3, to the native end. As such, memory and time consumed for front-end data processing can be reduced.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the copy and reuse apparatus 2 is configured to determine the number of copied ListCells based on the number of ListCells that can be included and displayed in a display area. Here, especially when a ListCell is displayed in the display area for the first time, because there is no reusable ListCell yet, the corresponding number of ListCells need to be obtained through copying based on the number of ListCells that can be included and displayed in the display area. For example, in FIG. 3, the corresponding number of ListCells is determined to be generated based on the number of ListCells that can be displayed on one screen. As such, the ListCell can be copied as needed, and the memory and time needed for creating and arranging new ListCells can be reduced to improve the performance. For example, 10 ListCell contents need to be displayed, and a display area can include and display 10 ListCells. In this case, 10 ListCells need to be copied.
  • In an example implementation of the apparatus reusing a ListCell in a hybrid application in the present application, the copy and reuse apparatus 2 is configured to recycle a ListCell including the moved-out ListCell content as a reusable ListCell when a ListCell content is moved out of the display area; determine whether there is a reusable ListCell when a new ListCell content is to be moved to the display area; and if yes, fill the new ListCell content in the reusable ListCell, and display the ListCell; or if no, obtain the ListCell by copying the ListCell template, fill the new ListCell content in the copied ListCell, and display the ListCell. Here, as shown in FIG. 3, especially when a ListCell is displayed in the display area for the first time, because there may already be a reusable ListCell at this time, the reusable ListCell can be used when a new ListCell content is displayed, that is, the ListCells in the display area are cyclically reused and moved in a list scrolling process. As such, the memory and time needed for creating and arranging new ListCells can be further reduced to improve the performance. Certainly, if there is no reusable ListCell, the ListCell template needs to be copied based on the new ListCell content to obtain a corresponding data ListCell. For example, 15 ListCell contents need to be displayed, and a display area can include and display 10 ListCells. In this case, 10 ListCells need to be copied in the first time of displaying, to display 10 ListCell contents. Five corresponding ListCell contents that have been displayed are moved out of the display area when the other five ListCell contents need to be moved to the display area for displaying. The five ListCells that are moved out of the display area can be recycled as reusable ListCells. The five reusable ListCells can be reused for the other five ListCell contents.
  • In conclusion, in the present application, the prototype of the ListCell is defined at the front-end. The prototype of the ListCell is copied at the native end. The native end reuses an invisible ListCell based on a current list presentation location. As such, the prototype of the ListCell can be defined at the front-end, and the ListCell can be freely created, rendered, and reused at the native end. Therefore, not only the flexibility of defining the ListCell in the hybrid development can be reserved, but also the ListCell can be reused at the native end, thereby greatly improving the large-list presentation and operation performance. The core of the technical solution of the present application is to resolve the problem that a structure and a class of a ListCell are defined at a front-end but the ListCell is created and reused at a native end in the hybrid application development, so as to reuse the ListCell on a list page and improve rendering and operation performance.
  • Apparently, a person skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. The present application is intended to cover these modifications and variations of the present application provided that they fall within the scope of protection defined by the following claims and their equivalent technologies.
  • It is worthwhile to note that the present application can be implemented in software and/or a combination of software and hardware. For example, the present application can be implemented by using an application-specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device. In an implementation, a software program in the present application can be executed by a processor, so as to implement the previous steps and functions. Similarly, the software program in the present application (including a related data structure) can be stored in a computer readable recording medium, for example, a RAM memory, a magnetic or optical drive, or a floppy disk and a similar device. In addition, some steps or functions in the present application can be implemented by using hardware, for example, a circuit that cooperates with the processor to execute the steps or the functions.
  • In addition, a part of the present application can be implemented as a computer program product, such as a computer program instruction. When the computer program instruction is executed by a computer, the methods and/or the technical solutions based on the present application can be invoked or provided by using operations of the computer. In addition, the program instruction for invoking the method in the present application can be stored in a fixed or removable recording medium, and/or is transmitted by using broadcast or a data flow in other signal bearer media, and/or is stored in an operating memory of a computer device that operates based on the program instruction. Here, an implementation according to the present application includes an apparatus, and the apparatus includes a memory configured to store a computer program instruction and a processor configured to execute the program instruction. When the computer program instruction is executed by the processor, the computer program instruction triggers the apparatus to operate based on the preceding methods and/or technical solutions in a plurality of implementations according to the present application.
  • It is apparent to a person skilled in the art that the present application is not limited to the details of the previous example implementations, and the present application can be implemented in another specific form without departing from the spirit or essential feature of the present application. Therefore, the implementations should be considered as illustrative and not restrictive in every aspect, and the scope of the present application is limited by the appended claims, rather than the above description. Therefore, the present application covers all changes within the meaning and the scope of the equivalent elements of the claims. Any reference numeral in the claims should not be considered as a limitation on the related claims. In addition, it is clear that the word “include” does not exclude another unit or step, and the singular does not exclude the plural. A plurality of units or apparatuses described in the apparatus claims can also be implemented by one unit or apparatus by using software or hardware. The words such as “first” and “second” are used to indicate names instead of any particular order.
  • FIG. 7 is a flowchart illustrating an example of a computer-implemented method 700 for reusing a ListCell in a hybrid application, according to an implementation of the present disclosure. For clarity of presentation, the description that follows generally describes method 700 in the context of the other figures in this description. However, it will be understood that method 700 can be performed, for example, by any system, environment, software, and hardware, or a combination of systems, environments, software, and hardware, as appropriate. In some implementations, various steps of method 700 can be run in parallel, in combination, in loops, or in any order.
  • At 702, a prototype of a ListCell is defined using a front end of a hybrid software application. In some implementations, defining the prototype of the ListCell includes defining a structure layout and a class of the prototype of the ListCell. In some implementations, the prototype of the ListCell is a prototype of a single ListCell. From 702, method 700 proceeds to 704.
  • At 704, a ListCell template is created based on the prototype of the ListCell. From 704, method 700 proceeds to 706.
  • At 706, a ListCell is obtained by copying the ListCell template. In some implementations, the ListCell template is copied at a native end of the hybrid software application. In some implementations, obtaining the ListCell comprises: traversing and obtaining all sub-views of the ListCell template and creating a ListCell that comprises all the sub-views and attributes of the sub-views. In some implementations, during obtaining the ListCell by copying the ListCell template, a number of copied ListCells is determined based on a number of ListCells that can be displayed in a computer display area. From 706, method 700 proceeds to 708.
  • At 708, the ListCell is filled with obtained ListCell content. In some implementations, filling the ListCell includes filling the obtained ListCell content in each corresponding sub-view of the created ListCell. In some implementations, the obtained ListCell content is obtained from the front end of the hybrid software application. From 708, method 700 proceeds to 710. At 710, display of the ListCell is initiated. After 710, method 700 stops.
  • In some implementations, the ListCell is reused, where reusing the ListCell includes: 1) recycling a ListCell as a reusable ListCell by removing the ListCell content from the reusable ListCell when the ListCell content of the reusable ListCell is moved out of the computer display area and 2) determining whether there is a reusable ListCell when new ListCell content is to be moved to the computer display area. If it is determined that there is a reusable ListCell, the reusable ListCell is filled with the new ListCell content and displaying the reusable ListCell. Otherwise, if it is determined that there is not a reusable ListCell a new ListCell is obtained by copying the ListCell template, filling the new ListCell with the new ListCell content, and displaying the new ListCell.
  • Embodiments and the operations described in this specification can be implemented in digital electronic circuitry, or in computer software, firmware, or hardware, including the structures disclosed in this specification or in combinations of one or more of them. The operations can be implemented as operations performed by a data processing apparatus on data stored on one or more computer-readable storage devices or received from other sources. A data processing apparatus, computer, or computing device may encompass apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, a system on a chip, or multiple ones, or combinations, of the foregoing. The apparatus can include special purpose logic circuitry, for example, a central processing unit (CPU), a field programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). The apparatus can also include code that creates an execution environment for the computer program in question, for example, code that constitutes processor firmware, a protocol stack, a database management system, an operating system (for example an operating system or a combination of operating systems), a cross-platform runtime environment, a virtual machine, or a combination of one or more of them. The apparatus and execution environment can realize various different computing model infrastructures, such as web services, distributed computing and grid computing infrastructures.
  • A computer program (also known, for example, as a program, software, software application, software module, software unit, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, object, or other unit suitable for use in a computing environment. A program can be stored in a portion of a file that holds other programs or data (for example, one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (for example, files that store one or more modules, sub-programs, or portions of code). A computer program can be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.
  • Processors for execution of a computer program include, by way of example, both general- and special-purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random-access memory or both. The essential elements of a computer are a processor for performing actions in accordance with instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data. A computer can be embedded in another device, for example, a mobile device, a personal digital assistant (PDA), a game console, a Global Positioning System (GPS) receiver, or a portable storage device. Devices suitable for storing computer program instructions and data include non-volatile memory, media and memory devices, including, by way of example, semiconductor memory devices, magnetic disks, and magneto-optical disks. The processor and the memory can be supplemented by, or incorporated in, special-purpose logic circuitry.
  • Mobile devices can include handsets, user equipment (UE), mobile telephones (for example, smartphones), tablets, wearable devices (for example, smart watches and smart eyeglasses), implanted devices within the human body (for example, biosensors, cochlear implants), or other types of mobile devices. The mobile devices can communicate wirelessly (for example, using radio frequency (RF) signals) to various communication networks (described below). The mobile devices can include sensors for determining characteristics of the mobile device's current environment. The sensors can include cameras, microphones, proximity sensors, GPS sensors, motion sensors, accelerometers, ambient light sensors, moisture sensors, gyroscopes, compasses, barometers, fingerprint sensors, facial recognition systems, RF sensors (for example, Wi-Fi and cellular radios), thermal sensors, or other types of sensors. For example, the cameras can include a forward- or rear-facing camera with movable or fixed lenses, a flash, an image sensor, and an image processor. The camera can be a megapixel camera capable of capturing details for facial and/or iris recognition. The camera along with a data processor and authentication information stored in memory or accessed remotely can form a facial recognition system. The facial recognition system or one-or-more sensors, for example, microphones, motion sensors, accelerometers, GPS sensors, or RF sensors, can be used for user authentication.
  • To provide for interaction with a user, embodiments can be implemented on a computer having a display device and an input device, for example, a liquid crystal display (LCD) or organic light-emitting diode (OLED)/virtual-reality (VR)/augmented-reality (AR) display for displaying information to the user and a touchscreen, keyboard, and a pointing device by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, for example, visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's client device in response to requests received from the web browser.
  • Embodiments can be implemented using computing devices interconnected by any form or medium of wireline or wireless digital data communication (or combination thereof), for example, a communication network. Examples of interconnected devices are a client and a server generally remote from each other that typically interact through a communication network. A client, for example, a mobile device, can carry out transactions itself, with a server, or through a server, for example, performing buy, sell, pay, give, send, or loan transactions, or authorizing the same. Such transactions may be in real time such that an action and a response are temporally proximate; for example an individual perceives the action and the response occurring substantially simultaneously, the time difference for a response following the individual's action is less than 1 millisecond (ms) or less than 1 second (s), or the response is without intentional delay taking into account processing limitations of the system.
  • Examples of communication networks include a local area network (LAN), a radio access network (RAN), a metropolitan area network (MAN), and a wide area network (WAN). The communication network can include all or a portion of the Internet, another communication network, or a combination of communication networks. Information can be transmitted on the communication network according to various protocols and standards, including Long Term Evolution (LTE), 5G, IEEE 802, Internet Protocol (IP), or other protocols or combinations of protocols. The communication network can transmit voice, video, biometric, or authentication data, or other information between the connected computing devices.
  • Features described as separate implementations may be implemented, in combination, in a single implementation, while features described as a single implementation may be implemented in multiple implementations, separately, or in any suitable sub-combination. Operations described and claimed in a particular order should not be understood as requiring that the particular order, nor that all illustrated operations must be performed (some operations can be optional). As appropriate, multitasking or parallel-processing (or a combination of multitasking and parallel-processing) can be performed.

Claims (20)

1. A computer-implemented method, comprising:
defining, by a front end layer of a hybrid software application, a structure and a class of a ListCell;
obtaining, by the front end layer, first content data;
creating, by the front end layer, a prototype of the ListCell based on the structure and the class of the ListCell;
transmitting, by the front end layer, the first content data to a native layer of the hybrid software application, wherein the native layer creates a ListCell template based on the prototype of the ListCell created by the front end layer, obtains a ListCell by copying the ListCell template, fills the ListCell with the first content data, and displays the ListCell that is filled with the first content data;
receiving, by the front end layer, a refresh trigger; and
in response to receiving the refresh trigger, transmitting, by the front end layer, second content data to the native layer, wherein the native layer resuses the ListCell and displays the ListCell filled with the second content data.
2. The computer-implemented method of claim 1, wherein receiving, by the front end layer, the refresh trigger comprises:
scrolling a list displayed in a computer display area by a user of the front end layer; and
determining, by the front end layer, second content data based on an updated list displayed in the computer display area after scrolling.
3. The computer-implemented method of claim 1, wherein obtaining the ListCell by copying the ListCell template comprises:
traversing and obtaining all sub-views of the ListCell template; and
creating a ListCell that comprises all the sub-views and attributes of the sub-views.
4. The computer-implemented method of claim 3, wherein filling the ListCell with the first content data comprises filling the first content data in each corresponding sub-view of the created ListCell.
5. The computer-implemented method of claim 1, comprising, during obtaining the ListCell by copying the ListCell template, a number of copied ListCells is determined based on a number of ListCells that can be displayed in a computer display area.
6. The computer-implemented method of claim 1, wherein the prototype of the ListCell is a prototype of a single ListCell.
7. The computer-implemented method of claim 1, further comprising:
determining, by the native layer, that a new ListCell is to be moved to a computer display area; or determining, by the native layer, that a ListCell is to be moved out of the computer display area; and
in response, reusing, by the native layer, the ListCell that is in the computer display area as a reusable ListCell.
8. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
defining, by a front end layer of a hybrid software application, a structure and a class of a ListCell;
obtaining, by the front end layer, first content data;
creating, by the front end layer, a prototype of the ListCell based on the structure and the class of the ListCell;
transmitting, by the front end layer, the first content data to a native layer of the hybrid software application, wherein the native layer creates a ListCell template based on the prototype of the ListCell created by the front end layer, obtains a ListCell by copying the ListCell template, fills the ListCell with the first content data, and displays the ListCell that is filled with the first content data;
receiving, by the front end layer, a refresh trigger; and
in response to receiving the refresh trigger, transmitting, by the front end layer, second content data to the native layer, wherein the native layer resuses the ListCell and displays the ListCell filled with the second content data.
9. The non-transitory, computer-readable medium of claim 8, wherein receiving, by the front end layer, the refresh trigger comprises:
scrolling a list displayed in a computer display area by a user of the front end layer; and
determining, by the front end layer, second content data based on an updated list displayed in the computer display area after scrolling.
10. The non-transitory, computer-readable medium of claim 8, wherein obtaining the ListCell by copying the ListCell template comprises:
traversing and obtaining all sub-views of the ListCell template; and
creating a ListCell that comprises all the sub-views and attributes of the sub-views.
11. The non-transitory, computer-readable medium of claim 10, wherein filling the ListCell with the first content data comprises filling the first content data in each corresponding sub-view of the created ListCell.
12. The non-transitory, computer-readable medium of claim 8, comprising, during obtaining the ListCell by copying the ListCell template, a number of copied ListCells is determined based on a number of ListCells that can be displayed in a computer display area.
13. The non-transitory, computer-readable medium of claim 8, wherein the prototype of the ListCell is a prototype of a single ListCell.
14. The non-transitory, computer-readable medium of claim 8, the operations further comprise:
determining, by the native layer, that a new ListCell is to be moved to a computer display area; or determining, by the native layer, that a ListCell is to be moved out of the computer display area; and
in response, reusing, by the native layer, the ListCell that is in the computer display area as a reusable ListCell.
15. A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising:
defining, by a front end layer of a hybrid software application, a structure and a class of a ListCell;
obtaining, by the front end layer, first content data;
creating, by the front end layer, a prototype of the ListCell based on the structure and the class of the ListCell;
transmitting, by the front end layer, the first content data to a native layer of the hybrid software application, wherein the native layer creates a ListCell template based on the prototype of the ListCell created by the front end layer, obtains a ListCell by copying the ListCell template, fills the ListCell with the first content data, and displays the ListCell that is filled with the first content data;
receiving, by the front end layer, a refresh trigger; and
in response to receiving the refresh trigger, transmitting, by the front end layer, second content data to the native layer, wherein the native layer resuses the ListCell and displays the ListCell filled with the second content data.
16. The computer-implemented system of claim 15, wherein receiving, by the front end layer, the refresh trigger comprises:
scrolling a list displayed in a computer display area by a user of the front end layer; and
determining, by the front end layer, second content data based on an updated list displayed in the computer display area after scrolling.
17. The computer-implemented system of claim 15, wherein obtaining the ListCell by copying the ListCell template comprises:
traversing and obtaining all sub-views of the ListCell template; and
creating a ListCell that comprises all the sub-views and attributes of the sub-views.
18. The computer-implemented system of claim 17, wherein filling the ListCell with the first content data comprises filling the first content data in each corresponding sub-view of the created ListCell.
19. The computer-implemented system of claim 15, comprising, during obtaining the ListCell by copying the ListCell template, a number of copied ListCells is determined based on a number of ListCells that can be displayed in a computer display area.
20. The computer-implemented system of claim 15, wherein the prototype of the ListCell is a prototype of a single ListCell.
US16/904,031 2016-03-02 2020-06-17 Method and apparatus reusing ListCell in hybrid application Active US10789051B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/904,031 US10789051B1 (en) 2016-03-02 2020-06-17 Method and apparatus reusing ListCell in hybrid application

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
CN201610116409.9A CN107153528A (en) 2016-03-02 2016-03-02 The method and apparatus that mixed model list items are reused
CN201610116409.9 2016-03-02
CN201610116409 2016-03-02
PCT/CN2017/074178 WO2017148298A1 (en) 2016-03-02 2017-02-20 Method and apparatus reusing list cell in hybrid application
US16/119,224 US10691427B2 (en) 2016-03-02 2018-08-31 Method and apparatus reusing listcell in hybrid application
US16/904,031 US10789051B1 (en) 2016-03-02 2020-06-17 Method and apparatus reusing ListCell in hybrid application

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US16/119,224 Continuation US10691427B2 (en) 2016-03-02 2018-08-31 Method and apparatus reusing listcell in hybrid application

Publications (2)

Publication Number Publication Date
US10789051B1 US10789051B1 (en) 2020-09-29
US20200319858A1 true US20200319858A1 (en) 2020-10-08

Family

ID=59743462

Family Applications (2)

Application Number Title Priority Date Filing Date
US16/119,224 Active US10691427B2 (en) 2016-03-02 2018-08-31 Method and apparatus reusing listcell in hybrid application
US16/904,031 Active US10789051B1 (en) 2016-03-02 2020-06-17 Method and apparatus reusing ListCell in hybrid application

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US16/119,224 Active US10691427B2 (en) 2016-03-02 2018-08-31 Method and apparatus reusing listcell in hybrid application

Country Status (10)

Country Link
US (2) US10691427B2 (en)
EP (1) EP3425526B1 (en)
JP (1) JP6941617B2 (en)
KR (1) KR102127063B1 (en)
CN (1) CN107153528A (en)
MY (1) MY193879A (en)
PH (1) PH12018501836A1 (en)
SG (1) SG11201807357WA (en)
TW (1) TWI697790B (en)
WO (1) WO2017148298A1 (en)

Families Citing this family (12)

* 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
CN110020308A (en) * 2017-12-01 2019-07-16 北京高德云图科技有限公司 The method and device of cell component load
CN108023960B (en) * 2017-12-08 2019-05-21 百度在线网络技术(北京)有限公司 The method for constructing the device and the push of Feed stream information of Feed stream application
CN108744514B (en) * 2018-05-18 2021-08-06 腾讯科技(深圳)有限公司 Sliding list generation method, data display device and storage medium
CN110688114B (en) * 2018-07-05 2022-11-11 武汉斗鱼网络科技有限公司 Method, storage medium, device and system for bridging native list views
CN109614194B (en) * 2018-12-11 2020-06-30 北京微播视界科技有限公司 List interface display method, device, equipment and storage medium
CN109683939B (en) * 2018-12-29 2023-05-02 北京小米移动软件有限公司 Component object updating method, device and storage medium
CN109871523A (en) * 2019-01-31 2019-06-11 成都摹客科技有限公司 A kind of Method of Creation Process and system of the unit cell based on prototype tool
CN109871254A (en) * 2019-01-31 2019-06-11 成都摹客科技有限公司 A kind of creation method and system of the unit cell of separable prototype tool
CN110347327B (en) * 2019-07-12 2021-03-23 网易(杭州)网络有限公司 Item editing method and touch terminal
CN111240672A (en) * 2020-01-02 2020-06-05 广州虎牙科技有限公司 List implementation method and device, electronic equipment and readable storage medium
CN111857718B (en) * 2020-07-29 2024-04-09 网易(杭州)网络有限公司 List editing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288501A1 (en) * 2000-12-29 2007-12-13 Julio Estrada Method and system for importing HTML forms
US10691427B2 (en) * 2016-03-02 2020-06-23 Alibab Group Holding Limited Method and apparatus reusing listcell in hybrid application

Family Cites Families (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5485600A (en) * 1992-11-09 1996-01-16 Virtual Prototypes, Inc. Computer modelling system and method for specifying the behavior of graphical operator interfaces
US6009251A (en) * 1997-09-30 1999-12-28 Synopsys, Inc. Method and system for layout verification of an integrated circuit design with reusable subdesigns
US7421648B1 (en) * 1999-05-21 2008-09-02 E-Numerate Solutions, Inc. Reusable data markup language
JP4136271B2 (en) * 2000-05-16 2008-08-20 住友電気工業株式会社 Application server system
US20130024812A1 (en) * 2011-07-13 2013-01-24 Z124 Foreground/background assortment of hidden windows
US8219900B2 (en) * 2006-07-07 2012-07-10 International Business Machines Corporation Programmatically hiding and displaying Wiki page layout sections
US9019300B2 (en) * 2006-08-04 2015-04-28 Apple Inc. Framework for graphics animation and compositing operations
US8621652B2 (en) * 2007-09-17 2013-12-31 Metabyte Inc. Copying a web element with reassigned permissions
US7853905B1 (en) * 2007-12-27 2010-12-14 Cadence Design Systems, Inc. Performing early DFT-aware prototyping of a design
US20100031152A1 (en) * 2008-07-31 2010-02-04 Microsoft Corporation Creation and Navigation of Infinite Canvas Presentation
US20100153866A1 (en) * 2008-12-11 2010-06-17 Accenture Global Services Gmbh Method and system for modifying the execution of a native application running on a portable electronic device
US8661147B2 (en) 2008-12-12 2014-02-25 At&T Intellectual Property I, L.P. Monitoring requested content
US8494824B2 (en) * 2009-02-16 2013-07-23 The Boeing Company Methods and apparatus for integrating engineering models from disparate tools in support of model reuse
US20110202871A1 (en) * 2010-02-17 2011-08-18 Oracle International Corporation Method and system for scrolling through a graphical user interface list control
US8645491B2 (en) * 2010-12-18 2014-02-04 Qualcomm Incorporated Methods and apparatus for enabling a hybrid web and native application
JP5276145B2 (en) * 2011-06-13 2013-08-28 株式会社ソニー・コンピュータエンタテインメント List display device
US20140089786A1 (en) * 2012-06-01 2014-03-27 Atiq Hashmi Automated Processor For Web Content To Mobile-Optimized Content Transformation
KR101456505B1 (en) * 2012-08-06 2014-10-31 인크로스 주식회사 A user interface framework for developing web applications
KR101456507B1 (en) * 2012-08-13 2014-10-31 인크로스 주식회사 An authoring apparatus for applying n-screen to web application ui and the method for the same
US10410257B1 (en) * 2012-12-18 2019-09-10 Nativo, Inc. Native online ad creation
CN103164839B (en) * 2013-03-07 2019-06-21 华为技术有限公司 A kind of drawing practice, device and terminal
US9760964B2 (en) * 2013-04-11 2017-09-12 Facebook, Inc. Application-tailored object re-use and recycling
CN103279382B (en) * 2013-04-27 2016-12-28 北京微云即趣科技有限公司 Primary mode accesses the method for resource, Java end, primary end and system
CN104216909B (en) * 2013-06-04 2018-10-02 腾讯科技(深圳)有限公司 Web data processing method and processing unit
CN103336816B (en) * 2013-06-28 2017-02-08 广州市动景计算机科技有限公司 Canvas element rendering method and device realized on Android system based on GPU (Graphic Processing Unit)
CN103530018B (en) * 2013-09-27 2017-07-28 深圳天珑无线科技有限公司 The method for building up and mobile terminal at widget interface in Android operation system
CN103995884A (en) * 2014-05-29 2014-08-20 北京中电普华信息技术有限公司 Hybrid application page switching method and system
KR101588592B1 (en) * 2014-08-22 2016-02-12 (주)비원이즈 Hybrid application development system based on object relational mapping and the method thereof
CN104267934B (en) * 2014-09-10 2017-12-29 北京金山安全软件有限公司 Information display method and device and mobile terminal
CN104238881A (en) * 2014-09-10 2014-12-24 北京金山安全软件有限公司 Terminal information display method and device and terminal
CN104572098B (en) * 2014-12-30 2018-10-12 北京奇虎科技有限公司 A kind of update method and device of mobile terminal pages table
CN104965914A (en) * 2015-07-06 2015-10-07 无锡天脉聚源传媒科技有限公司 Page display method and apparatus
CN105117154A (en) * 2015-08-07 2015-12-02 上海斐讯数据通信技术有限公司 Application method of Android list view component

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288501A1 (en) * 2000-12-29 2007-12-13 Julio Estrada Method and system for importing HTML forms
US10691427B2 (en) * 2016-03-02 2020-06-23 Alibab Group Holding Limited Method and apparatus reusing listcell in hybrid application

Also Published As

Publication number Publication date
TW201732640A (en) 2017-09-16
KR20180116423A (en) 2018-10-24
EP3425526B1 (en) 2021-08-04
JP6941617B2 (en) 2021-09-29
KR102127063B1 (en) 2020-06-26
US20180364990A1 (en) 2018-12-20
EP3425526A1 (en) 2019-01-09
MY193879A (en) 2022-10-30
JP2019510309A (en) 2019-04-11
US10691427B2 (en) 2020-06-23
PH12018501836A1 (en) 2019-05-15
WO2017148298A1 (en) 2017-09-08
EP3425526A4 (en) 2019-08-28
US10789051B1 (en) 2020-09-29
TWI697790B (en) 2020-07-01
CN107153528A (en) 2017-09-12
SG11201807357WA (en) 2018-09-27

Similar Documents

Publication Publication Date Title
US10789051B1 (en) Method and apparatus reusing ListCell in hybrid application
US10789420B2 (en) Mixed view display method and device
US11588653B2 (en) Blockchain-based smart contract call methods and apparatus, and electronic device
US10827010B2 (en) Information presentation method and apparatus
US10884767B2 (en) Service processing methods and devices
US11328459B2 (en) Method and apparatus for realizing color tween animation
US10573053B2 (en) Method and apparatus for animating images on mobile devices
US10831344B2 (en) Page positioning method and apparatus for erroneous input information
US11232169B2 (en) Processing image data of a webpage
US11409584B2 (en) Cross-application data sharing
WO2019104132A1 (en) Two-dimensional code generation method, two-dimensional code processing method, apparatus, device, and two-dimensional code
US20190018666A1 (en) Mobile terminal application update method and device
US11693704B2 (en) Resource loading and a service function for a software application
CN108605261B (en) Electronic device and operation method thereof
US10846355B2 (en) Method and device for page display
CN113485627A (en) Display method of application window and terminal
US10671366B2 (en) App program running method and apparatus
CN107895120B (en) Data processing method and device in cross-platform application, electronic equipment and storage medium

Legal Events

Date Code Title Description
FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

AS Assignment

Owner name: ALIBABA GROUP HOLDING LIMITED, CAYMAN ISLANDS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:GUAN, WEIGANG;SHI, DANXIA;CHEN, WENHONG;REEL/FRAME:053076/0980

Effective date: 20180827

AS Assignment

Owner name: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD., CAYMAN ISLANDS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ALIBABA GROUP HOLDING LIMITED;REEL/FRAME:053743/0464

Effective date: 20200826

STCF Information on status: patent grant

Free format text: PATENTED CASE

AS Assignment

Owner name: ADVANCED NEW TECHNOLOGIES CO., LTD., CAYMAN ISLANDS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.;REEL/FRAME:053754/0625

Effective date: 20200910

CC Certificate of correction
MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 4