package io.jamesclonk.turbojira;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;

public class ItemList extends AppCompatActivity {

    ArrayList<String> itemList = new ArrayList<>();
    ArrayAdapter<String> itemListAdapter;
    int clickCounter=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton addTaskButton = (FloatingActionButton) findViewById(R.id.add_task);
        addTaskButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //Snackbar.make(view, "Create new Jira Task", Snackbar.LENGTH_LONG)
                //        .setAction("Action", null).show();
                addItems(view);
            }
        });

        ListView listView = (ListView) findViewById(R.id.item_list);
        itemListAdapter = new ArrayAdapter<>(this,
                android.R.layout.simple_list_item_1,
                itemList);
        listView.setAdapter(itemListAdapter);
    }

    public void addItems(View v) {
        itemList.add("Clicked: "+clickCounter++);
        itemListAdapter.notifyDataSetChanged();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_item_list, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

package io.jamesclonk.turbojira;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;

public class ItemList extends AppCompatActivity {

    private ArrayList<String> itemList = new ArrayList<>();
    private ArrayAdapter<String> itemListAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton addTaskButton = (FloatingActionButton) findViewById(R.id.add_task);
        addTaskButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //Snackbar.make(view, "Create new Jira Task", Snackbar.LENGTH_LONG)
                //        .setAction("Action", null).show();
                addItems(view);
            }
        });

        for( int i = 1; i <= 15; i++) {
            itemList.add("Item: "+i);
        }
        ListView listView = (ListView) findViewById(R.id.item_list);
        itemListAdapter = new ArrayAdapter<>(this,
                android.R.layout.simple_list_item_1,
                itemList);
        listView.setAdapter(itemListAdapter);
    }

    public void addItem(String item) {
        itemList.add(item);
        itemListAdapter.notifyDataSetChanged();
    }

    public void addItems(View v) {
        //itemList.add("New Item");
        //itemListAdapter.notifyDataSetChanged();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_item_list, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

prepare for settings