package net.squanchy.about;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;

import net.squanchy.R;
import net.squanchy.fonts.TypefaceStyleableActivity;
import net.squanchy.navigation.Navigator;

public class AboutActivity extends TypefaceStyleableActivity {

    private static final String SQUANCHY_WEBSITE = "https://squanchy.net";
    private static final String SQUANCHY_GITHUB = "https://github.com/rock3r/squanchy";

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

        setContentView(R.layout.activity_about);

        setupToolbar();

        Navigator navigator = AboutInjector.obtain(this)
                .navigator();

        findViewById(R.id.website_button).setOnClickListener(
                view -> navigator.toExternalUrl(SQUANCHY_WEBSITE)
        );

        findViewById(R.id.github_button).setOnClickListener(
                view -> navigator.toExternalUrl(SQUANCHY_GITHUB)
        );

        findViewById(R.id.foss_button).setOnClickListener(
                view -> navigator.toFossLicenses()
        );
    }

    private void setupToolbar() {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
}

@@ -133,16 +133,46 @@
 Toolbar;
+%0Aimport android.view.MenuItem;
 %0A%0Aimport
@@ -1411,11 +1411,250 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public boolean onOptionsItemSelected(MenuItem item) %7B%0A        if (item.getItemId() == android.R.id.home) %7B%0A            finish();%0A            return true;%0A        %7D%0A        return super.onOptionsItemSelected(item);%0A    %7D
 %0A%7D%0A

Handle up button in about screen toolbar