package com.c0xif.simplyenglish;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class SpeechToTextFragment extends Fragment {

    TextView tv;

    public static SpeechToTextFragment newInstance() {
        return new SpeechToTextFragment();
    }

    public SpeechToTextFragment() {
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_speech_to_text, container, false);
        tv = (TextView)v.findViewById(R.id.speech2textBox);
        return v;
    }

    public boolean addText(String s) {
        tv.setText(tv.getText() + s);
        return true;
    }



}


@@ -335,24 +335,26 @@
 ew tv;%0A%0A    
+//
 public stati
@@ -392,24 +392,26 @@
 nce() %7B%0A    
+//
     return n
@@ -437,24 +437,26 @@
 ment();%0A    
+//
 %7D%0A%0A    publi
@@ -898,13 +898,293 @@
 %0A    %7D%0A%0A
+    public String sendWord() %7B%0A        String raw = (String) tv.getText();%0A%0A        int i = raw.indexOf(' ');%0A        String word = raw.substring(0, i);%0A        String rest = raw.substring(i);%0A        tv.setText(rest.trim());%0A        return word.replaceAll(%22.%22,%22%22).trim();%0A    %7D%0A%0A
 %0A%0A%7D%0A%0A

made word sender