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>CanvasWatchFaceService.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">CanvasWatchFaceService.Engine</h1> 224<p> 225<code class="api-signature"> 226 public 227 228 229 230 class 231 CanvasWatchFaceService.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.CanvasWatchFaceService.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 on a <code><a href="/reference/android/graphics/Canvas.html">Canvas</a></code>. You must implement 314 <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.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/CanvasWatchFaceService.Engine.html#CanvasWatchFaceService.Engine()">CanvasWatchFaceService.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 void</code> 392 </td> 393 394 <td width="100%"> 395 <code> 396 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#invalidate()">invalidate</a>() 397 </code> 398 399 <p>Schedules a call to <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDraw(android.graphics.Canvas, android.graphics.Rect)">onDraw(Canvas, Rect)</a></code> to draw the next frame. 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 void</code> 419 </td> 420 421 <td width="100%"> 422 <code> 423 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDestroy()">onDestroy</a>() 424 </code> 425 426 </td> 427 </tr> 428 429 430 431 <tr class="api apilevel-" > 432 433 434 <td><code> 435 436 437 438 439 440 void</code> 441 </td> 442 443 <td width="100%"> 444 <code> 445 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDraw(android.graphics.Canvas, android.graphics.Rect)">onDraw</a>(Canvas canvas, Rect bounds) 446 </code> 447 448 <p>Draws the watch face. 449 450 451</p> 452 453 </td> 454 </tr> 455 456 457 458 <tr class="api apilevel-" > 459 460 461 <td><code> 462 463 464 465 466 467 void</code> 468 </td> 469 470 <td width="100%"> 471 <code> 472 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onSurfaceChanged(android.view.SurfaceHolder, int, int, int)">onSurfaceChanged</a>(SurfaceHolder holder, int format, int width, int height) 473 </code> 474 475 </td> 476 </tr> 477 478 479 480 <tr class="api apilevel-" > 481 482 483 <td><code> 484 485 486 487 488 489 void</code> 490 </td> 491 492 <td width="100%"> 493 <code> 494 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onSurfaceCreated(android.view.SurfaceHolder)">onSurfaceCreated</a>(SurfaceHolder holder) 495 </code> 496 497 </td> 498 </tr> 499 500 501 502 <tr class="api apilevel-" > 503 504 505 <td><code> 506 507 508 509 510 511 void</code> 512 </td> 513 514 <td width="100%"> 515 <code> 516 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onSurfaceRedrawNeeded(android.view.SurfaceHolder)">onSurfaceRedrawNeeded</a>(SurfaceHolder holder) 517 </code> 518 519 </td> 520 </tr> 521 522 523 524 <tr class="api apilevel-" > 525 526 527 <td><code> 528 529 530 531 532 533 void</code> 534 </td> 535 536 <td width="100%"> 537 <code> 538 <a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#postInvalidate()">postInvalidate</a>() 539 </code> 540 541 <p>Posts a message to schedule a call to <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDraw(android.graphics.Canvas, android.graphics.Rect)">onDraw(Canvas, Rect)</a></code> to draw the next frame. 542 543 544</p> 545 546 </td> 547 </tr> 548 549 550 551</table> 552 553 554 555 556 557 558 559<!-- ========== METHOD SUMMARY =========== --> 560<table id="inhmethods" class="methods inhtable"> 561<tr><th><h3>Inherited methods</h3></th></tr> 562 563 564<tr class="api apilevel-" > 565<td colspan="2"> 566 567 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine" class="jd-expando-trigger closed" 568 ><img height="34" id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-trigger" 569 src="/assets/images/styles/disclosure_down.png" 570 class="jd-expando-trigger-img" /></a>From 571class 572<code> 573 574 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">android.support.wearable.watchface.WatchFaceService.Engine</a> 575 576</code> 577<div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine"> 578 <div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-list" 579 class="jd-inheritedlinks"> 580 </div> 581 <div id="inherited-methods-android.support.wearable.watchface.WatchFaceService.Engine-summary" style="display: none;"> 582 <table class="jd-sumtable-expando responsive"> 583 584 585 586 587 <tr class="api apilevel-" > 588 589 590 <td><code> 591 592 593 594 final 595 596 int</code> 597 </td> 598 599 <td width="100%"> 600 <code> 601 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getInterruptionFilter()">getInterruptionFilter</a>() 602 </code> 603 604 <p>Returns interruption filter selected by the user. 605 606 607</p> 608 609 </td> 610 </tr> 611 612 613 614 <tr class="api apilevel-" > 615 616 617 <td><code> 618 619 620 621 final 622 623 int</code> 624 </td> 625 626 <td width="100%"> 627 <code> 628 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getNotificationCount()">getNotificationCount</a>() 629 </code> 630 631 <p>Returns the total number of notification cards in the stream. 632 633 634</p> 635 636 </td> 637 </tr> 638 639 640 641 <tr class="api apilevel-" > 642 643 644 <td><code> 645 646 647 648 final 649 650 Rect</code> 651 </td> 652 653 <td width="100%"> 654 <code> 655 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getPeekCardPosition()">getPeekCardPosition</a>() 656 </code> 657 658 <p>Returns the location of the first peeking card. 659 660 661</p> 662 663 </td> 664 </tr> 665 666 667 668 <tr class="api apilevel-" > 669 670 671 <td><code> 672 673 674 675 final 676 677 int</code> 678 </td> 679 680 <td width="100%"> 681 <code> 682 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getUnreadCount()">getUnreadCount</a>() 683 </code> 684 685 <p>Returns the number of unread notification cards in the stream. 686 687 688</p> 689 690 </td> 691 </tr> 692 693 694 695 <tr class="api apilevel-" > 696 697 698 <td><code> 699 700 701 702 final 703 704 boolean</code> 705 </td> 706 707 <td width="100%"> 708 <code> 709 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#isInAmbientMode()">isInAmbientMode</a>() 710 </code> 711 712 <p>Returns whether the watch face is in ambient mode. 713 714 715</p> 716 717 </td> 718 </tr> 719 720 721 722 <tr class="api apilevel-" > 723 724 725 <td><code> 726 727 728 729 730 731 void</code> 732 </td> 733 734 <td width="100%"> 735 <code> 736 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onAmbientModeChanged(boolean)">onAmbientModeChanged</a>(boolean inAmbientMode) 737 </code> 738 739 <p>Called when the device enters or exits ambient mode. 740 741 742</p> 743 744 </td> 745 </tr> 746 747 748 749 <tr class="api apilevel-" > 750 751 752 <td><code> 753 754 755 756 757 758 Bundle</code> 759 </td> 760 761 <td width="100%"> 762 <code> 763 <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) 764 </code> 765 766 </td> 767 </tr> 768 769 770 771 <tr class="api apilevel-" > 772 773 774 <td><code> 775 776 777 778 779 780 void</code> 781 </td> 782 783 <td width="100%"> 784 <code> 785 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCreate(android.view.SurfaceHolder)">onCreate</a>(SurfaceHolder holder) 786 </code> 787 788 </td> 789 </tr> 790 791 792 793 <tr class="api apilevel-" > 794 795 796 <td><code> 797 798 799 800 801 802 void</code> 803 </td> 804 805 <td width="100%"> 806 <code> 807 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onDestroy()">onDestroy</a>() 808 </code> 809 810 </td> 811 </tr> 812 813 814 815 <tr class="api apilevel-" > 816 817 818 <td><code> 819 820 821 822 823 824 void</code> 825 </td> 826 827 <td width="100%"> 828 <code> 829 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onInterruptionFilterChanged(int)">onInterruptionFilterChanged</a>(int interruptionFilter) 830 </code> 831 832 <p>Called when the user changes interruption filter. 833 834 835</p> 836 837 </td> 838 </tr> 839 840 841 842 <tr class="api apilevel-" > 843 844 845 <td><code> 846 847 848 849 850 851 void</code> 852 </td> 853 854 <td width="100%"> 855 <code> 856 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onNotificationCountChanged(int)">onNotificationCountChanged</a>(int count) 857 </code> 858 859 <p>Called when the total number of notification cards in the stream has changed. 860 861 862</p> 863 864 </td> 865 </tr> 866 867 868 869 <tr class="api apilevel-" > 870 871 872 <td><code> 873 874 875 876 877 878 void</code> 879 </td> 880 881 <td width="100%"> 882 <code> 883 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPeekCardPositionUpdate(android.graphics.Rect)">onPeekCardPositionUpdate</a>(Rect rect) 884 </code> 885 886 <p>Called when the first, peeking card positions itself on the screen. 887 888 889</p> 890 891 </td> 892 </tr> 893 894 895 896 <tr class="api apilevel-" > 897 898 899 <td><code> 900 901 902 903 904 905 void</code> 906 </td> 907 908 <td width="100%"> 909 <code> 910 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPropertiesChanged(android.os.Bundle)">onPropertiesChanged</a>(Bundle properties) 911 </code> 912 913 <p>Called when the properties of the device are determined. 914 915 916</p> 917 918 </td> 919 </tr> 920 921 922 923 <tr class="api apilevel-" > 924 925 926 <td><code> 927 928 929 930 931 932 void</code> 933 </td> 934 935 <td width="100%"> 936 <code> 937 <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) 938 </code> 939 940 <p>Called when a tap or touch related event occurs. 941 942 943</p> 944 945 </td> 946 </tr> 947 948 949 950 <tr class="api apilevel-" > 951 952 953 <td><code> 954 955 956 957 958 959 void</code> 960 </td> 961 962 <td width="100%"> 963 <code> 964 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTimeTick()">onTimeTick</a>() 965 </code> 966 967 <p>Called periodically to update the time shown by the watch face. 968 969 970</p> 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#onUnreadCountChanged(int)">onUnreadCountChanged</a>(int count) 992 </code> 993 994 <p>Called when the number of unread notification cards in the stream has changed. 995 996 997</p> 998 999 </td> 1000 </tr> 1001 1002 1003 1004 <tr class="api apilevel-" > 1005 1006 1007 <td><code> 1008 1009 1010 1011 1012 1013 void</code> 1014 </td> 1015 1016 <td width="100%"> 1017 <code> 1018 <a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onVisibilityChanged(boolean)">onVisibilityChanged</a>(boolean visible) 1019 </code> 1020 1021 <p>Called to inform you of the watch face becoming visible or hidden. 1022 1023 1024</p> 1025 1026 </td> 1027 </tr> 1028 1029 1030 1031 <tr class="api apilevel-" > 1032 1033 1034 <td><code> 1035 1036 1037 1038 1039 1040 void</code> 1041 </td> 1042 1043 <td width="100%"> 1044 <code> 1045 <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) 1046 </code> 1047 1048 <p>Sets the watch face style. 1049 1050 1051</p> 1052 1053 </td> 1054 </tr> 1055 1056 1057 1058 </table> 1059 </div> 1060</div> 1061</td></tr> 1062 1063 1064 1065<tr class="api apilevel-" > 1066<td colspan="2"> 1067 1068 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.service.wallpaper.WallpaperService.Engine" class="jd-expando-trigger closed" 1069 ><img height="34" id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-trigger" 1070 src="/assets/images/styles/disclosure_down.png" 1071 class="jd-expando-trigger-img" /></a>From 1072class 1073<code> 1074 1075 android.service.wallpaper.WallpaperService.Engine 1076 1077</code> 1078<div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine"> 1079 <div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-list" 1080 class="jd-inheritedlinks"> 1081 </div> 1082 <div id="inherited-methods-android.service.wallpaper.WallpaperService.Engine-summary" style="display: none;"> 1083 <table class="jd-sumtable-expando responsive"> 1084 1085 1086 1087 1088 <tr class="api apilevel-" > 1089 1090 1091 <td><code> 1092 1093 1094 1095 1096 1097 void</code> 1098 </td> 1099 1100 <td width="100%"> 1101 <code> 1102 dump(String arg0, FileDescriptor arg1, PrintWriter arg2, String[] arg3) 1103 </code> 1104 1105 </td> 1106 </tr> 1107 1108 1109 1110 <tr class="api apilevel-" > 1111 1112 1113 <td><code> 1114 1115 1116 1117 1118 1119 int</code> 1120 </td> 1121 1122 <td width="100%"> 1123 <code> 1124 getDesiredMinimumHeight() 1125 </code> 1126 1127 </td> 1128 </tr> 1129 1130 1131 1132 <tr class="api apilevel-" > 1133 1134 1135 <td><code> 1136 1137 1138 1139 1140 1141 int</code> 1142 </td> 1143 1144 <td width="100%"> 1145 <code> 1146 getDesiredMinimumWidth() 1147 </code> 1148 1149 </td> 1150 </tr> 1151 1152 1153 1154 <tr class="api apilevel-" > 1155 1156 1157 <td><code> 1158 1159 1160 1161 1162 1163 SurfaceHolder</code> 1164 </td> 1165 1166 <td width="100%"> 1167 <code> 1168 getSurfaceHolder() 1169 </code> 1170 1171 </td> 1172 </tr> 1173 1174 1175 1176 <tr class="api apilevel-" > 1177 1178 1179 <td><code> 1180 1181 1182 1183 1184 1185 boolean</code> 1186 </td> 1187 1188 <td width="100%"> 1189 <code> 1190 isPreview() 1191 </code> 1192 1193 </td> 1194 </tr> 1195 1196 1197 1198 <tr class="api apilevel-" > 1199 1200 1201 <td><code> 1202 1203 1204 1205 1206 1207 boolean</code> 1208 </td> 1209 1210 <td width="100%"> 1211 <code> 1212 isVisible() 1213 </code> 1214 1215 </td> 1216 </tr> 1217 1218 1219 1220 <tr class="api apilevel-" > 1221 1222 1223 <td><code> 1224 1225 1226 1227 1228 1229 void</code> 1230 </td> 1231 1232 <td width="100%"> 1233 <code> 1234 onApplyWindowInsets(WindowInsets arg0) 1235 </code> 1236 1237 </td> 1238 </tr> 1239 1240 1241 1242 <tr class="api apilevel-" > 1243 1244 1245 <td><code> 1246 1247 1248 1249 1250 1251 Bundle</code> 1252 </td> 1253 1254 <td width="100%"> 1255 <code> 1256 onCommand(String arg0, int arg1, int arg2, int arg3, Bundle arg4, boolean arg5) 1257 </code> 1258 1259 </td> 1260 </tr> 1261 1262 1263 1264 <tr class="api apilevel-" > 1265 1266 1267 <td><code> 1268 1269 1270 1271 1272 1273 void</code> 1274 </td> 1275 1276 <td width="100%"> 1277 <code> 1278 onCreate(SurfaceHolder arg0) 1279 </code> 1280 1281 </td> 1282 </tr> 1283 1284 1285 1286 <tr class="api apilevel-" > 1287 1288 1289 <td><code> 1290 1291 1292 1293 1294 1295 void</code> 1296 </td> 1297 1298 <td width="100%"> 1299 <code> 1300 onDesiredSizeChanged(int arg0, int arg1) 1301 </code> 1302 1303 </td> 1304 </tr> 1305 1306 1307 1308 <tr class="api apilevel-" > 1309 1310 1311 <td><code> 1312 1313 1314 1315 1316 1317 void</code> 1318 </td> 1319 1320 <td width="100%"> 1321 <code> 1322 onDestroy() 1323 </code> 1324 1325 </td> 1326 </tr> 1327 1328 1329 1330 <tr class="api apilevel-" > 1331 1332 1333 <td><code> 1334 1335 1336 1337 1338 1339 void</code> 1340 </td> 1341 1342 <td width="100%"> 1343 <code> 1344 onOffsetsChanged(float arg0, float arg1, float arg2, float arg3, int arg4, int arg5) 1345 </code> 1346 1347 </td> 1348 </tr> 1349 1350 1351 1352 <tr class="api apilevel-" > 1353 1354 1355 <td><code> 1356 1357 1358 1359 1360 1361 void</code> 1362 </td> 1363 1364 <td width="100%"> 1365 <code> 1366 onSurfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) 1367 </code> 1368 1369 </td> 1370 </tr> 1371 1372 1373 1374 <tr class="api apilevel-" > 1375 1376 1377 <td><code> 1378 1379 1380 1381 1382 1383 void</code> 1384 </td> 1385 1386 <td width="100%"> 1387 <code> 1388 onSurfaceCreated(SurfaceHolder arg0) 1389 </code> 1390 1391 </td> 1392 </tr> 1393 1394 1395 1396 <tr class="api apilevel-" > 1397 1398 1399 <td><code> 1400 1401 1402 1403 1404 1405 void</code> 1406 </td> 1407 1408 <td width="100%"> 1409 <code> 1410 onSurfaceDestroyed(SurfaceHolder arg0) 1411 </code> 1412 1413 </td> 1414 </tr> 1415 1416 1417 1418 <tr class="api apilevel-" > 1419 1420 1421 <td><code> 1422 1423 1424 1425 1426 1427 void</code> 1428 </td> 1429 1430 <td width="100%"> 1431 <code> 1432 onSurfaceRedrawNeeded(SurfaceHolder arg0) 1433 </code> 1434 1435 </td> 1436 </tr> 1437 1438 1439 1440 <tr class="api apilevel-" > 1441 1442 1443 <td><code> 1444 1445 1446 1447 1448 1449 void</code> 1450 </td> 1451 1452 <td width="100%"> 1453 <code> 1454 onTouchEvent(MotionEvent arg0) 1455 </code> 1456 1457 </td> 1458 </tr> 1459 1460 1461 1462 <tr class="api apilevel-" > 1463 1464 1465 <td><code> 1466 1467 1468 1469 1470 1471 void</code> 1472 </td> 1473 1474 <td width="100%"> 1475 <code> 1476 onVisibilityChanged(boolean arg0) 1477 </code> 1478 1479 </td> 1480 </tr> 1481 1482 1483 1484 <tr class="api apilevel-" > 1485 1486 1487 <td><code> 1488 1489 1490 1491 1492 1493 void</code> 1494 </td> 1495 1496 <td width="100%"> 1497 <code> 1498 setFixedSizeAllowed(boolean arg0) 1499 </code> 1500 1501 </td> 1502 </tr> 1503 1504 1505 1506 <tr class="api apilevel-" > 1507 1508 1509 <td><code> 1510 1511 1512 1513 1514 1515 void</code> 1516 </td> 1517 1518 <td width="100%"> 1519 <code> 1520 setOffsetNotificationsEnabled(boolean arg0) 1521 </code> 1522 1523 </td> 1524 </tr> 1525 1526 1527 1528 <tr class="api apilevel-" > 1529 1530 1531 <td><code> 1532 1533 1534 1535 1536 1537 void</code> 1538 </td> 1539 1540 <td width="100%"> 1541 <code> 1542 setTouchEventsEnabled(boolean arg0) 1543 </code> 1544 1545 </td> 1546 </tr> 1547 1548 1549 1550 </table> 1551 </div> 1552</div> 1553</td></tr> 1554 1555 1556 1557<tr class="api apilevel-" > 1558<td colspan="2"> 1559 1560 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 1561 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 1562 src="/assets/images/styles/disclosure_down.png" 1563 class="jd-expando-trigger-img" /></a>From 1564class 1565<code> 1566 1567 java.lang.Object 1568 1569</code> 1570<div id="inherited-methods-java.lang.Object"> 1571 <div id="inherited-methods-java.lang.Object-list" 1572 class="jd-inheritedlinks"> 1573 </div> 1574 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 1575 <table class="jd-sumtable-expando responsive"> 1576 1577 1578 1579 1580 <tr class="api apilevel-" > 1581 1582 1583 <td><code> 1584 1585 1586 1587 1588 1589 Object</code> 1590 </td> 1591 1592 <td width="100%"> 1593 <code> 1594 clone() 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 boolean</code> 1612 </td> 1613 1614 <td width="100%"> 1615 <code> 1616 equals(Object 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 finalize() 1639 </code> 1640 1641 </td> 1642 </tr> 1643 1644 1645 1646 <tr class="api apilevel-" > 1647 1648 1649 <td><code> 1650 1651 1652 1653 final 1654 1655 Class<?></code> 1656 </td> 1657 1658 <td width="100%"> 1659 <code> 1660 getClass() 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 int</code> 1678 </td> 1679 1680 <td width="100%"> 1681 <code> 1682 hashCode() 1683 </code> 1684 1685 </td> 1686 </tr> 1687 1688 1689 1690 <tr class="api apilevel-" > 1691 1692 1693 <td><code> 1694 1695 1696 1697 final 1698 1699 void</code> 1700 </td> 1701 1702 <td width="100%"> 1703 <code> 1704 notify() 1705 </code> 1706 1707 </td> 1708 </tr> 1709 1710 1711 1712 <tr class="api apilevel-" > 1713 1714 1715 <td><code> 1716 1717 1718 1719 final 1720 1721 void</code> 1722 </td> 1723 1724 <td width="100%"> 1725 <code> 1726 notifyAll() 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 String</code> 1744 </td> 1745 1746 <td width="100%"> 1747 <code> 1748 toString() 1749 </code> 1750 1751 </td> 1752 </tr> 1753 1754 1755 1756 <tr class="api apilevel-" > 1757 1758 1759 <td><code> 1760 1761 1762 1763 final 1764 1765 void</code> 1766 </td> 1767 1768 <td width="100%"> 1769 <code> 1770 wait(long arg0, int arg1) 1771 </code> 1772 1773 </td> 1774 </tr> 1775 1776 1777 1778 <tr class="api apilevel-" > 1779 1780 1781 <td><code> 1782 1783 1784 1785 final 1786 1787 void</code> 1788 </td> 1789 1790 <td width="100%"> 1791 <code> 1792 wait(long arg0) 1793 </code> 1794 1795 </td> 1796 </tr> 1797 1798 1799 1800 <tr class="api apilevel-" > 1801 1802 1803 <td><code> 1804 1805 1806 1807 final 1808 1809 void</code> 1810 </td> 1811 1812 <td width="100%"> 1813 <code> 1814 wait() 1815 </code> 1816 1817 </td> 1818 </tr> 1819 1820 1821 1822 </table> 1823 </div> 1824</div> 1825</td></tr> 1826 1827 1828</table> 1829 1830 1831 1832<!-- XML Attributes --> 1833 1834 1835<!-- Enum Values --> 1836 1837 1838<!-- Constants --> 1839 1840 1841<!-- Fields --> 1842 1843 1844<!-- Public ctors --> 1845 1846 1847<!-- ========= CONSTRUCTOR DETAIL ======== --> 1848<h2 class="api-section">Public constructors</h2> 1849 1850 1851 1852<A NAME="CanvasWatchFaceService.Engine()"></A> 1853 1854<div class="api apilevel-"> 1855 <h3 class="api-name">CanvasWatchFaceService.Engine</h3> 1856 <div class="api-level"> 1857 <div></div> 1858 1859 1860 1861 </div> 1862<pre class="api-signature no-pretty-print"> 1863CanvasWatchFaceService.Engine ()</pre> 1864 1865 1866 1867 1868 <p></p> 1869 1870</div> 1871 1872 1873 1874 1875 1876<!-- ========= CONSTRUCTOR DETAIL ======== --> 1877<!-- Protected ctors --> 1878 1879 1880 1881<!-- ========= METHOD DETAIL ======== --> 1882<!-- Public methdos --> 1883 1884<h2 class="api-section">Public methods</h2> 1885 1886 1887 1888<A NAME="invalidate()"></A> 1889 1890<div class="api apilevel-"> 1891 <h3 class="api-name">invalidate</h3> 1892 <div class="api-level"> 1893 <div></div> 1894 1895 1896 1897 </div> 1898<pre class="api-signature no-pretty-print"> 1899void invalidate ()</pre> 1900 1901 1902 1903 1904 <p>Schedules a call to <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDraw(android.graphics.Canvas, android.graphics.Rect)">onDraw(Canvas, Rect)</a></code> to draw the next frame. Must be called on the main 1905 thread. 1906</p> 1907 1908</div> 1909 1910 1911<A NAME="onDestroy()"></A> 1912 1913<div class="api apilevel-"> 1914 <h3 class="api-name">onDestroy</h3> 1915 <div class="api-level"> 1916 <div></div> 1917 1918 1919 1920 </div> 1921<pre class="api-signature no-pretty-print"> 1922void onDestroy ()</pre> 1923 1924 1925 1926 1927 <p></p> 1928 1929</div> 1930 1931 1932<A NAME="onDraw(android.graphics.Canvas, android.graphics.Rect)"></A> 1933 1934<div class="api apilevel-"> 1935 <h3 class="api-name">onDraw</h3> 1936 <div class="api-level"> 1937 <div></div> 1938 1939 1940 1941 </div> 1942<pre class="api-signature no-pretty-print"> 1943void onDraw (Canvas canvas, 1944 Rect bounds)</pre> 1945 1946 1947 1948 1949 <p>Draws the watch face.</p> 1950 <table class="responsive"> 1951 <tr><th colspan=2>Parameters</th></tr> 1952 <tr> 1953 <td><code>canvas</code></td> 1954 <td width="100%"> 1955 <code>Canvas</code>: 1956 the canvas to draw into</td> 1957 </tr> 1958 <tr> 1959 <td><code>bounds</code></td> 1960 <td width="100%"> 1961 <code>Rect</code>: 1962 the bounds in which the watch face should be drawn 1963</td> 1964 </tr> 1965 </table> 1966 1967</div> 1968 1969 1970<A NAME="onSurfaceChanged(android.view.SurfaceHolder, int, int, int)"></A> 1971 1972<div class="api apilevel-"> 1973 <h3 class="api-name">onSurfaceChanged</h3> 1974 <div class="api-level"> 1975 <div></div> 1976 1977 1978 1979 </div> 1980<pre class="api-signature no-pretty-print"> 1981void onSurfaceChanged (SurfaceHolder holder, 1982 int format, 1983 int width, 1984 int height)</pre> 1985 1986 1987 1988 1989 <p></p> 1990 <table class="responsive"> 1991 <tr><th colspan=2>Parameters</th></tr> 1992 <tr> 1993 <td><code>holder</code></td> 1994 <td width="100%"> 1995 <code>SurfaceHolder</code> 1996 <!-- no parameter comment --></td> 1997 </tr> 1998 <tr> 1999 <td><code>format</code></td> 2000 <td width="100%"> 2001 <code>int</code> 2002 <!-- no parameter comment --></td> 2003 </tr> 2004 <tr> 2005 <td><code>width</code></td> 2006 <td width="100%"> 2007 <code>int</code> 2008 <!-- no parameter comment --></td> 2009 </tr> 2010 <tr> 2011 <td><code>height</code></td> 2012 <td width="100%"> 2013 <code>int</code> 2014 <!-- no parameter comment --></td> 2015 </tr> 2016 </table> 2017 2018</div> 2019 2020 2021<A NAME="onSurfaceCreated(android.view.SurfaceHolder)"></A> 2022 2023<div class="api apilevel-"> 2024 <h3 class="api-name">onSurfaceCreated</h3> 2025 <div class="api-level"> 2026 <div></div> 2027 2028 2029 2030 </div> 2031<pre class="api-signature no-pretty-print"> 2032void onSurfaceCreated (SurfaceHolder holder)</pre> 2033 2034 2035 2036 2037 <p></p> 2038 <table class="responsive"> 2039 <tr><th colspan=2>Parameters</th></tr> 2040 <tr> 2041 <td><code>holder</code></td> 2042 <td width="100%"> 2043 <code>SurfaceHolder</code> 2044 <!-- no parameter comment --></td> 2045 </tr> 2046 </table> 2047 2048</div> 2049 2050 2051<A NAME="onSurfaceRedrawNeeded(android.view.SurfaceHolder)"></A> 2052 2053<div class="api apilevel-"> 2054 <h3 class="api-name">onSurfaceRedrawNeeded</h3> 2055 <div class="api-level"> 2056 <div></div> 2057 2058 2059 2060 </div> 2061<pre class="api-signature no-pretty-print"> 2062void onSurfaceRedrawNeeded (SurfaceHolder holder)</pre> 2063 2064 2065 2066 2067 <p></p> 2068 <table class="responsive"> 2069 <tr><th colspan=2>Parameters</th></tr> 2070 <tr> 2071 <td><code>holder</code></td> 2072 <td width="100%"> 2073 <code>SurfaceHolder</code> 2074 <!-- no parameter comment --></td> 2075 </tr> 2076 </table> 2077 2078</div> 2079 2080 2081<A NAME="postInvalidate()"></A> 2082 2083<div class="api apilevel-"> 2084 <h3 class="api-name">postInvalidate</h3> 2085 <div class="api-level"> 2086 <div></div> 2087 2088 2089 2090 </div> 2091<pre class="api-signature no-pretty-print"> 2092void postInvalidate ()</pre> 2093 2094 2095 2096 2097 <p>Posts a message to schedule a call to <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#onDraw(android.graphics.Canvas, android.graphics.Rect)">onDraw(Canvas, Rect)</a></code> to draw the next frame. Unlike 2098 <code><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html#invalidate()">invalidate()</a></code>, this method is thread-safe and may be called on any thread. 2099</p> 2100 2101</div> 2102 2103 2104 2105 2106 2107<!-- ========= METHOD DETAIL ======== --> 2108 2109 2110 2111<!-- ========= END OF CLASS DATA ========= --> 2112 2113</div><!-- end jd-content --> 2114 2115 2116 2117<div class="data-reference-resources-wrapper"> 2118 2119 <ul data-reference-resources> 2120 2121 <li><h2>Annotations</h2> 2122 <ul> 2123 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.TapType.html">WatchFaceService.TapType</a></li> 2124 </ul> 2125 </li> 2126 2127 2128 <li><h2>Classes</h2> 2129 <ul> 2130 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.html">CanvasWatchFaceService</a></li> 2131 <li class="selected api apilevel-"><a href="/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html">CanvasWatchFaceService.Engine</a></li> 2132 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.html">Gles2WatchFaceService</a></li> 2133 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html">Gles2WatchFaceService.Engine</a></li> 2134 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.html">WatchFaceService</a></li> 2135 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceService.Engine.html">WatchFaceService.Engine</a></li> 2136 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceStyle.html">WatchFaceStyle</a></li> 2137 <li class="api apilevel-"><a href="/reference/android/support/wearable/watchface/WatchFaceStyle.Builder.html">WatchFaceStyle.Builder</a></li> 2138 </ul> 2139 </li> 2140 2141 2142 2143 </ul> 2144 2145</div> 2146 2147 2148 2149</body> 2150</html> 2151