package com.example.octoissues;

import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;

public class EditOwnerRepoDialog extends DialogFragment implements OnEditorActionListener{
	
	public interface EditRepoDialogListener {
		void onFinishEditDialog(String inputText);
	}
	
	private EditText editOwner;
	private EditText editRepo;
	
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_owner_repo, container);
        editOwner = (EditText) view.findViewById(R.id.owner_name);
        editRepo = (EditText) view.findViewById(R.id.repo_name);
        getDialog().setTitle("Enter Owner and Repo");

        return view;
    }

	@Override
	public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
		// TODO Auto-generated method stub
		return false;
	}


}

@@ -221,16 +221,60 @@
 wGroup;%0A
+import android.view.inputmethod.EditorInfo;%0A
 import a
@@ -297,16 +297,16 @@
 itText;%0A
-
 import a
@@ -558,17 +558,26 @@
 ing 
-inputText
+owner, String repo
 );%0A%09
@@ -1155,42 +1155,317 @@
 %7B%0A%09%09
-// TODO Auto-generated method stub
+if (EditorInfo.IME_ACTION_DONE == actionId) %7B%0A%09%09%09//Send input owner name and repo name to activity%0A%09%09%09EditRepoDialogListener activity = (EditRepoDialogListener) getActivity();%0A%09%09%09activity.onFinishEditDialog(editOwner.getText().toString(), editRepo.getText().toString());%0A%09%09%09this.dismiss();%0A%09%09%09return true;%0A%09%09%7D
 %0A%09%09r
@@ -1481,11 +1481,9 @@
 se;%0A
+
 %09%7D%0A
-%0A%0A
 %7D%0A

Send owner and repo info to enclosing activity when done