Skip to content

Commit 4725680

Browse files
authored
Release 1.9.0 (#215)
* Refresh, configure publishing * Configure CI for deploy and snapshots * Adjust repository in docs * Write changelog * Fix dokka task
1 parent 254280b commit 4725680

File tree

14 files changed

+188
-115
lines changed

14 files changed

+188
-115
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
22
# Renaming ? Change the README badge.
3-
name: Build
3+
name: 'Build'
44
on:
55
push:
66
branches:
7-
- master
7+
- main
88
pull_request:
9+
910
jobs:
11+
1012
ANDROID_BASE_CHECKS:
11-
name: Base Checks
13+
name: 'Base Checks'
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v2
15-
- uses: actions/setup-java@v1
17+
- uses: actions/setup-java@v2
1618
with:
17-
java-version: 1.8
18-
- name: Perform base checks
19-
run: ./gradlew app:assembleDebug library:dokka
19+
java-version: 11
20+
distribution: temurin
21+
cache: gradle
22+
- name: 'Perform base checks'
23+
run: ./gradlew app:assembleDebug library:dokkaJavadoc
24+
2025
ANDROID_UNIT_TESTS:
21-
name: Unit Tests
26+
name: 'Unit Tests'
2227
runs-on: ubuntu-latest
2328
steps:
2429
- uses: actions/checkout@v2
25-
- uses: actions/setup-java@v1
30+
- uses: actions/setup-java@v2
2631
with:
27-
java-version: 1.8
28-
- name: Execute unit tests
32+
java-version: 11
33+
distribution: temurin
34+
- name: 'Execute unit tests'
2935
run: ./gradlew library:testDebugUnitTest

.github/workflows/deploy.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
2-
name: Deploy
2+
name: 'Deploy'
33
on:
44
release:
55
types: [published]
6+
67
jobs:
7-
BINTRAY_UPLOAD:
8-
name: Bintray Upload
8+
9+
SONATYPE_DEPLOY:
10+
name: 'Deploy to Sonatype'
911
runs-on: ubuntu-latest
1012
env:
11-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
12-
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
13-
BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }}
13+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
14+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
15+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
16+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
1417
steps:
1518
- uses: actions/checkout@v2
16-
- uses: actions/setup-java@v1
19+
- uses: actions/setup-java@v2
1720
with:
18-
java-version: 1.8
19-
- name: Perform bintray upload
20-
run: ./gradlew bintrayUpload
21+
java-version: 11
22+
distribution: temurin
23+
cache: gradle
24+
- name: 'Publish library'
25+
run: ./gradlew library:publishToSonatype

.github/workflows/snapshot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Snapshot'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
9+
SNAPSHOT:
10+
name: 'Publish Snapshot'
11+
runs-on: ubuntu-latest
12+
env:
13+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
14+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
15+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
16+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-java@v2
20+
with:
21+
java-version: 11
22+
distribution: temurin
23+
cache: gradle
24+
- name: 'Publish library snapshot'
25+
run: ./gradlew library:publishToSonatypeSnapshot

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
A collection of flexible Android components that support zooming and panning of View hierarchies,
1818
images, video streams, and much more - either programmatically or through touch events.
1919

20-
```groovy
21-
implementation 'com.otaliastudios:zoomlayout:1.8.0'
20+
```kotlin
21+
implementation("com.otaliastudios:zoomlayout:1.9.0")
2222
```
2323

2424
- `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)

app/build.gradle.kts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ plugins {
33
}
44

55
android {
6-
setCompileSdkVersion(rootProject.extra["compileSdkVersion"] as Int)
6+
compileSdk = 31
77

88
defaultConfig {
99
applicationId = "com.otaliastudios.zoom.demo"
10-
setMinSdkVersion(rootProject.extra["minSdkVersion"] as Int)
11-
setTargetSdkVersion(rootProject.extra["targetSdkVersion"] as Int)
10+
minSdk = 21
11+
targetSdk = 31
1212
versionCode = 1
1313
versionName = "1.0"
1414
setProperty("archivesBaseName", "ZoomLayout_v${versionName}_($versionCode)")
@@ -21,9 +21,9 @@ android {
2121
}
2222

2323
dependencies {
24-
implementation("androidx.appcompat:appcompat:1.1.0")
25-
implementation("com.google.android.exoplayer:exoplayer-core:2.9.3")
26-
implementation("com.google.android.exoplayer:exoplayer-ui:2.9.3")
27-
implementation("com.otaliastudios.opengl:egloo:0.4.0")
24+
implementation("androidx.appcompat:appcompat:1.4.0")
25+
implementation("com.google.android.exoplayer:exoplayer-core:2.16.1")
26+
implementation("com.google.android.exoplayer:exoplayer-ui:2.16.1")
27+
implementation("com.otaliastudios.opengl:egloo:0.6.1")
2828
implementation(project(":library"))
2929
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
android:label="@string/app_name"
1515
android:supportsRtl="true"
1616
android:theme="@style/AppTheme">
17-
<activity android:name=".MainActivity">
17+
<activity
18+
android:name=".MainActivity"
19+
android:exported="true">
1820
<intent-filter>
1921
<action android:name="android.intent.action.MAIN"/>
2022
<category android:name="android.intent.category.LAUNCHER"/>

app/src/main/java/com/otaliastudios/zoom/demo/MainActivity.java

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,27 @@
88
import android.widget.Button;
99
import android.widget.Toast;
1010

11+
import androidx.annotation.NonNull;
1112
import androidx.appcompat.app.AppCompatActivity;
1213
import androidx.core.content.ContextCompat;
1314

14-
import com.google.android.exoplayer2.ExoPlayerFactory;
15-
import com.google.android.exoplayer2.SimpleExoPlayer;
16-
import com.google.android.exoplayer2.source.ExtractorMediaSource;
15+
import com.google.android.exoplayer2.ExoPlayer;
16+
import com.google.android.exoplayer2.MediaItem;
17+
import com.google.android.exoplayer2.Player;
1718
import com.google.android.exoplayer2.source.MediaSource;
19+
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
1820
import com.google.android.exoplayer2.ui.PlayerControlView;
1921
import com.google.android.exoplayer2.upstream.DataSource;
20-
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
21-
import com.google.android.exoplayer2.util.Util;
22-
import com.google.android.exoplayer2.video.VideoListener;
22+
import com.google.android.exoplayer2.upstream.DefaultDataSource;
23+
import com.google.android.exoplayer2.video.VideoSize;
2324
import com.otaliastudios.zoom.ZoomImageView;
2425
import com.otaliastudios.zoom.ZoomLayout;
2526
import com.otaliastudios.zoom.ZoomLogger;
2627
import com.otaliastudios.zoom.ZoomSurfaceView;
2728

28-
import org.jetbrains.annotations.NotNull;
29-
30-
3129
public class MainActivity extends AppCompatActivity {
3230

33-
private SimpleExoPlayer player;
31+
private ExoPlayer player;
3432

3533
@Override
3634
protected void onCreate(Bundle savedInstanceState) {
@@ -111,34 +109,34 @@ protected void onStart() {
111109

112110
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
113111
private void setUpVideoPlayer() {
114-
player = ExoPlayerFactory.newSimpleInstance(this);
112+
player = new ExoPlayer.Builder(this).build();
115113
PlayerControlView controls = findViewById(R.id.player_control_view);
116114
final ZoomSurfaceView surface = findViewById(R.id.surface_view);
117-
player.addVideoListener(new VideoListener() {
115+
player.addListener(new Player.Listener() {
118116
@Override
119-
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
120-
surface.setContentSize(width, height);
117+
public void onVideoSizeChanged(@NonNull VideoSize videoSize) {
118+
surface.setContentSize(videoSize.width, videoSize.height);
121119
}
122120
});
123121
surface.setBackgroundColor(ContextCompat.getColor(this, R.color.background));
124122
surface.addCallback(new ZoomSurfaceView.Callback() {
125123
@Override
126-
public void onZoomSurfaceCreated(@NotNull ZoomSurfaceView view) {
124+
public void onZoomSurfaceCreated(@NonNull ZoomSurfaceView view) {
127125
player.setVideoSurface(view.getSurface());
128126
}
129127

130128
@Override
131-
public void onZoomSurfaceDestroyed(@NotNull ZoomSurfaceView view) { }
129+
public void onZoomSurfaceDestroyed(@NonNull ZoomSurfaceView view) { }
132130
});
133131
controls.setPlayer(player);
134132
controls.setShowTimeoutMs(0);
135133
controls.show();
136-
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
137-
Util.getUserAgent(this, "ZoomLayoutLib"));
134+
DataSource.Factory dataSourceFactory = new DefaultDataSource.Factory(this);
138135
Uri videoUri = Uri.parse("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4");
139-
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
140-
.createMediaSource(videoUri);
141-
player.prepare(videoSource);
136+
MediaSource videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
137+
.createMediaSource(MediaItem.fromUri(videoUri));
138+
player.setMediaSource(videoSource);
139+
player.prepare();
142140
}
143141

144142
@Override

build.gradle.kts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,9 @@
11
buildscript {
2-
3-
extra["minSdkVersion"] = 16
4-
extra["compileSdkVersion"] = 29
5-
extra["targetSdkVersion"] = 29
6-
extra["kotlinVersion"] = "1.3.72"
7-
82
repositories {
93
mavenCentral()
104
google()
11-
jcenter()
125
}
13-
146
dependencies {
15-
val kotlinVersion = property("kotlinVersion") as String
16-
classpath("com.android.tools.build:gradle:4.0.0")
17-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
18-
classpath("com.otaliastudios.tools:publisher:0.1.5")
7+
classpath("io.deepmedia.tools:publisher:0.6.0")
198
}
209
}
21-
22-
allprojects {
23-
repositories {
24-
mavenCentral()
25-
google()
26-
jcenter()
27-
}
28-
}
29-
30-
tasks.register("clean", Delete::class) {
31-
delete(buildDir)
32-
}

docs/_about/changelog.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ New versions are released through GitHub, so the reference page is the [GitHub R
99
Starting from 1.7.0, you can now [support development](https://github.com/natario1/ZoomLayout/issues/125) through the GitHub Sponsors program.
1010
Companies can share a tiny part of their revenue and get private support hours in return. Thanks!
1111

12-
#### v1.8.0
12+
## v1.9.0
13+
14+
The library is now hosted on the Maven Central repository.
15+
16+
- Enhancement: open ZoomEngine constructor, thanks to [@coffeemakr][coffeemakr] ([#193][193])
17+
- Fix: improved moveTo animation ([#189][189])
18+
- Fix: fix verbose logging, thanks to [@r4zzz4k][r4zzz4k] ([#214][214])
19+
20+
<https://github.com/natario1/ZoomLayout/compare/v1.8.0...v1.9.0>
21+
22+
## v1.8.0
1323

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

8697
[38]: https://github.com/natario1/ZoomLayout/pull/38
8798
[70]: https://github.com/natario1/ZoomLayout/pull/70
@@ -107,3 +118,6 @@ Companies can share a tiny part of their revenue and get private support hours i
107118
[159]: https://github.com/natario1/ZoomLayout/pull/159
108119
[158]: https://github.com/natario1/ZoomLayout/pull/158
109120
[156]: https://github.com/natario1/ZoomLayout/pull/156
121+
[193]: https://github.com/natario1/ZoomLayout/pull/193
122+
[189]: https://github.com/natario1/ZoomLayout/pull/189
123+
[214]: https://github.com/natario1/ZoomLayout/pull/214

docs/_about/install.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,32 @@ order: 1
88
The library works on API 16+ (except for ZoomSurfaceView), which is the only requirement and
99
should be met by most projects nowadays.
1010

11-
It is publicly hosted on [JCenter](https://bintray.com/natario/android/ZoomLayout), where you
12-
can download the AAR package. To fetch with Gradle, make sure you add the JCenter repository in your root projects `build.gradle` file:
13-
14-
```groovy
15-
allprojects {
16-
repositories {
17-
jcenter()
18-
}
11+
It is publicly hosted on [Maven Central](https://repo.maven.apache.org/maven2/com/otaliastudios), where you
12+
can download the AAR package. To fetch with Gradle, make sure you add the Maven Central repository:
13+
14+
```kotlin
15+
repositories {
16+
mavenCentral()
1917
}
2018
```
2119

2220
Then simply download the latest version:
2321

24-
```groovy
25-
implementation 'com.otaliastudios:zoomlayout:{{ site.github_version }}'
22+
```kotlin
23+
implementation("com.otaliastudios:zoomlayout:{{ site.github_version }}")
24+
```
25+
26+
No other configuration steps are needed. If you want to try features that were not released yet,
27+
you can pull the latest snapshot by adding the Sonatype snapshot repository:
28+
29+
```kotlin
30+
repositories {
31+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
32+
}
2633
```
2734

28-
No other configuration steps are needed.
35+
And depending on the latest-SNAPSHOT version:
36+
37+
```kotlin
38+
api("com.otaliastudios:zoomlayout:latest-SNAPSHOT")
39+
```

0 commit comments

Comments
 (0)