{"record":{"id":"52a2412b28aaf61f","repo":"material-components/material-components-android","slug":"rounded-corners-without-gap-are-not-supported-in-c","errorCode":null,"errorMessage":"Rounded corners without gap are not supported in contiguous indeterminate animation.","messagePattern":"Rounded corners without gap are not supported in contiguous indeterminate animation\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"lib/java/com/google/android/material/progressindicator/LinearProgressIndicatorSpec.java","lineNumber":168,"sourceCode":"  public boolean useStrokeCap() {\n    return super.useStrokeCap() && getTrackInnerCornerRadiusInPx() == getTrackCornerRadiusInPx();\n  }\n\n  @Override\n  void validateSpec() {\n    super.validateSpec();\n    if (trackStopIndicatorSize < 0) {\n      // Throws an exception if trying to use a negative stop indicator size.\n      throw new IllegalArgumentException(\"Stop indicator size must be >= 0.\");\n    }\n    if (indeterminateAnimationType\n        == LinearProgressIndicator.INDETERMINATE_ANIMATION_TYPE_CONTIGUOUS) {\n      if ((getTrackCornerRadiusInPx() > 0\n              || (hasInnerCornerRadius && getTrackInnerCornerRadiusInPx() > 0))\n          && indicatorTrackGapSize == 0) {\n        // Throws an exception if trying to use the cornered indicator/track with contiguous\n        // indeterminate animation type without gap.\n        throw new IllegalArgumentException(\n            \"Rounded corners without gap are not supported in contiguous indeterminate animation.\");\n      }\n      if (indicatorColors.length < 3) {\n        // Throws an exception if trying to set contiguous indeterminate animation with less than 3\n        // indicator colors.\n        throw new IllegalArgumentException(\n            \"Contiguous indeterminate animation must be used with 3 or more indicator colors.\");\n      }\n    }\n  }\n}\n","sourceCodeStart":150,"sourceCodeEnd":180,"githubUrl":"https://github.com/material-components/material-components-android/blob/ac7e18efeefb331850c561faf9ab8bf81d27ba68/lib/java/com/google/android/material/progressindicator/LinearProgressIndicatorSpec.java#L150-L180","documentation":"LinearProgressIndicatorSpec.validateSpec() throws when the contiguous indeterminate animation type is combined with rounded corners (track or indicator corner radius > 0) and indicatorTrackGapSize == 0. The contiguous animator moves seamlessly-joined segments, and rounded corners without a gap between the joined lines produce an invalid/incorrect rendering, so the spec is rejected up front.","triggerScenarios":"Using INDETERMINATE_ANIMATION_TYPE_CONTIGUOUS with app:trackCornerRadius (or app:trackInnerCornerRadius) > 0 while app:indicatorTrackGapSize is 0 or unset — via XML attributes or the corresponding runtime setters that call validateSpec().","commonSituations":"Enabling the Material 3-style contiguous animation on a themed indicator whose shape theme already applies trackCornerRadius; upgrading Material library version and switching animation type while keeping existing corner-radius attributes; copying a rounded-track style from a disjoint setup.","solutions":["Set a positive gap: app:indicatorTrackGapSize=\"4dp\" (or setIndicatorTrackGapSize(4)) so rounded corners are supported.","Or remove the corner radii: set app:trackCornerRadius and app:trackInnerCornerRadius to 0dp.","Or keep the default disjoint animation type (INDETERMINATE_ANIMATION_TYPE_DISJOINT), which supports rounded corners without a gap."],"exampleFix":"<!-- before -->\n<com.google.android.material.progressindicator.LinearProgressIndicator\n    app:indeterminateAnimationType=\"contiguous\"\n    app:trackCornerRadius=\"4dp\" ... />\n\n<!-- after -->\n<com.google.android.material.progressindicator.LinearProgressIndicator\n    app:indeterminateAnimationType=\"contiguous\"\n    app:trackCornerRadius=\"4dp\"\n    app:indicatorTrackGapSize=\"4dp\" ... />","handlingStrategy":"validation","validationCode":"// Before enabling contiguous type, ensure gap if corners are set\nif (type == INDETERMINATE_ANIMATION_TYPE_CONTIGUOUS\n    && (trackCornerRadiusPx > 0 || indicatorTrackGapSizePx == 0)) {\n  indicator.setIndicatorTrackGapSize(dp(4));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair any trackCornerRadius styling with an explicit indicatorTrackGapSize when using contiguous animation.","Centralize progress-indicator styling in one theme/style so invalid combos are caught in one place.","Add a UI smoke test that inflates every progress style variant."],"tags":["android","material-components","progress-indicator","animation","validation"],"backgroundTag":null,"analyzedSha":"ac7e18efeefb331850c561faf9ab8bf81d27ba68","analyzedAt":"2026-08-14T15:35:35.735Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}