This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ConnectivityChangeReceiver mConnectivityChangeReceiver; | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
mConnectivityChangeReceiver = new ConnectivityChangeReceiver(); | |
registerReceiver(mConnectivityChangeReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*************************************************** | |
* Application class * | |
*************************************************** | |
HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>(); | |
/** | |
* Enum used to identify the tracker that needs to be used for tracking. | |
* <p/> | |
* A single tracker is usually enough for most purposes. In case you do need multiple trackers, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in Application onCreate() | |
Timber.plant(new Timber.DebugTree()); | |
// in build gradle | |
compile 'com.jakewharton.timber:timber:2.5.0' | |
//usage | |
Timber.e("Request for questions failed."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in Application class | |
private static ObjectGraph graph; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
graph = ObjectGraph.create(getModules().toArray()); | |
} | |
protected List<Object> getModules() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in build gradle | |
compile 'com.squareup:otto:1.3.5' | |
//in dagger module | |
@Provides | |
@Singleton | |
Bus provideBus() { | |
return new Bus(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import com.eftimoff.jokes.JokesApplication; | |
import com.eftimoff.jokes.utils.SharedPrefs; | |
import com.squareup.otto.Bus; | |
import javax.inject.Inject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.support.v4.app.Fragment; | |
import com.eftimoff.jokes.JokesApplication; | |
import com.eftimoff.jokes.utils.SharedPrefs; | |
import com.squareup.otto.Bus; | |
import javax.inject.Inject; | |
import butterknife.ButterKnife; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in build gradle | |
compile 'com.jakewharton:butterknife:6.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../topeka-elements/category-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
OlderNewer