Skip to content

Commit

Permalink
Porting to kotlin and repo update
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhE committed Aug 24, 2020
1 parent 5769e11 commit a9f9f0c
Show file tree
Hide file tree
Showing 22 changed files with 938 additions and 942 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: GuilhE

---

## 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.

## Details (please complete the following information):
- Library version
- Android version
- Emulator/Device specs
- Logs/Crash Reports/Stacktraces
- Example Code/Link to repositories

## Additional context
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
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.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/pull_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Pull Request
about: Contribute to this project
title: ''
labels: ''
assignees: ''

---

## Description
A few sentences describing the overall goals of the pull request's commits.

## Related PRs/Issues
List related PRs and Issues for this Pull Request.

## Todos
- [ ] Tests
- [ ] Documentation
- [ ] Screenshots
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish to Bintray
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Grant Permission to Execute
run: chmod +x gradlew

- name: Publish Library
env:
bintrayUser: ${{ secrets.BINTRAY_USER }}
bintrayApiKey: ${{ secrets.BINTRAY_API_KEY }}
run: ./gradlew bintrayUpload
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changelog

---

## [2.0.0]

- Added thumb size configurations support
- Kotlin port
- Global repository update
- Changed: `setProgressAnimationCallback` to `setActionCallback`
- Changed: `setBackgroundColor` to `setProgressBackgroundColor`
- Changed: `setProgressThumbSizeRate` to `setProgressMaxThumbSizeRate`
- Changed: `<attr name="backgroundColor" />` to `<attr name="progressBackgroundColor" />`
- Changed: `<attr name="backgroundAlphaEnabled" />` to `<attr name="progressBackgroundAlphaEnabled" />`

---

## [1.4.1]

- Changed LIBRARY_PACKAGE_NAME

---

## [1.3.1]

- Added reverse progress

---

## [1.3.0]

- Added multiple-arc-progress feature
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
# CircularProgressView
<img src="https://raw.githubusercontent.com/Guilhe/android-circular-progress-view/master/.imgs/banner.png" />
<img src="media/banner.png" />

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CircularProgressView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6152) [![Preview-Appetize.io](https://img.shields.io/badge/Preview-Appetize.io-brightgreen.svg?style=flat.svg)](https://appetize.io/app/jeftbchvbfuafwpeaf00fba8bm)
![Bintray](https://img.shields.io/bintray/dt/gdelgado/android/circular-progress-view)

A fancy CircularProgressView.

#### Version 1.x
- **Jul, 2019** - Added thumb size configurations support
- **Nov, 2019** - Added "gradient color" (SweepGradient) for progress
- **Apr, 2019** - Added rounded progress
- **Jun, 2018** - Added reverse progress
- **May, 2018** - Added _"multiple-arc-progress"_
- **February, 2018** - Background alpha enable/disable
- **November, 2017** - Progress thumb and animation callback
- **September, 2017** - CircularProgressView


## Getting started
Include it into your project, for example, as a Gradle dependency:

```groovy
implementation 'com.github.guilhe:circular-progress-view:${LATEST_VERSION}'
```
[![Maven Central](https://img.shields.io/maven-central/v/com.github.guilhe/circular-progress-view.svg)](https://search.maven.org/search?q=g:com.github.guilhe%20AND%20circular-progress-view) [![Download](https://api.bintray.com/packages/gdelgado/android/circular-progress-view/images/download.svg)](https://bintray.com/gdelgado/android/circular-progress-view/_latestVersion)

[![Maven Central](https://img.shields.io/maven-central/v/com.github.guilhe/circular-progress-view.svg)](https://search.maven.org/search?q=g:com.github.guilhe%20AND%20circular-progress-view) [![Download](https://api.bintray.com/packages/gdelgado/android/circular-progress-view/images/download.svg)](https://bintray.com/gdelgado/android/circular-progress-view/_latestVersion)
![Bintray](https://img.shields.io/bintray/dt/gdelgado/android/circular-progress-view)
## Usage
Check out the __sample__ module where you can find a few examples of how to create it by `xml` or `java`.

Expand All @@ -43,8 +33,8 @@ Attributes accepted in xml:
<attr name="progressBarColorArrayPositions" format="reference" />
<attr name="duplicateFirstColorInArray" format="boolean" />
<attr name="progressBarRounded" format="boolean" />
<attr name="backgroundColor" format="color" />
<attr name="backgroundAlphaEnabled" format="boolean" />
<attr name="progressBackgroundColor" format="color" />
<attr name="progressBackgroundAlphaEnabled" format="boolean" />
<attr name="reverse" format="boolean" />
<attr format="enum" name="progressThumbScaleType">
<enum name="auto" value="0"/>
Expand Down Expand Up @@ -89,7 +79,7 @@ For the given array of colors:
</array>
```
The default result will be (left):
<img src="https://raw.githubusercontent.com/Guilhe/android-circular-progress-view/master/.imgs/rainbow.png" />
<img src="media/rainbow.png" />

To achieve the result on the right side you have two options: either copy the first color and add it as last, or use the helper attribute/method that does that for you:
```xml
Expand All @@ -110,7 +100,7 @@ Finally, you may also use the attribute `progressBarColorArrayPositions` to pass
There are many methods to help you customize this `View` by code. For more details checkout the __sample app__, _javadocs_ or the code itself.

### "Multiple Progress" for PieChart
<img src="https://raw.githubusercontent.com/Guilhe/android-circular-progress-view/master/.imgs/piechart.png" />
<img src="media/piechart.png" />

```java
setProgress(@NonNull List<Float> progressList, @NonNull List<Integer> progressColorList)
Expand All @@ -119,7 +109,7 @@ This mode can be used to display a simple pie chart. It will disable the progres


## Sample
<img src="https://raw.githubusercontent.com/Guilhe/android-circular-progress-view/master/.imgs/sample.gif" alt="Sample" width="30%"/>
<img src="meida/sample.gif" alt="Sample" width="30%"/>

_Animation last update on April, 2019_

Expand Down
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.0'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -28,9 +30,9 @@ allprojects {

ext {
minSdkVersion = 19
targetSdkVersion = 29
compileSdkVersion = 29
buildToolsVersion = '29.0.3'
targetSdkVersion = 30
compileSdkVersion = 30
buildToolsVersion = '30.0.1'

supportLibraryVersion = '28.0.0'
}
5 changes: 5 additions & 0 deletions circular-progress-view/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand All @@ -23,8 +24,12 @@ android {

dependencies {
implementation "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

if (project.rootProject.file('local.properties').exists()) {
apply from: 'deploy.gradle'
}
repositories {
mavenCentral()
}
Loading

0 comments on commit a9f9f0c

Please sign in to comment.