CN116627294A - Menu display method and device based on android system and storage medium - Google Patents

Menu display method and device based on android system and storage medium Download PDF

Info

Publication number
CN116627294A
CN116627294A CN202310559223.0A CN202310559223A CN116627294A CN 116627294 A CN116627294 A CN 116627294A CN 202310559223 A CN202310559223 A CN 202310559223A CN 116627294 A CN116627294 A CN 116627294A
Authority
CN
China
Prior art keywords
menu
click
event
target icon
icon
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
CN202310559223.0A
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.)
Shenzhen Ruiboshi Software Co ltd
Original Assignee
Shenzhen Ruiboshi Software 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 Shenzhen Ruiboshi Software Co ltd filed Critical Shenzhen Ruiboshi Software Co ltd
Priority to CN202310559223.0A priority Critical patent/CN116627294A/en
Publication of CN116627294A publication Critical patent/CN116627294A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus
    • 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)
  • 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 application provides a menu display method, a device and a storage medium based on an android system, which are used for responding to click operation and identifying whether the click operation is right click operation or not; when the click operation is identified as a right click operation, detecting whether the operation position corresponding to the click operation is the position of a target icon or not; when the operation position corresponding to the clicking operation is detected to be the position of the target icon, invoking a right-key menu event corresponding to the target icon, and distributing the right-key menu event to a view monitor; processing a right key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon; interaction modes with applications under the android system can be enriched.

Description

Menu display method and device based on android system and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a menu display method and apparatus based on an android system, and a storage medium.
Background
Android (Android) is an operating system based on free and open source code of the Linux kernel (without GNU components), and is a very popular operating system at present.
Unlike the operation logic of windows systems, in which the android system is capable of interacting with applications by clicking, the android system is capable of returning to an event, such as returning to a previous interface, and in the current android system, only a single interaction can be performed by clicking with applications.
Disclosure of Invention
The application provides a menu display method, a menu display device and a storage medium based on an android system, which can enrich interaction modes with applications under the android system.
In a first aspect, the present application provides a menu display method based on an android system, including:
in response to a click operation, identifying whether the click operation is a right click operation;
when the click operation is identified as a right click operation, detecting whether the operation position corresponding to the click operation is the position of a target icon or not;
when the operation position corresponding to the clicking operation is detected to be the position of the target icon, invoking a right-key menu event corresponding to the target icon, and distributing the right-key menu event to a view monitor;
and processing a right-key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon.
Optionally, in some embodiments of the present application, the processing, by a preset interface method, a right-click menu event in the view monitor to display a menu corresponding to the target icon includes:
acquiring click coordinates of the right-click menu event through a preset control interface method;
and displaying a menu corresponding to the target icon based on interface parameters of a preset menu interface method and the click coordinates.
Optionally, in some embodiments of the present application, displaying the menu corresponding to the target icon based on the interface parameter of the preset menu interface method and the click coordinate includes:
acquiring view parameters and window attribute parameters of a preset menu interface method;
setting a menu display position and a menu display size of a menu corresponding to the target icon based on the window attribute parameter and the click coordinate;
acquiring menu display content corresponding to the target icon according to the view parameter;
and displaying the menu corresponding to the target icon based on the menu display position, the menu display size and the menu display content.
Optionally, in some embodiments of the present application, the detecting whether the operation position corresponding to the click operation is a position of the target icon includes:
determining operation coordinates corresponding to the operation positions;
acquiring an application list of an installed application program;
traversing the icon and the position corresponding to each application program in the application list;
detecting whether the operation position corresponding to the clicking operation is the position of any icon or not according to the operation coordinates, the icons and the positions corresponding to each application program;
when the operation position corresponding to the clicking operation is detected to be the position of any icon, determining the clicked icon as a target icon, and determining the operation position corresponding to the clicking operation as the position of the target icon.
Optionally, in some embodiments of the present application, further includes:
and when the operation position corresponding to the clicking operation is not detected to be the position of any icon, determining the area corresponding to the clicking operation as a blank area.
Optionally, in some embodiments of the present application, before the identifying, in response to the click operation, whether the click operation is a right click operation, the method further includes:
acquiring an initial result event corresponding to a right click operation;
and in response to a modification operation for the initial result event, modifying the initial result event into a right click display menu event.
Optionally, in some embodiments of the present application, the identifying, in response to a click operation, whether the click operation is a right click operation further includes:
acquiring an application type of an installable application;
and responding to a menu setting operation aiming at the application type, and binding the application type with preset menu contents.
In a second aspect, the present application further provides a menu display device based on an android system, including:
the identification module is used for responding to the click operation and identifying whether the click operation is a right click operation or not;
the detection module is used for detecting whether the operation position corresponding to the click operation is the position of the target icon or not when the click operation is identified as the right click operation;
the calling module is used for calling a right-key menu event corresponding to the target icon when the operation position corresponding to the clicking operation is detected to be the position of the target icon, and distributing the right-key menu event to the view monitor;
and the processing module is used for processing the right-key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon.
Optionally, in some embodiments of the application, the processing module comprises:
the acquisition unit is used for acquiring the click coordinates of the right key menu event through a preset control interface method;
and the display unit is used for displaying a menu corresponding to the target icon based on interface parameters of a preset menu interface method and the click coordinates.
In a third aspect, the present application further provides a computer storage medium, where a computer program is stored, where the computer program is executed to implement any one of the above methods for displaying a menu based on the android system.
After a click operation is identified, whether the click operation is a right click operation or not is identified, when the click operation is identified as the right click operation, whether an operation position corresponding to the click operation is a position of a target icon or not is detected, when the operation position corresponding to the click operation is detected as the position of the target icon, a right-click menu event corresponding to the target icon is called, the right-click menu event is distributed to a view monitor, and finally, the right-click menu event in the view monitor is processed through a preset interface method so as to display a menu corresponding to the target icon. In the menu display scheme based on the android system, when the click operation is determined to be the right click operation and the target icon is clicked, the right-click menu event corresponding to the target icon is called and distributed to the view monitor, and finally, the right-click menu event in the view monitor is processed through the preset interface method to display the menu corresponding to the target icon, so that richer interaction with the application icon can be performed through the right click instead of executing a simple return event, and the interaction mode with the application under the android system can be enriched.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments are briefly described below, and the drawings in the following description are only drawings corresponding to some embodiments of the present application, and it is possible for a person skilled in the art to obtain drawings of other embodiments according to these drawings without inventive effort.
Fig. 1 is a flow chart of a menu display method based on an android system according to an embodiment of the present application;
fig. 2 is an interface schematic diagram of a menu display method based on an android system according to an embodiment of the present application;
fig. 3 is another flow chart of a menu display method based on an android system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a menu display device based on an android system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application 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 application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
Referring to fig. 1, the menu display method based on the android system comprises the following steps:
101. in response to the click operation, it is identified whether the click operation is a right click operation.
Whether or not the listening click operation is a right click operation is monitored through a listener interface ongenericketionlist, which is a listener interface that handles input devices, various types of input device events such as a mouse, a trackball, a game pad, etc. can be listened to. When the input device has an associated event, the corresponding method in OnGenericmiotoionListener is recalled for processing. The implementation principle of the method is that the input device event is monitored through the InputManager service of the android system. When an event occurs in the input device, the InputManager passes the event to the current window, which then distributes the event to the view that binds OnGenericmotionListener, which is processed by calling the OnGenericmotionListener method (). In the ongenericnote () method, related information of an event, such as event type, device ID, coordinates, and the like, can be acquired.
For example, specifically, the monitor setOnGenericmotionListener monitors the click operation, after the monitor setOnGenericmotionListener monitors the click operation, the click operation is distributed to the OnGenericmotionListener interface, when the OnGenericmotionListener interface captures the AMOTION_event_BUTTON_SECONDARY in the click operation, the click operation is determined to be the right click operation.
It should be noted that, in the existing android system, the event corresponding to the right click is a return event, so, in order to implement the function of the right click output menu in this embodiment, before identifying whether the click operation is a right click operation, the event corresponding to the right click operation is preset to be a right click icon-display menu, that is, optionally, in some embodiments, before "in response to the click operation, identifying whether the click operation is a right click operation", the step may specifically further include:
(11) Acquiring an initial result event corresponding to a right click operation;
(12) In response to a modification operation for the initial result event, the initial result event is modified to a right click display menu event.
In this embodiment, the original result EVENT of the mouse mBtnRight (i.e., right click) is modified to be an event_event_button_back (i.e., right click BACK), and this modification will cause the android system to globally not respond to the event_button_back function of the original right mouse BUTTON, but respond to the specific function of the event_button_back, where the event_button_back is a constant representing the right mouse BUTTON EVENT and has a value of 2.
When the user presses the right mouse button, the android system passes the event to the onTouchEvent () method of the current active page. In the onTouchEvent () method, the currently pressed mouse BUTTON can be obtained through the getActionButton () method of the MotionEvent object, and if the value is AMOTION_EVENT_BUTTON_SECONDARY, the right mouse BUTTON EVENT is indicated. When the click operation is identified as a right click operation, step 102 is performed.
In addition, it should be further noted that, the menu content corresponding to the different types of applications is different, based on this, before the menu is displayed by right clicking, the menu content corresponding to the different types of applications needs to be preset, that is, optionally, in some embodiments, the step of "in response to the click operation, identifying whether the click operation is a right clicking operation" may specifically include:
(21) Acquiring an application type of an installable application;
(22) And binding the application type with preset menu content in response to the menu setting operation aiming at the application type.
Wherein, the application type of the installable application refers to: under the android system, a user can select an installed application, such as a game application, a media application and an office application, for example, the menu content corresponding to the game application is opened, deleted and uninstalled, the menu content corresponding to the media application is opened, deleted, uninstalled and previewed, the menu content corresponding to the office application is opened, deleted, uninstalled and windowed, wherein deletion refers to an icon of a hidden application, uninstalled refers to an icon of a hidden application, and a program file of the application is emptied, windowed refers to opening the application and displaying in a window form, and engineering personnel can set the menu content bound by different types of applications according to actual requirements, which is not repeated herein.
102. When the click operation is identified as the right click operation, detecting whether the operation position corresponding to the click operation is the position of the target icon.
After the OnGenericmotionListener interface captures the AMOTION_EVENT_BUTTON_SECONDARY in the clicking operation, the operation position corresponding to the clicking operation can be obtained, whether the operation position is the position of the target icon is detected, and if the operation position is detected to be the position of the target icon, step 103 is executed.
Detecting whether the operation position is the position of the target icon specifically may be performed by determining the coordinate a (x, y) of the operation position on the screen, then detecting whether the coordinate a (x, y) is located in the icon area corresponding to the target icon, and if it is detected that the coordinate a (x, y) is located in the icon area corresponding to the target icon, executing step 103; if the coordinates a (x, y) are detected not to be positioned in the icon area corresponding to the target icon, no response is triggered.
Optionally, in some embodiments, the step of "detecting whether the operation position corresponding to the click operation is the position of the target icon" may specifically include:
(31) Determining operation coordinates corresponding to the operation positions;
(32) Acquiring an application list of an installed application program;
(33) Traversing the icon and the position corresponding to each application program in the application list;
(34) Detecting whether the operation position corresponding to the clicking operation is the position of any icon or not according to the operation coordinates, the icon and the position corresponding to each application program;
(35) When the operation position corresponding to the clicking operation is detected to be the position of any icon, the clicked icon is determined to be the target icon, and the operation position corresponding to the clicking operation is determined to be the position of the target icon.
For example, specifically, the click coordinates corresponding to the right click event are converted into coordinates in a screen, an icon and a position corresponding to each application program in the application list are traversed by a package manager (packagedianaager), then, whether the operation position corresponding to the click operation is the position of any icon or not is detected according to the operation coordinates and the icon and the position corresponding to each application program, when the operation position corresponding to the click operation is detected to be the position of any icon, the clicked icon is determined to be the target icon, and the operation position corresponding to the click operation is determined to be the position of the target icon. The packagedinfo is obtained through a getpackagedinfo () method, such as public abstract List < packagedinfo > getInstalledPackages (int flags), returns all packagedinfos of a given condition, such as returning package information of each application program in an application list, and further, can use public abstractDrawable getApplicationIcon (String packageName) to obtain an icon of a given package name, otherwise, returns null, thereby obtaining an icon and a position corresponding to each application program in the application list, and of course, can obtain all applications through the following codes:
private void getAppInfo(ApplicationInfo applicationInfo){
string appname=applicationinfo.loadlabel (pm). ToString (); application name//
String packageName = applicationinfo. Packagename; name of the packet
System.out.printin ("application name:" +appname+ "package name:" +packagename);
optionally, in some embodiments, when the operation position corresponding to the clicking operation is not detected to be the position of any icon, the area corresponding to the clicking operation is determined to be a blank area.
103. And when the operation position corresponding to the clicking operation is detected to be the position of the target icon, calling a right-key menu event corresponding to the target icon, and distributing the right-key menu event to the view monitor.
As in the previous embodiment, the right click corresponding result event is modified to be a menu event in advance, the InputManager service of the android system listens for the input device event, when the input device has an event, the InputManager will transfer the event to the current window, then the window will distribute the event to the view listener binding on genericketionlist, the view listener will perform subsequent processing, when the view listener determines that the click operation is right click and the position of the click is icon, the true is returned, and then the event is consumed and the menu is popped up, i.e. step 104 is executed.
104. And processing a right-key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon.
The right-click menu event in the view listener may be processed through a preset interface method, for example, through an ongenericmacintonation () method in the view listener, the click coordinates are determined in response to the right-click menu event, and then, the menu of the target icon is displayed by using a showovertypapump (view, event, appItem) method and the click coordinates, that is, optionally, in some embodiments, the step of processing the right-click menu event in the view listener through the preset interface method to display the menu corresponding to the target icon may specifically include:
(41) Acquiring click coordinates of a right key menu event through a preset control interface method;
(42) And displaying a menu corresponding to the target icon based on interface parameters and click coordinates of a preset menu interface method.
The showOverlayPopup (view, event, appItem) method includes a windowmanager/addview operation, in the present application, menu display is performed by using the windowmanager/addview operation, coordinates (i.e., click coordinates) obtained by the ongenericmion () method are determined based on the windowmanager/addview operation, and thus, menu display of a target icon is achieved, that is, optionally, in some embodiments, the step of displaying a menu corresponding to the target icon "based on interface parameters and click coordinates of a preset menu interface method may specifically include:
(51) Acquiring view parameters and window attribute parameters of a preset menu interface method;
(52) Setting a menu display position and a menu display size of a menu corresponding to the target icon based on the window attribute parameters and the click coordinates;
(53) Acquiring menu display content corresponding to the target icon according to the view parameter;
(54) And displaying the menu corresponding to the target icon based on the menu display position, the menu display size and the menu display content.
For example, specifically, menu display is performed by a windowmanager, addview (View, view group, layoutparameters), it should be noted that, in the present application, the menu corresponding to the target icon is actually a window in the android system, the View parameter, that is, the window display content, is a window attribute parameter, the window position and the window size are set by the layoutparameters, the coordinates (the abscissa and the ordinate in the screen) obtained by the method of ongeneriction () are combined with the layoutparameters. X, layoutparameters. Y, the window display position (that is, the menu display position), optionally, in some embodiments, the click coordinate is a coordinate point in the upper left corner of the menu, and in addition, the size of the menu is set by the layoutparameters. Width, layoutheight attribute values.
All views in Android are presented through windows, and menus provided by the application are also of a type of windows, all views in Android are presented through windows, and in the using process, a user cannot directly access windows, and in order to operate windows, the user must pass through a Window manager. There are three common methods for WindowManager: the application sets a window in which a menu is located through windowmanager, and sets a combined control in the newly added window through an onDraw () method, thereby obtaining a menu of a target icon, and the menu comprises three menu items of opening, deleting, unloading and the like, as shown in fig. 2, after a user clicks the target icon on the right button, the menu is output at the target icon, and the user can interact with an application by clicking the corresponding menu item.
In order to further understand the menu display scheme of the present application, the following will further describe, referring to fig. 3, fig. 3 is another flow chart of the menu display method based on the android system provided by the embodiment of the present application.
Specifically, when a user uses an electronic device of an android system, clicking a certain icon through a right button of a mouse, after a setOnGenericmioteListener in the electronic device monitors a mouse clicking operation, distributing the clicking event to OnGenericmiote (View, motionEvent event), judging whether the clicking event is a right button clicking event of the mouse through OnGenericmiote (View, motionEvent event), if the clicking event is a right button clicking event of the mouse, returning true, consuming the event and popup a menu; if the click event is not a right click event, return false and then continue to distribute the click event.
Wherein, judge and select the icon mode as: the coordinates of the mouse click event are converted to coordinates on the screen. The PackageManager class is used to obtain a list of installed applications and to cycle through the list, while obtaining the icon and location information for each application. Judging whether the coordinate clicked by the user is in the icon area of a certain application program or not, and if the coordinate clicked by the user is in the icon area of the certain application program, indicating that the application program is selected by the user; if the coordinates clicked by the user are not within the icon area of any application program, the user is indicated to click the blank area.
The whole process can be simplified as follows: monitoring right click operation of a mouse; if right click operation exists, judging whether the click position is the icon position or not; if the click position is the icon position, a custom AMOTION_EVENT_BUTTON_SECONDARY EVENT is invoked. The function of the self-defined AMOTION_EVENT_BUTTON_SECONDARY EVENT is to display a preset menu at a set position corresponding to an icon, wherein the display mode is to call an onGenericdown () method in an OnGenericdown menu, and the corresponding menu can be displayed by right clicking through setting coordinates (menu display position) and EVENT contents (i.e. different menus) in the function.
In the android system, the value of AMOTION_EVENT_BUTTON_SECONDARY is a constant representing a right mouse BUTTON EVENT, which is 2. When the user presses the right mouse button, the android system passes the event to the onTouchEvent () method of the current active page. In the onTouchEvent () method, the currently pressed mouse BUTTON can be obtained through the getActionButton () method of the MotionEvent object, and if the value is amoton_event_button_second, the right mouse BUTTON EVENT is indicated.
It can be understood that when the right button of the mouse is clicked, the current View has the capability of monitoring the moving coordinate of the mouse through the setOnGenericmiosis list in the View of the desktop APP, the current position of the mouse can be captured through monitoring the OnGenericmiosis list, so that the icon selected by the mouse can be judged, when the mouse coordinate area falls on the area with the icon, the menu popped up by the right button is displayed through the showcase pop-up function, the menu content can be set according to the actual requirement, the layout design can be carried out, meanwhile, the function point expansion is carried out, the corresponding functions such as opening, deleting, unloading and renaming are realized, different menus are displayed aiming at different icons, the main functions are consistent, different file formats have different sub-option expansion and are consistent with the pop-up menu of the right button of Windows; at present, if the mouse coordinate falls in the blank area, returning to NULL, and no pop-up menu exists.
It should be noted that, the showoverlay includes a windowmanager.addview operation, and the output menu is implemented by a windowmanager.addview () method for the right click EVENT of the mouse, where windowmanager service is a window management service located in the frame layer, and its responsibility is all windows in the management system. This modification will result in the android system global no longer responding to the original mouse right BUTTON's amotin_event_button_back function, i.e., after modification, clicking the mouse right BUTTON will no longer respond to the return function.
The following is a specific process of clicking the right button by the mouse and popup the menu, which can be specifically as follows:
1. the MotionEvent parameter in the right mouse button processing event ongenericmion (View v, motionEvent event) is provided with an event type and a mouse click position (x and y values on two-dimensional coordinates of the mouse);
the windowmanager, addview (View View, viewGroup. LayoutParams) displays a menu by this method, which is a widnow window in the system. The view parameter is the display content of the window, the layoutParams is the window attribute parameter, and the window position, the window size and the like are set by setting the layoutParams attribute value. The window display position is set through the values of x and y obtained in the ongenericmion method through layoutparameters.x and layoutparameters.y, and the coordinate points at the left upper corner of the window are the values of x and y. The window size may be set by a layoutParams.width, layoutParams.height attribute value.
The specific source codes are as follows:
3. the parameter view refers to a system control, namely the menu content, and usually, the menu control can be realized by a custom control mode, and a common custom mode such as an onDraw mode draws and combines the controls. The menu control is realized by a mode of combining the controls, and a mode of easily combining a plurality of basic controls of the system by customizing the layout of the system.
It should be noted that, in android development, there are various ways to draw an interface, and the most common way is to draw an image on a View or custom control (custom View) by overlaying the onDraw () method. The onDraw () method is an important callback method that will be called when View or CustomView draws itself. In order to realize the function, firstly, the right click is bound with the pop-up menu item, secondly, a menu control covering an icon is set through an onDraw () method, and a user can interact with the menu item clicking the menu control, so that interaction between the menu and an application through a target icon is realized, and in the following process of function expansion, an engineer can increase or decrease the function of the menu control according to actual requirements.
Wherein the menu items of the menu comprise at least the following functions:
opening: startActivity ();
deletion: viewGroup.removeView ();
unloading: the jump system app uninstalls the interface.
According to the android system-based menu display method, after a click operation is responded, whether the click operation is a right click operation is identified, when the click operation is identified as the right click operation, whether an operation position corresponding to the click operation is a position of a target icon is detected, when the operation position corresponding to the click operation is detected as the position of the target icon, a right-click menu event corresponding to the target icon is called, the right-click menu event is distributed to a view monitor, and finally, the right-click menu event in the view monitor is processed through a preset interface method to display a menu corresponding to the target icon. In the menu display scheme based on the android system, when the click operation is determined to be the right click operation and the target icon is clicked, the right-click menu event corresponding to the target icon is called and distributed to the view monitor, and finally, the right-click menu event in the view monitor is processed through the preset interface method to display the menu corresponding to the target icon, so that richer interaction with the application icon can be performed through the right click instead of executing a simple return event, and the interaction mode with the application under the android system can be enriched.
Accordingly, referring to fig. 4, an embodiment of the present application provides a menu display device (hereinafter referred to as a display device) based on an android system, including:
an identifying module 201, configured to identify, in response to the click operation, whether the click operation is a right click operation;
the detection module 202 is configured to detect, when it is identified that the click operation is a right click operation, whether an operation position corresponding to the click operation is a position of the target icon;
the calling module 203 is configured to, when detecting that an operation position corresponding to the clicking operation is a position where the target icon is located, call a right-key menu event corresponding to the target icon, and distribute the right-key menu event to the view monitor;
and the processing module 204 is configured to process the right-click menu event in the view monitor by using a preset interface method, so as to display a menu corresponding to the target icon.
Alternatively, in some embodiments, the processing module 204 may specifically include:
the acquisition unit is used for acquiring click coordinates of the right-click menu event through a preset control interface method;
and the display unit is used for displaying a menu corresponding to the target icon based on the interface parameters and the click coordinates of the preset menu interface method.
Alternatively, in some embodiments, the display unit may be specifically configured to: acquiring view parameters and window attribute parameters of a preset menu interface method; setting a menu display position and a menu display size of a menu corresponding to the target icon based on the window attribute parameter and the click coordinate; acquiring menu display content corresponding to the target icon according to the view parameter; and displaying the menu corresponding to the target icon based on the menu display position, the menu display size and the menu display content.
Optionally, in some embodiments, the detection module 202 may be specifically configured to: determining operation coordinates corresponding to the operation positions; acquiring an application list of an installed application program; traversing the icon and the position corresponding to each application program in the application list; detecting whether the operation position corresponding to the clicking operation is the position of any icon or not according to the operation coordinates, the icon and the position corresponding to each application program; when the operation position corresponding to the clicking operation is detected to be the position of any icon, the clicked icon is determined to be the target icon, and the operation position corresponding to the clicking operation is determined to be the position of the target icon.
Optionally, in some embodiments, the detection module 202 may be further specifically configured to: and when the operation position corresponding to the clicking operation is not detected to be the position of any icon, determining that the area corresponding to the clicking operation is a blank area.
As can be seen from the foregoing, in the android system-based menu display device provided in this embodiment, after the recognition module 201 is configured to recognize whether the clicking operation is a right-click operation in response to the clicking operation, the detection module 202 is configured to detect, when the clicking operation is recognized as the right-click operation, whether the operation position corresponding to the clicking operation is the position of the target icon, the calling module 203 is configured to, when the operation position corresponding to the clicking operation is detected as the position of the target icon, call the right-click menu event corresponding to the target icon, and distribute the right-click menu event to the view monitor, and finally, the processing module 204 processes the right-click menu event in the view monitor through a preset interface method to display the menu corresponding to the target icon, and when the clicking operation is determined as the right-click operation, and the target icon is clicked, call the right-click menu event corresponding to the target icon, and finally, process the right-click menu event in the view monitor through a preset interface method to display the menu corresponding to the target icon, thereby, the menu corresponding to the target icon can be interacted with the application icon through right-click, and the menu event can be returned to the android system in a richer manner.
The embodiment of the application also provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program realizes the steps of any one of the above method embodiments when being loaded and executed by the controller.
The embodiment of the application also provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed, the method steps of any one of the above method embodiments are realized.
In the foregoing embodiments of 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 application 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. The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium.
Based on such understanding, the technical solution of the present application may be embodied in essence or contributing part or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a mobile terminal, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In summary, although the present application has been described with reference to the preferred embodiments, the scope of the application is not limited thereto, and any person skilled in the art who is skilled in the art should make equivalent substitutions or modifications according to the technical scheme of the present application within the scope of the present application.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.

Claims (10)

1. The menu display method based on the android system is characterized by comprising the following steps of:
in response to a click operation, identifying whether the click operation is a right click operation;
when the click operation is identified as a right click operation, detecting whether the operation position corresponding to the click operation is the position of a target icon or not;
when the operation position corresponding to the clicking operation is detected to be the position of the target icon, invoking a right-key menu event corresponding to the target icon, and distributing the right-key menu event to a view monitor;
and processing a right-key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon.
2. The method according to claim 1, wherein the processing the right-click menu event in the view listener by the preset interface method to display the menu corresponding to the target icon includes:
acquiring click coordinates of the right-click menu event through a preset control interface method;
and displaying a menu corresponding to the target icon based on interface parameters of a preset menu interface method and the click coordinates.
3. The method according to claim 2, wherein displaying the menu corresponding to the target icon based on the interface parameter of the preset menu interface method and the click coordinates includes:
acquiring view parameters and window attribute parameters of a preset menu interface method;
setting a menu display position and a menu display size of a menu corresponding to the target icon based on the window attribute parameter and the click coordinate;
acquiring menu display content corresponding to the target icon according to the view parameter;
and displaying the menu corresponding to the target icon based on the menu display position, the menu display size and the menu display content.
4. The method according to claim 1, wherein the detecting whether the operation position corresponding to the click operation is a position of a target icon includes:
determining operation coordinates corresponding to the operation positions;
acquiring an application list of an installed application program;
traversing the icon and the position corresponding to each application program in the application list;
detecting whether the operation position corresponding to the clicking operation is the position of any icon or not according to the operation coordinates, the icons and the positions corresponding to each application program;
when the operation position corresponding to the clicking operation is detected to be the position of any icon, determining the clicked icon as a target icon, and determining the operation position corresponding to the clicking operation as the position of the target icon.
5. The method as recited in claim 4, further comprising:
and when the operation position corresponding to the clicking operation is not detected to be the position of any icon, determining the area corresponding to the clicking operation as a blank area.
6. The method of any one of claims 1 to 5, wherein in response to a click operation, identifying whether the click operation was preceded by a right click operation further comprises:
acquiring an initial result event corresponding to a right click operation;
and in response to a modification operation for the initial result event, modifying the initial result event into a right click display menu event.
7. The method of any one of claims 1 to 5, wherein the identifying, in response to a click operation, whether the click operation is a right click operation further comprises:
acquiring an application type of an installable application;
and responding to a menu setting operation aiming at the application type, and binding the application type with preset menu contents.
8. An android system-based menu display device, comprising:
the identification module is used for responding to the click operation and identifying whether the click operation is a right click operation or not;
the detection module is used for detecting whether the operation position corresponding to the click operation is the position of the target icon or not when the click operation is identified as the right click operation;
the calling module is used for calling a right-key menu event corresponding to the target icon when the operation position corresponding to the clicking operation is detected to be the position of the target icon, and distributing the right-key menu event to the view monitor;
and the processing module is used for processing the right-key menu event in the view monitor through a preset interface method so as to display a menu corresponding to the target icon.
9. The apparatus of claim 8, wherein the processing module comprises:
the acquisition unit is used for acquiring the click coordinates of the right key menu event through a preset control interface method;
and the display unit is used for displaying a menu corresponding to the target icon based on interface parameters of a preset menu interface method and the click coordinates.
10. A storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the android system based menu display method of any of claims 1-7.
CN202310559223.0A 2023-05-17 2023-05-17 Menu display method and device based on android system and storage medium Pending CN116627294A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310559223.0A CN116627294A (en) 2023-05-17 2023-05-17 Menu display method and device based on android system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310559223.0A CN116627294A (en) 2023-05-17 2023-05-17 Menu display method and device based on android system and storage medium

Publications (1)

Publication Number Publication Date
CN116627294A true CN116627294A (en) 2023-08-22

Family

ID=87596643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310559223.0A Pending CN116627294A (en) 2023-05-17 2023-05-17 Menu display method and device based on android system and storage medium

Country Status (1)

Country Link
CN (1) CN116627294A (en)

Similar Documents

Publication Publication Date Title
US10762277B2 (en) Optimization schemes for controlling user interfaces through gesture or touch
US9507791B2 (en) Storage system user interface with floating file collection
CN107066188B (en) A kind of method and terminal sending screenshot picture
WO2019047189A1 (en) Message display method and device and terminal
US20230195298A1 (en) Permission setting method and apparatus and electronic device
EP2807541B1 (en) Image-based application automation
CN103902258A (en) Method and device for displaying self-defined menu in webpage
CN112162807A (en) Function execution method and device
CN113794795B (en) Information sharing method and device, electronic equipment and readable storage medium
CN107391914B (en) Parameter display method, device and equipment
CN111324398B (en) Method, device, terminal and storage medium for processing latest content
CN108780400A (en) Data processing method and electronic equipment
CN113268182B (en) Application icon management method and electronic device
CN110908552B (en) Multi-window operation control method, device, equipment and storage medium
US8719704B2 (en) Seamless integration of additional functionality into enterprise software without customization or apparent alteration of same
CN115454296B (en) Intelligent fusion method for user behaviors in cross-operation environment
CN103744573A (en) Data quick viewing and analyzing system based on graphic device interface
CN116627294A (en) Menu display method and device based on android system and storage medium
CN114911402A (en) Dragging interaction method and system between remote application and local system
CN112433723A (en) Personalized list development method and device
CN108108077B (en) Desktop management method and device
CN117193899A (en) Icon interaction method and device based on android system and storage medium
CN111966367B (en) Data deleting method and device and electronic equipment
CN113393373B (en) Icon processing method and device
CN116820296A (en) Left click operation interaction method and device based on android system and storage medium

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