mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 08:45:04 +01:00
Start call on click + some signaling settings
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
9ca7fe4bb6
commit
00eac7549e
@ -30,6 +30,7 @@ import com.nextcloud.talk.api.models.json.rooms.RoomOverall;
|
||||
import com.nextcloud.talk.api.models.json.rooms.RoomsOverall;
|
||||
import com.nextcloud.talk.api.models.json.sharees.ShareesOverall;
|
||||
import com.nextcloud.talk.api.models.json.signaling.SignalingOverall;
|
||||
import com.nextcloud.talk.api.models.json.signaling.settings.SignalingSettingsOverall;
|
||||
import com.nextcloud.talk.api.models.json.userprofile.UserProfileOverall;
|
||||
|
||||
import java.util.Map;
|
||||
@ -159,6 +160,9 @@ public interface NcApi {
|
||||
@POST
|
||||
Observable<GenericOverall> pingCall(@Header("Authorization") String authorization, @Url String url);
|
||||
|
||||
@GET
|
||||
Observable<SignalingSettingsOverall> getSignalingSettings(@Header("Authorization") String authorization, @Url
|
||||
String url);
|
||||
/*
|
||||
QueryMap items are as follows:
|
||||
- "messages" : "message"
|
||||
|
@ -130,6 +130,11 @@ public class ApiHelper {
|
||||
return baseUrl + ocsApiVersion + spreedApiVersion + "/signaling";
|
||||
}
|
||||
|
||||
public static String getUrlForSignalingSettings(String baseUrl) {
|
||||
return getUrlForSignaling(baseUrl) + "/settings";
|
||||
}
|
||||
|
||||
|
||||
public static String getUrlForUserProfile(String baseUrl) {
|
||||
return baseUrl + ocsApiVersion + "/cloud/user";
|
||||
}
|
||||
|
@ -30,5 +30,4 @@ import lombok.Data;
|
||||
public class SignalingOverall {
|
||||
@JsonField(name = "ocs")
|
||||
SignalingOCS ocs;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.api.models.json.signaling.settings;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
public class IceServer {
|
||||
@JsonField(name = "url")
|
||||
String url;
|
||||
|
||||
@JsonField(name = "username")
|
||||
String username;
|
||||
|
||||
@JsonField(name = "credential")
|
||||
String credential;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.api.models.json.signaling.settings;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
public class Settings {
|
||||
@JsonField(name = "stunservers")
|
||||
List<IceServer> stunServers;
|
||||
|
||||
@JsonField(name = "turnservers")
|
||||
List<IceServer> turnServers;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.api.models.json.signaling.settings;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.api.models.json.generic.GenericOCS;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
public class SignalingSettingsOcs extends GenericOCS {
|
||||
@JsonField(name = "data")
|
||||
Settings settings;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.api.models.json.signaling.settings;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.api.models.json.signaling.SignalingOCS;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
public class SignalingSettingsOverall {
|
||||
@JsonField(name = "ocs")
|
||||
SignalingOCS ocs;
|
||||
}
|
@ -22,6 +22,7 @@ package com.nextcloud.talk.controllers;
|
||||
|
||||
import android.app.SearchManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
@ -44,12 +45,13 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bluelinelabs.conductor.RouterTransaction;
|
||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
||||
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
||||
import com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.activities.CallActivity;
|
||||
import com.nextcloud.talk.adapters.items.UserItem;
|
||||
import com.nextcloud.talk.api.NcApi;
|
||||
import com.nextcloud.talk.api.helpers.api.ApiHelper;
|
||||
@ -60,8 +62,11 @@ import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
import com.nextcloud.talk.controllers.base.BaseController;
|
||||
import com.nextcloud.talk.models.RetrofitBucket;
|
||||
import com.nextcloud.talk.persistence.entities.UserEntity;
|
||||
import com.nextcloud.talk.utils.bundle.BundleBuilder;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
|
||||
import org.parceler.Parcels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@ -450,9 +455,14 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
|
||||
@Override
|
||||
public void onNext(RoomOverall roomOverall) {
|
||||
Toast.makeText(getActivity(), String.format(getResources().getString(R.string
|
||||
.nc_contacts_click), userItem.getModel().getName())
|
||||
,Toast.LENGTH_SHORT).show();
|
||||
overridePushHandler(new NoOpControllerChangeHandler());
|
||||
overridePopHandler(new NoOpControllerChangeHandler());
|
||||
Intent callIntent = new Intent(getActivity(), CallActivity.class);
|
||||
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
||||
bundleBuilder.putString("roomToken", roomOverall.getOcs().getRoomId());
|
||||
bundleBuilder.putParcelable("userEntity", Parcels.wrap(userEntity));
|
||||
callIntent.putExtras(bundleBuilder.build());
|
||||
startActivity(callIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +75,6 @@
|
||||
<!-- Contacts -->
|
||||
<string name="nc_one_contact_selected">contact selected</string>
|
||||
<string name="nc_more_contacts_selected">contacts selected</string>
|
||||
<string name="nc_contacts_click">Call with %1$s was created</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user