Nothing Special   »   [go: up one dir, main page]

CN107145268B - Method and device for switching navigation bar - Google Patents

Method and device for switching navigation bar Download PDF

Info

Publication number
CN107145268B
CN107145268B CN201710170353.XA CN201710170353A CN107145268B CN 107145268 B CN107145268 B CN 107145268B CN 201710170353 A CN201710170353 A CN 201710170353A CN 107145268 B CN107145268 B CN 107145268B
Authority
CN
China
Prior art keywords
key event
event message
current key
message
navigation bar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710170353.XA
Other languages
Chinese (zh)
Other versions
CN107145268A (en
Inventor
杜文彬
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710170353.XA priority Critical patent/CN107145268B/en
Publication of CN107145268A publication Critical patent/CN107145268A/en
Application granted granted Critical
Publication of CN107145268B publication Critical patent/CN107145268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/04815Interaction with a metaphor-based environment or interaction object displayed as three-dimensional, e.g. changing the user viewpoint with respect to the environment or object

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)
  • Navigation (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The invention provides a method and a device for switching navigation bars, wherein the method comprises the following steps: receiving a current key event message sent by a remote controller, and delaying the current key event message according to preset delay time; receiving a next key event message of the current key event message, judging whether the time interval between the next key event message and the current key event message is greater than a preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message; therefore, after receiving the current key event message, the current key event message is delayed according to the preset delay time, and after receiving the next key event message, the current key event message is distributed to the processing page only after the time interval of the two event messages is greater than the preset delay time, so that the data request is optimized by using a message delay mechanism, the refreshing times of the data request are reduced, and the operation efficiency of a user is improved.

Description

Method and device for switching navigation bar
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a method and a device for switching a navigation bar.
Background
In Android television application, the APP has a navigation bar and sometimes may have a linkage effect of two or three navigation bars, and in the navigation bar switching process, the switching can be realized only by requesting the content under the navigation bar again.
Generally, Android televisions/boxes are controlled to be switched by using a remote controller, when switching is performed, if the remote controller is pressed all the time and is not moved, the focus is controlled to be switched continuously, the navigation bar can refresh request data frequently, and if multi-stage navigation bars are linked, the operation of refreshing the request data can be increased in a geometric mode, so that the operation efficiency of a user is low, and the experience degree is low.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a device for switching a navigation bar, which are used for solving the technical problem that when the navigation bar on an Android television or an Android box is switched rapidly in the prior art, the navigation bar frequently refreshes request data, so that the operation efficiency of a user is reduced.
The invention provides a method for switching a navigation bar, which comprises the following steps:
receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time;
receiving a next key event message corresponding to the current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message.
In the foregoing solution, if the time interval is not greater than the preset delay time, the method further includes:
and deleting the current key event message, and switching the navigation bar according to the next key event message.
In the foregoing solution, before switching the navigation bar according to the current key event message, the method further includes:
and judging whether the first input direction of the current key event message is consistent with the second input direction of the next key event message, and if so, switching the navigation bar according to the current key event message.
In the foregoing solution, if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message includes:
marking the name of the message to be processed;
and judging whether the name of the current key event message is consistent with the name of the message to be processed, if so, calling an OnitemeSelectListener.
In the above solution, the deleting the current key event message and switching the navigation bar according to the next key event message includes:
deleting the current key event message in the main thread message queue by using a Handler;
judging whether the name of the next key event message is consistent with the name of the message to be processed or not, and if so, acquiring the next key event message by using a handler.
Sending the next key event message to a main thread processing page by using a Handler;
and processing the next key event message by using the main thread.
The invention also provides a device for switching the navigation bar, which comprises:
the delay unit is used for receiving a current key event message sent by the remote controller and delaying the current key event message according to preset delay time;
and the judging unit is used for receiving a next key event message corresponding to the current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and switching the navigation bar according to the current key event message if the time interval is greater than the preset delay time.
In the above scheme, the apparatus further comprises: the judging unit is further configured to:
and if the time interval is not greater than the preset delay time, deleting the current key event message, and switching the navigation bar according to the next key event message.
In the foregoing solution, the determining unit is further configured to:
before the navigation bar is switched according to the current key event message, whether a first input direction of the current key event message is consistent with a second input direction of the next key event message is judged, and if so, the navigation bar is switched according to the current key event message.
In the foregoing solution, the determining unit is specifically configured to:
marking the name of the message to be processed;
and judging whether the name of the current key event message is consistent with the name of the message to be processed, if so, calling an OnitemeSelectListener.
In the foregoing solution, the determining unit is further specifically configured to:
deleting the current key event message in the main thread message queue by using a Handler;
judging whether the name of the next key event message is consistent with the name of the message to be processed or not, and if so, acquiring the next key event message by using a handler.
Sending the next key event message to a processing page of a main thread by using a Handler;
and processing the next key event message by using the main thread.
The invention provides a method and a device for switching navigation bars, wherein the method comprises the following steps: receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time; receiving a next key event message corresponding to a key event message at present, judging whether a time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message; thus, after receiving the current key event message, the current key event message is delayed according to the preset delay time, when the user continues to press the remote controller to switch the navigation column, the next key event message is received, and only after the time interval of the two event messages is greater than the preset delay time, the current key event message is distributed to a processing page to be processed, so that the navigation column can be switched according to the current key event message; therefore, the data request is optimized by using the message delay mechanism, the refreshing times of the data request are reduced, and the operation efficiency of a user is improved.
Drawings
Fig. 1 is a schematic flow chart of a method for switching navigation bars according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a navigation bar switching device according to a second embodiment of the present invention.
Detailed Description
In order to improve the operation efficiency of a user when switching a navigation bar, the invention provides a method and a device for switching the navigation bar, wherein the method comprises the following steps: receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time; receiving a next key event message corresponding to the current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message.
The technical solution of the present invention is further described in detail by the accompanying drawings and the specific embodiments.
Example one
The present embodiment provides a method for switching a navigation bar, as shown in fig. 1, the method includes:
s101, receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time.
In this step, when a user needs to watch different television programs by switching the navigation bar of the android TV or the android box, the navigation bar is generally switched by inputting a key event message through a remote controller, and then the server receives a current key event message sent by the remote controller and monitors the current key event message to acquire a first input direction of the remote controller. The key event generally refers to an Onkey event of the remote controller.
Specifically, the monitoring the current key event message to acquire the input direction of the remote controller includes: acquiring a first KeyEvent event message of a current key event message, and determining a first input direction of the current key event message by using a first key code value of the first KeyEvent event message.
Here, in order to avoid that the data request for switching the navigation bar is frequently refreshed due to frequent operations performed by the user in the same input direction (for example, the first input direction is a lower direction, and the second input direction is a lower direction), after receiving the current key event message, the current key event message is delayed according to a preset delay time. Generally, the preset delay time may include 300 to 400ms, and the specific delay time may be determined according to the performance of the server, where the delay time is 300ms in this embodiment.
S102, receiving a next key event message of a current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message.
In this step, after the user inputs a next key event message of the current key event message by using a remote controller, it is determined whether a time interval between the next key event message and the current key event message is greater than the preset delay time, if the time interval is greater than the preset delay time, which indicates that the current key event message is required by the user, the current key event message is distributed to a processing page by using a callback function, and the navigation bar is switched according to the current key event message.
Specifically, when a current key event message is distributed to a processing page by using a callback function and the navigation bar is switched according to the current key event message, an interface onetitemselectListener of the callback function is defined first, and a callback function onetitempoasSelect is defined in the interface.
And then marking the name of the message to be processed, such as a message with message.
After an interface of a callback function and the callback function are defined, a message processing function Handler is defined, whether the name of the current key event message is consistent with the name of the message to be processed or not is judged, if so, a message queue MessageQueue distributes the previous key event message to the Handler, the Handler processes the message calling function HandleMessage, namely, the current key event message is distributed to a processing page of a main thread by calling an OnitemeSelectListener.
If the time interval is not greater than the preset delay time, it indicates that the message queue MessageQueue has not distributed the current key event message to the processing page of the main thread, at this time, the current key event is deleted, and the navigation bar is switched according to the next key event message.
The deleting the current key event and switching the navigation bar according to the next key event message specifically include:
deleting the current key event message in the main thread message queue by using a Handler; judging whether the name of the next key event message is consistent with the name of the message to be processed or not, and if so, acquiring the next key event message by using a handler. Sending the next key event message to a main thread processing page by using a Handler; and processing the next key event message by using the main thread, and after the processing is finished, realizing the switching of the navigation bar.
Of course, after the next key event Message is obtained, the next Message to be processed needs to be delayed by using the function handler. Therefore, when a user presses the remote controller to switch navigation columns, the event Message is sent by delaying 300ms through the Handler, namely the Handler sends the Message to the Message queue, and the Message queue blocks 300ms to distribute the Message, so that when the user quickly inputs two keys in the same direction, frequent data request is avoided, and data request is optimized. In practical applications, for example, the preset delay time is 200ms, if the user presses the key once every 500ms, when the user presses the key twice, the method provided in this embodiment only sends the data request to the server once; however, when the method is implemented according to the prior art, each time a key is pressed, a data request needs to be sent to the server, so that the processing frequency of the server is increased, the processing efficiency of the server is reduced, and the operation efficiency of a user is low.
Here, since the method provided by this embodiment is based on the fact that the two key event messages sent by the remote control device are input in the same direction, before switching the navigation bar according to the current key event message, the method further includes: and judging whether the first input direction of the current key event message is consistent with the second input direction of the next key event message, and if so, switching the navigation bar according to the current key event message.
Similarly, the method for determining the second input direction of the next key event message is the same as the method for determining the first input direction of the current key event message, and specifically, the second KeyEvent message of the next key event message is obtained, and the second input direction of the next key event message is determined by using the second key code value of the second KeyEvent message.
Example two
Corresponding to the first embodiment, this embodiment provides an apparatus for switching a navigation bar, as shown in fig. 2, the apparatus includes: a delay unit 21 and a judgment unit 22; wherein,
when a user needs to watch different television programs by switching the navigation bar of the android TV or the android box, the navigation bar is generally switched by inputting a key event message through a remote controller, and then the delay unit 21 receives a current key event message sent by the remote controller and monitors the current key event message to acquire a first input direction of the remote controller. The key event generally refers to an Onkey event of the remote controller.
Specifically, the step of the delay unit 21 listening to the current key event message to acquire the input direction of the remote controller includes: acquiring a first KeyEvent event message of a current key event message, and determining a first input direction of the current key event message by using a first key code value of the first KeyEvent event message.
Here, in order to avoid that the data request for switching the navigation bar is frequently refreshed due to frequent operations performed by the user in the same input direction (for example, the first input direction is downward, and the second input direction is also downward), the delay unit 21 delays the current key event message according to a preset delay time after receiving the current key event message. Generally, the preset delay time may include 300 to 400ms, and the specific delay time may be determined according to the performance of the server, where the delay time is 300ms in this embodiment.
When the user inputs the next key event message of the current key event message by using the remote controller, the determining unit 22 is configured to determine whether a time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, which indicates that the current key event message is required by the user, distribute the current key event message to a processing page by using a callback function, and switch the navigation bar according to the current key event message.
Specifically, when the judging unit 22 distributes the current key event message to the processing page by using the callback function and switches the navigation bar according to the current key event message, it first defines an interface oneitemselectlistener of the callback function and defines a callback function oneitemposselect in the interface.
And then marking the name of the message to be processed, such as a message with message.
After an interface of a callback function and the callback function are defined, a message processing function Handler is defined, whether the name of the current key event message is consistent with the name of the message to be processed or not is judged, if so, a message queue MessageQueue distributes the previous key event message to the Handler, the Handler processes the message calling function HandleMessage, namely, the current key event message is distributed to a processing page of a main thread by calling an OnitemeSelectListener.
Here, if the determining unit 22 determines that the time interval is not greater than the preset delay time, it indicates that the message queue MessageQueue has not distributed the current key event message to the processing page of the main thread, at this time, the current key event is deleted, and the navigation bar is switched according to the next key event message.
The deleting the current key event and switching the navigation bar according to the next key event message by the determining unit 22 specifically include:
deleting the current key event message in the main thread message queue by using a Handler; the determining unit 22 is further configured to determine whether the name of the next key event message is consistent with the name of the message to be processed, and if so, obtain the next key event message by using a handler. Sending the next key event message to a main thread processing page by using a Handler; and processing the next key event message by using the main thread, and after the processing is finished, realizing the switching of the navigation bar.
Of course, after acquiring the next key event Message, the delay unit 21 also needs to delay the next Message to be processed by using the function handler. Therefore, when a user presses the remote controller to switch navigation columns, the event Message is sent by delaying 300ms through the Handler, namely the Handler sends the Message to the Message queue, and the Message queue blocks 300ms to distribute the Message, so that when the user quickly inputs two keys in the same direction, frequent data request is avoided, and data request is optimized. In practical applications, for example, the preset delay time is 200ms, if the user presses the key once every 500ms, when the user presses the key twice, the method provided in this embodiment only sends the data request to the server once; however, when the method is implemented according to the prior art, each time a key is pressed, a data request needs to be sent to the server, so that the processing frequency of the server is increased, the processing efficiency of the server is reduced, and the operation efficiency of a user is low.
Here, since the method provided by the present embodiment is based on the fact that the two key event messages sent by the remote control are input in the same direction, before the navigation bar is switched according to the current key event message, the determining unit 22 is further configured to: and judging whether the first input direction of the current key event message is consistent with the second input direction of the next key event message, and if so, switching the navigation bar according to the current key event message.
Likewise, the judging unit 22 judges the second input direction of the next key event message in the same manner as the method of judging the first input direction of the current key event message, and in particular, acquires the second KeyEvent message of the next key event message, and determines the second input direction of the next key event message using the second key value of the second KeyEvent message.
The method and the device for switching the navigation bar provided by the embodiment of the invention have the following beneficial effects that:
the invention provides a method and a device for switching navigation bars, wherein the method comprises the following steps: receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time; receiving a next key event message corresponding to a current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message; therefore, after receiving the current key event message, the current key event message is delayed according to the preset delay time, when the user continues to press the remote controller to switch the navigation column, the next key event message is received, the current key event message is distributed to the processing page for processing only after the time interval of the two event messages is greater than the preset delay time, and when the time interval is not greater than the preset delay time, the current key event message is deleted, the navigation column is switched according to the next key event message, so that the data request is optimized by using the message delay mechanism, the refreshing time of the data request is reduced, and the operating efficiency of the user is improved.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.

Claims (8)

1. A method of switching a navigation bar, the method comprising:
receiving a current key event message sent by a remote controller, and delaying the current key event message according to a preset delay time;
receiving a next key event message corresponding to the current key event message, judging whether the time interval between the next key event message and the current key event message is greater than the preset delay time, and if the time interval is greater than the preset delay time, switching the navigation bar according to the current key event message; wherein,
if the time interval is not greater than the preset delay time, the method further comprises:
and deleting the current key event message, and switching the navigation bar according to the next key event message.
2. The method of claim 1, wherein prior to switching the navigation bar according to the current key event message, further comprising:
and judging whether the first input direction of the current key event message is consistent with the second input direction of the next key event message, and if so, switching the navigation bar according to the current key event message.
3. The method of claim 1, wherein switching the navigation bar according to the current key event message if the time interval is greater than the preset delay time comprises:
marking the name of the message to be processed;
and judging whether the name of the current key event message is consistent with the name of the message to be processed, if so, calling an OnitemeSelectListener.
4. The method of claim 3, wherein said deleting the current key event message and switching the navigation bar according to the next key event message comprises:
deleting the current key event message in the main thread message queue by using a Handler;
judging whether the name of the next key event message is consistent with the name of the message to be processed or not, and if so, acquiring the next key event message by using a handler.
Sending the next key event message to a main thread processing page by using a Handler;
and processing the next key event message by using the main thread.
5. An apparatus for switching a navigation bar, the apparatus comprising:
the delay unit is used for receiving a current key event message sent by the remote controller and delaying the current key event message according to preset delay time;
a judging unit, configured to receive a next key event message corresponding to the current key event message, judge whether a time interval between the next key event message and the current key event message is greater than the preset delay time, and switch the navigation bar according to the current key event message if the time interval is greater than the preset delay time; wherein,
the judging unit is further configured to:
and if the time interval is not greater than the preset delay time, deleting the current key event message, and switching the navigation bar according to the next key event message.
6. The apparatus of claim 5, wherein the determining unit is further configured to:
before the navigation bar is switched according to the current key event message, whether a first input direction of the current key event message is consistent with a second input direction of the next key event message is judged, and if so, the navigation bar is switched according to the current key event message.
7. The apparatus according to claim 5, wherein the determining unit is specifically configured to:
marking the name of the message to be processed;
and judging whether the name of the current key event message is consistent with the name of the message to be processed, if so, calling an OnitemeSelectListener.
8. The apparatus according to claim 7, wherein the determining unit is further specifically configured to:
deleting the current key event message in the main thread message queue by using a Handler;
judging whether the name of the next key event message is consistent with the name of the message to be processed or not, and if so, acquiring the next key event message by using a handler.
Sending the next key event message to a processing page of a main thread by using a Handler;
and processing the next key event message by using the main thread.
CN201710170353.XA 2017-03-21 2017-03-21 Method and device for switching navigation bar Active CN107145268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710170353.XA CN107145268B (en) 2017-03-21 2017-03-21 Method and device for switching navigation bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710170353.XA CN107145268B (en) 2017-03-21 2017-03-21 Method and device for switching navigation bar

Publications (2)

Publication Number Publication Date
CN107145268A CN107145268A (en) 2017-09-08
CN107145268B true CN107145268B (en) 2020-06-16

Family

ID=59783619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710170353.XA Active CN107145268B (en) 2017-03-21 2017-03-21 Method and device for switching navigation bar

Country Status (1)

Country Link
CN (1) CN107145268B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023406A (en) * 2015-07-24 2015-11-04 炼马机电(深圳)有限公司 Remote controller control method and system and remote controller

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453619B (en) * 2007-11-30 2011-12-28 康佳集团股份有限公司 Processing method and system for electronic product frequency key pressing
US9060152B2 (en) * 2012-08-17 2015-06-16 Flextronics Ap, Llc Remote control having hotkeys with dynamically assigned functions
CN104301780A (en) * 2014-09-26 2015-01-21 四川长虹电器股份有限公司 Method for frequently switching played video on smart television
CN105791942B (en) * 2014-12-23 2019-03-01 深圳Tcl数字技术有限公司 Channel information display method and device of smart television

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023406A (en) * 2015-07-24 2015-11-04 炼马机电(深圳)有限公司 Remote controller control method and system and remote controller

Also Published As

Publication number Publication date
CN107145268A (en) 2017-09-08

Similar Documents

Publication Publication Date Title
CN110247944B (en) Cross-regional service calling method, device and system and electronic equipment
JP6335738B2 (en) Source terminal, display control system, display control method, display control program
US20160119669A1 (en) Efficient Frame Rendering
KR20130137458A (en) Apparatus and method for display
US9572187B2 (en) Information processing apparatus, information processing method, and program
CN101853121A (en) Picture browsing method and device based on gravity sensor
CN103634636A (en) Application shortcut operation and control method and system of Android intelligent television
CN106648694A (en) Display switching method, device, electronic device and computer readable storage medium
US20130014156A1 (en) Digital content display system and method for providing information during a channel zapping delay
CN105791942A (en) Channel information display method and device of smart television
US10231005B2 (en) Operation instructing method and apparatus for remote controller of intelligent television
US20150371364A1 (en) Display Resolution Negotiation
CN107145268B (en) Method and device for switching navigation bar
CN103024552A (en) Television channel background recognition method
CN103702230B (en) Method for displaying image and device
US20150106531A1 (en) Multicast of stream selection from portable device
US20230345072A1 (en) Server for providing television and system and method for use of same
US20170353762A1 (en) Method for processing global key of smart television and system thereof
CN103986961A (en) Method and device for achieving picture in picture based on QNX vehicle-mounted system
CN106303691B (en) Video frame sends system and video frame sending method
US10575049B2 (en) Broadcasting signal receiving apparatus and control method thereof
CN109040018B (en) Data matching method and device, display terminal and readable storage medium
CN106101803B (en) Display screen control method and system of smart television
US20170245007A1 (en) Television system and method for promptly displaying information on television system
CN103813194A (en) Information processing method and electronic device

Legal Events

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