summaryrefslogtreecommitdiffstats
path: root/docs/html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html')
-rw-r--r--docs/html/guide/topics/ui/accessibility/services.jd3
-rw-r--r--docs/html/guide/topics/ui/drag-drop.jd110
-rw-r--r--docs/html/training/articles/perf-tips.jd1
3 files changed, 51 insertions, 63 deletions
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index 4bd752f..c868080 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -81,7 +81,8 @@ as shown in the following sample:</p>
<pre>
&lt;application&gt;
&lt;service android:name=&quot;.MyAccessibilityService&quot;
- android:label=&quot;@string/accessibility_service_label&quot;&gt;
+ android:label=&quot;@string/accessibility_service_label&quot;
+ android:permission=&quot;android.permission.BIND_ACCESSIBILITY_SERVICE&quot&gt;
&lt;intent-filter&gt;
&lt;action android:name=&quot;android.accessibilityservice.AccessibilityService&quot; /&gt;
&lt;/intent-filter&gt;
diff --git a/docs/html/guide/topics/ui/drag-drop.jd b/docs/html/guide/topics/ui/drag-drop.jd
index e989374..9a6b0e9 100644
--- a/docs/html/guide/topics/ui/drag-drop.jd
+++ b/docs/html/guide/topics/ui/drag-drop.jd
@@ -873,7 +873,7 @@ imageView.setOnDragListener(mDragListen);
...
-protected class myDragEventListener implements View.OnDragEventListener {
+protected class myDragEventListener implements View.OnDragListener {
// This is the method that the system calls when it dispatches a drag event to the
// listener.
@@ -899,18 +899,15 @@ protected class myDragEventListener implements View.OnDragEventListener {
v.invalidate();
// returns true to indicate that the View can accept the dragged data.
- return(true);
+ return true;
- } else {
+ }
- // Returns false. During the current drag and drop operation, this View will
- // not receive events again until ACTION_DRAG_ENDED is sent.
- return(false);
+ // Returns false. During the current drag and drop operation, this View will
+ // not receive events again until ACTION_DRAG_ENDED is sent.
+ return false;
- }
- break;
-
- case DragEvent.ACTION_DRAG_ENTERED: {
+ case DragEvent.ACTION_DRAG_ENTERED:
// Applies a green tint to the View. Return true; the return value is ignored.
@@ -919,79 +916,70 @@ protected class myDragEventListener implements View.OnDragEventListener {
// Invalidate the view to force a redraw in the new tint
v.invalidate();
- return(true);
-
- break;
+ return true;
- case DragEvent.ACTION_DRAG_LOCATION:
+ case DragEvent.ACTION_DRAG_LOCATION:
// Ignore the event
- return(true);
-
- break;
-
- case DragEvent.ACTION_DRAG_EXITED:
-
- // Re-sets the color tint to blue. Returns true; the return value is ignored.
- v.setColorFilter(Color.BLUE);
-
- // Invalidate the view to force a redraw in the new tint
- v.invalidate();
+ return true;
- return(true);
+ case DragEvent.ACTION_DRAG_EXITED:
- break;
-
- case DragEvent.ACTION_DROP:
+ // Re-sets the color tint to blue. Returns true; the return value is ignored.
+ v.setColorFilter(Color.BLUE);
- // Gets the item containing the dragged data
- ClipData.Item item = event.getClipData().getItemAt(0);
+ // Invalidate the view to force a redraw in the new tint
+ v.invalidate();
- // Gets the text data from the item.
- dragData = item.getText();
+ return true;
- // Displays a message containing the dragged data.
- Toast.makeText(this, "Dragged data is " + dragData, Toast.LENGTH_LONG);
+ case DragEvent.ACTION_DROP:
- // Turns off any color tints
- v.clearColorFilter();
+ // Gets the item containing the dragged data
+ ClipData.Item item = event.getClipData().getItemAt(0);
- // Invalidates the view to force a redraw
- v.invalidate();
+ // Gets the text data from the item.
+ dragData = item.getText();
- // Returns true. DragEvent.getResult() will return true.
- return(true);
+ // Displays a message containing the dragged data.
+ Toast.makeText(this, "Dragged data is " + dragData, Toast.LENGTH_LONG);
- break;
+ // Turns off any color tints
+ v.clearColorFilter();
- case DragEvent.ACTION_DRAG_ENDED:
+ // Invalidates the view to force a redraw
+ v.invalidate();
- // Turns off any color tinting
- v.clearColorFilter();
+ // Returns true. DragEvent.getResult() will return true.
+ return true;
- // Invalidates the view to force a redraw
- v.invalidate();
+ case DragEvent.ACTION_DRAG_ENDED:
- // Does a getResult(), and displays what happened.
- if (event.getResult()) {
- Toast.makeText(this, "The drop was handled.", Toast.LENGTH_LONG);
+ // Turns off any color tinting
+ v.clearColorFilter();
- } else {
- Toast.makeText(this, "The drop didn't work.", Toast.LENGTH_LONG);
+ // Invalidates the view to force a redraw
+ v.invalidate();
- };
+ // Does a getResult(), and displays what happened.
+ if (event.getResult()) {
+ Toast.makeText(this, "The drop was handled.", Toast.LENGTH_LONG);
- // returns true; the value is ignored.
- return(true);
+ } else {
+ Toast.makeText(this, "The drop didn't work.", Toast.LENGTH_LONG);
- break;
+ }
- // An unknown action type was received.
- default:
- Log.e("DragDrop Example","Unknown action type received by OnDragListener.");
+ // returns true; the value is ignored.
+ return true;
+ // An unknown action type was received.
+ default:
+ Log.e("DragDrop Example","Unknown action type received by OnDragListener.");
break;
- };
- };
+ }
+
+ return false;
+ }
};
</pre>
diff --git a/docs/html/training/articles/perf-tips.jd b/docs/html/training/articles/perf-tips.jd
index 7ff6c5c..1660b7f 100644
--- a/docs/html/training/articles/perf-tips.jd
+++ b/docs/html/training/articles/perf-tips.jd
@@ -16,7 +16,6 @@ page.article=true
<li><a href="#AvoidFloat">Avoid Using Floating-Point</a></li>
<li><a href="#UseLibraries">Know and Use the Libraries</a></li>
<li><a href="#NativeMethods">Use Native Methods Carefully</a></li>
- <li><a href="#library">Know And Use The Libraries</a></li>
<li><a href="#native_methods">Use Native Methods Judiciously</a></li>
<li><a href="#closing_notes">Closing Notes</a></li>
</ol>