Skip to content

Commit 076ce1f

Browse files
committed
1/27/2022
1 parent 2130862 commit 076ce1f

2 files changed

Lines changed: 18 additions & 21 deletions

File tree

photoslider/build.gradle

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'maven-publish'
33
apply plugin: 'signing'
44
android {
5-
compileSdkVersion 29
6-
buildToolsVersion "29.0.3"
5+
compileSdkVersion 31
76

87
defaultConfig {
98
minSdkVersion 17
@@ -26,20 +25,17 @@ android {
2625

2726
dependencies {
2827
implementation fileTree(include: ['*.jar'], dir: 'libs')
29-
implementation 'androidx.appcompat:appcompat:1.2.0'
30-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
31-
implementation 'com.google.android.material:material:1.2.0-alpha02'
28+
implementation 'androidx.appcompat:appcompat:1.4.0'
29+
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
30+
implementation 'com.google.android.material:material:1.4.0'
3231
implementation ('com.github.MikeOrtiz:TouchImageView:3.0.1'){transitive=true}
33-
implementation 'ir.smartdevelopers:smart_progress_image_view:1.7'
32+
implementation 'ir.smartdevelopers:smart_progress_image_view:1.8'
3433

3534
// glide
36-
implementation 'com.github.bumptech.glide:glide:4.11.0'
35+
implementation 'com.github.bumptech.glide:glide:4.12.0'
3736
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
3837
}
39-
task sourceCode(type:Jar){
40-
archiveClassifier.set('source')
41-
from android.sourceSets.main.java.srcDirs
42-
}
38+
4339
afterEvaluate {
4440
publishing {
4541
publications {
@@ -55,7 +51,7 @@ afterEvaluate {
5551
pom {
5652
name = 'smart-photo-slider'
5753
description = 'create photo slider with indicator'
58-
url = 'https://github.com/smartdevelopers-ir/smart-photo-slider'
54+
url = 'https://github.com/smartdevelopers-ir/SmartPhotoSlider'
5955

6056
licenses {
6157
license {
@@ -71,9 +67,9 @@ afterEvaluate {
7167
}
7268
}
7369
scm {
74-
connection = 'scm:git:git://github.com/smartdevelopers-ir/smart-photo-slider.git'
75-
developerConnection = 'scm:git:ssh://github.com/smartdevelopers-ir/smart-photo-slider.git'
76-
url = 'http://github.com/smartdevelopers-ir/smart-photo-slider'
70+
connection = 'scm:git:git://github.com/smartdevelopers-ir/SmartPhotoSlider.git'
71+
developerConnection = 'scm:git:ssh://github.com/smartdevelopers-ir/SmartPhotoSlider.git'
72+
url = 'http://github.com/smartdevelopers-ir/SmartPhotoSlider'
7773
}
7874
}
7975
}

photoslider/src/main/java/ir/smartdevelopers/photoslider/SmartPhotoSliderDownloadablePhotoAdapter.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.graphics.drawable.Drawable;
5+
import android.net.Uri;
56
import android.util.Log;
67
import android.view.LayoutInflater;
78
import android.view.View;
@@ -58,12 +59,12 @@ public Object instantiateItem(@NonNull ViewGroup container, int position) {
5859
Group downloadIconGroup=view.findViewById(R.id.item_downloadable_image_group);
5960
final SmartProgressImageView progressImageView=view.findViewById(R.id.item_downloadable_image_loadingView);
6061
progressImageView.setProgressNormalColor(progressColor);
61-
final File downloadedImage=getDownloadedImage(getContext(),position);
62+
final Uri downloadedImageUri=getDownloadedImage(getContext(),position);
6263

63-
if (downloadedImage!=null){
64+
if (downloadedImageUri!=null){
6465
downloadIconGroup.setVisibility(View.GONE);
6566

66-
Glide.with(touchImageView).load(downloadedImage.getPath())
67+
Glide.with(touchImageView).load(downloadedImageUri)
6768
.into(touchImageView);
6869

6970

@@ -149,13 +150,13 @@ public boolean onLongClick(View view) {
149150
return view;
150151
}
151152

152-
public final void downloadCompleted(int position,File downloadedImage){
153+
public final void downloadCompleted(int position,Uri downloadedImageUri){
153154
View view=parentPager.findViewWithTag(position);
154155
if (view!=null){
155156
TouchImageView touchImageView=view.findViewById(R.id.item_downloadable_image_imgImage);
156157
Group downloadIconGroup=view.findViewById(R.id.item_downloadable_image_group);
157158
downloadIconGroup.setVisibility(View.GONE);
158-
Glide.with(getContext()).load(downloadedImage).into(touchImageView);
159+
Glide.with(getContext()).load(downloadedImageUri).into(touchImageView);
159160
}
160161
}
161162
public final void downloadCompleted(int position){
@@ -181,7 +182,7 @@ protected void cancelDownload(Context context, int pos){
181182
mIsDownloading[pos]=false;
182183
}
183184
@Nullable
184-
protected abstract File getDownloadedImage(Context context, int position);
185+
protected abstract Uri getDownloadedImage(Context context, int position);
185186

186187
@Override
187188
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {

0 commit comments

Comments
 (0)