Skip to content

Commit

Permalink
NClientV2 1.6.7
Browse files Browse the repository at this point in the history
* Bug fixes
  • Loading branch information
Dar9586 committed Jan 17, 2019
1 parent 47758fe commit bfa1286
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.dar.nclientv2"
minSdkVersion 21
targetSdkVersion 28
versionCode 166
versionName "1.6.6"
versionCode 167
versionName "1.6.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}
Expand Down
20 changes: 12 additions & 8 deletions app/src/main/java/com/dar/nclientv2/ZoomActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.dar.nclientv2.components.CustomViewPager;
import com.dar.nclientv2.settings.Global;
import com.github.chrisbanes.photoview.PhotoView;
import com.squareup.picasso.Picasso;

import java.io.File;
import java.io.FileOutputStream;
Expand All @@ -41,6 +42,8 @@

public class ZoomActivity extends AppCompatActivity {
private GenericGallery gallery;
public int actualPage=0;
private static final Object preloadTag=new Object();
private final static int hideFlags=View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
Expand Down Expand Up @@ -88,14 +91,16 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse

@Override
public void onPageSelected(int position) {
actualPage=position;
pageManager.setText(getString(R.string.page_format,position+1,gallery.getPageCount()));
seekBar.setProgress(position);
if(!gallery.isLocal()){
/*if(!gallery.isLocal()){
Picasso.get().cancelTag(preloadTag);
Gallery gallery=(Gallery)ZoomActivity.this.gallery;
if(position<gallery.getPageCount()-1)Global.preloadImage(gallery.getPage(position+1));
if(position>0)Global.preloadImage(gallery.getPage(position-1));
if(position>0)Picasso.get().load(gallery.getPage(position-1)).tag(preloadTag).priority(Picasso.Priority.LOW).fetch();
if(position<gallery.getPageCount()-1)Picasso.get().load(gallery.getPage(position+1)).tag(preloadTag).priority(Picasso.Priority.LOW).fetch();
}
}*/
}

@Override
Expand Down Expand Up @@ -267,11 +272,10 @@ public void onAnimationEnd(Animator animation) {
int page=getArguments().getInt("PAGE",0);
File file=x.directory==null?null:new File(x.directory,("000"+(page+1)+".jpg").substring(Integer.toString(page+1).length()));
if(file==null||!file.exists()){
if(x.gallery.isLocal())Global.loadImage(R.mipmap.ic_launcher,photoView);
else Global.loadImage(((Gallery)x.gallery).getPage(page),photoView,true);

if(x.gallery.isLocal())Picasso.get().load(R.mipmap.ic_launcher).into(photoView);
else Picasso.get().load(((Gallery)x.gallery).getPage(page)).into(photoView);
}
else Global.loadImage(file,photoView);
else Picasso.get().load(file).into(photoView);
return rootView;
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.0'


// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit bfa1286

Please sign in to comment.