mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-21 11:45:03 +01:00
Various usability improvements
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
0d94501d29
commit
062eea5084
@ -168,7 +168,12 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
protected void onAttach(@NonNull View view) {
|
protected void onAttach(@NonNull View view) {
|
||||||
super.onAttach(view);
|
super.onAttach(view);
|
||||||
eventBus.register(this);
|
eventBus.register(this);
|
||||||
getParentController().getView().findViewById(R.id.navigation).setVisibility(View.VISIBLE);
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
userEntity = userUtils.getCurrentUser();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.controllers;
|
package com.nextcloud.talk.controllers;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.SearchManager;
|
import android.app.SearchManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -44,6 +45,7 @@ import android.view.ViewGroup;
|
|||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
@ -159,10 +161,12 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
|
|
||||||
public ContactsController() {
|
public ContactsController() {
|
||||||
super();
|
super();
|
||||||
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactsController(Bundle args) {
|
public ContactsController(Bundle args) {
|
||||||
super(args);
|
super(args);
|
||||||
|
setHasOptionsMenu(true);
|
||||||
if (args.containsKey(BundleKeys.KEY_NEW_CONVERSATION)) {
|
if (args.containsKey(BundleKeys.KEY_NEW_CONVERSATION)) {
|
||||||
isNewConversationView = true;
|
isNewConversationView = true;
|
||||||
}
|
}
|
||||||
@ -176,7 +180,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
@Override
|
@Override
|
||||||
protected void onAttach(@NonNull View view) {
|
protected void onAttach(@NonNull View view) {
|
||||||
super.onAttach(view);
|
super.onAttach(view);
|
||||||
setHasOptionsMenu(true);
|
|
||||||
eventBus.register(this);
|
eventBus.register(this);
|
||||||
|
|
||||||
if (isNewConversationView) {
|
if (isNewConversationView) {
|
||||||
@ -193,10 +196,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
super.onViewBound(view);
|
super.onViewBound(view);
|
||||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
if (isNewConversationView) {
|
|
||||||
getParentController().getView().findViewById(R.id.navigation).setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
FlipView.resetLayoutAnimationDelay(true, 1000L);
|
FlipView.resetLayoutAnimationDelay(true, 1000L);
|
||||||
FlipView.stopLayoutAnimation();
|
FlipView.stopLayoutAnimation();
|
||||||
|
|
||||||
@ -272,6 +271,13 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
|
||||||
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
|
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
|
||||||
callIntent.putExtras(bundle);
|
callIntent.putExtras(bundle);
|
||||||
|
if (getActivity() != null) {
|
||||||
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
if (imm != null) {
|
||||||
|
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
startActivity(callIntent);
|
startActivity(callIntent);
|
||||||
new Handler().postDelayed(() -> getRouter().popCurrentController(), 100);
|
new Handler().postDelayed(() -> getRouter().popCurrentController(), 100);
|
||||||
}
|
}
|
||||||
@ -635,6 +641,12 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
|
||||||
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
|
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(userEntity));
|
||||||
callIntent.putExtras(bundle);
|
callIntent.putExtras(bundle);
|
||||||
|
if (getActivity() != null) {
|
||||||
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
if (imm != null) {
|
||||||
|
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
startActivity(callIntent);
|
startActivity(callIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -726,19 +738,30 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
|
|
||||||
bottomSheet.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
bottomSheet.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
bottomSheet.setOnCancelListener(dialog -> {
|
||||||
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
bottomSheet.show();
|
bottomSheet.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onMessageEvent(BottomSheetLockEvent bottomSheetLockEvent) {
|
public void onMessageEvent(BottomSheetLockEvent bottomSheetLockEvent) {
|
||||||
|
|
||||||
if (bottomSheet != null) {
|
if (bottomSheet != null) {
|
||||||
if (!bottomSheetLockEvent.isCancelable()) {
|
if (!bottomSheetLockEvent.isCancelable()) {
|
||||||
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
||||||
} else {
|
} else {
|
||||||
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
|
||||||
if (bottomSheet.isShowing() && bottomSheetLockEvent.isCancel()) {
|
if (bottomSheet.isShowing() && bottomSheetLockEvent.isCancel()) {
|
||||||
new Handler().postDelayed(() -> bottomSheet.cancel(), bottomSheetLockEvent.getDelay());
|
new Handler().postDelayed(() -> {
|
||||||
getRouter().popCurrentController();
|
bottomSheet.setOnCancelListener(null);
|
||||||
|
bottomSheet.cancel();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> getRouter().popCurrentController(), 100);
|
||||||
|
}, bottomSheetLockEvent.getDelay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,8 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
|
|||||||
eventBus.post(new BottomSheetLockEvent(true, 0, false, true));
|
eventBus.post(new BottomSheetLockEvent(true, 0, false, true));
|
||||||
bundle = new Bundle();
|
bundle = new Bundle();
|
||||||
bundle.putBoolean(BundleKeys.KEY_NEW_CONVERSATION, true);
|
bundle.putBoolean(BundleKeys.KEY_NEW_CONVERSATION, true);
|
||||||
getParentController().getRouter().pushController((RouterTransaction.with(new ContactsController
|
getParentController().getParentController().getRouter().pushController((RouterTransaction.with
|
||||||
|
(new ContactsController
|
||||||
(bundle))
|
(bundle))
|
||||||
.pushChangeHandler(new VerticalChangeHandler())
|
.pushChangeHandler(new VerticalChangeHandler())
|
||||||
.popChangeHandler(new VerticalChangeHandler())));
|
.popChangeHandler(new VerticalChangeHandler())));
|
||||||
|
@ -182,7 +182,7 @@ public class EntryMenuController extends BaseController {
|
|||||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
editText.setOnEditorActionListener((v, actionId, event) -> {
|
editText.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE && proceedButton.isEnabled()) {
|
if (actionId == EditorInfo.IME_ACTION_DONE && proceedButton != null && proceedButton.isEnabled()) {
|
||||||
proceedButton.callOnClick();
|
proceedButton.callOnClick();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,16 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.controllers.bottomsheet;
|
package com.nextcloud.talk.controllers.bottomsheet;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@ -271,7 +272,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
.pushChangeHandler(new HorizontalChangeHandler())
|
.pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
} else {
|
} else {
|
||||||
initiateCall(false);
|
initiateCall();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showResultImage(false, true);
|
showResultImage(false, true);
|
||||||
@ -487,7 +488,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (localInvitedUsers.size() == 0) {
|
if (localInvitedUsers.size() == 0) {
|
||||||
initiateCall(true);
|
initiateCall();
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
@ -498,7 +499,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initiateCall(boolean fromContactsView) {
|
private void initiateCall() {
|
||||||
eventBus.post(new BottomSheetLockEvent(true, 0, true, true));
|
eventBus.post(new BottomSheetLockEvent(true, 0, true, true));
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, room.getToken());
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, room.getToken());
|
||||||
@ -510,12 +511,17 @@ public class OperationsMenuController extends BaseController {
|
|||||||
|
|
||||||
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
||||||
callIntent.putExtras(bundle);
|
callIntent.putExtras(bundle);
|
||||||
startActivity(callIntent);
|
|
||||||
if (fromContactsView) {
|
if (getActivity() != null) {
|
||||||
new Handler().postDelayed(() -> getParentController().getRouter().popCurrentController(), 100);
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||||
|
if (imm != null) {
|
||||||
|
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startActivity(callIntent);
|
||||||
|
}
|
||||||
|
|
||||||
private class OperationsObserver implements Observer {
|
private class OperationsObserver implements Observer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -530,7 +536,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
} else {
|
} else {
|
||||||
CallOverall callOverall = (CallOverall) o;
|
CallOverall callOverall = (CallOverall) o;
|
||||||
callSession = callOverall.getOcs().getData().getSessionId();
|
callSession = callOverall.getOcs().getData().getSessionId();
|
||||||
initiateCall(false);
|
initiateCall();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user