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 static Intent createIntent(Context paramContext) { | |
return IntentBuilder.forActivity(paramContext, EditPostActivity2.class).build(); | |
} | |
public static Intent createIntent(Context paramContext, String paramString, SelectionProtos.SelectionPb paramSelectionPb) { | |
return IntentBuilder.forActivity(paramContext, EditPostActivity2.class).withParam("postId", paramString).withJsonExtra("initialSelection", paramSelectionPb).build(); | |
} | |
public static Intent createIntentForQuoteResponse(Context paramContext, QuoteProtos.Quote paramQuote) { | |
return IntentBuilder.forActivity(paramContext, EditPostActivity2.class).withJsonExtra("inResponseToQuote", paramQuote).build(); |
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 IntentBuilder(Context paramContext, Class<?> paramClass) { | |
intent = new Intent(paramContext, paramClass); | |
res = paramContext.getResources(); | |
component = paramClass; | |
} | |
public static IntentBuilder forActivity(Context paramContext, Class<? extends MediumActivity> paramClass) { | |
return new IntentBuilder(paramContext, paramClass); | |
} |
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 Optional<Enum> maybeAction = Optional.absent(); | |
public IntentBuilder withAction(Enum paramEnum) { | |
maybeAction = Optional.of(paramEnum); | |
return this; | |
} |
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 IntentBuilder withExtra(String paramString, String[] paramArrayOfString) { | |
intent.putExtra(paramString, paramArrayOfString); | |
return this; | |
} | |
public IntentBuilder withJsonExtra(String paramString, JsonSerializable paramJsonSerializable) { | |
try { | |
intent.putExtra(paramString, mapper.writeValueAsString(paramJsonSerializable)); | |
return this; | |
} catch (JsonProcessingException paramJsonSerializable) { |
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 final Uri.Builder dataBuilder = new Uri.Builder(); //android.net.Uri.Builder | |
public IntentBuilder withParam(String paramString, int paramInt) { | |
dataBuilder.appendQueryParameter(paramString, Integer.toString(paramInt)); | |
return this; | |
} | |
public IntentBuilder withParam(String paramString, long paramLong) { | |
dataBuilder.appendQueryParameter(paramString, Long.toString(paramLong)); | |
return this; |
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 Intent build() { | |
Object localObject = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, component.getSimpleName()); | |
dataBuilder.scheme(res.getString(R.string.some_string)).authority((String) localObject); | |
if (maybeAction.isPresent()) { | |
localObject = (Enum) maybeAction.get(); | |
dataBuilder.fragment(((Enum) localObject).name()); | |
intent.setAction(localObject.getClass().getName() + "." + ((Enum) localObject).name()); | |
} | |
intent.setData(this.dataBuilder.build()); | |
return intent; |
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 static Intent createIntent(Context paramContext, AuthCredential paramAuthCredential, Optional<RegistrationData> paramOptional, boolean paramBoolean) { | |
return IntentBuilder.forActivity(paramContext, CreateAccountActivity.class).withSerializableExtra("authCredential", (Serializable) Preconditions.checkNotNull(paramAuthCredential)).withJsonExtra("registrationData", (JsonSerializable) paramOptional.orNull()).withParam("isOnboarded", paramBoolean).build(); | |
} |
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 AccessCredentialStore { | |
//... a bunch of fields... | |
Optional<AccessCredential> credential; | |
Optional<UserProtos.User> currentUser; | |
//... a bunch more fields... | |
public Optional<AccessCredential> loadCredential(); | |
public Optional<UserProtos.User> getCurrentUser(); | |
} |
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 abstract class AbstractMediumActivity<APP_COMPONENT> extends AppCompatActivity implements MediumActivity { | |
AuthChecker authChecker; | |
boolean enableCrashlytics; | |
MediumActivity.FailureDispatcher failureDispatcher; | |
Uri referrerBaseUri; | |
RxRegistry rxRegistry; | |
Optional<MediumTheme> themeOnCreation; | |
Provider<Optional<MediumTheme>> themeProvider; | |
Tracker tracker; | |
} |
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 abstract class DetailPresenter | |
implements TalkActionFactory.Callback, DetailActionRow.OnClickListener, | |
DownloadDialog.DownloadDialogListener, DownloadController.DownloadUICallback, TalkActionFactory.SectionCallback { | |
public DetailPresenter(Context context, DetailListFactory detailListFactory, StoreFavorites storeFavorites, | |
UpdateDownloads updateDownloads, StoreQueue storeQueue, GetDownloads getDownloads, Tracker tracker, StoreHistory storeHistory) { | |
this.context = context; | |
this.detailListFactory = detailListFactory; | |
this.downloadController = new DownloadController(context, updateDownloads, getDownloads, this); | |
this.storeFavorites = storeFavorites; |
OlderNewer