package com.hadlink.lay_s.presenter;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.hadlink.lay_s.R;
import com.hadlink.lay_s.delegate.MainDelegate;
import com.hadlink.library.base.BaseActivity;
import com.joanzapata.iconify.fonts.MaterialIcons;

/**
 * @author Created by lyao on 2016/3/2.
 */
public class MainAtyPresenter extends BaseActivity<MainDelegate> {


    @Override protected Class<MainDelegate> getDelegateClass() {
        return MainDelegate.class;
    }

    @Override protected void onUseIconifySetMenuItem(Menu menu) {
        setMenuItem(MaterialIcons.md_face, R.color.text_dark, menu.findItem(R.id.git));
    }

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewDelegate.initView(getSupportFragmentManager());
    }

    @Override protected String getToolBarTitle() {

        return "Image Browser";
    }

    @Override public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.git:
                break;
            case R.id.food:
                startActivity(new Intent(this, AnimAtyPresenter.class));
                break;
        }
        return super.onOptionsItemSelected(item);
    }
}

@@ -54,22 +54,96 @@
 content.
-Intent
+ActivityNotFoundException;%0Aimport android.content.Intent;%0Aimport android.net.Uri
 ;%0Aimport
@@ -1178,16 +1178,298 @@
 id.git:%0A
+                try %7B%0A                    Uri uri = Uri.parse(%22https://github.com/vihuela%22);%0A                    Intent it = new Intent(Intent.ACTION_VIEW, uri);%0A                    startActivity(it);%0A                %7D catch (ActivityNotFoundException ignored) %7B%0A                %7D%0A%0A
         

update menu operate