diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index fba22a4..621a316 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -10,6 +10,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 8178c2e..7215606 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -5,6 +5,7 @@
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 4008dd6..282c4ab 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "com.android.fresco.demo"
minSdkVersion 17
- targetSdkVersion 24
+ targetSdkVersion 22
versionCode 1
versionName "1.0"
}
@@ -26,6 +26,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':fresco-helper')
+ compile project(':fresco-photoview')
// compile 'com.facebook.fresco.helper:fresco-helper:1.0.2'
compile 'com.android.support:appcompat-v7:24.2.1'
diff --git a/app/src/main/java/com/android/fresco/demo/OnItemClickListener.java b/app/src/main/java/com/android/fresco/demo/OnItemClickListener.java
index 56529e0..292794e 100644
--- a/app/src/main/java/com/android/fresco/demo/OnItemClickListener.java
+++ b/app/src/main/java/com/android/fresco/demo/OnItemClickListener.java
@@ -1,5 +1,7 @@
package com.android.fresco.demo;
+import android.view.View;
+
import java.util.ArrayList;
/**
@@ -8,6 +10,6 @@
public interface OnItemClickListener {
- void onItemClick(ArrayList photos, int position);
+ void onItemClick(View view, ArrayListphotos, int position);
}
diff --git a/app/src/main/java/com/android/fresco/demo/PhotoAlbumActivity.java b/app/src/main/java/com/android/fresco/demo/PhotoAlbumActivity.java
index be4dd50..2f0ad59 100644
--- a/app/src/main/java/com/android/fresco/demo/PhotoAlbumActivity.java
+++ b/app/src/main/java/com/android/fresco/demo/PhotoAlbumActivity.java
@@ -11,9 +11,10 @@
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
+import android.view.View;
-import com.facebook.fresco.helper.photo.PictureBrowse;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.PictureBrowse;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
import java.io.File;
import java.util.ArrayList;
@@ -48,16 +49,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mPhotoWallAdapter = new PhotoWallAdapter(mImageList, new OnItemClickListener() {
@Override
- public void onItemClick(ArrayList photos, int position) {
+ public void onItemClick(View view, ArrayList photos, int position) {
// MLog.i("position = " + position);
// MLog.i("photos.get(position).thumbnailUrl = " + photos.get(position).thumbnailUrl);
PictureBrowse.newBuilder(PhotoAlbumActivity.this)
- .setLayoutManager(mLayoutManager)
- .setCurrentPosition(position)
.setPhotoList(photos)
- .enabledAnimation(false) // 关闭动画效果
- .build()
+ .setCurrentPosition(position)
.start();
}
});
diff --git a/app/src/main/java/com/android/fresco/demo/PhotoWallActivity.java b/app/src/main/java/com/android/fresco/demo/PhotoWallActivity.java
index 1a592b0..5774f36 100644
--- a/app/src/main/java/com/android/fresco/demo/PhotoWallActivity.java
+++ b/app/src/main/java/com/android/fresco/demo/PhotoWallActivity.java
@@ -5,9 +5,10 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
+import android.view.View;
-import com.facebook.fresco.helper.photo.PictureBrowse;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.PictureBrowse;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
import java.util.ArrayList;
@@ -91,17 +92,42 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mPhotoWallAdapter = new PhotoWallAdapter(data, new OnItemClickListener() {
@Override
- public void onItemClick(ArrayList photos, int position) {
+ public void onItemClick(View view, ArrayList photos, int position) {
// MLog.i("position = " + position);
// MLog.i("photos.get(position).thumbnailUrl = " + photos.get(position).thumbnailUrl);
PictureBrowse.newBuilder(PhotoWallActivity.this)
.setLayoutManager(mLayoutManager)
- .setCurrentPosition(position)
.setPhotoList(photos)
+ .setCurrentPosition(position)
.enabledAnimation(true)
- .build()
.start();
+
+// PictureBrowse.newBuilder(PhotoWallActivity.this)
+// .setPhotoList(photos)
+// .setCurrentPosition(position)
+// .start();
+
+// String thumbnailUrl = photos.get(position).thumbnailUrl;
+// PictureBrowse.newBuilder(PhotoWallActivity.this)
+// .setThumbnailView(view)
+// .setOriginalUrl(thumbnailUrl)
+// .enabledAnimation(true)
+// .start();
+
+// PictureBrowse.newBuilder(PhotoWallActivity.this)
+// .setThumbnailView(view)
+// .setPhotoInfo(photos.get(position))
+// .enabledAnimation(true)
+// .start();
+
+// String thumbnailUrl = photos.get(position).thumbnailUrl;
+// PictureBrowse.newBuilder(PhotoWallActivity.this)
+// .setThumbnailView(view)
+// .setOriginalUrl(thumbnailUrl)
+// .start();
+
+
}
});
mRecyclerView.setAdapter(mPhotoWallAdapter);
diff --git a/app/src/main/java/com/android/fresco/demo/PhotoWallAdapter.java b/app/src/main/java/com/android/fresco/demo/PhotoWallAdapter.java
index 1133d30..5b0adf7 100644
--- a/app/src/main/java/com/android/fresco/demo/PhotoWallAdapter.java
+++ b/app/src/main/java/com/android/fresco/demo/PhotoWallAdapter.java
@@ -10,7 +10,7 @@
import com.facebook.drawee.view.SimpleDraweeView;
import com.facebook.fresco.helper.ImageLoader;
import com.facebook.fresco.helper.Phoenix;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
import com.facebook.fresco.helper.utils.DensityUtil;
import java.util.ArrayList;
@@ -41,7 +41,7 @@ public RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent, int vi
@Override
public void onClick(View v) {
if(mOnItemClickListener != null) {
- mOnItemClickListener.onItemClick(mPhotos, photoViewHolder.getAdapterPosition());
+ mOnItemClickListener.onItemClick(v, mPhotos, photoViewHolder.getAdapterPosition());
}
}
});
diff --git a/fresco-helper/build.gradle b/fresco-helper/build.gradle
index 2950fe6..23ee6ea 100644
--- a/fresco-helper/build.gradle
+++ b/fresco-helper/build.gradle
@@ -8,7 +8,7 @@ android {
defaultConfig {
minSdkVersion 17
- targetSdkVersion 24
+ targetSdkVersion 22
versionCode 2
versionName "1.0.1"
}
@@ -29,9 +29,6 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:24.2.1'
- compile 'com.android.support:support-v4:24.2.1'
- compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.facebook.fresco:fresco:0.14.1'
compile 'com.facebook.fresco:animated-base-support:0.14.1'
@@ -39,13 +36,13 @@ dependencies {
compile 'com.facebook.fresco:webpsupport:0.14.1'
compile 'com.facebook.fresco:animated-webp:0.14.1'
compile 'com.facebook.fresco:imagepipeline-okhttp3:0.14.1'
- compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
+// compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
}
// Maven Group ID
group = "com.facebook.fresco.helper"
// library的版本号,后面每次更新都需要更改这个值
-version = "1.0.3"
+version = "1.0.4"
// 生成jar包的task
task sourcesJar(type: Jar) {
@@ -82,7 +79,7 @@ install {
packaging 'aar'
groupId 'com.facebook.fresco.helper'
artifactId 'fresco-helper'
- version '1.0.3'
+ version '1.0.4'
licenses {
license {
diff --git a/fresco-helper/src/main/AndroidManifest.xml b/fresco-helper/src/main/AndroidManifest.xml
index 074bc00..21e9107 100644
--- a/fresco-helper/src/main/AndroidManifest.xml
+++ b/fresco-helper/src/main/AndroidManifest.xml
@@ -1,18 +1 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/config/ImageLoaderConfig.java b/fresco-helper/src/main/java/com/facebook/fresco/helper/config/ImageLoaderConfig.java
index a5cab64..21df7c4 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/config/ImageLoaderConfig.java
+++ b/fresco-helper/src/main/java/com/facebook/fresco/helper/config/ImageLoaderConfig.java
@@ -26,7 +26,6 @@
import java.util.Set;
import okhttp3.OkHttpClient;
-import okhttp3.logging.HttpLoggingInterceptor;
/**
*
@@ -93,10 +92,10 @@ public void trim(MemoryTrimType trimType) {
}
});
- HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
- loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
+// HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
+// loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient okHttpClient = new OkHttpClient.Builder()
- .addInterceptor(loggingInterceptor)
+// .addInterceptor(loggingInterceptor)
// .retryOnConnectionFailure(false)
.build();
diff --git a/fresco-helper/src/main/res/values/strings.xml b/fresco-helper/src/main/res/values/strings.xml
deleted file mode 100644
index 9784f70..0000000
--- a/fresco-helper/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Fresco-Helper
-
diff --git a/fresco-photoview/.gitignore b/fresco-photoview/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/fresco-photoview/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/fresco-photoview/build.gradle b/fresco-photoview/build.gradle
new file mode 100644
index 0000000..07fd753
--- /dev/null
+++ b/fresco-photoview/build.gradle
@@ -0,0 +1,126 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.github.dcendents.android-maven'
+apply plugin: 'com.jfrog.bintray'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "25.0.0"
+
+ defaultConfig {
+ minSdkVersion 17
+ targetSdkVersion 24
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile 'com.android.support:support-v4:24.2.1'
+ compile 'com.android.support:recyclerview-v7:24.2.1'
+
+ compile 'com.facebook.fresco:fresco:0.14.1'
+ compile 'com.facebook.fresco:animated-base-support:0.14.1'
+ compile 'com.facebook.fresco:animated-gif:0.14.1'
+ compile 'com.facebook.fresco:webpsupport:0.14.1'
+ compile 'com.facebook.fresco:animated-webp:0.14.1'
+ compile 'com.facebook.fresco:imagepipeline-okhttp3:0.14.1'
+// compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
+
+}
+
+// Maven Group ID
+group = "com.facebook.fresco.helper"
+// library的版本号,后面每次更新都需要更改这个值
+version = "1.0.4"
+
+// 生成jar包的task
+task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+}
+
+// 生成jarDoc的task
+task javadoc(type: Javadoc) {
+ source = android.sourceSets.main.java.srcDirs
+ classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
+ failOnError false // 忽略注释语法错误,如果用jdk1.8你的注释写的不规范就编译不过。
+}
+
+// 生成javaDoc的jar
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives javadocJar
+ archives sourcesJar
+}
+
+install {
+ repositories.mavenInstaller {
+ pom.project {
+ name 'fresco-helper'
+ description 'Android上图片加载库Fresco的使用帮助类'
+ url 'https://github.com/hpdx/fresco-helper'
+ inceptionYear '2016'
+
+ packaging 'aar'
+ groupId 'com.facebook.fresco.helper'
+ artifactId 'photoview'
+ version '1.0.4'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ connection 'https://github.com/hpdx/fresco-helper.git' // Git仓库地址。
+ developerConnection 'https://github.com/hpdx/fresco-helper.git' // Git仓库地址。
+ url 'https://github.com/hpdx/fresco-helper' // 项目主页。
+ }
+
+ developers {
+ developer {
+ id 'android_ls'
+ name 'android_ls'
+ email 'android_ls@163.com'
+ }
+ }
+ }
+ }
+}
+
+Properties properties = new Properties()
+// 读取properties的配置信息
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+
+bintray {
+ user = properties.getProperty("bintray.user")
+ key = properties.getProperty("bintray.apikey")
+ configurations = ['archives']
+ pkg {
+ repo = 'maven'
+ name = 'fresco-helper'
+ userOrg = user
+ licenses = ['Apache-2.0']
+ websiteUrl = 'https://github.com/hpdx/fresco-helper'
+ vcsUrl = 'https://github.com/hpdx/fresco-helper.git'
+ publish = true
+ }
+}
+
+
+
diff --git a/fresco-photoview/proguard-rules.pro b/fresco-photoview/proguard-rules.pro
new file mode 100644
index 0000000..65c4c99
--- /dev/null
+++ b/fresco-photoview/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Users/android_ls/Documents/Tool/adt-bundle-mac-x86_64-20130917/sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/fresco-photoview/src/main/AndroidManifest.xml b/fresco-photoview/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..336028e
--- /dev/null
+++ b/fresco-photoview/src/main/AndroidManifest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MLog.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MLog.java
new file mode 100755
index 0000000..d1d76a4
--- /dev/null
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MLog.java
@@ -0,0 +1,226 @@
+package com.facebook.fresco.helper.photoview;
+
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+import android.util.Log;
+
+/**
+ * 打印LOG,用于调试,可直接定位到行数
+ *
+ * Created by android_ls on 16/9/20.
+ */
+public class MLog {
+
+ public static final String NULL_TIPS = "Log with null object";
+
+ public static final int V = 0x1;
+ public static final int D = 0x2;
+ public static final int I = 0x3;
+ public static final int W = 0x4;
+ public static final int E = 0x5;
+
+ private static final String DEFAULT_MESSAGE = "execute";
+ private static final String PARAM = "Param";
+ private static final String NULL = "null";
+ private static final String TAG_DEFAULT = "MLog";
+ private static final String SUFFIX = ".java";
+
+ private static final int STACK_TRACE_INDEX = 5;
+
+ private static String mGlobalTag;
+ private static boolean IS_SHOW_LOG = true;
+
+ public static void init(boolean isShowLog, @Nullable String tag) {
+ IS_SHOW_LOG = isShowLog;
+ mGlobalTag = tag;
+ }
+
+ public static void v() {
+ printLog(V, null, DEFAULT_MESSAGE);
+ }
+
+ public static void v(Object msg) {
+ printLog(V, null, msg);
+ }
+
+ public static void v(String tag, Object... objects) {
+ printLog(V, tag, objects);
+ }
+
+ public static void d() {
+ printLog(D, null, DEFAULT_MESSAGE);
+ }
+
+ public static void d(Object msg) {
+ printLog(D, null, msg);
+ }
+
+ public static void d(String tag, Object... objects) {
+ printLog(D, tag, objects);
+ }
+
+ public static void i() {
+ printLog(I, null, DEFAULT_MESSAGE);
+ }
+
+ public static void i(Object msg) {
+ printLog(I, null, msg);
+ }
+
+ public static void i(String tag, Object... objects) {
+ printLog(I, tag, objects);
+ }
+
+ public static void w() {
+ printLog(W, null, DEFAULT_MESSAGE);
+ }
+
+ public static void w(Object msg) {
+ printLog(W, null, msg);
+ }
+
+ public static void w(String tag, Object... objects) {
+ printLog(W, tag, objects);
+ }
+
+ public static void e() {
+ printLog(E, null, DEFAULT_MESSAGE);
+ }
+
+ public static void e(Object msg) {
+ printLog(E, null, msg);
+ }
+
+ public static void e(String tag, Object... objects) {
+ printLog(E, tag, objects);
+ }
+
+ private static void printLog(int type, String tagStr, Object... objects) {
+ if (!IS_SHOW_LOG) {
+ return;
+ }
+
+ String[] contents = wrapperContent(tagStr, objects);
+ String tag = contents[0];
+ String msg = contents[1];
+ String headString = contents[2];
+
+ switch (type) {
+ case V:
+ case D:
+ case I:
+ case W:
+ case E:
+ printDefault(type, tag, headString + msg);
+ break;
+ }
+ }
+
+ private static String[] wrapperContent(String tagStr, Object... objects) {
+
+ StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+
+ StackTraceElement targetElement = stackTrace[STACK_TRACE_INDEX];
+ String className = targetElement.getClassName();
+ String[] classNameInfo = className.split("\\.");
+ if (classNameInfo.length > 0) {
+ className = classNameInfo[classNameInfo.length - 1] + SUFFIX;
+ }
+
+ if (className.contains("$")) {
+ className = className.split("\\$")[0] + SUFFIX;
+ }
+
+ String methodName = targetElement.getMethodName();
+ int lineNumber = targetElement.getLineNumber();
+
+ if (lineNumber < 0) {
+ lineNumber = 0;
+ }
+
+ String methodNameShort = methodName.substring(0, 1).toUpperCase() + methodName.substring(1);
+
+ /**
+ * 支持全局TAG和局部TAG混搭
+ *
+ * 示例:
+ * KLog.i("使用全局的TAG");
+ KLog.i("Test", "使用局部的TAG");
+ 执行结果:
+ I/BoloLog: [ (Method.java:0)#Invoke ] 使用全局的TAG
+ I/Test: [ (Method.java:0)#Invoke ] 使用局部的TAG
+ **/
+ String tag = tagStr;
+ if (TextUtils.isEmpty(tag)) {
+ if (!TextUtils.isEmpty(mGlobalTag)) {
+ tag = mGlobalTag;
+ } else {
+ tag = TAG_DEFAULT;
+ }
+ }
+
+ String msg = (objects == null) ? NULL_TIPS : getObjectsString(objects);
+ String headString = "[ (" + className + ":" + lineNumber + ")#" + methodNameShort + " ] ";
+
+ return new String[]{tag, msg, headString};
+ }
+
+ private static String getObjectsString(Object... objects) {
+
+ if (objects.length > 1) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("\n");
+ for (int i = 0; i < objects.length; i++) {
+ Object object = objects[i];
+ if (object == null) {
+ stringBuilder.append(PARAM).append("[").append(i).append("]").append(" = ").append(NULL).append("\n");
+ } else {
+ stringBuilder.append(PARAM).append("[").append(i).append("]").append(" = ").append(object.toString()).append("\n");
+ }
+ }
+ return stringBuilder.toString();
+ } else {
+ Object object = objects[0];
+ return object == null ? NULL : object.toString();
+ }
+ }
+
+ public static void printDefault(int type, String tag, String msg) {
+
+ int index = 0;
+ int maxLength = 4000;
+ int countOfSub = msg.length() / maxLength;
+
+ if (countOfSub > 0) {
+ for (int i = 0; i < countOfSub; i++) {
+ String sub = msg.substring(index, index + maxLength);
+ printSub(type, tag, sub);
+ index += maxLength;
+ }
+ printSub(type, tag, msg.substring(index, msg.length()));
+ } else {
+ printSub(type, tag, msg);
+ }
+ }
+
+ private static void printSub(int type, String tag, String sub) {
+ switch (type) {
+ case MLog.V:
+ Log.v(tag, sub);
+ break;
+ case MLog.D:
+ Log.d(tag, sub);
+ break;
+ case MLog.I:
+ Log.i(tag, sub);
+ break;
+ case MLog.W:
+ Log.w(tag, sub);
+ break;
+ case MLog.E:
+ Log.e(tag, sub);
+ break;
+ }
+ }
+
+}
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/view/MViewPager.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MViewPager.java
similarity index 94%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/view/MViewPager.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MViewPager.java
index fc575bb..9ef7602 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/view/MViewPager.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/MViewPager.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.view;
+package com.facebook.fresco.helper.photoview;
import android.content.Context;
import android.support.v4.view.ViewPager;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowse.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowse.java
similarity index 77%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowse.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowse.java
index 8d32b93..d60f0c6 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowse.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowse.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo;
+package com.facebook.fresco.helper.photoview;
import android.app.Activity;
import android.content.Context;
@@ -7,9 +7,8 @@
import android.support.v7.widget.GridLayoutManager;
import android.text.TextUtils;
import android.view.View;
-
-import com.facebook.fresco.helper.photo.anim.ViewOptionsCompat;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.anim.ViewOptionsCompat;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
import java.util.ArrayList;
@@ -33,7 +32,7 @@ public static class Builder {
private GridLayoutManager mLayoutManager;
private ArrayList mThumbnailList;
private View mThumbnailView;
- private String mThumbnail;
+ private String mOriginalUrl;
private Context mContext;
private Builder(Context context) {
@@ -66,8 +65,26 @@ public Builder setPhotoStringList(ArrayList data) {
return this;
}
- public Builder setThumbnail(String thumbnail) {
- mThumbnail = thumbnail;
+ public Builder setOriginalUrl(String originalUrl) {
+ mOriginalUrl = originalUrl;
+
+ ArrayList photos = new ArrayList<>();
+ PhotoInfo photoInfo = new PhotoInfo();
+ photoInfo.originalUrl = originalUrl;
+ photos.add(photoInfo);
+
+ mIntent.putParcelableArrayListExtra(PHOTO_LIST_KEY, photos);
+ mIntent.putExtra(PHOTO_ONLY_ONE_ANIMATION_KEY, true);
+ return this;
+ }
+
+ public Builder setPhotoInfo(PhotoInfo photoInfo) {
+ mOriginalUrl = photoInfo.originalUrl;
+
+ ArrayList photos = new ArrayList<>();
+ photos.add(photoInfo);
+
+ mIntent.putParcelableArrayListExtra(PHOTO_LIST_KEY, photos);
mIntent.putExtra(PHOTO_ONLY_ONE_ANIMATION_KEY, true);
return this;
}
@@ -86,6 +103,17 @@ public Builder setCurrentPosition(int position) {
public Builder enabledAnimation(boolean isAnimation) {
this.isAnimation = isAnimation;
mIntent.putExtra(PHOTO_IS_ANIMATION_KEY, isAnimation);
+
+ if (isAnimation) {
+ if (mLayoutManager != null && mThumbnailList != null && mThumbnailList.size() > 0) {
+ Bundle bundle = ViewOptionsCompat.makeScaleUpAnimation(mLayoutManager, mThumbnailList);
+ mIntent.putExtras(bundle);
+ } else if (mThumbnailView != null && mOriginalUrl != null) {
+ MLog.i("mOriginalUrl = " + mOriginalUrl);
+ Bundle bundle = ViewOptionsCompat.makeScaleUpAnimation(mThumbnailView, mOriginalUrl);
+ mIntent.putExtras(bundle);
+ }
+ }
return this;
}
@@ -99,19 +127,6 @@ public Builder setThumbnailView(View thumbnailView) {
return this;
}
- public Builder build() {
- if (isAnimation) {
- if (mLayoutManager != null && mThumbnailList != null && mThumbnailList.size() > 0) {
- Bundle bundle = ViewOptionsCompat.makeScaleUpAnimation(mLayoutManager, mThumbnailList);
- mIntent.putExtras(bundle);
- } else if (mThumbnailView != null && mThumbnail != null) {
- Bundle bundle = ViewOptionsCompat.makeScaleUpAnimation(mThumbnailView, mThumbnail);
- mIntent.putExtras(bundle);
- }
- }
- return this;
- }
-
public void start() {
mContext.startActivity(mIntent);
((Activity) mContext).overridePendingTransition(0, 0);
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseActivity.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseActivity.java
similarity index 71%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseActivity.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseActivity.java
index f6d6e86..052c776 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseActivity.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseActivity.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo;
+package com.facebook.fresco.helper.photoview;
import android.content.Intent;
import android.os.Bundle;
@@ -7,14 +7,12 @@
import android.view.View;
import android.widget.TextView;
-import com.facebook.fresco.helper.R;
-import com.facebook.fresco.helper.photo.anim.TransitionCompat;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
-import com.facebook.fresco.helper.photo.view.MViewPager;
-import com.facebook.fresco.helper.photodraweeview.OnPhotoTapListener;
-import com.facebook.fresco.helper.utils.MLog;
+import com.facebook.fresco.helper.photoview.anim.TransitionCompat;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.photodraweeview.OnPhotoTapListener;
import java.util.ArrayList;
+import java.util.Locale;
/**
* Created by android_ls on 16/9/13.
@@ -34,6 +32,7 @@ public class PictureBrowseActivity extends FragmentActivity
private TransitionCompat mTransitionCompat;
private boolean mFirstExecAnimation;
+ private boolean mIsAnimation;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -50,15 +49,16 @@ public void onCreate(Bundle savedInstanceState) {
mPhotoIndex = data.getIntExtra(PictureBrowse.PHOTO_CURRENT_POSITION_KEY, 0);
MLog.i("mPhotoIndex = " + mPhotoIndex);
+ mIsAnimation = data.getBooleanExtra(PictureBrowse.PHOTO_IS_ANIMATION_KEY, false);
+ MLog.i("isAnimation = " + mIsAnimation);
+ mFirstExecAnimation = data.getBooleanExtra(PictureBrowse.PHOTO_ONLY_ONE_ANIMATION_KEY, false);
+ MLog.i("firstExecAnimation = " + mFirstExecAnimation);
+
setupViews();
- boolean isAnimation = data.getBooleanExtra(PictureBrowse.PHOTO_IS_ANIMATION_KEY, false);
- MLog.i("isAnimation = " + isAnimation);
- if (isAnimation) {
+ if (mIsAnimation) {
mTransitionCompat = new TransitionCompat(PictureBrowseActivity.this);
- mFirstExecAnimation = data.getBooleanExtra(PictureBrowse.PHOTO_ONLY_ONE_ANIMATION_KEY, false);
- MLog.i("firstExecAnimation = " + mFirstExecAnimation);
- mTransitionCompat.setCurrentPosition(mFirstExecAnimation ? 0 : mPhotoIndex);
+ mTransitionCompat.setCurrentPosition(mPhotoIndex);
mTransitionCompat.startTransition();
}
}
@@ -70,9 +70,14 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
@Override
public void onPageSelected(int position) {
+ if(mFirstExecAnimation) {
+ return;
+ }
+
mPhotoIndex = position;
- tvPhotoIndex.setText(String.format("%d/%d", mPhotoIndex + 1, mPhotoCount));
- if (mTransitionCompat != null && !mFirstExecAnimation) {
+ tvPhotoIndex.setText(String.format(Locale.getDefault(), "%d/%d", mPhotoIndex + 1, mPhotoCount));
+
+ if (mTransitionCompat != null && mIsAnimation) {
MLog.i("onPageSelected mPhotoIndex = " + mPhotoIndex);
mTransitionCompat.setCurrentPosition(mPhotoIndex);
}
@@ -85,7 +90,7 @@ public void onPageScrollStateChanged(int state) {
@Override
public void onBackPressed() {
- if (mTransitionCompat != null) {
+ if (mTransitionCompat != null && mIsAnimation) {
mTransitionCompat.finishAfterTransition();
} else {
super.onBackPressed();
@@ -106,7 +111,13 @@ private void setupViews() {
mViewPager.setAdapter(mAdapter);
mPhotoCount = mItems.size();
- tvPhotoIndex.setText(String.format("%d/%d", mPhotoIndex + 1, mPhotoCount));
+ if(mFirstExecAnimation) {
+ findViewById(R.id.rl_photo_bottom).setVisibility(View.GONE);
+ tvPhotoIndex.setVisibility(View.GONE);
+ } else {
+ tvPhotoIndex.setText(String.format(Locale.getDefault(), "%d/%d", mPhotoIndex + 1, mPhotoCount));
+ }
+
mViewPager.setCurrentItem(mPhotoIndex);
}
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseAdapter.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseAdapter.java
similarity index 91%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseAdapter.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseAdapter.java
index be9a227..a78d3fe 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/PictureBrowseAdapter.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/PictureBrowseAdapter.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo;
+package com.facebook.fresco.helper.photoview;
import android.graphics.drawable.Animatable;
import android.net.Uri;
@@ -11,12 +11,10 @@
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder;
import com.facebook.drawee.controller.BaseControllerListener;
-import com.facebook.fresco.helper.R;
-import com.facebook.fresco.helper.photo.entity.PhotoInfo;
-import com.facebook.fresco.helper.photodraweeview.OnPhotoTapListener;
-import com.facebook.fresco.helper.photodraweeview.OnViewTapListener;
-import com.facebook.fresco.helper.photodraweeview.PhotoDraweeView;
-import com.facebook.fresco.helper.utils.MLog;
+import com.facebook.fresco.helper.photoview.entity.PhotoInfo;
+import com.facebook.fresco.helper.photoview.photodraweeview.OnPhotoTapListener;
+import com.facebook.fresco.helper.photoview.photodraweeview.OnViewTapListener;
+import com.facebook.fresco.helper.photoview.photodraweeview.PhotoDraweeView;
import com.facebook.imagepipeline.core.ImagePipeline;
import com.facebook.imagepipeline.image.ImageInfo;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/AnimListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/AnimListener.java
similarity index 94%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/AnimListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/AnimListener.java
index 23025d0..83e5f99 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/AnimListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/AnimListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.animation.Animator;
import android.view.View;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/SceneScaleUpAnimator.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/SceneScaleUpAnimator.java
similarity index 98%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/SceneScaleUpAnimator.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/SceneScaleUpAnimator.java
index 8ac087e..b76b7f8 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/SceneScaleUpAnimator.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/SceneScaleUpAnimator.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.animation.Animator;
import android.animation.AnimatorSet;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionAnimator.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionAnimator.java
similarity index 95%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionAnimator.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionAnimator.java
index 2e617f6..575d838 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionAnimator.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionAnimator.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.animation.TimeInterpolator;
import android.app.Activity;
@@ -7,7 +7,7 @@
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
-import com.facebook.fresco.helper.R;
+import com.facebook.fresco.helper.photoview.R;
public abstract class TransitionAnimator {
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionCompat.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionCompat.java
similarity index 94%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionCompat.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionCompat.java
index ddc8671..efd897d 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/TransitionCompat.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/TransitionCompat.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.animation.TimeInterpolator;
import android.app.Activity;
@@ -13,7 +13,6 @@
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.view.SimpleDraweeView;
-import com.facebook.fresco.helper.utils.DensityUtil;
/**
* Created by android_ls on 16/9/20.
@@ -108,8 +107,8 @@ private void startThumbnailAnimation(ViewOptions viewOptions) {
float fraction = 0.8f;
final Rect finalBounds = new Rect(0, 0,
- (int)(DensityUtil.getDisplayWidth(mActivity) * fraction),
- (int)(DensityUtil.getDisplayHeight(mActivity) * fraction));
+ (int)(mActivity.getResources().getDisplayMetrics().widthPixels * fraction),
+ (int)(mActivity.getResources().getDisplayMetrics().heightPixels * fraction));
mAnimListener = new AnimListener(bitmapImageView, null);
final ViewAnim anim = new ViewAnim();
@@ -140,8 +139,8 @@ private void endThumbnailAnimation(ViewOptions viewOptions) {
* 开始设定view开始时的大小和坐标位置
*/
ViewGroup.LayoutParams orginalParams = new ViewGroup.LayoutParams(
- DensityUtil.getDisplayWidth(mActivity),
- DensityUtil.getDisplayHeight(mActivity));
+ mActivity.getResources().getDisplayMetrics().widthPixels,
+ mActivity.getResources().getDisplayMetrics().heightPixels);
ViewGroup rootView = (ViewGroup)(mActivity.getWindow().getDecorView());
rootView.addView(bitmapImageView, orginalParams);
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewAnim.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewAnim.java
similarity index 98%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewAnim.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewAnim.java
index 8541d88..eb3a67f 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewAnim.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewAnim.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptions.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptions.java
similarity index 97%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptions.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptions.java
index 037a7bf..8c24be6 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptions.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptions.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptionsCompat.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptionsCompat.java
similarity index 89%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptionsCompat.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptionsCompat.java
index c2204f9..965e0fe 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/anim/ViewOptionsCompat.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/anim/ViewOptionsCompat.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.anim;
+package com.facebook.fresco.helper.photoview.anim;
import android.app.Activity;
import android.graphics.Rect;
@@ -16,9 +16,10 @@ public class ViewOptionsCompat {
public static Bundle makeScaleUpAnimation(GridLayoutManager layoutManager, ArrayList thumbnailList) {
SparseArray sparseArray = new SparseArray<>();
+ int firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition();
int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition();
for (int i = 0; i < thumbnailList.size(); i++) {
- if (i <= lastVisibleItemPosition) {
+ if (i >= firstVisibleItemPosition && i <= lastVisibleItemPosition) {
View childView = layoutManager.findViewByPosition(i);
if(childView != null) {
sparseArray.put(i, createViewOptions(childView, thumbnailList.get(i)));
@@ -32,11 +33,11 @@ public static Bundle makeScaleUpAnimation(GridLayoutManager layoutManager, Array
}
public static Bundle makeScaleUpAnimation(View thumbnailView, String thumbnail) {
- ArrayList viewOptionses = new ArrayList<>();
- viewOptionses.add(createViewOptions(thumbnailView, thumbnail));
+ SparseArray sparseArray = new SparseArray<>();
+ sparseArray.put(0, createViewOptions(thumbnailView, thumbnail));
Bundle bundle = new Bundle();
- bundle.putParcelableArrayList(KEY_VIEW_OPTION_LIST, viewOptionses);
+ bundle.putSparseParcelableArray(KEY_VIEW_OPTION_LIST, sparseArray);
return bundle;
}
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/entity/PhotoInfo.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/entity/PhotoInfo.java
similarity index 95%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photo/entity/PhotoInfo.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/entity/PhotoInfo.java
index ab684c4..16e2ebe 100644
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photo/entity/PhotoInfo.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/entity/PhotoInfo.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photo.entity;
+package com.facebook.fresco.helper.photoview.entity;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/Attacher.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/Attacher.java
similarity index 99%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/Attacher.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/Attacher.java
index ae876b1..f554126 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/Attacher.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/Attacher.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.content.Context;
import android.graphics.Matrix;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/DefaultOnDoubleTapListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/DefaultOnDoubleTapListener.java
similarity index 97%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/DefaultOnDoubleTapListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/DefaultOnDoubleTapListener.java
index 9ee428a..831a10e 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/DefaultOnDoubleTapListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/DefaultOnDoubleTapListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.graphics.RectF;
import android.view.GestureDetector;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/IAttacher.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/IAttacher.java
similarity index 97%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/IAttacher.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/IAttacher.java
index 954189a..d620d0f 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/IAttacher.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/IAttacher.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.view.GestureDetector;
import android.view.View;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnPhotoTapListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnPhotoTapListener.java
similarity index 92%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnPhotoTapListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnPhotoTapListener.java
index c0fb60f..e3055be 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnPhotoTapListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnPhotoTapListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.view.View;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleChangeListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleChangeListener.java
similarity index 88%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleChangeListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleChangeListener.java
index 9d27abc..b657b10 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleChangeListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleChangeListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
/**
* Interface definition for callback to be invoked when attached ImageView scale changes
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleDragGestureListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleDragGestureListener.java
similarity index 94%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleDragGestureListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleDragGestureListener.java
index 66b3f89..952e43c 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnScaleDragGestureListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnScaleDragGestureListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
/**
* ****************************************************************************
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnViewTapListener.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnViewTapListener.java
similarity index 91%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnViewTapListener.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnViewTapListener.java
index 3c81e95..8532a52 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/OnViewTapListener.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/OnViewTapListener.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.view.View;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/PhotoDraweeView.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/PhotoDraweeView.java
similarity index 98%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/PhotoDraweeView.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/PhotoDraweeView.java
index fac0d06..a5b10ad 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/PhotoDraweeView.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/PhotoDraweeView.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.content.Context;
import android.graphics.Canvas;
diff --git a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/ScaleDragDetector.java b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/ScaleDragDetector.java
similarity index 99%
rename from fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/ScaleDragDetector.java
rename to fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/ScaleDragDetector.java
index 5ed71f3..bf5aa31 100755
--- a/fresco-helper/src/main/java/com/facebook/fresco/helper/photodraweeview/ScaleDragDetector.java
+++ b/fresco-photoview/src/main/java/com/facebook/fresco/helper/photoview/photodraweeview/ScaleDragDetector.java
@@ -1,4 +1,4 @@
-package com.facebook.fresco.helper.photodraweeview;
+package com.facebook.fresco.helper.photoview.photodraweeview;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
diff --git a/fresco-helper/src/main/res/drawable-xhdpi/loading_dialog.png b/fresco-photoview/src/main/res/drawable-xhdpi/loading_dialog.png
similarity index 100%
rename from fresco-helper/src/main/res/drawable-xhdpi/loading_dialog.png
rename to fresco-photoview/src/main/res/drawable-xhdpi/loading_dialog.png
diff --git a/fresco-helper/src/main/res/drawable/progressbar_dialog_view.xml b/fresco-photoview/src/main/res/drawable/progressbar_dialog_view.xml
similarity index 100%
rename from fresco-helper/src/main/res/drawable/progressbar_dialog_view.xml
rename to fresco-photoview/src/main/res/drawable/progressbar_dialog_view.xml
diff --git a/fresco-helper/src/main/res/layout/activity_picture_browse.xml b/fresco-photoview/src/main/res/layout/activity_picture_browse.xml
similarity index 86%
rename from fresco-helper/src/main/res/layout/activity_picture_browse.xml
rename to fresco-photoview/src/main/res/layout/activity_picture_browse.xml
index 8aa9b36..e22bd92 100644
--- a/fresco-helper/src/main/res/layout/activity_picture_browse.xml
+++ b/fresco-photoview/src/main/res/layout/activity_picture_browse.xml
@@ -5,16 +5,17 @@
android:layout_height="match_parent"
android:background="#ff000000">
-
+ android:background="#40000000">
-
+ Fresco-PhotoView
+
diff --git a/fresco-helper/src/main/res/values/styles.xml b/fresco-photoview/src/main/res/values/styles.xml
similarity index 100%
rename from fresco-helper/src/main/res/values/styles.xml
rename to fresco-photoview/src/main/res/values/styles.xml
diff --git a/settings.gradle b/settings.gradle
index 68a291f..21fd29c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,4 +1,5 @@
//include ':app'
include ':app',
+ ':fresco-photoview',
':fresco-helper'