Partly fix back button in ringtone selection

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-06-15 16:31:58 +02:00
parent 879098ca8c
commit 75fbf37210
3 changed files with 9 additions and 8 deletions

View File

@ -82,7 +82,7 @@ public class RingtoneSelectionController extends BaseController implements Flexi
public RingtoneSelectionController(Bundle args) {
super(args);
setHasOptionsMenu(true);
this.callNotificationSounds = args.getBoolean(BundleKeys.KEY_ARE_CALL_SOUNDS, false);
}
@ -116,11 +116,9 @@ public class RingtoneSelectionController extends BaseController implements Flexi
protected void onAttach(@NonNull View view) {
super.onAttach(view);
setHasOptionsMenu(true);
if (getActionBar() != null) {
getActionBar().setDisplayHomeAsUpEnabled(true);
}
}
@Override

View File

@ -233,16 +233,16 @@ public class SettingsController extends BaseController {
Bundle bundle = new Bundle();
bundle.putBoolean(BundleKeys.KEY_ARE_CALL_SOUNDS, true);
getRouter().pushController(RouterTransaction.with(new RingtoneSelectionController(bundle))
.pushChangeHandler(new HorizontalChangeHandler()
).popChangeHandler(new HorizontalChangeHandler()));
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
});
settingsMessageSound.setOnClickListener(v -> {
Bundle bundle = new Bundle();
bundle.putBoolean(BundleKeys.KEY_ARE_CALL_SOUNDS, false);
getRouter().pushController(RouterTransaction.with(new RingtoneSelectionController(bundle))
.pushChangeHandler(new HorizontalChangeHandler()
).popChangeHandler(new HorizontalChangeHandler()));
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
});
addAccountButton.addPreferenceClickListener(view15 -> {

View File

@ -27,6 +27,7 @@ import android.view.View;
import com.bluelinelabs.conductor.Controller;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.controllers.AccountVerificationController;
import com.nextcloud.talk.controllers.MagicBottomNavigationController;
import com.nextcloud.talk.controllers.ServerSelectionController;
import com.nextcloud.talk.controllers.SwitchAccountController;
import com.nextcloud.talk.controllers.WebViewLoginController;
@ -91,7 +92,9 @@ public abstract class BaseController extends RefWatchingController {
@Override
protected void onAttach(@NonNull View view) {
setTitle();
getActionBar().setDisplayHomeAsUpEnabled(false);
if (!MagicBottomNavigationController.class.getName().equals(getClass().getName())) {
getActionBar().setDisplayHomeAsUpEnabled(false);
}
super.onAttach(view);
}