Skip to content

Commit

Permalink
Merge pull request #174 from brudaswen/fix/issue-173-ignore-transpare…
Browse files Browse the repository at this point in the history
…nt-pixels
  • Loading branch information
mateuszkwiecinski authored May 17, 2021
2 parents 7822032 + 1e93e8d commit 34c71ec
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ColorRibbonFilter(
// draw the ribbon
graphics.color = ribbonColor
if (drawingOptions.contains(DrawingOption.IGNORE_TRANSPARENT_PIXELS) && !adaptive) {
graphics.composite = AlphaComposite.getInstance(AlphaComposite.SRC_IN, 1f)
graphics.composite = AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1f)
}

if (gravity == Gravity.TOP || gravity == Gravity.BOTTOM) {
Expand Down
23 changes: 23 additions & 0 deletions sample/example-icon-round/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ android {
signingConfig signingConfigs.debug
}
}

flavorDimensions "transparentPixels"
productFlavors {
keep {
dimension "transparentPixels"
}
ignore {
dimension "transparentPixels"
}
}
}

easylauncher {
productFlavors {
ignore {
filters = customRibbon(
label: "debug",
ribbonColor: "#99007200",
position: "topLeft",
drawingOptions: ["IgnoreTransparentPixels"],
)
}
}
}

dependencies {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.starter.easylauncher.screenshot
import android.Manifest
import androidx.test.rule.GrantPermissionRule
import com.example.custom.adaptive.MainActivity
import com.example.simple.BuildConfig
import com.example.simple.R
import com.starter.easylauncher.recordScreenshot
import org.junit.Rule
Expand All @@ -15,11 +16,11 @@ internal class IconsTest {

@Test
fun default() {
recordScreenshot<MainActivity>("default", iconName = R.mipmap.ic_launcher)
recordScreenshot<MainActivity>("${BuildConfig.FLAVOR}-default", iconName = R.mipmap.ic_launcher)
}

@Test
fun round() {
recordScreenshot<MainActivity>("round", iconName = R.mipmap.ic_launcher_round)
recordScreenshot<MainActivity>("${BuildConfig.FLAVOR}-round", iconName = R.mipmap.ic_launcher_round)
}
}

0 comments on commit 34c71ec

Please sign in to comment.