Return to group after not inviting new members

Also close keyboard when returning from message fragment
This commit is contained in:
Torsten Grote
2016-11-07 10:43:56 -02:00
parent fbcf334941
commit 7b884d2425
4 changed files with 16 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ public class GroupActivity extends
ThreadListActivity<PrivateGroup, GroupMessageItem, GroupMessageHeader>
implements OnClickListener {
private final static int REQUEST_INVITE = 1;
private final static int REQUEST_INVITE = 2;
@Inject
GroupController controller;

View File

@@ -6,6 +6,7 @@ import android.support.annotation.StringRes;
import android.support.annotation.UiThread;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
@@ -62,6 +63,18 @@ public abstract class BaseMessageFragment extends BaseFragment
message.showSoftKeyboard();
}
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (message.isKeyboardOpen()) message.hideSoftKeyboard();
listener.onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onSendClick(String msg) {
if (StringUtils.utf8IsTooLong(msg, listener.getMaximumMessageLength())) {