CN111309325B - Third party library reference method and device and mobile terminal - Google Patents

Third party library reference method and device and mobile terminal Download PDF

Info

Publication number
CN111309325B
CN111309325B CN202010074797.5A CN202010074797A CN111309325B CN 111309325 B CN111309325 B CN 111309325B CN 202010074797 A CN202010074797 A CN 202010074797A CN 111309325 B CN111309325 B CN 111309325B
Authority
CN
China
Prior art keywords
pull
refreshing
view control
party library
loading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010074797.5A
Other languages
Chinese (zh)
Other versions
CN111309325A (en
Inventor
杨磊
李中良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Junzheng Network Technology Co Ltd
Original Assignee
Shanghai Junzheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Junzheng Network Technology Co Ltd filed Critical Shanghai Junzheng Network Technology Co Ltd
Priority to CN202010074797.5A priority Critical patent/CN111309325B/en
Publication of CN111309325A publication Critical patent/CN111309325A/en
Application granted granted Critical
Publication of CN111309325B publication Critical patent/CN111309325B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device and a mobile terminal for referring to a third party library, aiming at finding a more effective implementation scheme for referring to the third party library, and the method comprises the following steps: creating a local view control, and allowing the local view control to inherit a third-party view control in a third-party library; defining a refreshing layout adapter interface and creating a method, so that the local view control realizes refreshing the layout adapter interface; the local view control is used in the Activity's layout file to have the Activity hold a refresh layout adapter interface. The invention inherits the creation of the local view control to the third party library and realizes the exchange of the third party library without perception in the Activity by means of the realized refreshing of the layout adapter interface, thereby avoiding the modification of all relevant layouts and pages to a certain extent and improving the development efficiency.

Description

Third party library reference method and device and mobile terminal
Technical Field
The invention relates to the field of mobile communication, in particular to a method and a device for quoting a third party library and a mobile terminal.
Background
Most of the existing application programs directly refer to the third party library in the layout when using the pull-down refresh to pull up the loaded library. And the reference of the third party library is directly held in the code, when other pull-down refreshing pull-up loading libraries are replaced, all relevant layout and page modification have to be carried out, so that the development efficiency is reduced.
Disclosure of Invention
In order to find a more effective implementation scheme of third party library reference, the invention provides a method, a device and a mobile terminal for third party library reference.
Scheme one:
a method of third party library referencing is provided, the method of third party library referencing comprising the steps of:
creating a local view control, and allowing the local view control to inherit a third-party view control used for realizing pull-down refreshing and pull-up loading in a third-party library;
defining a refreshing layout adapter interface and creating a method for realizing a pull-down refreshing pull-up loading view control in the refreshing layout adapter interface, so that the local view control realizes the refreshing layout adapter interface;
and using the local view control in the Activity layout file to enable the Activity to hold the refreshing layout adapter interface.
Preferably, after the local view control is used in the Activity layout file, the method includes the following steps:
when the third party library is replaced by a new third party library, the local view control conversion inherits the new third party view control used for realizing the pull-down refreshing and pull-up loading in the new third party library, and the local view control after the conversion inherits realizes the refreshing layout adapter interface.
Preferably, the method for implementing the pull-down refreshing pull-up loading view control includes one or more of the following:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
Preferably, after the local view control is used in the Activity layout file, the method includes the following steps:
setting the page number of the home page as a starting page number according to a preset page number format based on the monitored callback of the pull-down refreshing; transmitting a home page request and receiving home page request data corresponding to the home page request;
and clearing original data in the list control, and re-adding the original data by using the home page request data to inform the list control of updating.
Preferably, after the local view control is used in the Activity layout file, the method includes the following steps:
based on the monitored callback of the pull-up loading, sending a data request and receiving response data corresponding to the data request;
Analyzing the response data, and identifying whether a response list is empty;
if not, the response data is recovered to the tail of the list control, and the list control is notified to update.
Preferably, after the local view control is used in the Activity layout file, the method includes the following steps:
user instruction information is identified based on the current page number information.
Preferably, the identifying the user instruction information according to the current page number information includes the steps of:
judging whether the current page number is a starting page number or not;
if yes, the user instruction information is pull-down refreshing;
if not, the user instruction information is pull-up loading.
Scheme II:
an apparatus for providing a third party library reference, the apparatus comprising:
the creation inheritance module is used for creating a local view control and inheriting the local view control into a third-party view control for realizing pull-down refreshing and pull-up loading in a third-party library;
the adaptation realizing module is used for defining a refreshing layout adapter interface and creating a method for realizing pull-down refreshing pull-up loading view control in the refreshing layout adapter interface so that the local view control realizes the refreshing layout adapter interface;
The use module is used for using the local view control in the layout file of the Activity so that the Activity holds the refreshing layout adapter interface.
Preferably, the means for third party library referencing comprises:
and the replacement conversion module is used for enabling the local view control to convert and inherit a new third-party view control used for realizing pull-down refreshing and pull-up loading in the new third-party library when the third-party library is replaced by the new third-party library after the local view control is used in the Activity layout file, and enabling the local view control after the conversion inherit to realize the refreshing layout adapter interface.
Preferably, the method for implementing the pull-down refreshing pull-up loading view control includes one or more of the following:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
Preferably, the means for third party library referencing comprises:
the drop-down module is used for setting the page number of the first page as a starting page number according to a preset page number format based on a monitored drop-down refreshing callback after the local view control is used in the Activity layout file; transmitting a home page request and receiving home page request data corresponding to the home page request;
and the re-adding module is used for emptying original data in the list control and re-adding the data by using the home page request data to inform the list control of updating.
Preferably, the means for third party library referencing comprises:
the pull-up module is used for sending a data request and receiving response data corresponding to the data request based on a monitored pull-up loading callback after the local view control is used in the Activity layout file;
the analysis and identification module is used for analyzing the response data and identifying whether a response list is empty or not;
and the additional module is used for retrieving the response data back to the tail of the list control and notifying the update of the list control when the response list is not empty.
Preferably, the means for third party library referencing comprises:
and the instruction identification module is used for identifying user instruction information according to the current page number information after the local view control is used in the Activity layout file.
Preferably, the instruction recognition module includes:
a judging unit for judging whether the current page number is a start page number;
the pull-down instruction unit is used for refreshing the user instruction information in a pull-down way if the current page number is the initial page number;
and the pull-up instruction unit is used for loading the user instruction information into the pull-up mode if the current page number is not the initial page number.
Scheme III:
there is provided a mobile terminal including:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of third party library referencing of any of scheme one.
Compared with the prior art, the method and the device for referring to the third party library and the mobile terminal have the following beneficial effects:
according to the method and device for referencing the third party library and the mobile terminal, the local view control is created to inherit the third party library, and the third party library is exchanged without perception in the Activity by means of the mode of refreshing the layout adapter interface, so that modification of all relevant layouts and pages is avoided to a certain extent, and development efficiency is improved.
The scheme provided by the invention has little change to the existing system, does not influence the compatibility of the system, and is simple and efficient to realize.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of a method for third party library referencing according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of an apparatus for third party library referencing according to another embodiment of the present invention;
fig. 3 is a schematic block diagram of a mobile terminal according to still another embodiment of the present invention.
Detailed Description
In order to enable those skilled in the art to better understand the present invention, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present invention with reference to the accompanying drawings.
In some of the flows described in the specification and claims of the present invention and in the foregoing figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, the order of operations being 202, 204, etc., merely for distinguishing between the various operations, the order of the operations itself not representing any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
In one embodiment, the invention provides a method for third party library referencing that is applicable to the field of device interaction with a server and device display, wherein the device is preferably a networkable electronic device such as a cell phone, computer, tablet, smart watch, personal digital assistant, etc.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for third party library referencing according to an embodiment of the present invention, and as shown in fig. 1, the method for third party library referencing according to an embodiment of the present invention includes steps S101 to S105, which are specifically as follows:
step S101: and creating a local view control, and allowing the local view control to inherit a third-party view control used for realizing pull-down refreshing and pull-up loading in a third-party library.
The android system provides three design User Interfaces (UI) for a developer, wherein the UI comprises a layout file control UI, a code control UI and a mixed control UI, wherein the layout file control UI is an Interface written by using an extensible markup language (eXtensible Markup Language, XML) file, a layout type and a control are added, resources used in the layout are added into resource files, and the layout files are loaded in the Activity of an android program; the code control UI is used for writing an operation code in the Activity to realize the operation on the control, is of a non-visual design, and is suitable for the condition of simpler interface; the mixed control UI combines the layout file control UI and the code control UI, namely, at an initial interface, interface elements without change, layout files and frequently-changed interface elements are used, code control is used, and control codes are written in Activity to realize the operation on the control.
In order to facilitate understanding of a method for third party library referencing in the embodiment of the present invention, the embodiment of the present invention is explained and explained herein with reference to a layout file control UI, it should be understood that the method for third party library referencing in the embodiment of the present invention may also be applied to a hybrid control UI.
In the android system, the control inherits from the View, which is the base class of all the controls in the android, and a specific function class can be completed. In the embodiment of the invention, the local View control is a custom control, and View is also a base class thereof.
For example, assuming that AView represents a View control that specifically implements a pull-down refresh pull-up loading function, bview is a local View control, then letting the local View control inherit a third-party View control in a third-party library that implements the pull-down refresh pull-up loading, that is, letting Bview inherit AView. It should be explained that the key words inherited in the android system are extensions, the new class inherits the state and behavior of the general class, and adds its own new state and behavior as needed. The class resulting from inheritance is referred to as a child class, and the inherited class is referred to as a parent class.
Step S103: defining a refreshing layout adapter interface and creating a method for realizing a pull-down refreshing pull-up loading view control in the refreshing layout adapter interface, so that the local view control realizes the refreshing layout adapter interface; the meaning of the Interface (Interface) is different from the Interface represented by the I of the graphical user Interface (Graphical User Interface, GUI for short), and the Interface is an abstract class and a class which cannot be initialized.
In some implementations, a method for implementing a pull-down refresh pull-up loading view control includes one or more of the following:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
Specifically, the refresh layout adapter interface is defined as follows:
it should be noted that the implementation of the refresh layout adapter interface is then implemented by a local View control, i.e., bview in the example is a View control representing the implementation of the refresh layout adapter interface.
Step S105: and using the local view control in the Activity layout file to enable the Activity to hold the refreshing layout adapter interface.
Specifically, the layout file in the Activity is preferably activity_main_xml, so that after the BView control is found in the Activity, the interface can be converted into a refresh layout adapter interface, and then the interface is held, namely the Aview control is not relied on in the Activity but is the BView control, so that the decoupling purpose is realized.
In some embodiments, in order to solve the problem of third party library replacement, the method for third party library referencing in the embodiment of the present invention includes the following steps after using a local view control in an Activity layout file:
when the third party library is replaced by a new third party library, the local view control conversion inherits the new third party view control used for realizing the pull-down refreshing and pull-up loading in the new third party library, and the local view control after the conversion inherits realizes the refreshing layout adapter interface.
In some embodiments, the replacement of the third party library by the new third party library may be active or passive, and the embodiments of the present invention are not limited in this respect.
By way of example, assume that CView represents a View control used in a new third party library to realize a pull-down refresh pull-up load function in a pull-down refresh pull-up load library, at this time, exchange can be realized only by converting Bview control to inherit Cview control and realizing refresh layout adapter interface again indirectly based on Cview control, and all this is in a layout file, so that exchange of the third party library is realized without perception in Activity, modification of all relevant layouts and pages is avoided to a certain extent, and development efficiency is improved.
In order to solve user instruction recognition, the method for referring to the third party library in the embodiment of the invention further comprises the following steps after the local view control is used in the Activity layout file:
user instruction information is identified based on the current page number information.
Specifically, identifying user instruction information from the current page number information includes the steps of:
judging whether the current page number is a starting page number or not;
if yes, the user instruction information is pull-down refreshing;
if not, the user instruction information is pull-up loading.
In some embodiments, the current page number may be acquired through a preset interface and a class implementing the interface. For example, assuming that the current page number is page, the method in the defined preset interface is getpage (). It should be noted that the preset interfaces and classes implementing the interfaces may be different in different programming languages, and the embodiments of the present invention are not limited thereto.
In order to solve the problem of third party library pull-down refreshing, the method for third party library reference in the embodiment of the invention comprises the following steps after using a local view control in an Activity layout file:
setting the page number of the home page as a starting page number according to a preset page number format based on the monitored callback of the pull-down refreshing; transmitting a home page request and receiving home page request data corresponding to the home page request;
And (5) clearing original data in the list control, and re-adding the original data by using the first page request data to inform the list control of updating.
In some embodiments, before the callback of the snoop-based pull-down refresh, the method comprises the steps of: initializing the local view control and refreshing the layout adapter interface.
It should be noted that when the original data in the list control is empty, the original data also needs to be emptied so as to facilitate the first page to request the data to be added again.
In order to solve the problem of pull-up loading, the method for referencing the third party library in the embodiment of the invention comprises the following steps after using the local view control in the Activity layout file:
based on the monitored callback of the pull-up loading, sending a data request and receiving response data corresponding to the data request;
analyzing the response data, and identifying whether the response list is empty;
if not, the response data is recovered to the tail of the list control, and the list control is informed of updating.
In order to solve the different effects of the same library, the method for referring to the third party library in the embodiment of the invention can also define a refreshing layout factory interface for defining the initialization of the refreshing layout adapter, the operation behavior of the refreshing layout adapter after the network request is finished, and the like. If different implementation modes of pull-down, refresh and pull-up are needed in different business scenes, only different factory interface implementation classes with refresh layout are needed to be provided.
It should be noted that in a process of implementing a method for third party library referencing in an embodiment of the present invention, the following interfaces and classes for implementing the interfaces are defined. It should be noted that the following embodiments are not the only implementation manner of the embodiments of the present invention, and those skilled in the art may make several improvements and modifications according to their own language or programming habit without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
A generic paging interface is defined: the method is used for processing the related behaviors of paging requests, such as acquisition of a current page, and different distributed interface implementation classes can be provided according to specific service scenes when the method is used;
a refresh construct class is defined and implemented: the method comprises the steps of solidifying paging interface realization classes and refreshing initialization sequences of the layout adapter interface realization classes;
a list control adapter interface is defined: the adapter behaviors of list controls such as ListView, recyclerView are unified and abstracted;
a pull-down refresh snoop adapter interface is defined: the operation is used for monitoring pull-down refreshing;
a load more listening adapter interface is defined: the operation is used for monitoring the pull-up loading;
A network request interface is defined: the method is used for initiating specific network requests and is often realized by the Activity;
a network response interface is defined: relevant logic used for uniformly processing the network request after completion, such as notifying refreshing layout update, updating the state of the paging interface realization class and the like;
a director interface is defined: the method comprises the steps of initializing a refreshing layout, starting a pull-down refreshing, receiving a response of successful network request and the like;
defining and implementing a director interface implementation class: an implementation of a director interface in a generic scenario is provided. The implementation class can be directly used in most scenes, and if other special scenes exist, the implementation class of other director interfaces can also be provided according to specific service scenes.
It should be noted that, in actual use, the Activity only needs to call the director interface, so that the specific application process can be performed in a conventional manner by those skilled in the art, and the embodiments of the present invention are not described herein again.
In some embodiments, after the network request is completed, the refresh layout method update in the refresh layout factory interface is notified to update the generic paging interface implementation class-related state.
Compared with the prior art, the method for referring to the third party library has the following beneficial effects:
according to the method for referencing the third party library, the local view control is created to inherit the third party library, and the third party library is exchanged without perception in the Activity by means of refreshing the layout adapter interface, so that modification of all relevant layouts and pages is avoided to a certain extent, and development efficiency is improved.
Referring to fig. 2, another embodiment of the present invention provides an apparatus for third party library referencing, based on the same inventive concept as a method for third party library referencing according to the embodiment of the present invention, the apparatus for third party library referencing comprising:
the creation inheritance module 2002 is used for creating a local view control and inheriting the local view control to a third-party view control used for realizing pull-down refreshing and pull-up loading in a third-party library;
an adaptation implementation module 2004 for defining a refresh layout adapter interface and creating a method for implementing a pull-down refresh pull-up load view control in the refresh layout adapter interface, letting the local view control implement the refresh layout adapter interface;
a use module 2006 is used to use the local view control in the Activity's layout file to make the Activity hold a refresh layout adapter interface.
In some embodiments, the means for third party library referencing comprises:
and the replacement conversion module is used for enabling the local view control to convert and inherit a new third-party view control used for realizing pull-down refreshing and pull-up loading in the new third-party library when the third-party library is replaced by the new third-party library after the local view control is used in the Activity layout file, and enabling the local view control after the conversion inherit to realize the refreshing layout adapter interface.
Preferably, the method for implementing a pull-down refresh pull-up loading view control includes one or more of the following:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
In some embodiments, the means for third party library referencing comprises:
the drop-down module is used for setting the page number of the home page as the initial page number according to a preset page number format based on the monitored drop-down refreshing callback after the local view control is used in the Activity layout file; transmitting a home page request and receiving home page request data corresponding to the home page request;
And the re-adding module is used for emptying original data in the list control and re-adding the original data by using the home page request data to inform the list control of updating.
In some embodiments, the means for third party library referencing comprises:
the system comprises a pull-up module, a data request and a response module, wherein the pull-up module is used for sending a data request and receiving response data corresponding to the data request based on a monitored pull-up loading callback after a local view control is used in an Activity layout file;
the analysis and identification module is used for analyzing the response data and identifying whether the response list is empty;
and the adding module is used for recovering the response data to the tail of the list control and notifying the update of the list control when the response list is not empty.
In some embodiments, the means for third party library referencing comprises:
the instruction identification module is used for identifying user instruction information according to the current page number information after the local view control is used in the Activity layout file.
Specifically, the instruction recognition module includes:
a judging unit for judging whether the current page number is a start page number;
the pull-down instruction unit is used for refreshing the user instruction information in a pull-down way if the current page number is the initial page number;
and the pull-up instruction unit is used for loading the user instruction information into the pull-up mode if the current page number is not the initial page number.
Compared with the prior art, the device for third party library reference has the following beneficial effects:
according to the device for referencing the third party library, through the arrangement of the creation inheritance module 2002, the adaptation realization module 2004 and the use module 2006, the exchange of the third party library is realized without perception in the Activity, the modification of all relevant layout and pages is avoided to a certain extent, and the development efficiency is improved.
Referring to fig. 3, a further embodiment of the present invention provides a mobile terminal based on the same inventive concept as a third party library referencing method according to the embodiment of the present invention. Fig. 3 is a block diagram showing a part of the structure of a mobile phone related to a mobile terminal according to still another embodiment of the present invention. The mobile phone comprises: radio Frequency (RF) circuitry 1510, memory 1520, input unit 1530, display unit 1540, sensor 1550, audio circuitry 1560, wireless fidelity (wireless fidelity, wiFi) module 1570, processor 1580, power supply 1590, and the like. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 3:
the RF circuit 1510 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 1580; in addition, the data of the design uplink is sent to the base station. Generally, RF circuitry 1510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low noise amplifier (Low NoiseAmplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 1510 may also communicate with networks and other devices through wireless communication. The wireless communications may use any communication standard or protocol including, but not limited to, global System for mobile communications (Global System 0f Mobile communication,GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), email, short message service (Short Messaging Service, SMS), and the like.
The memory 1520 may be used to store software programs and modules, and the processor 1580 performs various functional applications and data processing of the cellular phone by executing the software programs and modules stored in the memory 1520. The memory 1520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1530 may be used to receive input numerical or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1531 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 1531 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 1580, and can receive and execute commands sent from the processor 1580. In addition, the touch panel 1531 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1530 may include other input devices 1532 in addition to the touch panel 1531. In particular, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1540 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1540 may include a display panel 1541, and alternatively, the display panel 1541 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1531 may cover the display panel 1541, and when the touch panel 1531 detects a touch operation thereon or thereabout, the touch operation is transferred to the processor 1580 to determine the type of touch event, and then the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of touch event. Although in fig. 3, the touch panel 1531 and the display panel 1541 are two separate components for implementing the input and input functions of the mobile phone, in some embodiments, the touch panel 1531 may be integrated with the display panel 1541 to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1541 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1541 and/or the backlight when the phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 1560, a speaker 1561, and a microphone 1562 may provide an audio interface between a user and a cell phone. The audio circuit 1560 may transmit the received electrical signal converted from audio data to the speaker 1561, and be converted into a sound signal by the speaker 1561 for output; on the other hand, the microphone 1562 converts the collected sound signals into electrical signals, which are received by the audio circuit 1560 for conversion into audio data, which is processed by the audio data output processor 1580 for transmission to, for example, another cellular phone via the RF circuit 1510 or for output to the memory 1520 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1570, so that wireless broadband Internet access is provided for the user. Although fig. 3 shows WiFi module 1570, it is understood that it is not a necessary component of a cell phone and may be omitted entirely as desired within the scope of not changing the essence of the invention.
The processor 1580 is a control center of the mobile phone, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions and processes data of the mobile phone by running or executing software programs and/or modules stored in the memory 1520 and calling data stored in the memory 1520, thereby performing overall monitoring of the mobile phone. In the alternative, processor 1580 may include one or more processing units; preferably, the processor 1580 can integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1580.
The handset further includes a power supply 1590 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1580 via a power management system so as to provide for the management of charging, discharging, and power consumption by the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In yet another embodiment of the present invention, the processor 1580 included in the mobile terminal further has the following functions:
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to:
creating a local view control, and allowing the local view control to inherit a third-party view control used for realizing pull-down refreshing and pull-up loading in a third-party library;
defining a refreshing layout adapter interface and creating a method for realizing a pull-down refreshing pull-up loading view control in the refreshing layout adapter interface, so that the local view control realizes the refreshing layout adapter interface;
and using the local view control in the Activity layout file to enable the Activity to hold the refreshing layout adapter interface.
In some embodiments, after the local view control is used in the Activity layout file, the method includes the following steps:
when the third party library is replaced by a new third party library, the local view control conversion inherits the new third party view control used for realizing the pull-down refreshing and pull-up loading in the new third party library, and the local view control after the conversion inherits realizes the refreshing layout adapter interface.
Specifically, the method for implementing a pull-down refresh pull-up loading view control includes one or more of the following:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
In some embodiments, after the local view control is used in the Activity layout file, the method includes the following steps:
setting the page number of the home page as a starting page number according to a preset page number format based on the monitored callback of the pull-down refreshing; transmitting a home page request and receiving home page request data corresponding to the home page request;
And clearing original data in the list control, and re-adding the original data by using the home page request data to inform the list control of updating.
In some embodiments, after the local view control is used in the Activity layout file, the method includes the following steps:
based on the monitored callback of the pull-up loading, sending a data request and receiving response data corresponding to the data request;
analyzing the response data, and identifying whether a response list is empty;
if not, the response data is recovered to the tail of the list control, and the list control is notified to update.
In some embodiments, after the local view control is used in the Activity layout file, the method includes the following steps:
user instruction information is identified based on the current page number information.
Specifically, the step of identifying the user instruction information according to the current page number information comprises the following steps:
judging whether the current page number is a starting page number or not;
if yes, the user instruction information is pull-down refreshing;
if not, the user instruction information is pull-up loading.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Compared with the prior art, the mobile terminal provided by the application has the following beneficial effects:
according to the mobile terminal, the local view control is created to inherit the third party library, and the third party library is exchanged without perception in the Activity by means of the mode of refreshing the layout adapter interface, so that modification of all relevant layouts and pages is avoided to a certain extent, and development efficiency is improved.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: read Only Memory (ROM), random access Memory (RAM, randomAccess Memory), magnetic disk or optical disk, and the like.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (15)

1. A method of third party library referencing, the method comprising the steps of:
creating a local view control, and allowing the local view control to inherit a third-party view control used for realizing pull-down refreshing and pull-up loading in a third-party library;
defining a refreshing layout adapter interface and creating a method for realizing a pull-down refreshing pull-up loading view control in the refreshing layout adapter interface, so that the local view control realizes the refreshing layout adapter interface;
and using the local view control in the Activity layout file to enable the Activity to hold the refreshing layout adapter interface.
2. The method of third party library referencing according to claim 1, wherein said using said local view control in an Activity layout file is followed by the steps of:
when the third party library is replaced by a new third party library, the local view control conversion inherits the new third party view control used for realizing the pull-down refreshing and pull-up loading in the new third party library, and the local view control after the conversion inherits realizes the refreshing layout adapter interface.
3. The method of third party library referencing of claim 1, wherein said method for implementing a pull-down refresh pull-up load view control comprises one or more of:
Automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
4. The method of third party library referencing according to claim 1, wherein said using said local view control in an Activity layout file is followed by the steps of:
setting the page number of the home page as a starting page number according to a preset page number format based on the monitored callback of the pull-down refreshing; transmitting a home page request and receiving home page request data corresponding to the home page request;
and clearing original data in the list control, and re-adding the original data by using the home page request data to inform the list control of updating.
5. The method of third party library referencing according to claim 1, wherein said using said local view control in an Activity layout file is followed by the steps of:
based on the monitored callback of the pull-up loading, sending a data request and receiving response data corresponding to the data request;
Analyzing the response data, and identifying whether a response list is empty;
if not, the response data is recovered to the tail of the list control, and the list control is notified to update.
6. The method of third party library referencing according to claim 1, wherein said using said local view control in an Activity layout file is followed by the steps of:
user instruction information is identified based on the current page number information.
7. The method for third party library referencing according to claim 6, wherein said identifying user instruction information based on current page number information comprises the steps of:
judging whether the current page number is a starting page number or not;
if yes, the user instruction information is pull-down refreshing;
if not, the user instruction information is pull-up loading.
8. An apparatus for third party library referencing, said apparatus comprising:
the creation inheritance module is used for creating a local view control and inheriting the local view control into a third-party view control for realizing pull-down refreshing and pull-up loading in a third-party library;
the adaptation realizing module is used for defining a refreshing layout adapter interface and creating a method for realizing pull-down refreshing pull-up loading view control in the refreshing layout adapter interface so that the local view control realizes the refreshing layout adapter interface;
The use module is used for using the local view control in the layout file of the Activity so that the Activity holds the refreshing layout adapter interface.
9. The apparatus for third party library referencing of claim 8, wherein said apparatus for third party library referencing comprises:
and the replacement conversion module is used for enabling the local view control to convert and inherit a new third-party view control used for realizing pull-down refreshing and pull-up loading in the new third-party library when the third-party library is replaced by the new third-party library after the local view control is used in the Activity layout file, and enabling the local view control after the conversion inherit to realize the refreshing layout adapter interface.
10. The apparatus of third party library referencing of claim 8, wherein said method for implementing a pull-down refresh pull-up load view control comprises one or more of:
automatically starting refreshing;
setting pull-down refreshing monitoring;
setting and loading more monitoring;
transitioning the page to a finish refresh mode;
make the page show the style that finishes loading and has no more data;
the page is displayed to complete the loading style;
marking that there is no more data;
Setting allows more loading;
the setting allows for automatic triggering of loading more operations;
setting permission to trigger pull-down refreshing;
whether the setting is visible.
11. The apparatus for third party library referencing of claim 8, wherein said apparatus for third party library referencing comprises:
the drop-down module is used for setting the page number of the first page as a starting page number according to a preset page number format based on a monitored drop-down refreshing callback after the local view control is used in the Activity layout file; transmitting a home page request and receiving home page request data corresponding to the home page request;
and the re-adding module is used for emptying original data in the list control and re-adding the data by using the home page request data to inform the list control of updating.
12. The apparatus for third party library referencing of claim 8, wherein said apparatus for third party library referencing comprises:
the pull-up module is used for sending a data request and receiving response data corresponding to the data request based on a monitored pull-up loading callback after the local view control is used in the Activity layout file;
the analysis and identification module is used for analyzing the response data and identifying whether a response list is empty or not;
And the additional module is used for retrieving the response data back to the tail of the list control and notifying the update of the list control when the response list is not empty.
13. The apparatus for third party library referencing of claim 8, wherein said apparatus for third party library referencing comprises:
and the instruction identification module is used for identifying user instruction information according to the current page number information after the local view control is used in the Activity layout file.
14. The apparatus for third party library referencing of claim 13, wherein said instruction identification module comprises:
a judging unit for judging whether the current page number is a start page number;
the pull-down instruction unit is used for refreshing the user instruction information in a pull-down way if the current page number is the initial page number;
and the pull-up instruction unit is used for loading the user instruction information into the pull-up mode if the current page number is not the initial page number.
15. A mobile terminal, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of third party library referencing of any of claims 1-7.
CN202010074797.5A 2020-01-22 2020-01-22 Third party library reference method and device and mobile terminal Active CN111309325B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074797.5A CN111309325B (en) 2020-01-22 2020-01-22 Third party library reference method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074797.5A CN111309325B (en) 2020-01-22 2020-01-22 Third party library reference method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN111309325A CN111309325A (en) 2020-06-19
CN111309325B true CN111309325B (en) 2023-08-18

Family

ID=71145171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074797.5A Active CN111309325B (en) 2020-01-22 2020-01-22 Third party library reference method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN111309325B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782304B (en) * 2020-07-21 2024-04-02 深圳赛安特技术服务有限公司 Paging loading data logic control method, device, computer equipment and medium
CN114816369B (en) * 2022-06-29 2022-10-04 易方信息科技股份有限公司 Method and device for safely cutting third-party library supported by Android terminal
CN115809056B (en) * 2023-02-07 2023-05-05 深圳复临科技有限公司 Component multiplexing implementation method and device, terminal equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981861A (en) * 2012-12-12 2013-03-20 上海航天测控通信研究所 Using method of custom control based on Qt
CN103902634A (en) * 2012-12-30 2014-07-02 航天信息股份有限公司 Method for achieving automatic binding between View assembly and database fields through Adapter
CN105094683A (en) * 2015-06-30 2015-11-25 北京金山安全软件有限公司 Data display method and device
CN108170416A (en) * 2017-12-28 2018-06-15 北京云杉世纪网络科技有限公司 A kind of method and system for building web front-end
CN109976851A (en) * 2019-03-15 2019-07-05 努比亚技术有限公司 Menu item display methods, wearable device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981861A (en) * 2012-12-12 2013-03-20 上海航天测控通信研究所 Using method of custom control based on Qt
CN103902634A (en) * 2012-12-30 2014-07-02 航天信息股份有限公司 Method for achieving automatic binding between View assembly and database fields through Adapter
CN105094683A (en) * 2015-06-30 2015-11-25 北京金山安全软件有限公司 Data display method and device
CN108170416A (en) * 2017-12-28 2018-06-15 北京云杉世纪网络科技有限公司 A kind of method and system for building web front-end
CN109976851A (en) * 2019-03-15 2019-07-05 努比亚技术有限公司 Menu item display methods, wearable device and computer readable storage medium

Also Published As

Publication number Publication date
CN111309325A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN111309325B (en) Third party library reference method and device and mobile terminal
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
CN104135500B (en) The method and system that prompting application upgrades
US11057762B2 (en) Electronic device and method for switching electronic device between dual standby mode and single standby mode
CN106453511B (en) A kind of data back up method and equipment
EP3410299B1 (en) Electronic device for controlling application and operation method thereof
CN104093123B (en) The information-pushing method of application program, device and system, mobile terminal
CN103500002A (en) Method, device and terminal equipment for managing application program
CN105278937A (en) Method and device for displaying pop-up box messages
CN108549519A (en) split screen processing method, device, storage medium and electronic equipment
EP3671451B1 (en) Method of automatically releasing resource occupied by background process of terminal, storage medium and terminal
CN103473092A (en) Method and device for processing downloaded applications and terminal equipment
CN106713608B (en) Application function state modification method and device and terminal
KR20150033505A (en) Method for performing a power save mode on an electronic device and the electronic device therefor
CN106095489A (en) A kind of application controls method and mobile terminal
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
CN106534288A (en) Data transmission method and mobile terminal
CN110046497B (en) Function hook realization method, device and storage medium
CN111104180B (en) Application program optimization method and device, storage medium and electronic equipment
CN111435318A (en) Dex optimization method of application program and terminal
US11150913B2 (en) Method, device, and terminal for accelerating startup of application
CN106230919B (en) File uploading method and device
JP6685538B2 (en) Application acceleration method and device
CN115357829A (en) Method and device for exposing and burying point of page control and storage medium
CN109286571A (en) The method, apparatus and storage device of mobile terminal and application program limit core and limit net

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant