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

Migrate to android x #111

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ You can take a look at [sample project][sample] for more information.

Download via **Gradle**:
```gradle
compile 'com.github.stfalcon:frescoimageviewer:0.5.0'
compile 'com.github.stfalcon:frescoimageviewer:0.6.0'
```

or **Maven**:
```xml
<dependency>
<groupId>com.github.stfalcon</groupId>
<artifactId>frescoimageviewer</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
<type>pom</type>
</dependency>
```
Expand Down
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.novoda:bintray-release:0.3.4'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.novoda:bintray-release:0.8.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -16,6 +20,10 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
}

Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 0.6.0 (2022/09/19)
* replaced android support libraries by AndroidX
* updated android sdk target version to 31

## Version 0.5.0 (2017/03/14)

* formatter for custom objects collections;
Expand Down
31 changes: 10 additions & 21 deletions frescoimageviewer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 31

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "0.5.0"
minSdkVersion 15
targetSdkVersion 31
versionCode 2
versionName "0.6.0"
}
buildTypes {
release {
Expand All @@ -25,19 +23,10 @@ android {

}

publish {
groupId = 'com.github.stfalcon'
artifactId = 'frescoimageviewer'
publishVersion = '0.5.0'
desc = 'Customizable full screen image viewer based on Fresco library, that includes "pinch to zoom" and "swipe to dismiss" gestures'
licences = ['Apache-2.0']
uploadName = 'FrescoImageViewer'
website = 'https://github.com/stfalcon-studio/FrescoImageViewer.git'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'me.relex:photodraweeview:1.1.0'
provided 'com.facebook.fresco:fresco:0.12.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'me.relex:photodraweeview:2.0.0'
implementation 'com.facebook.fresco:fresco:2.6.0'
implementation 'android.support.v4'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.stfalcon.frescoimageviewer;

import com.facebook.drawee.backends.pipeline.Fresco;
import android.content.Context;

public class FrescoWrapper {
public static void Initialize(Context context)
{
Fresco.initialize(context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import android.content.DialogInterface;
import android.graphics.Color;
import android.net.Uri;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.annotation.StyleRes;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.StyleRes;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AlertDialog;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package com.stfalcon.frescoimageviewer;

import android.content.Context;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v4.view.ViewPager;
import androidx.core.view.GestureDetectorCompat;
import androidx.viewpager.widget.ViewPager;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package com.stfalcon.frescoimageviewer;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
Expand Down Expand Up @@ -105,6 +105,8 @@ public float getMaximumScale() {
return attacher.getMaximumScale();
}

public void setOrientation(int orientation) { }

@Override
public void setMinimumScale(float minimumScale) {
attacher.setMinimumScale(minimumScale);
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 11 09:58:14 EEST 2017
#Fri Sep 16 13:12:09 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
29 changes: 14 additions & 15 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 31

defaultConfig {
applicationId "com.stfalcon.frescoimageviewersample"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
targetSdkVersion 31
versionCode 2
versionName "2.0"

renderscriptTargetApi 25
renderscriptSupportModeEnabled true
Expand All @@ -33,17 +32,17 @@ ext {
}

dependencies {
compile project(':frescoimageviewer')
compile "com.android.support:design:$supportVersion"
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:support-v4:$supportVersion"
compile "com.android.support:cardview-v7:$supportVersion"
implementation project(':frescoimageviewer')
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'

compile "com.facebook.fresco:fresco:$frescoVersion"
implementation "com.facebook.fresco:fresco:$frescoVersion"

compile 'com.github.mmin18:realtimeblurview:1.1.0'
compile 'me.relex:circleindicator:1.2.2@aar'
implementation 'com.github.mmin18:realtimeblurview:1.1.0'
implementation 'me.relex:circleindicator:1.2.2@aar'

compile 'jp.wasabeef:fresco-processors:2.0.0'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
implementation 'jp.wasabeef:fresco-processors:2.0.0'
implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
}
1 change: 1 addition & 0 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<activity
android:name=".features.main.MainActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/AppThemeNoActionBar">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stfalcon.frescoimageviewersample.features.demo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;

import com.facebook.drawee.view.SimpleDraweeView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import androidx.viewpager.widget.ViewPager;

import com.stfalcon.frescoimageviewersample.R;
import com.stfalcon.frescoimageviewersample.features.demo.DemoActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.stfalcon.frescoimageviewersample.features.main;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.stfalcon.frescoimageviewersample.R;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.content.Context;
import android.os.Handler;
import android.support.annotation.StringRes;
import android.support.design.widget.BaseTransientBottomBar;
import android.support.design.widget.Snackbar;
import androidx.annotation.StringRes;
import com.google.android.material.snackbar.BaseTransientBottomBar;
import com.google.android.material.snackbar.Snackbar;

import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -59,7 +60,7 @@ public void onClick(View view) {
}

private static Snackbar multilineSnackbar(Snackbar snackbar) {
TextView textView = (TextView) snackbar.getView().findViewById(android.support.design.R.id.snackbar_text);
TextView textView = snackbar.getView().findViewById(com.google.android.material.R.id.snackbar_text);
textView.setMaxLines(5);
return snackbar;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import androidx.appcompat.app.AlertDialog;

import com.stfalcon.frescoimageviewersample.R;

Expand Down
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_demo.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/coordinator"
android:layout_width="match_parent"
Expand All @@ -9,4 +9,4 @@
android:id="@+id/postersContainer"
layout="@layout/content_posters_grid"/>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
8 changes: 4 additions & 4 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand All @@ -7,7 +7,7 @@
android:fitsSystemWindows="true">

<!--stub-->
<android.support.v4.widget.Space
<androidx.legacy.widget.Space
android:layout_width="0dp"
android:layout_height="0dp"
android:fitsSystemWindows="true"
Expand Down Expand Up @@ -47,7 +47,7 @@
android:layout_height="0dp"
android:layout_weight="3">

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -67,4 +67,4 @@

</LinearLayout>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/fragment_demo_card.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
Expand Down Expand Up @@ -43,4 +43,4 @@

</RelativeLayout>

</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>