Skip to content

Commit

Permalink
Merge pull request ImaginativeShohag#112 from ImaginativeShohag/dev
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ImaginativeShohag authored May 7, 2024
2 parents 1272cc9 + fa2f35a commit 5de480e
Show file tree
Hide file tree
Showing 88 changed files with 1,441 additions and 708 deletions.
24 changes: 24 additions & 0 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright 2021 Md. Mahmudul Hasan Shohag
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Turn Gradle daemon off due to https://github.com/Kotlin/dokka/issues/1405
org.gradle.daemon=false

org.gradle.parallel=true
org.gradle.jvmargs=-Xmx4608m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.workers.max=2

kotlin.compiler.execution.strategy=in-process
51 changes: 51 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish docs

on:
pull_request:
types:
- closed
branches: [ "master", "dev" ]
workflow_dispatch:

jobs:
deploy_docs:
runs-on: ubuntu-latest
env:
TERM: dumb

steps:
- uses: actions/checkout@v2

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Setup java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install mkdocs-material=="9.*"

- name: Generate docs
run: ./generate_docs.sh

- name: Build site
run: mkdocs build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.iml
.idea
.idea/*
.gradle
/local.properties
/.idea/caches
Expand Down Expand Up @@ -100,3 +100,16 @@ lint/outputs/
lint/tmp/
# lint/reports/

# IntelliJ project icon
!.idea/icon.svg

# Temporary API docs
docs/api

# Mkdocs temporary serving folder
docs-gen
site
*.bak

# Python
venv/*
File renamed without changes
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Why Not! Image Carousel! Logo](images/logo.svg)
![Why Not! Image Carousel! Logo](docs/images/logo.svg)

# Why Not! Image Carousel!

Expand All @@ -11,9 +11,9 @@ An easy, super simple and customizable image carousel view for Android.

## Preview

| ![Screenshot](images/preview_1.gif) | ![Preview](images/preview_2.gif) |
| ![Screenshot](docs/images/preview_1.gif) | ![Preview](docs/images/preview_2.gif) |
| :---------------------------------: | :---------------------------------: |
| ![Screenshot](images/preview_3.gif) | ![Screenshot](images/preview_4.gif) |
| ![Screenshot](docs/images/preview_3.gif) | ![Screenshot](docs/images/preview_4.gif) |

## Usage

Expand Down Expand Up @@ -509,7 +509,7 @@ So it is recommended if you enabled `autoPlay` & `infiniteCarousel`.

## Infinite Carousel

![Infinite Carousel](images/infinite_carousel.gif)
![Infinite Carousel](docs/images/infinite_carousel.gif)

The library now supports an infinite carousel, which means that the item view is looped infinitely. This feature is enabled by default, but you can disable it by setting the `infiniteCarousel` property to `false`.

Expand Down Expand Up @@ -582,7 +582,7 @@ binding.carousel.setCarouselListener(new CarouselListener() {

## Carousel Type (`carouselType`)

![Carousel type preview](images/carousel_type.png)
![Carousel type preview](docs/images/carousel_type.png)

`ImageCarousel` has following types:

Expand All @@ -598,13 +598,13 @@ You can also use the `scaleOnScroll` and `scalingFactor` attributes with this ca

### Scale Item View On Scroll (`scaleOnScroll`)

![Scale-on-scroll preview](images/scale_on_scroll.png)
![Scale-on-scroll preview](docs/images/scale_on_scroll.png)

You can use `scaleOnScroll` attribute to scaling down the adjacent views like above. Use `scalingFactor` to define scale down percentage. Value should be 0.0 to 1.0.

## Carousel Gravity (`carouselGravity`)

![Carousel gravity preview](images/carousel_gravity.png)
![Carousel gravity preview](docs/images/carousel_gravity.png)

For `CarouselType.SHOWCASE`, you can set carousel gravity. Supported gravities ase:

Expand All @@ -624,7 +624,7 @@ All the images from [Unsplash](https://unsplash.com).

## Change Log

See the change log [here](https://github.com/ImaginativeShohag/Why-Not-Image-Carousel/blob/master/CHANGELOG.md).
See the change log [here](CHANGELOG.md).

## License

Expand Down
71 changes: 58 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,71 @@
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTask

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.8.21'
repositories {
google()
mavenCentral()
}
ext.kotlin_version = '1.9.23'
ext.dokka_version = '1.9.20'

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath("org.jetbrains.dokka:dokka-base:$dokka_version")
}
}

allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
plugins {
id 'com.android.application' version '8.4.0' apply false
id 'com.android.library' version '8.4.0' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
id 'com.google.devtools.ksp' version '1.9.23-1.0.20' apply false
id 'com.diffplug.spotless' version '6.25.0'
id "org.jetbrains.dokka" version "$dokka_version"
}

subprojects {
apply plugin: 'com.diffplug.spotless'

spotless {
kotlin {
target '**/*.kt'
targetExclude "${layout.buildDirectory}/**/*.kt"
targetExclude 'bin/**/*.kt'

ktlint()
licenseHeaderFile rootProject.file('spotless/copyright.kt')
}

format('kts') {
target '**/*.kts'
targetExclude '**/build/**/*.kts'
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile rootProject.file('spotless/copyright.kts'), '(^(?![\\/ ]\\*).*$)'
}

format('xml') {
target '**/*.xml'
targetExclude '**/build/**/*.xml'
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile rootProject.file('spotless/copyright.xml'), '(<[^!?])'
}
}
}

tasks.withType(DokkaMultiModuleTask).configureEach {
moduleName = "Why Not! Image Carousel!"
outputDirectory = rootProject.file('docs/api')
failOnWarning = true

pluginsMapConfiguration.set(
[
"org.jetbrains.dokka.base.DokkaBase": """{
"footerMessage": "Copyright © 2021 Md. Mahmudul Hasan Shohag"
}"""
]
)
}
File renamed without changes
File renamed without changes
File renamed without changes
31 changes: 31 additions & 0 deletions docs/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
44 changes: 44 additions & 0 deletions generate_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Copyright 2021 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Fail on any error
set -ex

DOCS_ROOT=docs-gen

[ -d $DOCS_ROOT ] && rm -r $DOCS_ROOT
mkdir $DOCS_ROOT

# Clear out the old API docs
[ -d docs/api ] && rm -r docs/api
# Build the docs with dokka
./gradlew dokkaHtmlMultiModule --stacktrace

# Create a copy of our docs at our $DOCS_ROOT
cp -a docs/* $DOCS_ROOT

cp README.md $DOCS_ROOT/index.md
cp CHANGELOG.md $DOCS_ROOT/changelog.md

sed -i.bak 's/README.md//g' $DOCS_ROOT/index.md
sed -i.bak 's/CHANGELOG.md/changelog/' $DOCS_ROOT/index.md
sed -i.bak 's/docs\/images\//images\//g' $DOCS_ROOT/index.md

# Convert docs/xxx.md links to just xxx/
sed -i.bak 's/docs\/\([a-zA-Z-]*\).md/\1/g' $DOCS_ROOT/index.md

# Finally delete all of the backup files
find . -name '*.bak' -delete
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# ------------------------------------------------------------
android.nonTransitiveRClass=false
android.nonFinalResIds=false
# ------------------------------------------------------------
# For Publication
# ------------------------------------------------------------
GROUP=org.imaginativeworld.whynotimagecarousel
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
Loading

0 comments on commit 5de480e

Please sign in to comment.