use of com.squareup.picasso.OkHttpDownloader in project iNGAGE by davis123123.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
Picasso.Builder builder = new Picasso.Builder(this);
builder.downloader(new OkHttpDownloader(this, Integer.MAX_VALUE));
Picasso built = builder.build();
built.setIndicatorsEnabled(true);
// built.setLoggingEnabled(true);
Picasso.setSingletonInstance(built);
}
use of com.squareup.picasso.OkHttpDownloader in project Lets-Chat by kshitiz1007.
the class LetsChat method onCreate.
@Override
public void onCreate() {
super.onCreate();
mAuth = FirebaseAuth.getInstance();
FirebaseUser mUser = mAuth.getCurrentUser();
// ---DO IT WHENEVER YOU GET TIME---
if (mUser != null) {
// ---FIREBASE OFFLINE FEATURE---
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
// ---PIACSSO OFFLINE FEATURE--
mAuth = FirebaseAuth.getInstance();
Picasso.Builder builder = new Picasso.Builder(this);
builder.downloader(new OkHttpDownloader(this, Integer.MAX_VALUE));
Picasso built = builder.build();
built.setIndicatorsEnabled(true);
built.setLoggingEnabled(true);
Picasso.setSingletonInstance(built);
// String user_id = mAuth.getCurrentUser().getUid();
// Log.e("Current user inside : ",user_id);
// ---SEETING TIME_STAMP ON DISCONNECT-----
mUserDatabase = FirebaseDatabase.getInstance().getReference().child("users").child(mAuth.getCurrentUser().getUid());
mUserDatabase.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot != null) {
mUserDatabase.child("online").onDisconnect().setValue(ServerValue.TIMESTAMP);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
use of com.squareup.picasso.OkHttpDownloader in project sbt-android by scala-android.
the class DebugDataModule method providePicasso.
@Provides
@Singleton
Picasso providePicasso(OkHttpClient client, NetworkBehavior behavior, @IsMockMode boolean isMockMode, Application app) {
Picasso.Builder builder = new Picasso.Builder(app).downloader(new OkHttpDownloader(client));
if (isMockMode) {
builder.addRequestHandler(new MockRequestHandler(behavior, app.getAssets()));
}
builder.listener((picasso, uri, exception) -> {
Timber.e(exception, "Error while loading image " + uri);
});
return builder.build();
}
use of com.squareup.picasso.OkHttpDownloader in project iNGAGE by davis123123.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
Picasso.Builder builder = new Picasso.Builder(this);
builder.downloader(new OkHttpDownloader(this, Integer.MAX_VALUE));
Picasso built = builder.build();
// built.setIndicatorsEnabled(true);
// built.setLoggingEnabled(true);
Picasso.setSingletonInstance(built);
}
Aggregations