1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/wearable/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>Gles2WatchFaceService.Engine</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190<div class="sum-details-links"> 191 192Summary: 193 194 195 196 197 198 199 200 201 202 <a href="#pubctors">Ctors</a> 203 204 205 206 207 | <a href="#pubmethods">Methods</a> 208 209 210 211 212 | <a href="#inhmethods">Inherited Methods</a> 213 214| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 215 216</div><!-- end sum-details-links --> 217</div><!-- end api-info-block --> 218 219<div class="api apilevel-" id="jd-content"> 220 221<!-- ======== START OF CLASS DATA ======== --> 222 223<h1 class="api-title">Gles2WatchFaceService.Engine</h1> 224<p> 225<code class="api-signature"> 226 public 227 228 229 230 class 231 Gles2WatchFaceService.Engine 232</code> 233<br> 234 235 236<code class="api-signature"> 237 238 239 240</code> 241 242<code class="api-signature"> 243 244 245 246</code> 247 248<code class="api-signature"> 249 250 extends <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">WatchFaceService.Engine</a> 251 252 253 254</code> 255 256<code class="api-signature"> 257 258 259 260</code> 261 262</p><table class="jd-inheritance-table"> 263 264 265 <tr> 266 267 <td colspan="4" class="jd-inheritance-class-cell">java.lang.Object 268 </td> 269 </tr> 270 271 272 <tr> 273 274 <td class="jd-inheritance-space"> ↳</td> 275 276 <td colspan="3" class="jd-inheritance-class-cell">android.service.wallpaper.WallpaperService.Engine 277 </td> 278 </tr> 279 280 281 <tr> 282 283 <td class="jd-inheritance-space"> </td> 284 285 <td class="jd-inheritance-space"> ↳</td> 286 287 <td colspan="2" class="jd-inheritance-class-cell"><a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">android.support.wearable.watchface.WatchFaceService.Engine</a> 288 </td> 289 </tr> 290 291 292 <tr> 293 294 <td class="jd-inheritance-space"> </td> 295 296 <td class="jd-inheritance-space"> </td> 297 298 <td class="jd-inheritance-space"> ↳</td> 299 300 <td colspan="1" class="jd-inheritance-class-cell">android.support.wearable.watchface.Gles2WatchFaceService.Engine 301 </td> 302 </tr> 303 304 305</table> 306 307 308 309 310<br><hr> 311 312 313 <p>The actual implementation of a watch face that draws using OpenGL ES 2.0. You must implement 314 <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.html#onCreateEngine()">onCreateEngine()</a></code> to return your concrete Engine 315 implementation. 316</p> 317 318 319 320 321 322 323 324<h2 class="api-section">Summary</h2> 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348<!-- ======== CONSTRUCTOR SUMMARY ======== --> 349<table id="pubctors" class="responsive constructors"> 350<tr><th colspan="2"><h3>Public constructors</h3></th></tr> 351 352 353 354 355 <tr class="api apilevel-" > 356 357 358 <td width="100%"> 359 <code> 360 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#Gles2WatchFaceService.Engine()">Gles2WatchFaceService.Engine</a>() 361 </code> 362 363 </td> 364 </tr> 365 366 367 368</table> 369 370 371 372 373 374 375<!-- ========== METHOD SUMMARY =========== --> 376<table id="pubmethods" class="responsive methods"> 377<tr><th colspan="2"><h3>Public methods</h3></th></tr> 378 379 380 381 382 <tr class="api apilevel-" > 383 384 385 <td><code> 386 387 388 389 390 391 EGLConfig</code> 392 </td> 393 394 <td width="100%"> 395 <code> 396 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#chooseEglConfig(android.opengl.EGLDisplay)">chooseEglConfig</a>(EGLDisplay eglDisplay) 397 </code> 398 399 <p>Returns the desired EGL config to use. 400 401 402</p> 403 404 </td> 405 </tr> 406 407 408 409 <tr class="api apilevel-" > 410 411 412 <td><code> 413 414 415 416 417 418 EGLContext</code> 419 </td> 420 421 <td width="100%"> 422 <code> 423 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#createEglContext(android.opengl.EGLDisplay, android.opengl.EGLConfig)">createEglContext</a>(EGLDisplay eglDisplay, EGLConfig eglConfig) 424 </code> 425 426 <p>Creates the EGL context and returns it. 427 428 429</p> 430 431 </td> 432 </tr> 433 434 435 436 <tr class="api apilevel-" > 437 438 439 <td><code> 440 441 442 443 444 445 EGLSurface</code> 446 </td> 447 448 <td width="100%"> 449 <code> 450 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#createWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.view.SurfaceHolder)">createWindowSurface</a>(EGLDisplay eglDisplay, EGLConfig eglConfig, SurfaceHolder surfaceHolder) 451 </code> 452 453 <p>Creates and returns a new EGL window surface for <code>surfaceHolder</code>. 454 455 456</p> 457 458 </td> 459 </tr> 460 461 462 463 <tr class="api apilevel-" > 464 465 466 <td><code> 467 468 469 470 471 472 EGLDisplay</code> 473 </td> 474 475 <td width="100%"> 476 <code> 477 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#initializeEglDisplay()">initializeEglDisplay</a>() 478 </code> 479 480 <p>Initializes the display. 481 482 483</p> 484 485 </td> 486 </tr> 487 488 489 490 <tr class="api apilevel-" > 491 492 493 <td><code> 494 495 496 497 final 498 499 void</code> 500 </td> 501 502 <td width="100%"> 503 <code> 504 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#invalidate()">invalidate</a>() 505 </code> 506 507 <p>Schedules a call to <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDraw()">onDraw()</a></code> to draw the next frame. 508 509 510</p> 511 512 </td> 513 </tr> 514 515 516 517 <tr class="api apilevel-" > 518 519 520 <td><code> 521 522 523 524 525 526 void</code> 527 </td> 528 529 <td width="100%"> 530 <code> 531 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onApplyWindowInsets(android.view.WindowInsets)">onApplyWindowInsets</a>(WindowInsets insets) 532 </code> 533 534 </td> 535 </tr> 536 537 538 539 <tr class="api apilevel-" > 540 541 542 <td><code> 543 544 545 546 547 548 void</code> 549 </td> 550 551 <td width="100%"> 552 <code> 553 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onCreate(android.view.SurfaceHolder)">onCreate</a>(SurfaceHolder surfaceHolder) 554 </code> 555 556 </td> 557 </tr> 558 559 560 561 <tr class="api apilevel-" > 562 563 564 <td><code> 565 566 567 568 569 570 void</code> 571 </td> 572 573 <td width="100%"> 574 <code> 575 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDestroy()">onDestroy</a>() 576 </code> 577 578 </td> 579 </tr> 580 581 582 583 <tr class="api apilevel-" > 584 585 586 <td><code> 587 588 589 590 591 592 void</code> 593 </td> 594 595 <td width="100%"> 596 <code> 597 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDraw()">onDraw</a>() 598 </code> 599 600 <p>Draws the watch face. 601 602 603</p> 604 605 </td> 606 </tr> 607 608 609 610 <tr class="api apilevel-" > 611 612 613 <td><code> 614 615 616 617 618 619 void</code> 620 </td> 621 622 <td width="100%"> 623 <code> 624 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onGlContextCreated()">onGlContextCreated</a>() 625 </code> 626 627 <p>Called when a new GL context is created. 628 629 630</p> 631 632 </td> 633 </tr> 634 635 636 637 <tr class="api apilevel-" > 638 639 640 <td><code> 641 642 643 644 645 646 void</code> 647 </td> 648 649 <td width="100%"> 650 <code> 651 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onGlSurfaceCreated(int, int)">onGlSurfaceCreated</a>(int width, int height) 652 </code> 653 654 <p>Called when a new GL surface is created. 655 656 657</p> 658 659 </td> 660 </tr> 661 662 663 664 <tr class="api apilevel-" > 665 666 667 <td><code> 668 669 670 671 final 672 673 void</code> 674 </td> 675 676 <td width="100%"> 677 <code> 678 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onSurfaceChanged(android.view.SurfaceHolder, int, int, int)">onSurfaceChanged</a>(SurfaceHolder holder, int format, int width, int height) 679 </code> 680 681 </td> 682 </tr> 683 684 685 686 <tr class="api apilevel-" > 687 688 689 <td><code> 690 691 692 693 final 694 695 void</code> 696 </td> 697 698 <td width="100%"> 699 <code> 700 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onSurfaceDestroyed(android.view.SurfaceHolder)">onSurfaceDestroyed</a>(SurfaceHolder holder) 701 </code> 702 703 </td> 704 </tr> 705 706 707 708 <tr class="api apilevel-" > 709 710 711 <td><code> 712 713 714 715 final 716 717 void</code> 718 </td> 719 720 <td width="100%"> 721 <code> 722 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onSurfaceRedrawNeeded(android.view.SurfaceHolder)">onSurfaceRedrawNeeded</a>(SurfaceHolder holder) 723 </code> 724 725 </td> 726 </tr> 727 728 729 730 <tr class="api apilevel-" > 731 732 733 <td><code> 734 735 736 737 final 738 739 void</code> 740 </td> 741 742 <td width="100%"> 743 <code> 744 <a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#postInvalidate()">postInvalidate</a>() 745 </code> 746 747 <p>Posts a message to schedule a call to <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDraw()">onDraw()</a></code> to draw the next frame. 748 749 750</p> 751 752 </td> 753 </tr> 754 755 756 757</table> 758 759 760 761 762 763 764 765<!-- ========== METHOD SUMMARY =========== --> 766<table id="inhmethods" class="methods inhtable"> 767<tr><th><h3>Inherited methods</h3></th></tr> 768 769 770<tr class="api apilevel-" > 771<td colspan="2"> 772 773 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine" class="jd-expando-trigger closed" 774 ><img height="34" id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-trigger" 775 src="/assets/images/styles/disclosure_down.png" 776 class="jd-expando-trigger-img" /></a>From 777class 778<code> 779 780 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">android.support.wearable.watchface.WatchFaceService.Engine</a> 781 782</code> 783<div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine"> 784 <div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-list" 785 class="jd-inheritedlinks"> 786 </div> 787 <div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-summary" style="display: none;"> 788 <table class="jd-sumtable-expando responsive"> 789 790 791 792 793 <tr class="api apilevel-" > 794 795 796 <td><code> 797 798 799 800 final 801 802 int</code> 803 </td> 804 805 <td width="100%"> 806 <code> 807 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getInterruptionFilter()">getInterruptionFilter</a>() 808 </code> 809 810 <p>Returns interruption filter selected by the user. 811 812 813</p> 814 815 </td> 816 </tr> 817 818 819 820 <tr class="api apilevel-" > 821 822 823 <td><code> 824 825 826 827 final 828 829 int</code> 830 </td> 831 832 <td width="100%"> 833 <code> 834 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getNotificationCount()">getNotificationCount</a>() 835 </code> 836 837 <p>Returns the total number of notification cards in the stream. 838 839 840</p> 841 842 </td> 843 </tr> 844 845 846 847 <tr class="api apilevel-" > 848 849 850 <td><code> 851 852 853 854 final 855 856 Rect</code> 857 </td> 858 859 <td width="100%"> 860 <code> 861 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getPeekCardPosition()">getPeekCardPosition</a>() 862 </code> 863 864 <p>Returns the location of the first peeking card. 865 866 867</p> 868 869 </td> 870 </tr> 871 872 873 874 <tr class="api apilevel-" > 875 876 877 <td><code> 878 879 880 881 final 882 883 int</code> 884 </td> 885 886 <td width="100%"> 887 <code> 888 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getUnreadCount()">getUnreadCount</a>() 889 </code> 890 891 <p>Returns the number of unread notification cards in the stream. 892 893 894</p> 895 896 </td> 897 </tr> 898 899 900 901 <tr class="api apilevel-" > 902 903 904 <td><code> 905 906 907 908 final 909 910 boolean</code> 911 </td> 912 913 <td width="100%"> 914 <code> 915 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#isInAmbientMode()">isInAmbientMode</a>() 916 </code> 917 918 <p>Returns whether the watch face is in ambient mode. 919 920 921</p> 922 923 </td> 924 </tr> 925 926 927 928 <tr class="api apilevel-" > 929 930 931 <td><code> 932 933 934 935 936 937 void</code> 938 </td> 939 940 <td width="100%"> 941 <code> 942 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onAmbientModeChanged(boolean)">onAmbientModeChanged</a>(boolean inAmbientMode) 943 </code> 944 945 <p>Called when the device enters or exits ambient mode. 946 947 948</p> 949 950 </td> 951 </tr> 952 953 954 955 <tr class="api apilevel-" > 956 957 958 <td><code> 959 960 961 962 963 964 Bundle</code> 965 </td> 966 967 <td width="100%"> 968 <code> 969 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean)">onCommand</a>(String action, int x, int y, int z, Bundle extras, boolean resultRequested) 970 </code> 971 972 </td> 973 </tr> 974 975 976 977 <tr class="api apilevel-" > 978 979 980 <td><code> 981 982 983 984 985 986 void</code> 987 </td> 988 989 <td width="100%"> 990 <code> 991 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCreate(android.view.SurfaceHolder)">onCreate</a>(SurfaceHolder holder) 992 </code> 993 994 </td> 995 </tr> 996 997 998 999 <tr class="api apilevel-" > 1000 1001 1002 <td><code> 1003 1004 1005 1006 1007 1008 void</code> 1009 </td> 1010 1011 <td width="100%"> 1012 <code> 1013 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onDestroy()">onDestroy</a>() 1014 </code> 1015 1016 </td> 1017 </tr> 1018 1019 1020 1021 <tr class="api apilevel-" > 1022 1023 1024 <td><code> 1025 1026 1027 1028 1029 1030 void</code> 1031 </td> 1032 1033 <td width="100%"> 1034 <code> 1035 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onInterruptionFilterChanged(int)">onInterruptionFilterChanged</a>(int interruptionFilter) 1036 </code> 1037 1038 <p>Called when the user changes interruption filter. 1039 1040 1041</p> 1042 1043 </td> 1044 </tr> 1045 1046 1047 1048 <tr class="api apilevel-" > 1049 1050 1051 <td><code> 1052 1053 1054 1055 1056 1057 void</code> 1058 </td> 1059 1060 <td width="100%"> 1061 <code> 1062 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onNotificationCountChanged(int)">onNotificationCountChanged</a>(int count) 1063 </code> 1064 1065 <p>Called when the total number of notification cards in the stream has changed. 1066 1067 1068</p> 1069 1070 </td> 1071 </tr> 1072 1073 1074 1075 <tr class="api apilevel-" > 1076 1077 1078 <td><code> 1079 1080 1081 1082 1083 1084 void</code> 1085 </td> 1086 1087 <td width="100%"> 1088 <code> 1089 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPeekCardPositionUpdate(android.graphics.Rect)">onPeekCardPositionUpdate</a>(Rect rect) 1090 </code> 1091 1092 <p>Called when the first, peeking card positions itself on the screen. 1093 1094 1095</p> 1096 1097 </td> 1098 </tr> 1099 1100 1101 1102 <tr class="api apilevel-" > 1103 1104 1105 <td><code> 1106 1107 1108 1109 1110 1111 void</code> 1112 </td> 1113 1114 <td width="100%"> 1115 <code> 1116 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPropertiesChanged(android.os.Bundle)">onPropertiesChanged</a>(Bundle properties) 1117 </code> 1118 1119 <p>Called when the properties of the device are determined. 1120 1121 1122</p> 1123 1124 </td> 1125 </tr> 1126 1127 1128 1129 <tr class="api apilevel-" > 1130 1131 1132 <td><code> 1133 1134 1135 1136 1137 1138 void</code> 1139 </td> 1140 1141 <td width="100%"> 1142 <code> 1143 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTapCommand(int, int, int, long)">onTapCommand</a>(int tapType, int x, int y, long eventTime) 1144 </code> 1145 1146 <p>Called when a tap or touch related event occurs. 1147 1148 1149</p> 1150 1151 </td> 1152 </tr> 1153 1154 1155 1156 <tr class="api apilevel-" > 1157 1158 1159 <td><code> 1160 1161 1162 1163 1164 1165 void</code> 1166 </td> 1167 1168 <td width="100%"> 1169 <code> 1170 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTimeTick()">onTimeTick</a>() 1171 </code> 1172 1173 <p>Called periodically to update the time shown by the watch face. 1174 1175 1176</p> 1177 1178 </td> 1179 </tr> 1180 1181 1182 1183 <tr class="api apilevel-" > 1184 1185 1186 <td><code> 1187 1188 1189 1190 1191 1192 void</code> 1193 </td> 1194 1195 <td width="100%"> 1196 <code> 1197 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onUnreadCountChanged(int)">onUnreadCountChanged</a>(int count) 1198 </code> 1199 1200 <p>Called when the number of unread notification cards in the stream has changed. 1201 1202 1203</p> 1204 1205 </td> 1206 </tr> 1207 1208 1209 1210 <tr class="api apilevel-" > 1211 1212 1213 <td><code> 1214 1215 1216 1217 1218 1219 void</code> 1220 </td> 1221 1222 <td width="100%"> 1223 <code> 1224 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onVisibilityChanged(boolean)">onVisibilityChanged</a>(boolean visible) 1225 </code> 1226 1227 <p>Called to inform you of the watch face becoming visible or hidden. 1228 1229 1230</p> 1231 1232 </td> 1233 </tr> 1234 1235 1236 1237 <tr class="api apilevel-" > 1238 1239 1240 <td><code> 1241 1242 1243 1244 1245 1246 void</code> 1247 </td> 1248 1249 <td width="100%"> 1250 <code> 1251 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setWatchFaceStyle(android.support.wearable.watchface.WatchFaceStyle)">setWatchFaceStyle</a>(<a href="/reference/android/support/wearable/watchface/WatchFaceStyle.html">WatchFaceStyle</a> watchFaceStyle) 1252 </code> 1253 1254 <p>Sets the watch face style. 1255 1256 1257</p> 1258 1259 </td> 1260 </tr> 1261 1262 1263 1264 </table> 1265 </div> 1266</div> 1267</td></tr> 1268 1269 1270 1271<tr class="api apilevel-" > 1272<td colspan="2"> 1273 1274 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.service.wallpaper.WallpaperService.Engine" class="jd-expando-trigger closed" 1275 ><img height="34" id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-trigger" 1276 src="/assets/images/styles/disclosure_down.png" 1277 class="jd-expando-trigger-img" /></a>From 1278class 1279<code> 1280 1281 android.service.wallpaper.WallpaperService.Engine 1282 1283</code> 1284<div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine"> 1285 <div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-list" 1286 class="jd-inheritedlinks"> 1287 </div> 1288 <div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-summary" style="display: none;"> 1289 <table class="jd-sumtable-expando responsive"> 1290 1291 1292 1293 1294 <tr class="api apilevel-" > 1295 1296 1297 <td><code> 1298 1299 1300 1301 1302 1303 void</code> 1304 </td> 1305 1306 <td width="100%"> 1307 <code> 1308 dump(String arg0, FileDescriptor arg1, PrintWriter arg2, String[] arg3) 1309 </code> 1310 1311 </td> 1312 </tr> 1313 1314 1315 1316 <tr class="api apilevel-" > 1317 1318 1319 <td><code> 1320 1321 1322 1323 1324 1325 int</code> 1326 </td> 1327 1328 <td width="100%"> 1329 <code> 1330 getDesiredMinimumHeight() 1331 </code> 1332 1333 </td> 1334 </tr> 1335 1336 1337 1338 <tr class="api apilevel-" > 1339 1340 1341 <td><code> 1342 1343 1344 1345 1346 1347 int</code> 1348 </td> 1349 1350 <td width="100%"> 1351 <code> 1352 getDesiredMinimumWidth() 1353 </code> 1354 1355 </td> 1356 </tr> 1357 1358 1359 1360 <tr class="api apilevel-" > 1361 1362 1363 <td><code> 1364 1365 1366 1367 1368 1369 SurfaceHolder</code> 1370 </td> 1371 1372 <td width="100%"> 1373 <code> 1374 getSurfaceHolder() 1375 </code> 1376 1377 </td> 1378 </tr> 1379 1380 1381 1382 <tr class="api apilevel-" > 1383 1384 1385 <td><code> 1386 1387 1388 1389 1390 1391 boolean</code> 1392 </td> 1393 1394 <td width="100%"> 1395 <code> 1396 isPreview() 1397 </code> 1398 1399 </td> 1400 </tr> 1401 1402 1403 1404 <tr class="api apilevel-" > 1405 1406 1407 <td><code> 1408 1409 1410 1411 1412 1413 boolean</code> 1414 </td> 1415 1416 <td width="100%"> 1417 <code> 1418 isVisible() 1419 </code> 1420 1421 </td> 1422 </tr> 1423 1424 1425 1426 <tr class="api apilevel-" > 1427 1428 1429 <td><code> 1430 1431 1432 1433 1434 1435 void</code> 1436 </td> 1437 1438 <td width="100%"> 1439 <code> 1440 onApplyWindowInsets(WindowInsets arg0) 1441 </code> 1442 1443 </td> 1444 </tr> 1445 1446 1447 1448 <tr class="api apilevel-" > 1449 1450 1451 <td><code> 1452 1453 1454 1455 1456 1457 Bundle</code> 1458 </td> 1459 1460 <td width="100%"> 1461 <code> 1462 onCommand(String arg0, int arg1, int arg2, int arg3, Bundle arg4, boolean arg5) 1463 </code> 1464 1465 </td> 1466 </tr> 1467 1468 1469 1470 <tr class="api apilevel-" > 1471 1472 1473 <td><code> 1474 1475 1476 1477 1478 1479 void</code> 1480 </td> 1481 1482 <td width="100%"> 1483 <code> 1484 onCreate(SurfaceHolder arg0) 1485 </code> 1486 1487 </td> 1488 </tr> 1489 1490 1491 1492 <tr class="api apilevel-" > 1493 1494 1495 <td><code> 1496 1497 1498 1499 1500 1501 void</code> 1502 </td> 1503 1504 <td width="100%"> 1505 <code> 1506 onDesiredSizeChanged(int arg0, int arg1) 1507 </code> 1508 1509 </td> 1510 </tr> 1511 1512 1513 1514 <tr class="api apilevel-" > 1515 1516 1517 <td><code> 1518 1519 1520 1521 1522 1523 void</code> 1524 </td> 1525 1526 <td width="100%"> 1527 <code> 1528 onDestroy() 1529 </code> 1530 1531 </td> 1532 </tr> 1533 1534 1535 1536 <tr class="api apilevel-" > 1537 1538 1539 <td><code> 1540 1541 1542 1543 1544 1545 void</code> 1546 </td> 1547 1548 <td width="100%"> 1549 <code> 1550 onOffsetsChanged(float arg0, float arg1, float arg2, float arg3, int arg4, int arg5) 1551 </code> 1552 1553 </td> 1554 </tr> 1555 1556 1557 1558 <tr class="api apilevel-" > 1559 1560 1561 <td><code> 1562 1563 1564 1565 1566 1567 void</code> 1568 </td> 1569 1570 <td width="100%"> 1571 <code> 1572 onSurfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) 1573 </code> 1574 1575 </td> 1576 </tr> 1577 1578 1579 1580 <tr class="api apilevel-" > 1581 1582 1583 <td><code> 1584 1585 1586 1587 1588 1589 void</code> 1590 </td> 1591 1592 <td width="100%"> 1593 <code> 1594 onSurfaceCreated(SurfaceHolder arg0) 1595 </code> 1596 1597 </td> 1598 </tr> 1599 1600 1601 1602 <tr class="api apilevel-" > 1603 1604 1605 <td><code> 1606 1607 1608 1609 1610 1611 void</code> 1612 </td> 1613 1614 <td width="100%"> 1615 <code> 1616 onSurfaceDestroyed(SurfaceHolder arg0) 1617 </code> 1618 1619 </td> 1620 </tr> 1621 1622 1623 1624 <tr class="api apilevel-" > 1625 1626 1627 <td><code> 1628 1629 1630 1631 1632 1633 void</code> 1634 </td> 1635 1636 <td width="100%"> 1637 <code> 1638 onSurfaceRedrawNeeded(SurfaceHolder arg0) 1639 </code> 1640 1641 </td> 1642 </tr> 1643 1644 1645 1646 <tr class="api apilevel-" > 1647 1648 1649 <td><code> 1650 1651 1652 1653 1654 1655 void</code> 1656 </td> 1657 1658 <td width="100%"> 1659 <code> 1660 onTouchEvent(MotionEvent arg0) 1661 </code> 1662 1663 </td> 1664 </tr> 1665 1666 1667 1668 <tr class="api apilevel-" > 1669 1670 1671 <td><code> 1672 1673 1674 1675 1676 1677 void</code> 1678 </td> 1679 1680 <td width="100%"> 1681 <code> 1682 onVisibilityChanged(boolean arg0) 1683 </code> 1684 1685 </td> 1686 </tr> 1687 1688 1689 1690 <tr class="api apilevel-" > 1691 1692 1693 <td><code> 1694 1695 1696 1697 1698 1699 void</code> 1700 </td> 1701 1702 <td width="100%"> 1703 <code> 1704 setFixedSizeAllowed(boolean arg0) 1705 </code> 1706 1707 </td> 1708 </tr> 1709 1710 1711 1712 <tr class="api apilevel-" > 1713 1714 1715 <td><code> 1716 1717 1718 1719 1720 1721 void</code> 1722 </td> 1723 1724 <td width="100%"> 1725 <code> 1726 setOffsetNotificationsEnabled(boolean arg0) 1727 </code> 1728 1729 </td> 1730 </tr> 1731 1732 1733 1734 <tr class="api apilevel-" > 1735 1736 1737 <td><code> 1738 1739 1740 1741 1742 1743 void</code> 1744 </td> 1745 1746 <td width="100%"> 1747 <code> 1748 setTouchEventsEnabled(boolean arg0) 1749 </code> 1750 1751 </td> 1752 </tr> 1753 1754 1755 1756 </table> 1757 </div> 1758</div> 1759</td></tr> 1760 1761 1762 1763<tr class="api apilevel-" > 1764<td colspan="2"> 1765 1766 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 1767 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 1768 src="/assets/images/styles/disclosure_down.png" 1769 class="jd-expando-trigger-img" /></a>From 1770class 1771<code> 1772 1773 java.lang.Object 1774 1775</code> 1776<div id="inherited-methods-java.lang.Object"> 1777 <div id="inherited-methods-java.lang.Object-list" 1778 class="jd-inheritedlinks"> 1779 </div> 1780 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 1781 <table class="jd-sumtable-expando responsive"> 1782 1783 1784 1785 1786 <tr class="api apilevel-" > 1787 1788 1789 <td><code> 1790 1791 1792 1793 1794 1795 Object</code> 1796 </td> 1797 1798 <td width="100%"> 1799 <code> 1800 clone() 1801 </code> 1802 1803 </td> 1804 </tr> 1805 1806 1807 1808 <tr class="api apilevel-" > 1809 1810 1811 <td><code> 1812 1813 1814 1815 1816 1817 boolean</code> 1818 </td> 1819 1820 <td width="100%"> 1821 <code> 1822 equals(Object arg0) 1823 </code> 1824 1825 </td> 1826 </tr> 1827 1828 1829 1830 <tr class="api apilevel-" > 1831 1832 1833 <td><code> 1834 1835 1836 1837 1838 1839 void</code> 1840 </td> 1841 1842 <td width="100%"> 1843 <code> 1844 finalize() 1845 </code> 1846 1847 </td> 1848 </tr> 1849 1850 1851 1852 <tr class="api apilevel-" > 1853 1854 1855 <td><code> 1856 1857 1858 1859 final 1860 1861 Class<?></code> 1862 </td> 1863 1864 <td width="100%"> 1865 <code> 1866 getClass() 1867 </code> 1868 1869 </td> 1870 </tr> 1871 1872 1873 1874 <tr class="api apilevel-" > 1875 1876 1877 <td><code> 1878 1879 1880 1881 1882 1883 int</code> 1884 </td> 1885 1886 <td width="100%"> 1887 <code> 1888 hashCode() 1889 </code> 1890 1891 </td> 1892 </tr> 1893 1894 1895 1896 <tr class="api apilevel-" > 1897 1898 1899 <td><code> 1900 1901 1902 1903 final 1904 1905 void</code> 1906 </td> 1907 1908 <td width="100%"> 1909 <code> 1910 notify() 1911 </code> 1912 1913 </td> 1914 </tr> 1915 1916 1917 1918 <tr class="api apilevel-" > 1919 1920 1921 <td><code> 1922 1923 1924 1925 final 1926 1927 void</code> 1928 </td> 1929 1930 <td width="100%"> 1931 <code> 1932 notifyAll() 1933 </code> 1934 1935 </td> 1936 </tr> 1937 1938 1939 1940 <tr class="api apilevel-" > 1941 1942 1943 <td><code> 1944 1945 1946 1947 1948 1949 String</code> 1950 </td> 1951 1952 <td width="100%"> 1953 <code> 1954 toString() 1955 </code> 1956 1957 </td> 1958 </tr> 1959 1960 1961 1962 <tr class="api apilevel-" > 1963 1964 1965 <td><code> 1966 1967 1968 1969 final 1970 1971 void</code> 1972 </td> 1973 1974 <td width="100%"> 1975 <code> 1976 wait(long arg0, int arg1) 1977 </code> 1978 1979 </td> 1980 </tr> 1981 1982 1983 1984 <tr class="api apilevel-" > 1985 1986 1987 <td><code> 1988 1989 1990 1991 final 1992 1993 void</code> 1994 </td> 1995 1996 <td width="100%"> 1997 <code> 1998 wait(long arg0) 1999 </code> 2000 2001 </td> 2002 </tr> 2003 2004 2005 2006 <tr class="api apilevel-" > 2007 2008 2009 <td><code> 2010 2011 2012 2013 final 2014 2015 void</code> 2016 </td> 2017 2018 <td width="100%"> 2019 <code> 2020 wait() 2021 </code> 2022 2023 </td> 2024 </tr> 2025 2026 2027 2028 </table> 2029 </div> 2030</div> 2031</td></tr> 2032 2033 2034</table> 2035 2036 2037 2038<!-- XML Attributes --> 2039 2040 2041<!-- Enum Values --> 2042 2043 2044<!-- Constants --> 2045 2046 2047<!-- Fields --> 2048 2049 2050<!-- Public ctors --> 2051 2052 2053<!-- ========= CONSTRUCTOR DETAIL ======== --> 2054<h2 class="api-section">Public constructors</h2> 2055 2056 2057 2058<A NAME="Gles2WatchFaceService.Engine()"></A> 2059 2060<div class="api apilevel-"> 2061 <h3 class="api-name">Gles2WatchFaceService.Engine</h3> 2062 <div class="api-level"> 2063 <div></div> 2064 2065 2066 2067 </div> 2068<pre class="api-signature no-pretty-print"> 2069Gles2WatchFaceService.Engine ()</pre> 2070 2071 2072 2073 2074 <p></p> 2075 2076</div> 2077 2078 2079 2080 2081 2082<!-- ========= CONSTRUCTOR DETAIL ======== --> 2083<!-- Protected ctors --> 2084 2085 2086 2087<!-- ========= METHOD DETAIL ======== --> 2088<!-- Public methdos --> 2089 2090<h2 class="api-section">Public methods</h2> 2091 2092 2093 2094<A NAME="chooseEglConfig(android.opengl.EGLDisplay)"></A> 2095 2096<div class="api apilevel-"> 2097 <h3 class="api-name">chooseEglConfig</h3> 2098 <div class="api-level"> 2099 <div></div> 2100 2101 2102 2103 </div> 2104<pre class="api-signature no-pretty-print"> 2105EGLConfig chooseEglConfig (EGLDisplay eglDisplay)</pre> 2106 2107 2108 2109 2110 <p>Returns the desired EGL config to use. By default, uses a config that:<ul> 2111 <li>supports OpenGL ES 2.0 contexts 2112 <li>has at least 8 bits for each of red, green, blue, and alpha 2113 </ul>If there are multiple matches, the one with the most bits for red, green, blue, and 2114 alpha is chosen. 2115 2116 <p>Watch faces can override this method to call <code><a href="/reference/android/opengl/EGL14.html#eglChooseConfig(android.opengl.EGLDisplay, int[], int, android.opengl.EGLConfig[], int, int, int[], int)">eglChooseConfig(EGLDisplay, int[], int, EGLConfig[], int, int, int[], int)</a></code> with 2117 different attributes. By passing in a large array, <code>eglChooseConfig</code> can return 2118 multiple matching configs and the watch face can choose among them by using 2119 <code><a href="/reference/android/opengl/EGL14.html#eglGetConfigAttrib(android.opengl.EGLDisplay, android.opengl.EGLConfig, int, int[], int)">eglGetConfigAttrib(EGLDisplay, EGLConfig, int, int[], int)</a></code> to fetch their attributes.</p> 2120 <table class="responsive"> 2121 <tr><th colspan=2>Parameters</th></tr> 2122 <tr> 2123 <td><code>eglDisplay</code></td> 2124 <td width="100%"> 2125 <code>EGLDisplay</code>: 2126 the EGL display to use</td> 2127 </tr> 2128 </table> 2129 <table class="responsive"> 2130 <tr><th colspan=2>Returns</th></tr> 2131 <tr> 2132 <td><code>EGLConfig</code></td> 2133 <td width="100%">the EGL config to use 2134</td> 2135 </tr> 2136 </table> 2137 2138</div> 2139 2140 2141<A NAME="createEglContext(android.opengl.EGLDisplay, android.opengl.EGLConfig)"></A> 2142 2143<div class="api apilevel-"> 2144 <h3 class="api-name">createEglContext</h3> 2145 <div class="api-level"> 2146 <div></div> 2147 2148 2149 2150 </div> 2151<pre class="api-signature no-pretty-print"> 2152EGLContext createEglContext (EGLDisplay eglDisplay, 2153 EGLConfig eglConfig)</pre> 2154 2155 2156 2157 2158 <p>Creates the EGL context and returns it. By default, creates an EGL 2.0 context using 2159 <code><a href="/reference/android/opengl/EGL14.html#eglCreateContext(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.opengl.EGLContext, int[], int)">eglCreateContext(EGLDisplay, EGLConfig, EGLContext, int[], int)</a></code>. 2160 2161 <p>Watch faces can override this method to call <code><a href="/reference/android/opengl/EGL14.html#eglCreateContext(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.opengl.EGLContext, int[], int)">eglCreateContext(EGLDisplay, EGLConfig, EGLContext, int[], int)</a></code> with 2162 different attributes. 2163</p> 2164 <table class="responsive"> 2165 <tr><th colspan=2>Parameters</th></tr> 2166 <tr> 2167 <td><code>eglDisplay</code></td> 2168 <td width="100%"> 2169 <code>EGLDisplay</code> 2170 <!-- no parameter comment --></td> 2171 </tr> 2172 <tr> 2173 <td><code>eglConfig</code></td> 2174 <td width="100%"> 2175 <code>EGLConfig</code> 2176 <!-- no parameter comment --></td> 2177 </tr> 2178 </table> 2179 <table class="responsive"> 2180 <tr><th colspan=2>Returns</th></tr> 2181 <tr> 2182 <td><code>EGLContext</code></td> 2183 <td width="100%"><!-- no returns description in source --></td> 2184 </tr> 2185 </table> 2186 2187</div> 2188 2189 2190<A NAME="createWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, android.view.SurfaceHolder)"></A> 2191 2192<div class="api apilevel-"> 2193 <h3 class="api-name">createWindowSurface</h3> 2194 <div class="api-level"> 2195 <div></div> 2196 2197 2198 2199 </div> 2200<pre class="api-signature no-pretty-print"> 2201EGLSurface createWindowSurface (EGLDisplay eglDisplay, 2202 EGLConfig eglConfig, 2203 SurfaceHolder surfaceHolder)</pre> 2204 2205 2206 2207 2208 <p>Creates and returns a new EGL window surface for <code>surfaceHolder</code>. By default, this 2209 surface has no attributes. 2210 2211 <p>Watch faces can override this method to call <code><a href="/reference/android/opengl/EGL14.html#eglCreateWindowSurface(android.opengl.EGLDisplay, android.opengl.EGLConfig, java.lang.Object, int[], int)">eglCreateWindowSurface(EGLDisplay, EGLConfig, Object, int[], int)</a></code> with 2212 different attributes. 2213</p> 2214 <table class="responsive"> 2215 <tr><th colspan=2>Parameters</th></tr> 2216 <tr> 2217 <td><code>eglDisplay</code></td> 2218 <td width="100%"> 2219 <code>EGLDisplay</code> 2220 <!-- no parameter comment --></td> 2221 </tr> 2222 <tr> 2223 <td><code>eglConfig</code></td> 2224 <td width="100%"> 2225 <code>EGLConfig</code> 2226 <!-- no parameter comment --></td> 2227 </tr> 2228 <tr> 2229 <td><code>surfaceHolder</code></td> 2230 <td width="100%"> 2231 <code>SurfaceHolder</code> 2232 <!-- no parameter comment --></td> 2233 </tr> 2234 </table> 2235 <table class="responsive"> 2236 <tr><th colspan=2>Returns</th></tr> 2237 <tr> 2238 <td><code>EGLSurface</code></td> 2239 <td width="100%"><!-- no returns description in source --></td> 2240 </tr> 2241 </table> 2242 2243</div> 2244 2245 2246<A NAME="initializeEglDisplay()"></A> 2247 2248<div class="api apilevel-"> 2249 <h3 class="api-name">initializeEglDisplay</h3> 2250 <div class="api-level"> 2251 <div></div> 2252 2253 2254 2255 </div> 2256<pre class="api-signature no-pretty-print"> 2257EGLDisplay initializeEglDisplay ()</pre> 2258 2259 2260 2261 2262 <p>Initializes the display. Calls <code><a href="/reference/android/opengl/EGL14.html#eglGetDisplay(int)">eglGetDisplay(int)</a></code> and 2263 <code><a href="/reference/android/opengl/EGL14.html#eglInitialize(android.opengl.EGLDisplay, int[], int, int[], int)">eglInitialize(EGLDisplay, int[], int, int[], int)</a></code>.</p> 2264 <table class="responsive"> 2265 <tr><th colspan=2>Returns</th></tr> 2266 <tr> 2267 <td><code>EGLDisplay</code></td> 2268 <td width="100%">the initialized EGLDisplay to use 2269</td> 2270 </tr> 2271 </table> 2272 2273</div> 2274 2275 2276<A NAME="invalidate()"></A> 2277 2278<div class="api apilevel-"> 2279 <h3 class="api-name">invalidate</h3> 2280 <div class="api-level"> 2281 <div></div> 2282 2283 2284 2285 </div> 2286<pre class="api-signature no-pretty-print"> 2287void invalidate ()</pre> 2288 2289 2290 2291 2292 <p>Schedules a call to <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDraw()">onDraw()</a></code> to draw the next frame. Must be called on the main 2293 thread. 2294</p> 2295 2296</div> 2297 2298 2299<A NAME="onApplyWindowInsets(android.view.WindowInsets)"></A> 2300 2301<div class="api apilevel-"> 2302 <h3 class="api-name">onApplyWindowInsets</h3> 2303 <div class="api-level"> 2304 <div></div> 2305 2306 2307 2308 </div> 2309<pre class="api-signature no-pretty-print"> 2310void onApplyWindowInsets (WindowInsets insets)</pre> 2311 2312 2313 2314 2315 <p></p> 2316 <table class="responsive"> 2317 <tr><th colspan=2>Parameters</th></tr> 2318 <tr> 2319 <td><code>insets</code></td> 2320 <td width="100%"> 2321 <code>WindowInsets</code> 2322 <!-- no parameter comment --></td> 2323 </tr> 2324 </table> 2325 2326</div> 2327 2328 2329<A NAME="onCreate(android.view.SurfaceHolder)"></A> 2330 2331<div class="api apilevel-"> 2332 <h3 class="api-name">onCreate</h3> 2333 <div class="api-level"> 2334 <div></div> 2335 2336 2337 2338 </div> 2339<pre class="api-signature no-pretty-print"> 2340void onCreate (SurfaceHolder surfaceHolder)</pre> 2341 2342 2343 2344 2345 <p></p> 2346 <table class="responsive"> 2347 <tr><th colspan=2>Parameters</th></tr> 2348 <tr> 2349 <td><code>surfaceHolder</code></td> 2350 <td width="100%"> 2351 <code>SurfaceHolder</code> 2352 <!-- no parameter comment --></td> 2353 </tr> 2354 </table> 2355 2356</div> 2357 2358 2359<A NAME="onDestroy()"></A> 2360 2361<div class="api apilevel-"> 2362 <h3 class="api-name">onDestroy</h3> 2363 <div class="api-level"> 2364 <div></div> 2365 2366 2367 2368 </div> 2369<pre class="api-signature no-pretty-print"> 2370void onDestroy ()</pre> 2371 2372 2373 2374 2375 <p></p> 2376 2377</div> 2378 2379 2380<A NAME="onDraw()"></A> 2381 2382<div class="api apilevel-"> 2383 <h3 class="api-name">onDraw</h3> 2384 <div class="api-level"> 2385 <div></div> 2386 2387 2388 2389 </div> 2390<pre class="api-signature no-pretty-print"> 2391void onDraw ()</pre> 2392 2393 2394 2395 2396 <p>Draws the watch face. It's safe to use GL APIs in this method. 2397</p> 2398 2399</div> 2400 2401 2402<A NAME="onGlContextCreated()"></A> 2403 2404<div class="api apilevel-"> 2405 <h3 class="api-name">onGlContextCreated</h3> 2406 <div class="api-level"> 2407 <div></div> 2408 2409 2410 2411 </div> 2412<pre class="api-signature no-pretty-print"> 2413void onGlContextCreated ()</pre> 2414 2415 2416 2417 2418 <p>Called when a new GL context is created. It's safe to use GL APIs in this method. 2419</p> 2420 2421</div> 2422 2423 2424<A NAME="onGlSurfaceCreated(int, int)"></A> 2425 2426<div class="api apilevel-"> 2427 <h3 class="api-name">onGlSurfaceCreated</h3> 2428 <div class="api-level"> 2429 <div></div> 2430 2431 2432 2433 </div> 2434<pre class="api-signature no-pretty-print"> 2435void onGlSurfaceCreated (int width, 2436 int height)</pre> 2437 2438 2439 2440 2441 <p>Called when a new GL surface is created. It's safe to use GL APIs in this method.</p> 2442 <table class="responsive"> 2443 <tr><th colspan=2>Parameters</th></tr> 2444 <tr> 2445 <td><code>width</code></td> 2446 <td width="100%"> 2447 <code>int</code>: 2448 width of surface in pixels</td> 2449 </tr> 2450 <tr> 2451 <td><code>height</code></td> 2452 <td width="100%"> 2453 <code>int</code>: 2454 height of surface in pixels 2455</td> 2456 </tr> 2457 </table> 2458 2459</div> 2460 2461 2462<A NAME="onSurfaceChanged(android.view.SurfaceHolder, int, int, int)"></A> 2463 2464<div class="api apilevel-"> 2465 <h3 class="api-name">onSurfaceChanged</h3> 2466 <div class="api-level"> 2467 <div></div> 2468 2469 2470 2471 </div> 2472<pre class="api-signature no-pretty-print"> 2473void onSurfaceChanged (SurfaceHolder holder, 2474 int format, 2475 int width, 2476 int height)</pre> 2477 2478 2479 2480 2481 <p></p> 2482 <table class="responsive"> 2483 <tr><th colspan=2>Parameters</th></tr> 2484 <tr> 2485 <td><code>holder</code></td> 2486 <td width="100%"> 2487 <code>SurfaceHolder</code> 2488 <!-- no parameter comment --></td> 2489 </tr> 2490 <tr> 2491 <td><code>format</code></td> 2492 <td width="100%"> 2493 <code>int</code> 2494 <!-- no parameter comment --></td> 2495 </tr> 2496 <tr> 2497 <td><code>width</code></td> 2498 <td width="100%"> 2499 <code>int</code> 2500 <!-- no parameter comment --></td> 2501 </tr> 2502 <tr> 2503 <td><code>height</code></td> 2504 <td width="100%"> 2505 <code>int</code> 2506 <!-- no parameter comment --></td> 2507 </tr> 2508 </table> 2509 2510</div> 2511 2512 2513<A NAME="onSurfaceDestroyed(android.view.SurfaceHolder)"></A> 2514 2515<div class="api apilevel-"> 2516 <h3 class="api-name">onSurfaceDestroyed</h3> 2517 <div class="api-level"> 2518 <div></div> 2519 2520 2521 2522 </div> 2523<pre class="api-signature no-pretty-print"> 2524void onSurfaceDestroyed (SurfaceHolder holder)</pre> 2525 2526 2527 2528 2529 <p></p> 2530 <table class="responsive"> 2531 <tr><th colspan=2>Parameters</th></tr> 2532 <tr> 2533 <td><code>holder</code></td> 2534 <td width="100%"> 2535 <code>SurfaceHolder</code> 2536 <!-- no parameter comment --></td> 2537 </tr> 2538 </table> 2539 2540</div> 2541 2542 2543<A NAME="onSurfaceRedrawNeeded(android.view.SurfaceHolder)"></A> 2544 2545<div class="api apilevel-"> 2546 <h3 class="api-name">onSurfaceRedrawNeeded</h3> 2547 <div class="api-level"> 2548 <div></div> 2549 2550 2551 2552 </div> 2553<pre class="api-signature no-pretty-print"> 2554void onSurfaceRedrawNeeded (SurfaceHolder holder)</pre> 2555 2556 2557 2558 2559 <p></p> 2560 <table class="responsive"> 2561 <tr><th colspan=2>Parameters</th></tr> 2562 <tr> 2563 <td><code>holder</code></td> 2564 <td width="100%"> 2565 <code>SurfaceHolder</code> 2566 <!-- no parameter comment --></td> 2567 </tr> 2568 </table> 2569 2570</div> 2571 2572 2573<A NAME="postInvalidate()"></A> 2574 2575<div class="api apilevel-"> 2576 <h3 class="api-name">postInvalidate</h3> 2577 <div class="api-level"> 2578 <div></div> 2579 2580 2581 2582 </div> 2583<pre class="api-signature no-pretty-print"> 2584void postInvalidate ()</pre> 2585 2586 2587 2588 2589 <p>Posts a message to schedule a call to <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#onDraw()">onDraw()</a></code> to draw the next frame. Unlike 2590 <code><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html#invalidate()">invalidate()</a></code>, this method is thread-safe and may be called on any thread. 2591</p> 2592 2593</div> 2594 2595 2596 2597 2598 2599<!-- ========= METHOD DETAIL ======== --> 2600 2601 2602 2603<!-- ========= END OF CLASS DATA ========= --> 2604 2605</div><!-- end jd-content --> 2606 2607 2608 2609<div class="data-reference-resources-wrapper"> 2610 2611 <ul data-reference-resources> 2612 2613 <li><h2>Annotations</h2> 2614 <ul> 2615 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.TapType.html">WatchFaceService.TapType</a></li> 2616 </ul> 2617 </li> 2618 2619 2620 <li><h2>Classes</h2> 2621 <ul> 2622 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.html">CanvasWatchFaceService</a></li> 2623 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html">CanvasWatchFaceService.Engine</a></li> 2624 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.html">Gles2WatchFaceService</a></li> 2625 <li class="selected api apilevel-"><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html">Gles2WatchFaceService.Engine</a></li> 2626 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.html">WatchFaceService</a></li> 2627 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">WatchFaceService.Engine</a></li> 2628 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceStyle.html">WatchFaceStyle</a></li> 2629 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceStyle.Builder.html">WatchFaceStyle.Builder</a></li> 2630 </ul> 2631 </li> 2632 2633 2634 2635 </ul> 2636 2637</div> 2638 2639 2640 2641</body> 2642</html> 2643