Skip to content

Commit

Permalink
Release 1.9.0 (#215)
Browse files Browse the repository at this point in the history
* Refresh, configure publishing

* Configure CI for deploy and snapshots

* Adjust repository in docs

* Write changelog

* Fix dokka task
  • Loading branch information
natario1 authored Nov 25, 2021
1 parent 254280b commit 4725680
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 115 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
# Renaming ? Change the README badge.
name: Build
name: 'Build'
on:
push:
branches:
- master
- main
pull_request:

jobs:

ANDROID_BASE_CHECKS:
name: Base Checks
name: 'Base Checks'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 1.8
- name: Perform base checks
run: ./gradlew app:assembleDebug library:dokka
java-version: 11
distribution: temurin
cache: gradle
- name: 'Perform base checks'
run: ./gradlew app:assembleDebug library:dokkaJavadoc

ANDROID_UNIT_TESTS:
name: Unit Tests
name: 'Unit Tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 1.8
- name: Execute unit tests
java-version: 11
distribution: temurin
- name: 'Execute unit tests'
run: ./gradlew library:testDebugUnitTest
25 changes: 15 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
name: Deploy
name: 'Deploy'
on:
release:
types: [published]

jobs:
BINTRAY_UPLOAD:
name: Bintray Upload

SONATYPE_DEPLOY:
name: 'Deploy to Sonatype'
runs-on: ubuntu-latest
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 1.8
- name: Perform bintray upload
run: ./gradlew bintrayUpload
java-version: 11
distribution: temurin
cache: gradle
- name: 'Publish library'
run: ./gradlew library:publishToSonatype
25 changes: 25 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Snapshot'
on:
push:
branches:
- main

jobs:

SNAPSHOT:
name: 'Publish Snapshot'
runs-on: ubuntu-latest
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: temurin
cache: gradle
- name: 'Publish library snapshot'
run: ./gradlew library:publishToSonatypeSnapshot
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
A collection of flexible Android components that support zooming and panning of View hierarchies,
images, video streams, and much more - either programmatically or through touch events.

```groovy
implementation 'com.otaliastudios:zoomlayout:1.8.0'
```kotlin
implementation("com.otaliastudios:zoomlayout:1.9.0")
```

- `ZoomLayout`: a container that supports 2D pan and zoom to a View hierarchy, even supporting clicks [[docs]](https://natario1.github.io/ZoomLayout/docs/zoom-layout)
Expand Down
14 changes: 7 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
}

android {
setCompileSdkVersion(rootProject.extra["compileSdkVersion"] as Int)
compileSdk = 31

defaultConfig {
applicationId = "com.otaliastudios.zoom.demo"
setMinSdkVersion(rootProject.extra["minSdkVersion"] as Int)
setTargetSdkVersion(rootProject.extra["targetSdkVersion"] as Int)
minSdk = 21
targetSdk = 31
versionCode = 1
versionName = "1.0"
setProperty("archivesBaseName", "ZoomLayout_v${versionName}_($versionCode)")
Expand All @@ -21,9 +21,9 @@ android {
}

dependencies {
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("com.google.android.exoplayer:exoplayer-core:2.9.3")
implementation("com.google.android.exoplayer:exoplayer-ui:2.9.3")
implementation("com.otaliastudios.opengl:egloo:0.4.0")
implementation("androidx.appcompat:appcompat:1.4.0")
implementation("com.google.android.exoplayer:exoplayer-core:2.16.1")
implementation("com.google.android.exoplayer:exoplayer-ui:2.16.1")
implementation("com.otaliastudios.opengl:egloo:0.6.1")
implementation(project(":library"))
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
40 changes: 19 additions & 21 deletions app/src/main/java/com/otaliastudios/zoom/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,27 @@
import android.widget.Button;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.PlayerControlView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.VideoListener;
import com.google.android.exoplayer2.upstream.DefaultDataSource;
import com.google.android.exoplayer2.video.VideoSize;
import com.otaliastudios.zoom.ZoomImageView;
import com.otaliastudios.zoom.ZoomLayout;
import com.otaliastudios.zoom.ZoomLogger;
import com.otaliastudios.zoom.ZoomSurfaceView;

import org.jetbrains.annotations.NotNull;


public class MainActivity extends AppCompatActivity {

private SimpleExoPlayer player;
private ExoPlayer player;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -111,34 +109,34 @@ protected void onStart() {

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
private void setUpVideoPlayer() {
player = ExoPlayerFactory.newSimpleInstance(this);
player = new ExoPlayer.Builder(this).build();
PlayerControlView controls = findViewById(R.id.player_control_view);
final ZoomSurfaceView surface = findViewById(R.id.surface_view);
player.addVideoListener(new VideoListener() {
player.addListener(new Player.Listener() {
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
surface.setContentSize(width, height);
public void onVideoSizeChanged(@NonNull VideoSize videoSize) {
surface.setContentSize(videoSize.width, videoSize.height);
}
});
surface.setBackgroundColor(ContextCompat.getColor(this, R.color.background));
surface.addCallback(new ZoomSurfaceView.Callback() {
@Override
public void onZoomSurfaceCreated(@NotNull ZoomSurfaceView view) {
public void onZoomSurfaceCreated(@NonNull ZoomSurfaceView view) {
player.setVideoSurface(view.getSurface());
}

@Override
public void onZoomSurfaceDestroyed(@NotNull ZoomSurfaceView view) { }
public void onZoomSurfaceDestroyed(@NonNull ZoomSurfaceView view) { }
});
controls.setPlayer(player);
controls.setShowTimeoutMs(0);
controls.show();
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
Util.getUserAgent(this, "ZoomLayoutLib"));
DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(this);
Uri videoUri = Uri.parse("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4");
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(videoUri);
player.prepare(videoSource);
MediaSource videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(MediaItem.fromUri(videoUri));
player.setMediaSource(videoSource);
player.prepare();
}

@Override
Expand Down
25 changes: 1 addition & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
buildscript {

extra["minSdkVersion"] = 16
extra["compileSdkVersion"] = 29
extra["targetSdkVersion"] = 29
extra["kotlinVersion"] = "1.3.72"

repositories {
mavenCentral()
google()
jcenter()
}

dependencies {
val kotlinVersion = property("kotlinVersion") as String
classpath("com.android.tools.build:gradle:4.0.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.otaliastudios.tools:publisher:0.1.5")
classpath("io.deepmedia.tools:publisher:0.6.0")
}
}

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

tasks.register("clean", Delete::class) {
delete(buildDir)
}
16 changes: 15 additions & 1 deletion docs/_about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ New versions are released through GitHub, so the reference page is the [GitHub R
Starting from 1.7.0, you can now [support development](https://github.com/natario1/ZoomLayout/issues/125) through the GitHub Sponsors program.
Companies can share a tiny part of their revenue and get private support hours in return. Thanks!

#### v1.8.0
## v1.9.0

The library is now hosted on the Maven Central repository.

- Enhancement: open ZoomEngine constructor, thanks to [@coffeemakr][coffeemakr] ([#193][193])
- Fix: improved moveTo animation ([#189][189])
- Fix: fix verbose logging, thanks to [@r4zzz4k][r4zzz4k] ([#214][214])

<https://github.com/natario1/ZoomLayout/compare/v1.8.0...v1.9.0>

## v1.8.0

- Enhancement: raise an exception if a drawable without intrinsic dimensions is used ([#157][157])
- Enhancement: overzoom customization ([#164][164])
Expand Down Expand Up @@ -82,6 +92,7 @@ Companies can share a tiny part of their revenue and get private support hours i
[Sly112]: https://github.com/Sly112
[RayyanTahir]: https://github.com/RayyanTahir
[r4zzz4k]: https://github.com/r4zzz4k
[coffeemakr]: https://github.com/coffeemakr

[38]: https://github.com/natario1/ZoomLayout/pull/38
[70]: https://github.com/natario1/ZoomLayout/pull/70
Expand All @@ -107,3 +118,6 @@ Companies can share a tiny part of their revenue and get private support hours i
[159]: https://github.com/natario1/ZoomLayout/pull/159
[158]: https://github.com/natario1/ZoomLayout/pull/158
[156]: https://github.com/natario1/ZoomLayout/pull/156
[193]: https://github.com/natario1/ZoomLayout/pull/193
[189]: https://github.com/natario1/ZoomLayout/pull/189
[214]: https://github.com/natario1/ZoomLayout/pull/214
33 changes: 22 additions & 11 deletions docs/_about/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,32 @@ order: 1
The library works on API 16+ (except for ZoomSurfaceView), which is the only requirement and
should be met by most projects nowadays.

It is publicly hosted on [JCenter](https://bintray.com/natario/android/ZoomLayout), where you
can download the AAR package. To fetch with Gradle, make sure you add the JCenter repository in your root projects `build.gradle` file:

```groovy
allprojects {
repositories {
jcenter()
}
It is publicly hosted on [Maven Central](https://repo.maven.apache.org/maven2/com/otaliastudios), where you
can download the AAR package. To fetch with Gradle, make sure you add the Maven Central repository:

```kotlin
repositories {
mavenCentral()
}
```

Then simply download the latest version:

```groovy
implementation 'com.otaliastudios:zoomlayout:{{ site.github_version }}'
```kotlin
implementation("com.otaliastudios:zoomlayout:{{ site.github_version }}")
```

No other configuration steps are needed. If you want to try features that were not released yet,
you can pull the latest snapshot by adding the Sonatype snapshot repository:

```kotlin
repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
```

No other configuration steps are needed.
And depending on the latest-SNAPSHOT version:

```kotlin
api("com.otaliastudios:zoomlayout:latest-SNAPSHOT")
```
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ google_analytics_id: 'UA-155077779-4'
google_site_verification: '4x49i17ABIrSvUl52SeL0-t0341aTnWWaC62-FYCRT4'
github: [metadata] # TODO What's this?
github_repo: ZoomLayout
github_version: 1.8.0
github_version: 1.9.0
github_branch: master
baseurl: '/ZoomLayout' # Keep as an empty string if served up at the root
collections:
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-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
Loading

0 comments on commit 4725680

Please sign in to comment.