Skip to content
Permalink
Browse files

leargeHeap?

  • Loading branch information...
morphium committed Mar 10, 2017
1 parent 79ceed3 commit 246a4d6bb4d8ec95e04c38cb4703ef77d000b909
@@ -2,6 +2,9 @@ buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://plugins.gradle.org/m2/"}
flatDir {
dirs 'libs'
}
}

dependencies {
@@ -20,20 +23,22 @@ repositories {

gobind {
pkg = "golang.org/x/mobile/example/bind/hello"
//pkg = "github.com/gogotattoo/gogo-upload/watermark"
//pkg = "github.com/skip2/go-qrcode"

GOPATH = "/Users/delirium/go"
GOPATH = "/home/delirium/go"

// Optional path to the go executable.
GO = "/Users/delirium/go/bin/go"
GO = "/home/delirium/go/bin/go"

// Optionally, set the absolute path to the gomobile binary.
GOMOBILE = "/Users/delirium/go/bin/gomobile"
GOMOBILE = "/home/delirium/go/bin/gomobile"

// Pass extra parameters to command line. Optional.
// GOMOBILEFLAGS="-javapkg my.java.package"

// Absolute path to the gobind binary. Optional.
GOBIND="/Users/delirium/go/bin/gobind"
GOBIND="/home/delirium/go/bin/gobind"

// Optional list of architectures. Defaults to all supported architectures.
// GOARCH="arm amd64"
@@ -88,6 +93,9 @@ dependencies {
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.6@aar') {
transitive = true;
}

// compile(name:'watermark', ext:'aar')

}

crashlytics {
@@ -12,6 +12,7 @@
android:label="@string/app_name_short"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:largeHeap="true"
tools:replace="android:label">

<!--<meta-data android:name=".config.GlideConfiguration"-->
@@ -25,6 +25,7 @@
import android.widget.ImageView;
import android.widget.TextView;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;

@@ -291,9 +292,9 @@ public void onDetach() {
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnArtistArtworkFragmentInteractionListener {
void onListFragmentInteraction(Fragment fr, String artistName, ArtWork item);
void onListFragmentInteraction(WeakReference<Fragment> fr, String artistName, ArtWork item);

void loadThumbnail(Fragment fr, ArtworkRecyclerViewAdapter.ViewHolder holder);
void loadThumbnail(WeakReference<Fragment> fr, ArtworkRecyclerViewAdapter.ViewHolder holder);
}

}
@@ -10,6 +10,7 @@

import com.bumptech.glide.Glide;

import java.lang.ref.WeakReference;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
@@ -61,17 +62,23 @@ public void onClick(View v) {
if (null != mListener) {
// Notify the active callbacks interface (the activity, if the
// fragment is attached to one) that an item has been selected.
mListener.onListFragmentInteraction(mFragment, mArtistName, holder.mItem);
mListener.onListFragmentInteraction(new WeakReference<>(mFragment), mArtistName, holder.mItem);
}
}
});
mListener.loadThumbnail(mFragment, holder);
mListener.loadThumbnail(new WeakReference<>(mFragment), holder);
}

@Override
public void onViewDetachedFromWindow(ViewHolder holder) {
super.onViewDetachedFromWindow(holder);
//Glide.clear(holder.ivThumbnail);
//
}

@Override
public void onViewRecycled(ViewHolder holder) {
super.onViewRecycled(holder);
Glide.clear(holder.ivThumbnail);
}

@Override
@@ -1,5 +1,6 @@
package tattoo.gogo.app.gogo_android;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
@@ -25,10 +26,13 @@
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.Request;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.target.SizeReadyCallback;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.target.ViewTarget;

import java.lang.ref.WeakReference;

import butterknife.BindView;
import butterknife.ButterKnife;
import tattoo.gogo.app.gogo_android.model.ArtWork;
@@ -218,10 +222,14 @@ public void onClick(View v) {
}

@Override
public void onListFragmentInteraction(Fragment fr, String artistName, ArtWork artWork) {
public void onListFragmentInteraction(WeakReference<Fragment> fr, String artistName, ArtWork artWork) {
if (fr.get() == null) {
Log.d(TAG, "loadThumbnail: Fragment is null");
return;
}
String tag = artistName + "/" + artWork.getType() + "/"+ artWork.getLink();
getSupportFragmentManager().beginTransaction()
.hide(fr)
.hide(fr.get())
.add(R.id.fragment_container, ArtistArtworkFragment.newInstance(artistName, artWork), tag)
.addToBackStack(tag)
.commit();
@@ -254,21 +262,46 @@ public void onBackStackChanged() {


@Override
public void loadThumbnail(final Fragment fr, ArtworkRecyclerViewAdapter.ViewHolder holder) {
public void loadThumbnail(WeakReference<Fragment> fr, ArtworkRecyclerViewAdapter.ViewHolder holder) {
Log.d(TAG, "loadThumbnail: " + holder.mItem.getTitle());
if (fr.get() == null) {
Log.d(TAG, "loadThumbnail: Fragment is null");
return;
}
final String url = GogoConst.IPFS_GATEWAY_URL + holder.mItem.getImageIpfs();
holder.ivThumbnail.setVisibility(View.VISIBLE);
Display display = getWindowManager().getDefaultDisplay();
final DisplayMetrics outMetrics = new DisplayMetrics();
display.getMetrics(outMetrics);

Glide.with(getApplicationContext())
Glide.with(fr.get())
.load(url)
.placeholder(R.drawable.progress_animation)
.error(R.drawable.doge)
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.override(outMetrics.widthPixels, outMetrics.heightPixels)
.into(holder.ivThumbnail);

//
// Glide.with(fr.get())
// .load(url)
// .asBitmap()
// .dontAnimate()
// //.placeholder(R.drawable.progress_animation)
// //.error(R.drawable.doge)
// .diskCacheStrategy(DiskCacheStrategy.RESULT)
// //.override(outMetrics.widthPixels, outMetrics.heightPixels)
// .into(new SimpleTarget<Bitmap>() {
// @Override
// public void onResourceReady(Bitmap bitmap, GlideAnimation anim) {
//
// if (bitmap != null) {
//
// holder.ivThumbnail.setImageBitmap(bitmap);
//
// }
// }
// });
//
// iv.setOnLongClickListener(new View.OnLongClickListener() {
// @Override
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:orientation="vertical">

<TextView
android:id="@+id/tv_artwork_title"
@@ -1,4 +1,4 @@
#Mon Mar 06 11:27:58 CST 2017
#Fri Mar 10 12:21:06 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -1,90 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Binary file not shown.
@@ -0,0 +1,6 @@
#Mon Mar 06 11:27:58 CST 2017
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

0 comments on commit 246a4d6

Please sign in to comment.
You can’t perform that action at this time.