package com.hongdazeng.kindhearts;

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.EditText;

public class MainActivity extends AppCompatActivity {

    private EditText name;

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

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Created by H A B & M at Yhack 2015 ", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        this.name = (EditText) findViewById(R.id.editText);
    }

    public String getName(String defaultNam) {
        return this.name != null ? name.getText().toString() : defaultNam;
    }

    //@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_main, 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);
    }
}

@@ -302,16 +302,20 @@
 iew.Menu
+Item
 ;%0Aimport
@@ -319,37 +319,37 @@
 ort android.
-view.MenuItem
+widget.Button
 ;%0Aimport and
@@ -369,16 +369,46 @@
 ditText;
+%0Aimport android.widget.Switch;
 %0A%0Apublic
@@ -483,16 +483,148 @@
 t name;%0A
+    private EditText helpReason;%0A    private Button buttonHelp;%0A    private Button buttonRefresh;%0A    private Switch statusToggle;%0A%0A
 %0A    @Ov
@@ -1291,105 +1291,459 @@
 his.
-name = (EditText) findViewById(R.id.editText);%0A    %7D%0A%0A    public String getName(String defaultNam
+helpReason = (EditText) findViewById(R.id.editText);%0A        this.name = (EditText) findViewById(R.id.editText2);%0A        this.buttonHelp = (Button) findViewById(R.id.button);%0A        this.buttonRefresh = (Button) findViewById(R.id.button2);%0A        this.statusToggle = (Switch) findViewById(R.id.switch1);%0A    %7D%0A%0A    public String getName() %7B%0A        return this.name != null ? name.getText().toString() : %22John%22;%0A    %7D%0A%0A    public String getMessage(
 ) %7B%0A
@@ -1754,36 +1754,42 @@
     return this.
-name
+helpReason
  != null ? name.
@@ -1775,36 +1775,42 @@
 eason != null ? 
-name
+helpReason
 .getText().toStr
@@ -1821,25 +1821,327 @@
 ) : 
-defaultNam;%0A    %7D
+%22need help%22;%0A    %7D%0A%0A    public void onClick(View v) %7B%0A        if (v == buttonHelp) %7B%0A            // call server update with change%0A        %7D else if (v == buttonRefresh) %7B%0A            // call sever update with change%0A        %7D else if (v == statusToggle) %7B%0A            // call server update with change%0A        %7D%0A    %7D%0A
 %0A%0A  
@@ -2587,16 +2587,20 @@
 p button
+Help
 , so lon

support for most items in app