indentation problem fixed

This commit is contained in:
Ankush Sachdeva 2015-05-09 01:11:37 +05:30
parent 7284b7d423
commit f9a991e37d

View file

@ -68,20 +68,20 @@ public class MainActivity extends Activity {
@Override @Override
public void onEmojiconClicked(Emojicon emojicon) { public void onEmojiconClicked(Emojicon emojicon) {
if (emojiconEditText == null || emojicon == null) { if (emojiconEditText == null || emojicon == null) {
return; return;
} }
int start = emojiconEditText.getSelectionStart(); int start = emojiconEditText.getSelectionStart();
int end = emojiconEditText.getSelectionEnd(); int end = emojiconEditText.getSelectionEnd();
if (start < 0) { if (start < 0) {
emojiconEditText.append(emojicon.getEmoji()); emojiconEditText.append(emojicon.getEmoji());
} else { } else {
emojiconEditText.getText().replace(Math.min(start, end), emojiconEditText.getText().replace(Math.min(start, end),
Math.max(start, end), emojicon.getEmoji(), 0, Math.max(start, end), emojicon.getEmoji(), 0,
emojicon.getEmoji().length()); emojicon.getEmoji().length());
} }
} }
}); });
//On backspace clicked, emulate the KEYCODE_DEL key event //On backspace clicked, emulate the KEYCODE_DEL key event
@ -90,7 +90,7 @@ public class MainActivity extends Activity {
@Override @Override
public void onEmojiconBackspaceClicked(View v) { public void onEmojiconBackspaceClicked(View v) {
KeyEvent event = new KeyEvent( KeyEvent event = new KeyEvent(
0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL); 0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
emojiconEditText.dispatchKeyEvent(event); emojiconEditText.dispatchKeyEvent(event);
} }
}); });
@ -129,21 +129,21 @@ public class MainActivity extends Activity {
}); });
//On submit, add the edittext text to listview and clear the edittext //On submit, add the edittext text to listview and clear the edittext
submitButton.setOnClickListener(new OnClickListener() { submitButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
String newText = emojiconEditText.getText().toString(); String newText = emojiconEditText.getText().toString();
emojiconEditText.getText().clear(); emojiconEditText.getText().clear();
mAdapter.add(newText); mAdapter.add(newText);
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
}
});
} }
});
}
private void changeEmojiKeyboardIcon(ImageView iconToBeChanged, int drawableResourceId){ private void changeEmojiKeyboardIcon(ImageView iconToBeChanged, int drawableResourceId){
iconToBeChanged.setImageResource(drawableResourceId); iconToBeChanged.setImageResource(drawableResourceId);
} }
} }