Skip to content

Commit

Permalink
Fixes shimohq#24
Browse files Browse the repository at this point in the history
  • Loading branch information
Noitidart committed Mar 9, 2018
1 parent e8092ab commit a08841b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions android/src/main/java/im/shimo/react/prompt/RNPromptFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import android.widget.EditText;
import android.view.inputmethod.EditorInfo;
import android.graphics.Color;
import android.widget.TextView;
import android.view.KeyEvent;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -110,7 +112,7 @@ public Dialog createDialog(Context activityContext, Bundle arguments) {
mButtonColor = "";
}

AlertDialog alertDialog = builder.create();
final AlertDialog alertDialog = builder.create();

// input style
LayoutInflater inflater = LayoutInflater.from(activityContext);
Expand Down Expand Up @@ -197,9 +199,17 @@ public Dialog createDialog(Context activityContext, Bundle arguments) {
}
alertDialog.setView(input, 50, 15, 50, 0);

// input.setLinkTextColor(Color.parseColor("green"));

mInputText = input;

input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).performClick();
}
return false;
}
});

return alertDialog;
}

Expand Down

0 comments on commit a08841b

Please sign in to comment.