初始化所有边框 @param borderType 边框类型 @param borderColor 边框颜色 @param borderThickness 边框厚度
(Constants.Enums.BorderType borderType, Color borderColor, float borderThickness)
| 412 | * @param borderThickness 边框厚度 |
| 413 | */ |
| 414 | private void initBorder(Constants.Enums.BorderType borderType, Color borderColor, float borderThickness) { |
| 415 | double roundRadius = AllConfigs.getInstance().getConfigEntity().getRoundRadius(); |
| 416 | int borderThickNessInt = (int) borderThickness; |
| 417 | Color explorerAttachBorderColor; |
| 418 | if (ColorUtil.isDark(searchBarColor.getRGB())) { |
| 419 | explorerAttachBorderColor = Color.WHITE; |
| 420 | } else { |
| 421 | explorerAttachBorderColor = Color.BLACK; |
| 422 | } |
| 423 | RoundBorder topRound = new RoundBorder(borderColor, |
| 424 | borderThickness, |
| 425 | (int) roundRadius, |
| 426 | RoundBorder.RoundedCorners.TOP_LEFT | RoundBorder.RoundedCorners.TOP_RIGHT, |
| 427 | RoundBorder.ShowLines.TOP | RoundBorder.ShowLines.LEFT | RoundBorder.ShowLines.RIGHT); |
| 428 | RoundBorder explorerTopRound = new RoundBorder(explorerAttachBorderColor, |
| 429 | borderThickness, |
| 430 | (int) roundRadius, |
| 431 | RoundBorder.RoundedCorners.TOP_LEFT | RoundBorder.RoundedCorners.TOP_RIGHT, |
| 432 | RoundBorder.ShowLines.TOP | RoundBorder.ShowLines.LEFT | RoundBorder.ShowLines.RIGHT); |
| 433 | RoundBorder bottomRound = new RoundBorder(borderColor, |
| 434 | borderThickness, |
| 435 | (int) roundRadius, |
| 436 | RoundBorder.RoundedCorners.BOTTOM_LEFT | RoundBorder.RoundedCorners.BOTTOM_RIGHT, |
| 437 | RoundBorder.ShowLines.BOTTOM | RoundBorder.ShowLines.LEFT | RoundBorder.ShowLines.RIGHT); |
| 438 | RoundBorder explorerBottomRound = new RoundBorder(explorerAttachBorderColor, |
| 439 | borderThickness, |
| 440 | (int) roundRadius, |
| 441 | RoundBorder.RoundedCorners.BOTTOM_LEFT | RoundBorder.RoundedCorners.BOTTOM_RIGHT, |
| 442 | RoundBorder.ShowLines.BOTTOM | RoundBorder.ShowLines.LEFT | RoundBorder.ShowLines.RIGHT); |
| 443 | RoundBorder fullRound = new RoundBorder(borderColor, |
| 444 | borderThickness, |
| 445 | (int) roundRadius, |
| 446 | RoundBorder.RoundedCorners.ALL, |
| 447 | RoundBorder.ShowLines.ALL); |
| 448 | RoundBorder explorerFullRound = new RoundBorder(explorerAttachBorderColor, |
| 449 | borderThickness, |
| 450 | (int) roundRadius, |
| 451 | RoundBorder.RoundedCorners.ALL, |
| 452 | RoundBorder.ShowLines.ALL); |
| 453 | if (Constants.Enums.BorderType.AROUND == borderType) { |
| 454 | topBorder = topRound; |
| 455 | middleBorder = BorderFactory.createMatteBorder(0, borderThickNessInt, 0, borderThickNessInt, borderColor); |
| 456 | bottomBorder = bottomRound; |
| 457 | fullBorder = fullRound; |
| 458 | explorerTopBorder = explorerTopRound; |
| 459 | explorerMiddleBorder = BorderFactory.createMatteBorder(0, borderThickNessInt, 0, borderThickNessInt, explorerAttachBorderColor); |
| 460 | explorerBottomBorder = explorerBottomRound; |
| 461 | explorerFullBorder = explorerFullRound; |
| 462 | } else if (Constants.Enums.BorderType.EMPTY == borderType) { |
| 463 | Border emptyBorder = BorderFactory.createEmptyBorder(); |
| 464 | topBorder = emptyBorder; |
| 465 | middleBorder = emptyBorder; |
| 466 | bottomBorder = emptyBorder; |
| 467 | fullBorder = emptyBorder; |
| 468 | explorerTopBorder = emptyBorder; |
| 469 | explorerMiddleBorder = emptyBorder; |
| 470 | explorerBottomBorder = emptyBorder; |
| 471 | explorerFullBorder = emptyBorder; |
no test coverage detected