• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.graphics;
18 
19 @android.ravenwood.annotation.RavenwoodKeepWholeClass
20 public class DashPathEffect extends PathEffect {
21 
22     /**
23      * The intervals array must contain an even number of entries (>=2), with
24      * the even indices specifying the "on" intervals, and the odd indices
25      * specifying the "off" intervals. phase is an offset into the intervals
26      * array (mod the sum of all of the intervals). The intervals array
27      * controls the length of the dashes. The paint's strokeWidth controls the
28      * thickness of the dashes.
29      * Note: this patheffect only affects drawing with the paint's style is set
30      * to STROKE or FILL_AND_STROKE. It is ignored if the drawing is done with
31      * style == FILL.
32      * @param intervals array of ON and OFF distances
33      * @param phase offset into the intervals array
34      */
DashPathEffect(float intervals[], float phase)35     public DashPathEffect(float intervals[], float phase) {
36         if (intervals.length < 2) {
37             throw new ArrayIndexOutOfBoundsException();
38         }
39         native_instance = nativeCreate(intervals, phase);
40     }
41 
nativeCreate(float intervals[], float phase)42     private static native long nativeCreate(float intervals[], float phase);
43 }
44 
45