Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update classes visibility #19

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ sealed class GraphicUnit {
abstract val memberName: MemberName?
}

class Pixel(override val value: Float) : GraphicUnit() {
internal class Pixel(override val value: Float) : GraphicUnit() {
override val memberName: MemberName? = null
}

class Dp(override val value: Float) : GraphicUnit() {
internal class Dp(override val value: Float) : GraphicUnit() {
override val memberName: MemberName = MemberNames.Dp
}

fun rawAsGraphicUnit(raw: String): GraphicUnit {
internal fun rawAsGraphicUnit(raw: String): GraphicUnit {
val isStrokeDp = raw.endsWith("dp")
return when {
isStrokeDp -> Dp(raw.removeSuffix("dp").toFloat())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package androidx.compose.material.icons.generator

/**
* Represents a icon's Kotlin name, processed XML file name, theme, and XML file content.
* Represents an icon's Kotlin name, processed XML file name, theme, and XML file content.
*
* @property fileContent the content of the source XML file that will be parsed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.squareup.kotlinpoet.MemberName
/**
* Package names used for icon generation.
*/
enum class PackageNames(val packageName: String) {
internal enum class PackageNames(val packageName: String) {
UiPackage("androidx.compose.ui"),
GraphicsPackage(UiPackage.packageName + ".graphics"),
VectorPackage(GraphicsPackage.packageName + ".vector"),
Expand Down Expand Up @@ -56,19 +56,8 @@ object ClassNames {
object MemberNames {
val Path = MemberName(PackageNames.VectorPackage.packageName, "path")

val EvenOdd = MemberName(ClassNames.PathFillTypeWithCompanion, "EvenOdd")
val NonZero = MemberName(ClassNames.PathFillTypeWithCompanion, "NonZero")

val Group = MemberName(PackageNames.VectorPackage.packageName, "group")

val StrokeCapButt = MemberName(ClassNames.StrokeCapWithCompanion, "Butt")
val StrokeCapRound = MemberName(ClassNames.StrokeCapWithCompanion, "Round")
val StrokeCapSquare = MemberName(ClassNames.StrokeCapWithCompanion, "Square")

val StrokeJoinMiter = MemberName(ClassNames.StrokeJoinWithCompanion, "Miter")
val StrokeJoinRound = MemberName(ClassNames.StrokeJoinWithCompanion, "Round")
val StrokeJoinBevel = MemberName(ClassNames.StrokeJoinWithCompanion, "Bevel")

val Dp = MemberName(PackageNames.Unit.packageName, "dp")
val Modifier = MemberName(PackageNames.UiPackage.packageName, "Modifier")
val Padding = MemberName(PackageNames.LayoutPackage.packageName, "padding")
Expand All @@ -84,6 +73,6 @@ object MemberNames {
/**
* @return the [ClassName] of the given [classNames] inside this package.
*/
fun PackageNames.className(vararg classNames: String) = ClassName(this.packageName, *classNames)
internal fun PackageNames.className(vararg classNames: String) = ClassName(this.packageName, *classNames)

private const val CompanionImportName = "Companion"
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@

package androidx.compose.material.icons.generator.vector

import androidx.compose.material.icons.generator.MemberNames
import com.squareup.kotlinpoet.MemberName

/**
* Determines the winding rule that decides how the interior of a [VectorNode.Path] is calculated.
*
* This maps to [android.graphics.Path.FillType] used in the framework, and can be defined in XML
* via `android:fillType`.
*/
enum class FillType(val memberName: MemberName) {
NonZero(MemberNames.NonZero),
EvenOdd(MemberNames.EvenOdd)
enum class FillType {
NonZero,
EvenOdd
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import io.github.composegears.valkyrie.generator.ext.formatFloat
* @property isCurve whether this command is a curve command
* @property isQuad whether this command is a quad command
*/
/* ktlint-disable max-line-length */
sealed class PathNode(val isCurve: Boolean = false, val isQuad: Boolean = false) {
/**
* Maps a [PathNode] to a string representing an invocation of the corresponding PathBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlin.math.min
* Trimmed down copy of PathParser that doesn't handle interacting with Paths, and only is
* responsible for parsing path strings.
*/
object PathParser {
internal object PathParser {
/**
* Parses the path string to create a collection of PathNode instances with their corresponding
* arguments
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package androidx.compose.material.icons.generator.vector

import androidx.compose.material.icons.generator.MemberNames
import com.squareup.kotlinpoet.MemberName

enum class StrokeCap(val memberName: MemberName) {
Butt(MemberNames.StrokeCapButt),
Round(MemberNames.StrokeCapRound),
Square(MemberNames.StrokeCapSquare)
enum class StrokeCap {
Butt,
Round,
Square
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package androidx.compose.material.icons.generator.vector

import androidx.compose.material.icons.generator.MemberNames
import com.squareup.kotlinpoet.MemberName

enum class StrokeJoin(val memberName: MemberName) {
Miter(MemberNames.StrokeJoinMiter),
Round(MemberNames.StrokeJoinRound),
Bevel(MemberNames.StrokeJoinBevel)
enum class StrokeJoin {
Miter,
Round,
Bevel
}