Skip to content
Permalink
Browse files

GA refactoring and merging

  • Loading branch information...
Roman Tronenko
Roman Tronenko committed Mar 12, 2017
2 parents 1452d29 + 246a4d6 commit 0b81783d12104ecd57efe68ea80681042683a518
@@ -7,6 +7,7 @@
/build
/captures
.externalNativeBuild
/app/google-services.json
app/google-services.json
app/fabric.properties
app/libs/
app/src/main/jniLibs
@@ -103,6 +103,14 @@ dependencies {
compile 'me.dm7.barcodescanner:zxing:1.9'
// compile(name:'watermark', ext:'aar')

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

}

crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}

crashlytics {
@@ -37,6 +37,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
</activity>

<meta-data
android:name="io.fabric.ApiKey"
android:value="49f02412d8578d9bc6b6b688fb4adaa71855db40" />
@@ -1,5 +1,6 @@
package tattoo.gogo.app.gogo_android;


import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
@@ -5,6 +5,7 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;

import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -282,7 +283,6 @@ private void loadImage(final String hash, final ImageView iv) {
.placeholder(R.drawable.progress_animation)
.error(R.drawable.doge)
.into(iv);

iv.setOnLongClickListener(view -> {
mListener.showContextMenu(iv, hash, this::loadImage);
return true;
@@ -118,7 +118,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
return view;
}


@Override
public void onResume() {
super.onResume();
@@ -212,6 +211,35 @@ public void onResponse(Call<List<ArtWork>> call, Response<List<ArtWork>> respons
} else {
setupRecyclerView();
}
//mRecyclerView.setHasFixedSize(true);
mRecyclerView.setItemViewCacheSize(20);
mRecyclerView.setDrawingCacheEnabled(true);
//mRecyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
mRecyclerView.setAdapter(new ArtworkRecyclerViewAdapter(ArtistArtworkListFragment.this, mWorks, mListener, mArtistName));
final LinearLayoutManager lm = (LinearLayoutManager) mRecyclerView.getLayoutManager();
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
int visibleItemCount = lm.getChildCount();
int totalItemCount = lm.getItemCount();
int pastVisibleItems = lm.findFirstVisibleItemPosition();
if (pastVisibleItems + visibleItemCount >= totalItemCount) {
mWorks.add(mAllWorks.remove(0));
mRecyclerView.invalidate();
}
}
});
mRecyclerView.addOnScrollListener(new HidingScrollListener() {
@Override
public void onHide() {
hideViews();
}

@Override
public void onShow() {
showViews();
}
});
}

@Override
@@ -18,6 +18,7 @@
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
@@ -343,6 +344,7 @@ public void onBackStackChanged() {
getSupportActionBar().setIcon(0);
Log.i(TAG, "Setting screen name: " + name);
AnalyticsUtil.sendScreenName(mTracker, title);

}
}

@@ -376,28 +378,6 @@ public void loadThumbnail(final WeakReference<Fragment> fr, final ArtworkRecycle
return true;
});

//
// 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);
//
// }
// }
// });
//

}

@Override
@@ -524,7 +504,7 @@ protected void onPostExecute(String filePath) {

private String saveImageToFile(String imageIpfs) throws Exception {
if (!haveStoragePermission()) {
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, MainActivity.PERMISSION_REQUEST_STORAGE);
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, MainActivity.PERMISSION_REQUEST_STORAGE);
throw new Exception("No permission");
}

@@ -4,13 +4,9 @@
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
@@ -103,7 +99,6 @@ public void onAnimationRepeat(Animation animation) {

//tvDescription.setText(Hello.greetings("This is a greeting from golang, WOW!"));


}

private void loadArtist(final ImageView iv, String link, final String artistName) {
@@ -114,30 +109,24 @@ public void onResourceReady(GlideBitmapDrawable bitmap, GlideAnimation glideAnim
// do something with the bitmap
// for demonstration purposes, let's just set it to an ImageView
iv.setImageBitmap(bitmap.getBitmap());
iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String tag = artistName+"/"+ArtistArtworkListFragment.ARTWORK_TYPE_TATTOO;
getFragmentManager().beginTransaction()
.hide(MainActivityFragment.this)
.add(R.id.fragment_container, ArtistArtworkListFragment.newInstance(1,
artistName, ArtistArtworkListFragment.ARTWORK_TYPE_TATTOO), tag)
.addToBackStack(tag)
.commit();
}
iv.setOnClickListener(v -> {
String tag = artistName+"/"+ArtistArtworkListFragment.ARTWORK_TYPE_TATTOO;
getFragmentManager().beginTransaction()
.hide(MainActivityFragment.this)
.add(R.id.fragment_container, ArtistArtworkListFragment.newInstance(1,
artistName, ArtistArtworkListFragment.ARTWORK_TYPE_TATTOO), tag)
.addToBackStack(tag)
.commit();
});
iv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
String tag = artistName+"/"+ArtistArtworkListFragment.ARTWORK_TYPE_DESIGN;
getFragmentManager().beginTransaction()
.hide(MainActivityFragment.this)
.add(R.id.fragment_container, ArtistArtworkListFragment.newInstance(1,
artistName, ArtistArtworkListFragment.ARTWORK_TYPE_DESIGN), tag)
.addToBackStack(tag)
.commit();
return true;
}
iv.setOnLongClickListener(view -> {
String tag = artistName+"/"+ArtistArtworkListFragment.ARTWORK_TYPE_DESIGN;
getFragmentManager().beginTransaction()
.hide(MainActivityFragment.this)
.add(R.id.fragment_container, ArtistArtworkListFragment.newInstance(1,
artistName, ArtistArtworkListFragment.ARTWORK_TYPE_DESIGN), tag)
.addToBackStack(tag)
.commit();
return true;
});
}
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 0b81783

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