mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Refactor intent creation
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
b721e68a1a
commit
719c81d4a6
@ -441,17 +441,10 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.conversation_video_call:
|
case R.id.conversation_video_call:
|
||||||
Bundle bundle = new Bundle();
|
startActivity(getIntentForCall(false));
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
|
|
||||||
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(currentUser));
|
|
||||||
bundle.putString(BundleKeys.KEY_CALL_SESSION, currentCall.getSessionId());
|
|
||||||
|
|
||||||
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
|
||||||
callIntent.putExtras(bundle);
|
|
||||||
|
|
||||||
startActivity(callIntent);
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.conversation_voice_call:
|
case R.id.conversation_voice_call:
|
||||||
|
startActivity(getIntentForCall(true));
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -459,6 +452,22 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Intent getIntentForCall(boolean isVoiceOnlyCall) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
|
||||||
|
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(currentUser));
|
||||||
|
bundle.putString(BundleKeys.KEY_CALL_SESSION, currentCall.getSessionId());
|
||||||
|
|
||||||
|
if (isVoiceOnlyCall) {
|
||||||
|
bundle.putBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
||||||
|
callIntent.putExtras(bundle);
|
||||||
|
|
||||||
|
return callIntent;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelectionChanged(int count) {
|
public void onSelectionChanged(int count) {
|
||||||
//globalMenu.findItem(R.id.action_delete).setVisible(count > 0);
|
//globalMenu.findItem(R.id.action_delete).setVisible(count > 0);
|
||||||
|
@ -47,4 +47,5 @@ public class BundleKeys {
|
|||||||
public static final String KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS";
|
public static final String KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS";
|
||||||
public static final String KEY_CONVERSATION_NAME = "KEY_CONVERSATION_NAME";
|
public static final String KEY_CONVERSATION_NAME = "KEY_CONVERSATION_NAME";
|
||||||
public static final String KEY_ROOM_PASSWORD = "KEY_ROOM_PASSWORD";
|
public static final String KEY_ROOM_PASSWORD = "KEY_ROOM_PASSWORD";
|
||||||
|
public static final String KEY_CALL_VOICE_ONLY = "KEY_CALL_VOICE_ONLY";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user