View designer.html
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="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
<polymer-element name="my-element"> | |
<template> |
View gist:923e995405aed6be25f1
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
<H3 ADD_DATE="1412113824" LAST_MODIFIED="1412114012">sharable</H3> | |
<DL><p> | |
<DT><A HREF="http://www.techotopia.com/index.php/An_Example_iOS_5_iPhone_Location_Application" ADD_DATE="1357330177" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACY0lEQVQ4jaWSS0jUURSHv/l7HWfSSlAjRawRKnTGGnvgptcihJYFURARLgI3WZuiRetwFUhEtGhVRG1a9KLoSSTYQwxbRA+KrDTNyaHUmbn3nntb/Ed7QBJ04XDh45zD73fOgf98kdZjmeYgKLnqnE947/DO4YrhneCc/M684J0nKFGfK6uqdiiC4Kb31DsniLWI1VhjMEZz8MVp2r4O0LHiMHd6u1i4tZ2WT+s5P3SS+7Fli3uaO68HQSSo/5u8bSO3WD41RGrqHddUjJf37tKS/0BTYYTd3x+jp7LzFf7fvB5pO4E1hs3ZgVlmrUV9y47z4MC8WfjyS5TP38vY1OiI9gZg4eSeWlxbEwDBo0k4CgviitZVSZQ1GpEyhrIRVAA9D0vpbLOIOHIG4sCpvoDnIyUAtLwP2A94PNYYlNUaEeHNuOLcsyiHNuRZXu0QgfJSDxr2rdXYdTkA1BMNV4sWjEYZEzZY3yCkF2tiyvM2E7Ck0jEzH3GCiIR7d+GPB2M0ypoCIoLzUBqB473lrK41VMcdURshDpx5GmPwSzkAK9/H6OIXBbao4MabGP0jZSRrNBsbQrkxFVrYu2oSvWYCgGj/JFwvKjMaZXRBrLiS9sZpquLCmtoCzoUJ+aKC88/L2d4aQu9/7t1aQyDW9l/sm0BESC+aRkRmo0yFRTubv80yV+xuxPNxPPdJ5U2uo/vy6IXuK6Mtfx7Pq7xjAdB1dpjbl14DsGVqmHOA |
View BetterPresenter.java
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
public class SampleActivity Extends BaseActivity | |
@Inject ScreenOnePresenter firstScreen | |
@Inject ScreenTwoPresenter secondScreen | |
@Inject SampleActivityModel model | |
onCreate() | |
{ | |
//put anything in model that needs to be shared between views | |
//things that normally get passed in intent between activities | |
View betterscreens.java
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
Class GoalSummary extends Activity | |
{ | |
@Inject | |
GoalSummaryScreen summary | |
onCreate(){ | |
loadModule |
View Screen Blueprint
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
Basic Premise: | |
Single activity, as each screen loads a scope and >=1 views that each have their own presenter keeping things like a header and footer seperated yet able to act as a single unit. | |
MortarActivity | |
MainFlow | |
WalkthroughScreen | |
WalkthroughView and Presenter | |
ActionBarView and Presenter | |
WalkthroughPagerView and Presenter | |
ScreenAdapter |
View BaseDAO.java
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
package net.danlew.sample; | |
import rx.Observable; | |
/** | |
* Simulates three different sources - one from memory, one from disk, | |
* and one from network. In reality, they're all in-memory, but let's | |
* play pretend. | |
* | |
* Observable.create() is used so that we always return the latest data |
View trace.java
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
java.lang.RuntimeException: Unable to create application com.nytimes.android.NYTApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@22f99528 (pid=7923) when getting content provider settings | |
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4752) | |
at android.app.ActivityThread.access$1600(ActivityThread.java:172) | |
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368) | |
at android.os.Handler.dispatchMessage(Handler.java:102) | |
at android.os.Looper.loop(Looper.java:146) | |
at android.app.ActivityThread.main(ActivityThread.java:5653) | |
at java.lang.reflect.Method.invokeNative(Native Method) | |
at java.lang.reflect.Method.invoke(Method.java:515) | |
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) |
View DaggerLove.java
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
@Singleton | |
public class ArticleStore extends Store<String, ArticleEnvelope> { | |
@Inject | |
public ArticleStore(ArticleParser parser, ArticleDiskDAO diskDAO, ArticleNetworkDAO networkDAO) { | |
super(parser, diskDAO, networkDAO); | |
} | |
} |
View okio.java
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
Observable.fromCallable(() -> { | |
RedditData result = null; | |
Response response = makeRequest(); | |
String diskStorage = null; | |
try { | |
ResponseBody body = response.body(); | |
BufferedSource sourceForDisk = body.source(); | |
MediaType contentType = body.contentType(); | |
Charset charset = contentType != null ? contentType.charset(UTF_8) : UTF_8; |
View MMGood.java
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
@Singleton | |
public class Store { | |
@NonNull | |
public static final String SCANNED = "ScannedItemIDs"; | |
@NonNull | |
public static final String SYNCED = "ScannedAndSyncedItemIDs"; | |
@NonNull | |
private final RxStore store; | |
@NonNull | |
private final Api api; |
OlderNewer