Toast component realization method and system

A technology for implementing systems and methods, applied in the computer field, can solve problems such as dependence on acitvity and authorization, and achieve the effect of avoiding abnormal display

Active Publication Date: 2017-02-08
WUHAN DOUYU NETWORK TECH CO LTD
View PDF2 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] Embodiments of the present invention provide a Toast component implementation method and system, which are used to solve the technical problem of relying on acitvity and authorization when implementing Toast components in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Toast component realization method and system
  • Toast component realization method and system
  • Toast component realization method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0044] Embodiments of the present invention provide a method and system for implementing Toast components, which are used to solve the technical problem of relying on acitvity and authorization when implementing Toast components in the prior art.

[0045] In order to solve the above technical problems, the general idea of ​​the technical solution provided by the present invention is as follows:

[0046] In the technical solution of the embodiment of the present invention, first obtain the Toast layout and create the root layout, then add the Toast root layout to the object of WindowManager through the addView function of WindowManager, and finally hold the handler object of the main thread message queue to convert the Toast The root layout is sent to the main thread message queue, and when the main thread processes the Toast root layout message, the corresponding Toast component can be displayed. Among them, the level of WindowManager.LayoutParams used to represent the display...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

Embodiments of the invention provide a Toast component realization method and system, which is used for solving the technical problem of dependency on activity and authorization during Toast component realization in the prior art. The method comprises the steps of obtaining a Toast layout; creating a Toast root layout; adding the Toast layout to the Toast root layout through an addView function of the Toast root layout; adding the Toast root layout to an object of a WindowManager through an addView function of the WindowManager, wherein the grade of WindowManager.LayoutParams used for representing a display view parameter in the addView function of the WindowManager is the same as that of native Toast; and sending the Toast root layout to a main thread message queue through a Handler object with the main thread message queue, and then displaying a Toast component corresponding to the Toast root layout. According to the method and the system, the technical problem of dependency on activity and authorization is avoided while multiple shortcomings of the native Toast are overcome.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a Toast component realization method and system. Background technique [0002] The Toast component is a component used in the Android system to display prompt messages on the interface. The original Toast, or native Toast has the following disadvantages: 1) The display time cannot be customized: the Toast component only has a display time of 4 seconds defined by LENGTH_SHORT (the macro definition inside the TOAST component) or 5 seconds defined by LENGTH_LONG (the macro definition inside the TOAST component) Display time, other display time cannot be set, and when the Toast displays too much content, the user may not be able to browse all the content; 2) When there are multiple Toasts displayed, they will be superimposed: when there are multiple Toast components displayed, the Superimposed together, resulting in view overlap, superimposed display not only reduces view ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F8/24
Inventor 刘一琛
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products