MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / animate

Method animate

CodenameOne/src/com/codename1/ui/TextField.java:1776–1813  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1774
1775 /// {@inheritDoc}
1776 @Override
1777 public boolean animate() {
1778 boolean ani = super.animate();
1779
1780 // while native editing we don't need the cursor animations
1781 if (Display.getInstance().isNativeEditorVisible(this)) {
1782 return ani;
1783 }
1784 if (hasFocus() && isVisible()) {
1785 long currentTime = System.currentTimeMillis();
1786 if (drawCursor) {
1787 if ((currentTime - cursorBlinkTime) > blinkOnTime) {
1788 cursorBlinkTime = currentTime;
1789 drawCursor = false;
1790 return true;
1791 }
1792 } else {
1793 if ((currentTime - cursorBlinkTime) > blinkOffTime) {
1794 cursorBlinkTime = currentTime;
1795 drawCursor = true;
1796 return true;
1797 }
1798 }
1799 if (pressedAndNotReleased) {
1800 if (currentTime - pressTime >= getLongClickDuration()) {
1801 pressedAndNotReleased = false;
1802 longClick(pressedKeyCode);
1803 }
1804 } else {
1805 if (pendingCommit && currentTime - releaseTime > commitTimeout) {
1806 commitChange();
1807 }
1808 }
1809 } else {
1810 drawCursor = false;
1811 }
1812 return ani;
1813 }
1814
1815 /// {@inheritDoc}
1816 @Override

Callers

nothing calls this directly

Calls 9

getInstanceMethod · 0.95
currentTimeMillisMethod · 0.95
getLongClickDurationMethod · 0.95
longClickMethod · 0.95
commitChangeMethod · 0.95
hasFocusMethod · 0.80
animateMethod · 0.65
isVisibleMethod · 0.65
isNativeEditorVisibleMethod · 0.45

Tested by

no test coverage detected