use of com.alexstyl.specialdates.MementoApplication in project Memento-Calendar by alexstyl.
the class UpcomingWidgetConfigureActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppComponent applicationModule = ((MementoApplication) getApplication()).getApplicationModule();
applicationModule.inject(this);
setContentView(R.layout.activity_upcoming_events_widget_configure);
MementoToolbar mementoToolbar = Views.findById(this, R.id.memento_toolbar);
setSupportActionBar(mementoToolbar);
backgroundView = Views.findById(this, R.id.upcoming_widget_wallpaper);
previewLayout = Views.findById(this, R.id.upcoming_widget_preview);
configurationPanel = Views.findById(this, R.id.upcoming_widget_configure_panel);
configurationPanel.setListener(configurationListener);
preferences = new UpcomingWidgetPreferences(this);
initialisePreview(preferences);
considerAsNotComplete();
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if (extras != null) {
mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
}
}
use of com.alexstyl.specialdates.MementoApplication in project Memento-Calendar by alexstyl.
the class DailyReminderIntentService method onCreate.
@Override
public void onCreate() {
super.onCreate();
AppComponent applicationModule = ((MementoApplication) getApplication()).getApplicationModule();
applicationModule.inject(this);
bankHolidaysPreferences = AndroidBankHolidaysPreferences.newInstance(this);
checker = new AndroidPermissions(tracker, this);
}
use of com.alexstyl.specialdates.MementoApplication in project Memento-Calendar by alexstyl.
the class UpcomingEventsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppComponent applicationModule = ((MementoApplication) getActivity().getApplication()).getApplicationModule();
applicationModule.inject(this);
askForSupport = new AskForSupport(getActivity());
refresher.addEventsView(this);
}
use of com.alexstyl.specialdates.MementoApplication in project Memento-Calendar by alexstyl.
the class FacebookProfileActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppComponent applicationModule = ((MementoApplication) getApplication()).getApplicationModule();
applicationModule.inject(this);
analytics.trackScreen(Screen.FACEBOOK_PROFILE);
setContentView(R.layout.activity_facebook_profile);
setupToolbar();
profilePicture = findById(this, R.id.facebook_profile_avatar);
userName = findById(this, R.id.facebook_profile_name);
findById(this, R.id.facebook_profile_fb_page).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
navigator.toFacebookPage();
}
});
FacebookFriendsPersister persister = new FacebookFriendsPersister(new AndroidPeopleEventsPersister(new EventSQLiteOpenHelper(this), marshaller, tracker));
navigator = new ExternalNavigator(this, analytics, tracker);
FacebookLogoutService service = new FacebookLogoutService(AndroidSchedulers.mainThread(), facebookSettings, persister, uiRefresher, onLogOut());
presenter = new FacebookProfilePresenter(service, this, facebookSettings);
presenter.startPresenting();
}
use of com.alexstyl.specialdates.MementoApplication in project Memento-Calendar by alexstyl.
the class FacebookLogInActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppComponent applicationModule = ((MementoApplication) getApplication()).getApplicationModule();
applicationModule.inject(this);
analytics.trackScreen(Screen.FACEBOOK_LOG_IN);
setContentView(R.layout.activity_facebook_log_in);
Toolbar toolbar = Views.findById(this, R.id.memento_toolbar);
setSupportActionBar(toolbar);
avatar = Views.findById(this, R.id.facebook_import_avatar);
helloView = Views.findById(this, R.id.facebook_import_hello);
moreText = Views.findById(this, R.id.facebook_import_description);
progress = Views.findById(this, R.id.progress);
shareButton = Views.findById(this, R.id.facebook_import_share);
shareButton.setOnClickListener(shareAppIntentOnClick());
closeButton = Views.findById(this, R.id.facebook_import_close);
closeButton.setOnClickListener(onCloseButtonPressed());
webView = Views.findById(this, R.id.facebook_import_webview);
orientationLock = new ScreenOrientationLock();
facebookFriendsScheduler = new FacebookFriendsScheduler(thisActivity(), (AlarmManager) getSystemService(ALARM_SERVICE));
webView.setCallback(facebookCallback);
UserCredentials userCredentials = facebookUserSettings.retrieveCredentials();
if (savedInstanceState == null || userCredentials.equals(UserCredentials.ANNONYMOUS)) {
new CookieResetter(CookieManager.getInstance()).clearAll();
webView.loadLogInPage();
} else {
showData(userCredentials);
}
}
Aggregations