From d7bd838e88dbe79808c87c97c43c1a13c953984d Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Sun, 14 Aug 2022 22:38:22 +0200 Subject: [PATCH] Integrated Github Actions (#3) * Integrated Github Actions --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++ .github/workflows/pull-request.yml | 16 ++++++++ app/build.gradle.kts | 2 +- .../himanshoe/charty/line/CurveLineChart.kt | 2 +- .../java/com/himanshoe/charty/pie/PieChart.kt | 6 ++- 6 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..eb59994 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,16 @@ +name: Pull Request Workflow + +on: pull_request +jobs: + code-style-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - name: ktlint check + uses: gradle/gradle-build-action@v2 + with: + arguments: ktlintCheck + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 18e3185..4bf77ad 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -49,7 +49,7 @@ android { } dependencies { - //implementation(project(":charty")) + // implementation(project(":charty")) implementation("com.himanshoe:charty:1.0.0-alpha01") implementation(Deps.Compose.ui) implementation(Deps.Compose.material) diff --git a/charty/src/main/java/com/himanshoe/charty/line/CurveLineChart.kt b/charty/src/main/java/com/himanshoe/charty/line/CurveLineChart.kt index 776af05..2d1cb30 100644 --- a/charty/src/main/java/com/himanshoe/charty/line/CurveLineChart.kt +++ b/charty/src/main/java/com/himanshoe/charty/line/CurveLineChart.kt @@ -122,7 +122,7 @@ fun CurveLineChart( pointsPath.apply { reset() moveTo(offsetItems.first().x, offsetItems.first().y) - (0.until(offsetItems.size .minus(1))).forEach { index -> + (0.until(offsetItems.size.minus(1))).forEach { index -> cubicTo( graphPathPoints[index].x, graphPathPoints[index].y, backgroundPathPoints[index].x, backgroundPathPoints[index].y, diff --git a/charty/src/main/java/com/himanshoe/charty/pie/PieChart.kt b/charty/src/main/java/com/himanshoe/charty/pie/PieChart.kt index 9192901..4849c38 100644 --- a/charty/src/main/java/com/himanshoe/charty/pie/PieChart.kt +++ b/charty/src/main/java/com/himanshoe/charty/pie/PieChart.kt @@ -8,7 +8,11 @@ import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Size