CN113805865A - Method for displaying multi-type styles based on Android system RecyclerView component - Google Patents
Method for displaying multi-type styles based on Android system RecyclerView component Download PDFInfo
- Publication number
- CN113805865A CN113805865A CN202110946597.9A CN202110946597A CN113805865A CN 113805865 A CN113805865 A CN 113805865A CN 202110946597 A CN202110946597 A CN 202110946597A CN 113805865 A CN113805865 A CN 113805865A
- Authority
- CN
- China
- Prior art keywords
- styles
- data
- type
- component
- android system
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000006978 adaptation Effects 0.000 claims abstract description 18
- 238000002955 isolation Methods 0.000 claims description 3
- 238000005457 optimization Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method for displaying multi-type styles based on an Android system RecyclerView component, and relates to the field of Android system component optimization; setting a universal data adapter according to a RecycleView component, adding or removing data, using the data added by the generic adaptation through an abstract class, performing customized development by defining a corresponding method, distributing the developed data with different styles to different classes, and displaying the style styles in an isolated manner.
Description
Technical Field
The invention discloses a method, relates to the field of Android system component optimization, and particularly relates to a method for displaying multi-type styles based on an Android system RecyclerView component.
Background
With the rapid development of the mobile internet, the style function of a large APP list is more and more complex, the official example of the RecycleView component required by the list is more and more difficult to meet the requirement of actual customization, and the existing Android system loading mode inevitably causes serious code coupling and weak universality.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides the method for displaying the multi-type styles based on the Android system RecyclerView component, which has the characteristics of strong universality, simple and convenient implementation and the like, and has wide application prospect.
The specific scheme provided by the invention is as follows:
the method for displaying the multi-type styles based on the RecycleView component of the Android system is characterized in that a universal data adapter is arranged according to the RecycleView component to add or remove data,
the data added by the generic adaptation is used through the abstract class, the customized development is carried out by defining a corresponding method, the developed data with different styles are distributed to different classes, and the style styles are displayed in an isolated mode.
Further, in the method for displaying the multi-type styles based on the Android system RecyclerView component, data query is performed through the object storage view of the Sparearray type.
Furthermore, the method for displaying the multi-type styles based on the Android system RecyclerView component utilizes a list to display the type styles, and the type styles inherit the abstract class for adaptation.
Further, in the method for displaying the multi-type styles based on the Android system RecyclerView component, the arrangement mode of the loading type styles is specified by a setSpanSize () method in a corresponding method, and customized development is performed.
Further, the method for displaying the multi-type styles based on the Android system RecyclerView component comprises the following specific steps:
through the universal data adapter, the corresponding data is added,
the object storage view of the spareararray type is utilized to query the corresponding data,
corresponding data obtained by the query is adapted according to the style of the list presentation type through the abstract class by using the generic type,
the arrangement mode of the loading type styles is specified by utilizing a setSpanSize () method, customized development is carried out,
and distributing the developed data with different styles to different classes, and displaying the style styles in an isolated mode.
A system for displaying multi-type styles based on an Android system RecycleView component, a data acquisition module, an adaptation module, a customization module and an isolation module,
the data acquisition module sets a universal data adapter according to the RecycleView component to add or remove data,
the adaptation module uses the data added by the generic adaptation through the abstract class, carries out customized development by defining a corresponding method, distributes the developed data with different styles to different classes, and isolates and displays the style styles.
Device based on Android system RecycleView subassembly shows polymorphic type style includes: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is used for calling the machine readable program and executing the method for displaying the multi-type styles based on the Android system RecyclerView component.
A computer readable medium having stored thereon computer instructions, which, when executed by a processor, cause the processor to perform the method for displaying multi-type styles based on an Android system RecycleView component.
The invention has the advantages that:
the invention provides a method for displaying multi-type styles based on an Android system RecyclerView component, which is characterized in that data are added or removed through a universal data adapter, the data added through extensive adaptation are used through abstract classes, customized development is carried out through defining a corresponding method, the developed data with different styles are distributed to different classes, the style of the display type is isolated, and the decoupling display of a list of various complex styles of the Android system is realized.
Drawings
FIG. 1 is a schematic diagram of the application framework of the method of the present invention.
FIG. 2 is a schematic flow diagram of the process of the present invention.
Detailed Description
Android is an open source, Linux-based mobile device operating system, which is mainly used in mobile devices such as smart phones and tablet computers. Android was developed by the open cell phone alliance led by google and other companies.
The RecyclerView is a control of Android, and not only can achieve the same effect as the ListView, but also various defects in the ListView are optimized. The data can be scrolled longitudinally and also can be scrolled transversely.
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
The invention also provides a method for displaying multi-type styles based on the RecycleView component of the Android system, a universal data adapter is arranged according to the RecycleView component to add or remove data,
the data added by the generic adaptation is used through the abstract class, the customized development is carried out by defining a corresponding method, the developed data with different styles are distributed to different classes, and the style styles are displayed in an isolated mode.
By using the method, the data is added or removed through the universal data adapter, the data added through the generic adaptation is used through the abstract class, the customized development is carried out through defining the corresponding method, the developed data with different styles are distributed to different classes, the style styles are isolated and displayed, and the decoupling display of the list of various complex styles of the Android system is realized.
In a specific application, in some embodiments of the method, a universal data adapter inpurdapt is set through an Android system RecyclerView component to increase or remove data, view is stored through a sparerarray type object to inquire corresponding data, multiple types of data are adapted by using an abstract class InspurDataItem through a manifold, all types of styles to be added in a list are adapted by inheriting the abstract class InspurDataItem, multiple methods are defined to realize multiple customized development, different types of styles are isolated into different classes, no influence is caused between the styles, and decoupling is completed.
The method comprises the following specific steps:
through the universal data adapter, the corresponding data is added,
the object storage view of the spareararray type is utilized to query the corresponding data,
corresponding data obtained by the query is adapted according to the style of the list presentation type through the abstract class by using the generic type,
the arrangement mode of the loading type styles is specified by utilizing a setSpanSize () method, customized development is carried out,
and distributing the developed data with different styles to different classes, and displaying the style styles in an isolated mode.
The above process application can be referred to fig. 1, and different types of patterns are isolated into different classes without affecting each other, thereby completing the decoupling.
Meanwhile, the invention provides a system for displaying multi-type styles based on an Android system RecyclerView component, a data acquisition module, an adaptation module, a customization module and an isolation module,
the data acquisition module sets a universal data adapter according to the RecycleView component to add or remove data,
the adaptation module uses the data added by the generic adaptation through the abstract class, carries out customized development by defining a corresponding method, distributes the developed data with different styles to different classes, and isolates and displays the style styles.
The contents of information interaction, execution process, and the like between the modules in the system are based on the same concept as the method embodiment of the present invention, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
Similarly, the system can add or remove data through the universal data adapter, use the data added by the generic adaptation through the abstract class, carry out customized development by defining a corresponding method, distribute the developed data with different styles to different classes, isolate and display the style styles, and realize the decoupling display of a list of various complex styles of the Android system.
The invention also provides a device for displaying the multi-type styles based on the Android system RecyclerView component, which comprises the following steps: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is used for calling the machine readable program and executing the method for displaying the multi-type styles based on the Android system RecyclerView component.
The contents of information interaction, readable program process execution and the like of the processor in the device are based on the same concept as the method embodiment of the present invention, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
Similarly, the device can add or remove data through the universal data adapter, use the data added by the generic adaptation through the abstract class, carry out customized development by defining a corresponding method, distribute the developed data with different styles to different classes, isolate and display the style styles, and realize the decoupling display of a list of various complex styles of the Android system.
The invention also provides a computer readable medium, which stores computer instructions, and when the computer instructions are executed by a processor, the computer instructions cause the processor to execute the method for displaying the multi-type styles based on the Android system RecycleView component.
Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
It should be noted that not all steps and modules in the above flows and system structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.
Claims (8)
1. A method for displaying multi-type styles based on an Android system RecycleView component is characterized in that a universal data adapter is arranged according to the RecycleView component to add or remove data,
the data added by the generic adaptation is used through the abstract class, the customized development is carried out by defining a corresponding method, the developed data with different styles are distributed to different classes, and the style styles are displayed in an isolated mode.
2. The Android system RecyclerView component-based method of displaying multi-type styles of claim 1, wherein data queries are performed on a SparseArray type object storage view.
3. The Android system RecyclerView component-based method of displaying multi-type styles according to claim 1 or 2, wherein the type styles are presented using lists, said type styles being adapted inheriting an abstract class.
4. The method for displaying multiple types of styles based on the Android system RecyclerView component of claim 1, wherein the customized development is performed by specifying the arrangement of the loading type styles through a setSpanSize () method in the corresponding method.
5. The method for displaying the multi-type styles based on the Android system RecyclerView component as claimed in claim 1, comprising the specific steps of:
through the universal data adapter, the corresponding data is added,
the object storage view of the spareararray type is utilized to query the corresponding data,
corresponding data obtained by the query is adapted according to the style of the list presentation type through the abstract class by using the generic type,
the arrangement mode of the loading type styles is specified by utilizing a setSpanSize () method, customized development is carried out,
and distributing the developed data with different styles to different classes, and displaying the style styles in an isolated mode.
6. A system for displaying multi-type styles based on an Android system RecyclerView component is characterized by comprising a data acquisition module, an adaptation module, a customization module and an isolation module,
the data acquisition module sets a universal data adapter according to the RecycleView component to add or remove data,
the adaptation module uses the data added by the generic adaptation through the abstract class, carries out customized development by defining a corresponding method, distributes the developed data with different styles to different classes, and isolates and displays the style styles.
7. Device based on Android system RecycleView subassembly shows polymorphic type style, characterized by includes: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is used for calling the machine readable program and executing the method for displaying the multi-type styles based on the Android system RecycleView component in any one of claims 1 to 5.
8. Computer readable medium characterized in that said computer readable medium has stored thereon computer instructions which, when executed by a processor, cause said processor to execute the method of displaying multi-type styles based on an Android system RecyclerView component of any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110946597.9A CN113805865A (en) | 2021-08-18 | 2021-08-18 | Method for displaying multi-type styles based on Android system RecyclerView component |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110946597.9A CN113805865A (en) | 2021-08-18 | 2021-08-18 | Method for displaying multi-type styles based on Android system RecyclerView component |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113805865A true CN113805865A (en) | 2021-12-17 |
Family
ID=78893800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110946597.9A Withdrawn CN113805865A (en) | 2021-08-18 | 2021-08-18 | Method for displaying multi-type styles based on Android system RecyclerView component |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113805865A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114443198A (en) * | 2022-01-26 | 2022-05-06 | 阿里巴巴(中国)有限公司 | View component management method, device, storage medium and computer program product |
-
2021
- 2021-08-18 CN CN202110946597.9A patent/CN113805865A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114443198A (en) * | 2022-01-26 | 2022-05-06 | 阿里巴巴(中国)有限公司 | View component management method, device, storage medium and computer program product |
CN114443198B (en) * | 2022-01-26 | 2024-03-29 | 阿里巴巴(中国)有限公司 | View assembly management method, device, storage medium and computer program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9665841B2 (en) | Cross-platform application framework | |
CN111221726A (en) | Test data generation method and device, storage medium and intelligent equipment | |
CN109117169A (en) | Method and apparatus for repairing kernel loophole | |
CN103049375B (en) | A kind of camera on-line debugging method | |
CN103559065B (en) | Method and system for OTA (Over-the-Air Technology) upgrade | |
CN110096424B (en) | Test processing method and device, electronic equipment and storage medium | |
CN103365682B (en) | Message processing device and information processing method | |
CN108334534A (en) | Operation system field configuration method, apparatus, server and readable storage medium storing program for executing | |
CN107958365B (en) | Material information changing method and device, storage medium and electronic equipment | |
WO2019222811A1 (en) | Method of processing push information, method of pushing advertisement information, device and platform | |
CN102760131A (en) | Exhibition method and system of network album | |
CN113805865A (en) | Method for displaying multi-type styles based on Android system RecyclerView component | |
US8086834B2 (en) | System and method for populating a dedicated system service repository for an information handling system | |
CN109446047B (en) | Performance test platform script storage method, device, equipment and storage medium | |
CN111159040A (en) | Test data generation method, device, equipment and storage medium | |
CN109144620B (en) | Skipping method and device for suspension window permission setting interface | |
CN102857817B (en) | Set-top box production system and method capable of realizing dynamical loading | |
CN111736825B (en) | Information display method, device, equipment and storage medium | |
US8850418B2 (en) | System and method for business function reversibility | |
CN111061522A (en) | Method, device, equipment and storage medium for generating front-end card assembly based on back end | |
CN112204527A (en) | Method and system for processing engineering data in a multi-engineering system environment | |
CN102801749B (en) | A kind of dispositions method of J2ME application program and device | |
US7844506B2 (en) | Method, system, and program product for automatically populating a field of a record | |
CN103699418A (en) | Method and device of retrieving external SD cards | |
CN111459583A (en) | Menu creating method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20211217 |
|
WW01 | Invention patent application withdrawn after publication |