package net.squanchy.eventdetails;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import net.squanchy.R;
import net.squanchy.eventdetails.widget.EventDetailsCoordinatorLayout;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;

public class EventDetailsActivity extends AppCompatActivity {

    private static final String EXTRA_EVENT_ID = "event_id";

    private EventDetailsService service;
    private Disposable subscription;
    private EventDetailsCoordinatorLayout coordinatorLayout;

    public static Intent createIntent(Context context, String eventId) {
        Intent intent = new Intent(context, EventDetailsActivity.class);
        intent.putExtra(EXTRA_EVENT_ID, eventId);
        return intent;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_event_details);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        EventDetailsComponent component = EventDetailsInjector.obtain(this);
        service = component.service();

        coordinatorLayout = (EventDetailsCoordinatorLayout) findViewById(R.id.event_details_root);
    }

    @Override
    protected void onStart() {
        super.onStart();

        Intent intent = getIntent();
        String eventId = intent.getStringExtra(EXTRA_EVENT_ID);

        subscription = service.event(eventId)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(event -> coordinatorLayout.updateWith(event));
    }

    @Override
    protected void onStop() {
        super.onStop();

        subscription.dispose();
    }
}

@@ -122,57 +122,8 @@
 le;%0A
-import android.support.v7.app.AppCompatActivity;%0A
 impo
@@ -160,16 +160,16 @@
 oolbar;%0A
+
 %0Aimport 
@@ -254,16 +254,69 @@
 rLayout;
+%0Aimport net.squanchy.fonts.TypefaceStyleableActivity;
 %0A%0Aimport
@@ -458,17 +458,25 @@
 nds 
-AppCompat
+TypefaceStyleable
 Acti
@@ -1089,72 +1089,8 @@
 );%0A%0A
-        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A
     
@@ -1100,32 +1100,18 @@
  set
-S
 up
-portActionBar(t
+T
 oolbar
+(
 );%0A%0A
@@ -1223,24 +1223,24 @@
 service();%0A%0A
-
         coor
@@ -1325,32 +1325,303 @@
 s_root);%0A    %7D%0A%0A
+    private void setupToolbar() %7B%0A        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A        setSupportActionBar(toolbar);%0A        getSupportActionBar().setDisplayShowTitleEnabled(false);%0A        getSupportActionBar().setDisplayHomeAsUpEnabled(true);%0A    %7D%0A%0A
     @Override%0A  

Make EventDetailsActivity extend correct super