Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit ae3df59

Browse files
authored
Make :constraintlayout compatible with Doclava (#244)
Fixes some errors in visibility, documentation or references so that the library can be processed through Doclava in the jetpack repo. Co-authored-by: Oscar Adame Vazquez <oscarad@google.com>
1 parent d9b602a commit ae3df59

File tree

7 files changed

+47
-33
lines changed

7 files changed

+47
-33
lines changed

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/MotionScene.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@
5656
* The information to transition between multiple ConstraintSets
5757
* This Class is meant to be used from XML
5858
*
59-
* @hide
6059
*/
61-
6260
public class MotionScene {
63-
public static final String TAG = "MotionScene";
61+
private static final String TAG = "MotionScene";
6462
private static final boolean DEBUG = false;
6563
private static final int MIN_DURATION = 8;
6664
final static int TRANSITION_BACKWARD = 0;

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/utils/widget/ImageFilterButton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void setImageZoom(float zoom) {
270270
/**
271271
* sets the rotation angle of the image in degrees
272272
*
273-
* @rotation the rotation in degrees
273+
* @param rotation the rotation in degrees
274274
*/
275275
public void setImageRotate(float rotation) {
276276
mRotate = rotation;

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/utils/widget/ImageFilterView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public void setImageZoom(float zoom) {
395395
/**
396396
* sets the rotation angle of the image in degrees
397397
*
398-
* @rotation the rotation in degrees
398+
* @param rotation the rotation in degrees
399399
*/
400400
public void setImageRotate(float rotation) {
401401
mRotate = rotation;

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/utils/widget/MotionLabel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private float getVerticalOffset() {
345345
private void setUpTheme(Context context, @Nullable AttributeSet attrs) {
346346
TypedValue typedValue = new TypedValue();
347347
final Resources.Theme theme = context.getTheme();
348-
theme.resolveAttribute(R.attr.colorPrimary, typedValue, true);
348+
theme.resolveAttribute(androidx.appcompat.R.attr.colorPrimary, typedValue, true);
349349
mPaint.setColor(mTextFillColor = typedValue.data);
350350
}
351351

@@ -612,7 +612,7 @@ private void setTypefaceFromAttrs(String familyName, int typefaceIndex, int styl
612612
}
613613
}
614614

615-
private void setTypeface(Typeface tf) {
615+
public void setTypeface(Typeface tf) {
616616
if (mPaint.getTypeface() != tf) {
617617
mPaint.setTypeface(tf);
618618
if (mLayout != null) {

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintLayout.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,10 +2433,12 @@ public static class LayoutParams extends ViewGroup.MarginLayoutParams {
24332433
* If the child is the start of a horizontal chain, this attribute will drive how
24342434
* the elements of the chain will be positioned. The possible values are:
24352435
* <ul>
2436-
* <li>{@see CHAIN_SPREAD} -- the elements will be spread out</li>
2437-
* <li>{@see CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not be spread out</li>
2438-
* <li>{@see CHAIN_PACKED} -- the elements of the chain will be packed together. The horizontal
2439-
* bias attribute of the child will then affect the positioning of the packed elements</li>
2436+
* <li>{@link #CHAIN_SPREAD} -- the elements will be spread out</li>
2437+
* <li>{@link #CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not
2438+
* be spread out</li>
2439+
* <li>{@link #CHAIN_PACKED} -- the elements of the chain will be packed together. The
2440+
* horizontal bias attribute of the child will then affect the positioning of the packed
2441+
* elements</li>
24402442
* </ul>
24412443
*/
24422444
public int horizontalChainStyle = CHAIN_SPREAD;
@@ -2445,36 +2447,44 @@ public static class LayoutParams extends ViewGroup.MarginLayoutParams {
24452447
* If the child is the start of a vertical chain, this attribute will drive how
24462448
* the elements of the chain will be positioned. The possible values are:
24472449
* <ul>
2448-
* <li>{@see CHAIN_SPREAD} -- the elements will be spread out</li>
2449-
* <li>{@see CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not be spread out</li>
2450-
* <li>{@see CHAIN_PACKED} -- the elements of the chain will be packed together. The vertical
2451-
* bias attribute of the child will then affect the positioning of the packed elements</li>
2450+
* <li>{@link #CHAIN_SPREAD} -- the elements will be spread out</li>
2451+
* <li>{@link #CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not
2452+
* be spread out</li>
2453+
* <li>{@link #CHAIN_PACKED} -- the elements of the chain will be packed together. The
2454+
* vertical bias attribute of the child will then affect the positioning of the packed
2455+
* elements</li>
24522456
* </ul>
24532457
*/
24542458
public int verticalChainStyle = CHAIN_SPREAD;
24552459

24562460
/**
24572461
* Define how the widget horizontal dimension is handled when set to MATCH_CONSTRAINT
24582462
* <ul>
2459-
* <li>{@see MATCH_CONSTRAINT_SPREAD} -- the default. The dimension will expand up to the constraints, minus margins</li>
2460-
* <li>{@see MATCH_CONSTRAINT_WRAP} -- DEPRECATED -- use instead WRAP_CONTENT and constrainedWidth=true<br>
2463+
* <li>{@link #MATCH_CONSTRAINT_SPREAD} -- the default. The dimension will expand up to
2464+
* the constraints, minus margins</li>
2465+
* <li>{@link #MATCH_CONSTRAINT_WRAP} -- DEPRECATED -- use instead WRAP_CONTENT and
2466+
* constrainedWidth=true<br>
24612467
* The dimension will be the same as WRAP_CONTENT, unless the size ends
24622468
* up too large for the constraints; in that case the dimension will expand up to the constraints, minus margins</li>
24632469
* This attribute may not be applied if the widget is part of a chain in that dimension.
2464-
* <li>{@see MATCH_CONSTRAINT_PERCENT} -- The dimension will be a percent of another widget (by default, the parent)</li>
2470+
* <li>{@link #MATCH_CONSTRAINT_PERCENT} -- The dimension will be a percent of another
2471+
* widget (by default, the parent)</li>
24652472
* </ul>
24662473
*/
24672474
public int matchConstraintDefaultWidth = MATCH_CONSTRAINT_SPREAD;
24682475

24692476
/**
24702477
* Define how the widget vertical dimension is handled when set to MATCH_CONSTRAINT
24712478
* <ul>
2472-
* <li>{@see MATCH_CONSTRAINT_SPREAD} -- the default. The dimension will expand up to the constraints, minus margins</li>
2473-
* <li>{@see MATCH_CONSTRAINT_WRAP} -- DEPRECATED -- use instead WRAP_CONTENT and constrainedHeight=true<br>
2479+
* <li>{@link #MATCH_CONSTRAINT_SPREAD} -- the default. The dimension will expand up to
2480+
* the constraints, minus margins</li>
2481+
* <li>{@link #MATCH_CONSTRAINT_WRAP} -- DEPRECATED -- use instead WRAP_CONTENT and
2482+
* constrainedWidth=true<br>
24742483
* The dimension will be the same as WRAP_CONTENT, unless the size ends
24752484
* up too large for the constraints; in that case the dimension will expand up to the constraints, minus margins</li>
24762485
* This attribute may not be applied if the widget is part of a chain in that dimension.
2477-
* <li>{@see MATCH_CONSTRAINT_PERCENT} -- The dimension will be a percent of another widget (by default, the parent)</li>
2486+
* <li>{@link #MATCH_CONSTRAINT_PERCENT} -- The dimension will be a percent of another
2487+
* widget (by default, the parent)</li>
24782488
* </ul>
24792489
*/
24802490
public int matchConstraintDefaultHeight = MATCH_CONSTRAINT_SPREAD;

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintSet.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
* </li>
7373
* </ul><p>
7474
* Example code:<br>
75-
* {@sample resources/examples/ExampleConstraintSet.java
76-
* Example}
75+
* {@sample resources/examples/ExampleConstraintSet.java Example}
7776
*/
7877
public class ConstraintSet {
7978
private static final String TAG = "ConstraintSet";
@@ -3617,10 +3616,14 @@ public void setVerticalWeight(int viewId, float weight) {
36173616
* How the elements of the horizontal chain will be positioned. if the dimension
36183617
* behaviour is set to MATCH_CONSTRAINT. The possible values are:
36193618
*
3620-
* <ul> <li>{@see CHAIN_SPREAD} -- the elements will be spread out</li> <li>{@see
3621-
* CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not be spread out</li>
3622-
* <li>{@see CHAIN_PACKED} -- the elements of the chain will be packed together. The horizontal
3623-
* bias attribute of the child will then affect the positioning of the packed elements</li> </ul>
3619+
* <ul>
3620+
* <li>{@link #CHAIN_SPREAD} -- the elements will be spread out</li>
3621+
* <li>{@link #CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not
3622+
* be spread out</li>
3623+
* <li>{@link #CHAIN_PACKED} -- the elements of the chain will be packed together. The
3624+
* horizontal bias attribute of the child will then affect the positioning of the packed
3625+
* elements</li>
3626+
* </ul>
36243627
*
36253628
* @param viewId ID of view to adjust its HorizontalChainStyle
36263629
* @param chainStyle the weight that we can use to distribute the horizontal space
@@ -3633,10 +3636,14 @@ public void setHorizontalChainStyle(int viewId, int chainStyle) {
36333636
* How the elements of the vertical chain will be positioned. in a chain, if the dimension
36343637
* behaviour is set to MATCH_CONSTRAINT
36353638
*
3636-
* <ul> <li>{@see CHAIN_SPREAD} -- the elements will be spread out</li> <li>{@see
3637-
* CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not be spread out</li>
3638-
* <li>{@see CHAIN_PACKED} -- the elements of the chain will be packed together. The horizontal
3639-
* bias attribute of the child will then affect the positioning of the packed elements</li> </ul>
3639+
* <ul>
3640+
* <li>{@link #CHAIN_SPREAD} -- the elements will be spread out</li>
3641+
* <li>{@link #CHAIN_SPREAD_INSIDE} -- similar, but the endpoints of the chain will not
3642+
* be spread out</li>
3643+
* <li>{@link #CHAIN_PACKED} -- the elements of the chain will be packed together. The
3644+
* vertical bias attribute of the child will then affect the positioning of the packed
3645+
* elements</li>
3646+
* </ul>
36403647
*
36413648
* @param viewId ID of view to adjust its VerticalChainStyle
36423649
* @param chainStyle the weight that we can use to distribute the horizontal space

constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/Guideline.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
* and {@link ConstraintSet#setGuidelinePercent} functions in {@link ConstraintSet}.
4949
* <p>
5050
* Example of a {@code Button} constrained to a vertical {@code Guideline}:<br>
51-
* {@sample resources/examples/Guideline.xml
52-
* Guideline}
51+
* {@sample resources/examples/Guideline.xml Guideline}
5352
*/
5453
public class Guideline extends View {
5554
public Guideline(Context context) {

0 commit comments

Comments
 (0)