[go: nahoru, domu]

CN111190599A - Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment - Google Patents

Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment Download PDF

Info

Publication number
CN111190599A
CN111190599A CN201911401611.6A CN201911401611A CN111190599A CN 111190599 A CN111190599 A CN 111190599A CN 201911401611 A CN201911401611 A CN 201911401611A CN 111190599 A CN111190599 A CN 111190599A
Authority
CN
China
Prior art keywords
soft keyboard
keyboard
dialog
height
view
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911401611.6A
Other languages
Chinese (zh)
Inventor
耿鹏飞
张鹤
张彦雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiuyingshiji Beijing Technology Co ltd
Original Assignee
Jiuyingshiji Beijing 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 Jiuyingshiji Beijing Technology Co ltd filed Critical Jiuyingshiji Beijing Technology Co ltd
Priority to CN201911401611.6A priority Critical patent/CN111190599A/en
Publication of CN111190599A publication Critical patent/CN111190599A/en
Pending legal-status Critical Current

Links

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the disclosure provides a method, a device and electronic equipment for realizing an android user-defined soft keyboard by using Dialog, belonging to the technical field of android system intelligent terminals, wherein the method comprises the following steps: integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard; related functions in a native interface are realized in Java codes and are called by Js codes in WebView, so that the spreading-in and popping of a safe soft keyboard and content input are facilitated; determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard; and moving the whole WebView view upwards by the offset height through an interface of the ViewGroup. The user-defined soft keyboard created by the invention has smooth animation, stable software operation and convenient integration.

Description

Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment
Technical Field
The disclosure relates to the technical field of android system intelligent terminals, in particular to a method and a device for realizing an android user-defined soft keyboard by using Dialog and electronic equipment.
Background
With the continuous development and popularization of mobile terminals, various mobile terminals have become essential tools for people to live and work, and especially mobile devices carrying android systems have occupied the largest market proportion. In an android operating system, the main way of interacting with a user includes soft keyboard input, but the soft keyboard of the system cannot meet the safety input and some special requirements of the user. Therefore, the user-defined safe soft keyboard becomes a way to satisfy the safe input of the user.
Currently, a system provides a software keyboard basic class KeyboardView, and a user can inherit the software keyboard application for realizing customization. For popup and popup of KeyboardView, a Viewgroup object is generally customized, popup and popup animations of the object are realized at the same time, and finally, a user-defined soft keyboard is realized by integrating a KeyboardView view.
The functions that typically define a secure keyboard include:
1) the disordering of numbers, letters and special characters is supported.
2) A switch providing a character-pressing effect of the security keypad.
3) And providing a switch for previewing the effect of the keys of the safety keyboard.
4) And monitoring the bounce state of the safety keyboard.
However, as web pages are increasingly integrated in android systems, there is an increasing need to support custom soft keyboard displays under WebView.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a method, an apparatus, and an electronic device for implementing an android soft keyboard by using Dialog, so as to at least partially solve the problems in the prior art.
In a first aspect, an embodiment of the present disclosure provides a method for implementing an android soft keyboard by using Dialog, including:
integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard;
related functions in a native interface are realized in Java codes and are called by Js codes in WebView, so that the spreading-in and popping of a safe soft keyboard and content input are facilitated;
determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard;
and moving the whole WebView view upwards by the offset height through an interface of the ViewGroup.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
and setting the content of the DialogView to a KeyboardView soft keyboard view by using a setContentView interface in the Dialogue.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
and controlling the keyboard to pop in and pop out by using the show and hide interfaces of Dialog.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
the state monitoring of the keyboard is realized by utilizing the setOnShowListener and setOnDismissListener interfaces of Dialog.
According to a specific implementation manner of the embodiment of the present disclosure, after the related function in the native interface is implemented in the Java code and called by the Js code in the WebView, the method further includes:
and utilizing an interface loadUrl (javascript: insert (' "+ content +") of WebView to call the function of the Js interface by real Java codes, and submitting the content input by the soft keyboard to a webpage.
According to a specific implementation manner of the embodiment of the present disclosure, the determining the offset height of the soft keyboard by reading the first size parameter of the mobile phone and the second size parameter of the soft keyboard includes:
acquiring the height screen height of the mobile phone;
acquiring the height keyboardHeight of the soft keyboard;
acquiring the height etHeight of the current edit box from the top of the page;
acquiring a status bar height status;
acquiring the height scrollHeight of the navigation bar;
calculating the occlusion offset height of the keyboard and the edit box as follows:
offsetHeight=(screenHeight-(statusHeight+etHeight))-(keyboardHeight+scrollHeight)。
according to a specific implementation manner of the embodiment of the present disclosure, moving the whole WebView view upward by the offset height through the view group interface includes:
and dynamically acquiring the offset height, and moving the WebView view upwards in the current view based on the acquired offset height.
In a second aspect, an embodiment of the present disclosure provides an apparatus for implementing an android soft keyboard by using Dialog, including:
the device comprises an integration module, a display module and a display module, wherein the integration module is used for integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard;
the realization module is used for realizing related functions in a native interface in Java codes for being called by Js codes in WebView so as to facilitate the spreading-in and popping of a safe soft keyboard and the input of contents;
the determining module is used for determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard;
and the moving module is used for moving the whole WebView view upwards by the offset height through the interface of the Viewgroup. .
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method of implementing an android custom soft keyboard using Dialog in the foregoing first aspect or any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method for implementing an android custom soft keyboard by using Dialog in the foregoing first aspect or any implementation manner of the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the method for implementing an android custom soft keyboard using dialogs in the foregoing first aspect or any implementation manner of the first aspect.
The scheme for realizing the android self-defined soft keyboard by using the Dialog in the embodiment of the disclosure comprises the steps of integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of the keyboard and the state monitoring of the keyboard; related functions in a native interface are realized in Java codes and are called by Js codes in WebView, so that the spreading-in and popping of a safe soft keyboard and content input are facilitated; determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard; and moving the whole WebView view upwards by the offset height through an interface of the ViewGroup. The user-defined soft keyboard created by the invention has smooth animation, stable software operation and convenient integration.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for implementing an android soft keyboard by using Dialog according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of another method for implementing an android soft keyboard using Dialog according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an apparatus for implementing an android soft keyboard by using Dialog according to an embodiment of the present disclosure;
fig. 4 is a schematic view of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the disclosure provides a method for realizing an android self-defined soft keyboard by using Dialog. The method for implementing the android custom soft keyboard by using the Dialog provided by the embodiment can be executed by a computing device, the computing device can be implemented as software, or implemented as a combination of software and hardware, and the computing device can be integrally arranged in a server, a client and the like.
Referring to fig. 1, in an embodiment of the present disclosure, a method for implementing an android soft keyboard by using Dialog includes:
s101, integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard;
s102, realizing related functions in a native interface in Java codes for being called by Js codes in WebView so as to facilitate the spreading-in and popping of a secure soft keyboard and the input of contents;
s103, determining the offset height of the soft keyboard by reading the first size parameter of the mobile phone and the second size parameter of the soft keyboard;
and S104, moving the whole WebView view upwards by the offset height through the interface of the Viewgroup.
In the process of realizing the steps S101 to S104, the invention utilizes the characteristics of the Dialog object and combines the view of the KeyboardView to realize an efficient self-defined secure soft keyboard.
At the same time, the following requirements are fulfilled:
implementing the disorder of numbers, letters and special characters.
A switch to provide a security keypad character press effect.
A switch to provide a security keyboard key preview effect.
Listen for secure keyboard bounce status.
Supporting use of a self-defined secure keyboard in WebView
Solving the problem of occlusion of the input box and the soft keyboard in WebView
The Dialog object itself has implemented the functions of popup and popup, as well as a state listening interface. By utilizing the functions and the interfaces, the KeyboardView object can be loaded into the Dialog, so that the keyboard can be popped in and popped out, and meanwhile, the state monitoring of the keyboard is realized.
As a specific embodiment, steps S101 to S104 can be implemented as follows.
Dialog object integrated KeyboardView soft keyboard view
Setting the content of the DialogView to a KeyboardView soft keyboard view by using a setContentView interface in the Dialogue;
using the show and hide interfaces of Dialog to control the keyboard to pop in and pop out;
the state listening of the keyboard is realized by using the setOnShowListener and setOnDismissListener interfaces of Dialog.
WebView integrated custom security soft keyboard
And related functions in a native interface are realized in Java codes and are called by Js codes in WebView. These functions include popping and popping the secure soft keyboard.
The Java code can be used for calling the function of the Js interface by using the interface loadUrl of WebView (javascript: insert (' "+ content +"), so that the content input by the soft keyboard can be submitted to the webpage.
Solving the problem of shielding an input frame and a soft keyboard in WebView
Referring to fig. 2, this may be done as follows:
obtaining the height of the mobile phone screen, screen height
Get the height keyboardHeight of the soft keyboard
Get the height etHeight of the current edit box from the top of the page
Get status bar height status height
Get navigation bar height scrollHeight
Computing occlusion offset of keyboard and edit box
offsetHeight=(screenHeight-(statusHeight+etHeight))-(keyboardHeight+scrollHeight)
And finally, the whole WebView view is shifted upwards by offset height through a ScrollBy interface of the VIewgroup, so that the problem of shielding of an input frame and a soft keyboard is dynamically solved.
In conclusion, the invention realizes the stable and high-efficiency user-defined soft keyboard by combining the system Dialog and the system KeyboardView, and simultaneously solves the problem of shielding between the user-defined soft keyboard and the editing frame by using the user-defined soft keyboard and dynamically.
The user-defined soft keyboard created by the invention is based on the system DIalog component, so that the keyboard animation is smooth, the software runs stably, and the integration is convenient. The soft keyboard of the technology can be integrated in both traditional Activity components and WebView views.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
and setting the content of the DialogView to a KeyboardView soft keyboard view by using a setContentView interface in the Dialogue.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
and controlling the keyboard to pop in and pop out by using the show and hide interfaces of Dialog.
According to a specific implementation manner of the embodiment of the present disclosure, the integrating a KeyboardView soft keyboard view in a Dialog object includes:
the state monitoring of the keyboard is realized by utilizing the setOnShowListener and setOnDismissListener interfaces of Dialog.
According to a specific implementation manner of the embodiment of the present disclosure, after the related function in the native interface is implemented in the Java code and called by the Js code in the WebView, the method further includes:
and utilizing an interface loadUrl (javascript: insert (' "+ content +") of WebView to call the function of the Js interface by real Java codes, and submitting the content input by the soft keyboard to a webpage.
According to a specific implementation manner of the embodiment of the present disclosure, the determining the offset height of the soft keyboard by reading the first size parameter of the mobile phone and the second size parameter of the soft keyboard includes:
acquiring the height screen height of the mobile phone;
acquiring the height keyboardHeight of the soft keyboard;
acquiring the height etHeight of the current edit box from the top of the page;
acquiring a status bar height status;
acquiring the height scrollHeight of the navigation bar;
calculating the occlusion offset height of the keyboard and the edit box as follows:
offsetHeight=(screenHeight-(statusHeight+etHeight))-(keyboardHeight+scrollHeight)。
according to a specific implementation manner of the embodiment of the present disclosure, moving the whole WebView view upward by the offset height through the view group interface includes:
and dynamically acquiring the offset height, and moving the WebView view upwards in the current view based on the acquired offset height.
Corresponding to the above method embodiment, referring to fig. 3, an embodiment of the present disclosure further provides an apparatus 30 for implementing an android soft keyboard by using Dialog, including:
an integration module 301, configured to integrate a KeyboardView soft keyboard view in a Dialog object, so as to facilitate popup and popup of a keyboard and state monitoring of the keyboard;
the implementation module 302 is used for implementing related functions in a native interface in Java codes for being called by Js codes in WebView so as to facilitate the spreading-in and popping of a secure soft keyboard and the input of content;
the determining module 303 is configured to determine the offset height of the soft keyboard by reading the first size parameter of the mobile phone and the second size parameter of the soft keyboard;
and a moving module 304, configured to move the entire WebView view upward by the offset height through the ViewGroup interface.
For parts not described in detail in this embodiment, reference is made to the contents described in the above method embodiments, which are not described again here.
Referring to fig. 4, an embodiment of the present disclosure also provides an electronic device 60, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of implementing an android custom soft keyboard using Dialog in the aforementioned method embodiments.
The disclosed embodiments also provide a non-transitory computer readable storage medium storing computer instructions for causing the computer to execute the method for implementing the android custom soft keyboard by using Dialog in the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the method for implementing an android custom soft keyboard using Dialog in the aforementioned method embodiments.
Referring now to FIG. 4, a block diagram of an electronic device 60 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the electronic device 60 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 60 are also stored. The processing device 601, the ROM602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. While the figures illustrate an electronic device 60 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present disclosure should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for realizing an android self-defined soft keyboard by using Dialog is characterized by comprising the following steps:
integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard;
related functions in a native interface are realized in Java codes and are called by Js codes in WebView, so that the spreading-in and popping of a safe soft keyboard and content input are facilitated;
determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard;
and moving the whole WebView view upwards by the offset height through an interface of the ViewGroup.
2. The method of claim 1, wherein integrating a KeyboardView soft keyboard view in a Dialog object comprises:
and setting the content of the DialogView to a KeyboardView soft keyboard view by using a setContentView interface in the Dialogue.
3. The method of claim 1, wherein integrating a KeyboardView soft keyboard view in a Dialog object comprises:
and controlling the keyboard to pop in and pop out by using the show and hide interfaces of Dialog.
4. The method of claim 1, wherein integrating a KeyboardView soft keyboard view in a Dialog object comprises:
the state monitoring of the keyboard is realized by utilizing the setOnShowListener and setOnDismissListener interfaces of Dialog.
5. The method of claim 1, wherein after implementing the related functions in native interface in Java code for calls by Js code in WebView, the method further comprises:
and utilizing an interface loadUrl (javascript: insert (' "+ content +") of WebView to call the function of the Js interface by real Java codes, and submitting the content input by the soft keyboard to a webpage.
6. The method of claim 1, wherein determining the offset height of the soft keyboard by reading a first size parameter of the handset and a second size parameter of the soft keyboard comprises:
acquiring the height screen height of the mobile phone;
acquiring the height keyboardHeight of the soft keyboard;
acquiring the height etHeight of the current edit box from the top of the page;
acquiring a status bar height status;
acquiring the height scrollHeight of the navigation bar;
calculating the occlusion offset height of the keyboard and the edit box as follows:
offsetHeight=(screenHeight-(statusHeight+etHeight))-(keyboardHeight+scrollHeight)。
7. the method of claim 1, wherein moving the entire WebView view up the offset height through the ViewGroup interface comprises:
and dynamically acquiring the offset height, and moving the WebView view upwards in the current view based on the acquired offset height.
8. An apparatus for implementing an android custom soft keyboard using Dialog, comprising:
the device comprises an integration module, a display module and a display module, wherein the integration module is used for integrating a KeyboardView soft keyboard view in a Dialog object so as to facilitate the popup and popup of a keyboard and the state monitoring of the keyboard;
the realization module is used for realizing related functions in a native interface in Java codes for being called by Js codes in WebView so as to facilitate the spreading-in and popping of a safe soft keyboard and the input of contents;
the determining module is used for determining the offset height of the soft keyboard by reading a first size parameter of the mobile phone and a second size parameter of the soft keyboard;
and the moving module is used for moving the whole WebView view upwards by the offset height through the interface of the Viewgroup.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any of the preceding claims 1-7 for implementing an android custom soft keyboard with Dialog.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any of the preceding claims 1-7 for implementing an android custom soft keyboard with Dialog.
CN201911401611.6A 2019-12-30 2019-12-30 Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment Pending CN111190599A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911401611.6A CN111190599A (en) 2019-12-30 2019-12-30 Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911401611.6A CN111190599A (en) 2019-12-30 2019-12-30 Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment

Publications (1)

Publication Number Publication Date
CN111190599A true CN111190599A (en) 2020-05-22

Family

ID=70711110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911401611.6A Pending CN111190599A (en) 2019-12-30 2019-12-30 Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment

Country Status (1)

Country Link
CN (1) CN111190599A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694560A (en) * 2020-05-26 2020-09-22 五八有限公司 Soft keyboard starting method and mobile application development terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331927A (en) * 2011-06-24 2012-01-25 浙大网新科技股份有限公司 Method for integrating soft keyboard input of Wine and Android mobile phone
CN102830930A (en) * 2012-08-15 2012-12-19 Tcl集团股份有限公司 Treatment method and device for keyboard keys and multimedia terminal
US20150269721A1 (en) * 2014-03-19 2015-09-24 International Business Machines Corporation Automated validation of the appearance of graphical user interfaces
CN105700703A (en) * 2016-02-24 2016-06-22 北京小牛互联科技有限公司 Method and device for inserting expressions in character input interface of keyboard and supporting user-defined expressions
CN107741790A (en) * 2016-08-14 2018-02-27 天脉聚源(北京)科技有限公司 A kind of method and system of Android mobile terminal processing text input box

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331927A (en) * 2011-06-24 2012-01-25 浙大网新科技股份有限公司 Method for integrating soft keyboard input of Wine and Android mobile phone
CN102830930A (en) * 2012-08-15 2012-12-19 Tcl集团股份有限公司 Treatment method and device for keyboard keys and multimedia terminal
US20150269721A1 (en) * 2014-03-19 2015-09-24 International Business Machines Corporation Automated validation of the appearance of graphical user interfaces
CN105700703A (en) * 2016-02-24 2016-06-22 北京小牛互联科技有限公司 Method and device for inserting expressions in character input interface of keyboard and supporting user-defined expressions
CN107741790A (en) * 2016-08-14 2018-02-27 天脉聚源(北京)科技有限公司 A kind of method and system of Android mobile terminal processing text input box

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694560A (en) * 2020-05-26 2020-09-22 五八有限公司 Soft keyboard starting method and mobile application development terminal

Similar Documents

Publication Publication Date Title
CN110046021B (en) Page display method, device, system, equipment and storage medium
CN109460233B (en) Method, device, terminal equipment and medium for updating native interface display of page
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
CN109857486B (en) Method, device, equipment and medium for processing program page data
CN109344352B (en) Page loading method and device and electronic equipment
CN110688829B (en) Table generation method, apparatus, device and storage medium
CN111790148B (en) Information interaction method and device in game scene and computer readable medium
WO2020220773A1 (en) Method and apparatus for displaying picture preview information, electronic device and computer-readable storage medium
CN111459364B (en) Icon updating method and device and electronic equipment
US20230401377A1 (en) Document creation method and apparatus, and device and storage medium
CN111290737A (en) Method and device for application program development and electronic equipment
CN110647369B (en) Page dynamic display method and device, mobile terminal and storage medium
CN114363686B (en) Method, device, equipment and medium for publishing multimedia content
CN107168738A (en) Application tool management method, device, equipment and storage medium
CN112492399B (en) Information display method and device and electronic equipment
CN109857503B (en) Page interaction effect self-adaption method and device and electronic equipment
CN109976857B (en) Display control method and device of terminal interface, storage medium and electronic equipment
CN111190599A (en) Method and device for realizing android self-defined soft keyboard by using Dialog and electronic equipment
CN110134477B (en) Method, device, medium and electronic equipment for dynamically laying out user pages
CN110618811B (en) Information presentation method and device
CN109683726B (en) Character input method, character input device, electronic equipment and storage medium
CN111209503A (en) Method and device for processing popup in webpage, electronic equipment and storage medium
CN111309406A (en) Event processing method and device of application program and electronic equipment
CN111324835A (en) Method and device for rendering user interface component, electronic equipment and storage medium
CN108021317B (en) Method and device for screen editing

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