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

merge form changes to main #69

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3c6bf47
- added the formatting classes
LinusMuema Jun 12, 2023
13b94ad
Merge branch 'develop' into mask-formatter
LinusMuema Jun 12, 2023
e292fe7
- remove unnecessary empty string replacement
LinusMuema Jun 12, 2023
218a2cc
Merge pull request #65 from jkuatdsc/feature/card-number-formatting
joykangangi Jun 12, 2023
7fbe681
Implement Web-Url Validator
joykangangi Jun 14, 2023
5a2a790
Add Date and Card Examples
joykangangi Jun 16, 2023
448cf74
Add Date Validator
joykangangi Jun 28, 2023
9885933
Remove Phone Field
joykangangi Jun 28, 2023
d705d86
Migrating from using Gradle with Grovy to use Gradle with Kotlin.
Nenoeldeeb Aug 22, 2024
de58b95
Migrating from using Gradle with Grovy to use Gradle with Kotlin.
Nenoeldeeb Aug 23, 2024
7a5dfd4
Migrating to versions catalog system and unifing the compileSdk and t…
Nenoeldeeb Aug 25, 2024
be8d898
Upgrading dependencies & some adaptation and configurations.
Nenoeldeeb Aug 25, 2024
35845f1
Upgrade the library version.
Nenoeldeeb Aug 25, 2024
a3053b3
Update README.md
Nenoeldeeb Aug 26, 2024
2fd735f
Update jitpack.yml
Nenoeldeeb Aug 26, 2024
3cc2ad2
Update build.gradle.kts (form-builder)
Nenoeldeeb Aug 26, 2024
9c83578
Update README.md
Nenoeldeeb Aug 26, 2024
cbeb529
Add a new field of type "SwitchState" that handle the Switch Composable.
Nenoeldeeb Sep 1, 2024
9f7cdee
Adding unit & integration tests to the newly added field.
Nenoeldeeb Sep 1, 2024
90a216e
Update the library version to "1.2.0".
Nenoeldeeb Sep 1, 2024
757b707
Update the Kotlin version to "2.2.20".
Nenoeldeeb Sep 1, 2024
9115d66
Merge pull request #66 from jkuatdsc/form-inputs
joykangangi Sep 1, 2024
faa0ee3
Update build.yaml workflow
Nenoeldeeb Sep 2, 2024
01e8ca3
Update build.yaml workflow
Nenoeldeeb Sep 2, 2024
8bfe169
Update build.yaml workflow
Nenoeldeeb Sep 2, 2024
a8a5882
Merge branch 'refs/heads/develop' into fork/Nenoeldeeb/main
joykangangi Sep 22, 2024
cde88ee
resolve merge conflicts
joykangangi Sep 22, 2024
e013588
Merge pull request #70 from Nenoeldeeb/main
joykangangi Sep 22, 2024
c429464
Update build.yaml
joykangangi Sep 24, 2024
8655413
Update build.yaml
joykangangi Sep 24, 2024
fc8cbb0
Update build.yaml
joykangangi Sep 24, 2024
9eb48ca
Delete old form-builder/build.gradle
joykangangi Sep 24, 2024
84d02e6
restore authors in docs
joykangangi Sep 24, 2024
fdcbcf6
add formatters docs
joykangangi Sep 24, 2024
b47e463
Add Contribution Guideline
joykangangi Sep 25, 2024
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
11 changes: 6 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 12
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 12
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -24,4 +25,4 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: ./form-builder/build/dokka/html
FOLDER: ./form-builder/build/dokka/html
84 changes: 77 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![](https://jitpack.io/v/jkuatdsc/form-builder.svg)](https://jitpack.io/#jkuatdsc/form-builder)


## Jetpack Compose FormBuilder

A customisable android library used to provide an abstraction layer over form elements as well as provide a DRY code
Expand All @@ -8,24 +9,32 @@ implementation of a form.
The library is used to help in the state management of a `Form` in Jetpack compose. Currently, we don't have an official
support for a form state so the library is used to provide a custom implementation of the same.

* [<a id="installs" href="#installs">Installation</a>](#installation)
* [<a id="basics" href="#basics">Basic Usage</a>](#basic-usage)
* [<a id="demos" href="#demos">Demos</a>](#demos)
* [<a id="links" href="#links">Further Reading</a>](#further-reading)
* [<a id="contribution" href="#contribution">Contribution Guideline</a>](#contribution-guideline)

<!-- TOC --><a name="installation"></a>
### <a id="installs" href="#installs">Installation</a>

In the root `build.gradle` file add the following:

```groovy
```kotlin
repositories {
maven { url "https://jitpack.io" }
maven { url = uri("https://jitpack.io") }
}
```

Then add the following to your module's `build.gradle`

```groovy
```kotlin
dependencies {
implementation 'com.github.jkuatdsc:form-builder:${version}'
implementation("com.github.jkuatdsc:form-builder:${version}")
}
```

<!-- TOC --><a name="basic-usage"></a>
### <a id="basics" href="#basics">Basic Usage</a>

The library provides a [`FormState`](/form-builder/src/main/java/com/dsc/form_builder/FormState.kt) class that
Expand Down Expand Up @@ -112,7 +121,8 @@ TextFieldState(
)
```

### Demos
<!-- TOC --><a name="demos"></a>
### <a id="demos" href="#demos">Demos</a>

**Demo 1** : In this demo, the validations are executed before the next screen is presented.

Expand All @@ -124,12 +134,72 @@ https://user-images.githubusercontent.com/47350130/204372977-e8b66f71-0b61-4d93-

You can find the sample apk [here](https://drive.google.com/file/d/1tMtDtJwuDZoQnxluiAPNC0dYs7aqXUjt/view?usp=sharing)

For more details about the library, check out the [references](https://jkuatdsc.github.io/form-builder/).

<!-- TOC --><a name="further-reading"></a>
### <a id="links" href="#links">Further Reading</a>

The links below provide a reinforced understanding to the library.
* [Form Builder Documentation](https://jkuatdsc.github.io/form-builder/).
* [Introduction to Form Builder basics](https://www.section.io/engineering-education/jetpack-compose-forms/)
* [Advanced Form Builder operations guide](https://www.section.io/engineering-education/making-jetpack-form-builder/)

<!-- TOC --><a name="contribution-guideline"></a>
### <a id="contribution" href="#contribution">Contribution Guideline</a>

We appreciate your interest in contributing to our project! To ensure a smooth and collaborative process, please follow these guidelines.

#### 1. Fork the Repository
- Begin by **forking** the repository to your GitHub account.
- **Clone** the forked repository to your local machine.

#### 2. Create a Feature Branch
- Create a new branch for your feature or bug fix. Branch names should follow this format:
```bash
feature/<feature-name>
fix/<bug-description>
```
#### 3. Make Changes and commit
- Make your changes on the feature branch.
- Keep your commits small, focused, and meaningful.

#### 4. Rebase with Develop Branch
- Before opening a pull request, rebase your feature branch with the latest `develop` branch
```bash
git checkout develop
git pull origin develop
git checkout <your-branch>
git rebase develop
```
#### 5. Create a Pull Request (PR)
- Once your feature branch is up to date with `develop`, create a pull request (PR) to merge into the `develop` branch.
- Ensure that the PR description includes:
- A summary of the changes.
- Any relevant issue references (e.g., "Closes #issue-number")
- Details about any potential impact on existing functionality.

#### 6. Code Review
- Wait for a code review from maintainers or team members. Address any feedback by making further changes and pushing them to the same feature branch.

#### 7. Merge into Develop
- After approval and successful tests, your PR will be merged into the `develop` branch.

#### 8. Merging to Main
- Once the changes in `develop` are stable, they will be merged into the `main` branch as part of a release cycle.

#### 9. Updating Documentation
- If your changes require updates to the documentation, ensure you update the relevant files or create new ones before submitting your PR.

#### 10. Best Practices
- Write tests for any new features or bug fixes.
- Follow the existing coding standards and style guides used in the project.
- Ensure that your changes pass any automated tests and that the project builds successfully.

#### 11. Contribution Etiquette
- Do not maliciously delete any library functionality, change the name or package of the library, or amend any library information unless there is a well-justified reason for doing so.
- Be respectful and collaborative when communicating with other contributors or maintainers.
- When submitting a PR, please ensure that your comments and descriptions are clear and concise.
- Avoid large, unrelated changes in a single commit. Keep your work focused on the task at hand

Your collaboration is key to the success of this project, and every contribution matters.
Thank you for being part of our journey!✨

MIT [Licence](LICENSE)
19 changes: 0 additions & 19 deletions build.gradle

This file was deleted.

7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.jetbrains.dokka) apply false
alias(libs.plugins.jetbrains.compose.compiler) apply false
}
64 changes: 0 additions & 64 deletions example/build.gradle

This file was deleted.

71 changes: 71 additions & 0 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.jetbrains.compose.compiler)
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
applicationId = "com.dsc.formbuilder"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = libs.versions.appVersionCode.get().toInt()
versionName = libs.versions.appVersionName.get()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility(libs.versions.jvmTarget.get())
targetCompatibility(libs.versions.jvmTarget.get())
isCoreLibraryDesugaringEnabled = true
}

kotlin {
jvmToolchain(libs.versions.jvmTarget.get().toInt())
}
buildFeatures {
compose = true
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
namespace = "com.dsc.formbuilder"
}

dependencies {

implementation(project(":form-builder"))
// For using modern java 8 classes with older versions of android
coreLibraryDesugaring(libs.core.java8)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.compose)
implementation(libs.android.material)
implementation(libs.androidx.lifecycle.runtime)

implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.ui.tooling.preview)

debugImplementation(libs.androidx.compose.ui.tooling)

implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.window.size)
}
2 changes: 1 addition & 1 deletion example/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
3 changes: 1 addition & 2 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dsc.formbuilder">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
Loading
Loading