Search in sources :

Example 1 with ExternalNavigator

use of com.alexstyl.specialdates.ExternalNavigator 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();
}
Also used : FacebookFriendsPersister(com.alexstyl.specialdates.facebook.friendimport.FacebookFriendsPersister) ExternalNavigator(com.alexstyl.specialdates.ExternalNavigator) AndroidPeopleEventsPersister(com.alexstyl.specialdates.events.peopleevents.AndroidPeopleEventsPersister) MementoApplication(com.alexstyl.specialdates.MementoApplication) AppComponent(com.alexstyl.specialdates.AppComponent) EventSQLiteOpenHelper(com.alexstyl.specialdates.events.database.EventSQLiteOpenHelper) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with ExternalNavigator

use of com.alexstyl.specialdates.ExternalNavigator in project Memento-Calendar by alexstyl.

the class RateDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rate_dialog);
    AppComponent applicationModule = ((MementoApplication) getApplication()).getApplicationModule();
    applicationModule.inject(this);
    externalNavigator = new ExternalNavigator(this, analytics, tracker);
    Views.findById(this, R.id.support_rate_button).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            externalNavigator.toPlayStore();
            Toast.makeText(context(), R.string.support_thanks_for_rating, Toast.LENGTH_LONG).show();
            askForSupport.onRateEnd();
            finish();
        }
    });
    Views.findById(this, R.id.support_cancel_button).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            askForSupport.onRateEnd();
            finish();
        }
    });
    TextView textDescription = Views.findById(this, R.id.support_description);
    textDescription.append(smiley);
    ImageView imageView = Views.findById(this, R.id.support_heroimage);
    Animation pulse = AnimationUtils.loadAnimation(imageView.getContext(), R.anim.heartbeat);
    imageView.startAnimation(pulse);
}
Also used : ExternalNavigator(com.alexstyl.specialdates.ExternalNavigator) MementoApplication(com.alexstyl.specialdates.MementoApplication) AppComponent(com.alexstyl.specialdates.AppComponent) Animation(android.view.animation.Animation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 AppComponent (com.alexstyl.specialdates.AppComponent)2 ExternalNavigator (com.alexstyl.specialdates.ExternalNavigator)2 MementoApplication (com.alexstyl.specialdates.MementoApplication)2 Animation (android.view.animation.Animation)1 EventSQLiteOpenHelper (com.alexstyl.specialdates.events.database.EventSQLiteOpenHelper)1 AndroidPeopleEventsPersister (com.alexstyl.specialdates.events.peopleevents.AndroidPeopleEventsPersister)1 FacebookFriendsPersister (com.alexstyl.specialdates.facebook.friendimport.FacebookFriendsPersister)1