mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
commit
275d50a83f
@ -17,8 +17,8 @@ android {
|
||||
targetSdkVersion 28
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
versionCode 89
|
||||
versionName "6.0.0beta1"
|
||||
versionCode 90
|
||||
versionName "6.0.0beta2"
|
||||
|
||||
flavorDimensions "default"
|
||||
renderscriptTargetApi 19
|
||||
|
@ -34,6 +34,8 @@ import butterknife.ButterKnife;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
import com.nextcloud.talk.utils.DisplayUtils;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||
import eu.davidea.viewholders.FlexibleViewHolder;
|
||||
@ -96,7 +98,7 @@ public class MenuItem extends AbstractFlexibleItem<MenuItem.MenuItemViewHolder>
|
||||
static class MenuItemViewHolder extends FlexibleViewHolder {
|
||||
|
||||
@BindView(R.id.menu_text)
|
||||
public TextView menuTitle;
|
||||
public EmojiTextView menuTitle;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
@ -155,7 +155,8 @@ public class MagicIncomingTextMessageViewHolder
|
||||
.nc_incoming_text_mention_others);
|
||||
}
|
||||
|
||||
messageString = DisplayUtils.searchAndColor(message.getText(), "@" + individualHashMap.get("name"), color);
|
||||
messageString = DisplayUtils.searchAndColor(messageString,
|
||||
"@" + individualHashMap.get("name"), color);
|
||||
} else if (individualHashMap.get("type").equals("file")) {
|
||||
itemView.setOnClickListener(v -> {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(individualHashMap.get("link")));
|
||||
|
@ -92,7 +92,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
||||
if (individualHashMap.get("type").equals("user") || individualHashMap.get("type").equals("guest") || individualHashMap.get("type").equals("call")) {
|
||||
if (!individualHashMap.get("id").equals(message.getActiveUserId())) {
|
||||
messageString =
|
||||
DisplayUtils.searchAndColor(message.getText(),
|
||||
DisplayUtils.searchAndColor(messageString,
|
||||
"@" + individualHashMap.get("name"), NextcloudTalkApplication
|
||||
.getSharedApplication().getResources().getColor(R.color.nc_outcoming_text_default));
|
||||
}
|
||||
|
@ -68,7 +68,8 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
|
||||
}
|
||||
|
||||
messageString =
|
||||
DisplayUtils.searchAndColor(message.getText(), "@" + individualHashMap.get("name"), color);
|
||||
DisplayUtils.searchAndColor(messageString,
|
||||
"@" + individualHashMap.get("name"), color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,10 +35,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.*;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@ -98,6 +95,7 @@ import pub.devrel.easypermissions.AfterPermissionGranted;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -268,6 +266,8 @@ public class CallController extends BaseController {
|
||||
.setRepeatCount(PulseAnimation.INFINITE)
|
||||
.setRepeatMode(PulseAnimation.REVERSE);
|
||||
|
||||
setPipVideoViewDimensions();
|
||||
|
||||
try {
|
||||
cache.evictAll();
|
||||
} catch (IOException e) {
|
||||
@ -540,7 +540,6 @@ public class CallController extends BaseController {
|
||||
if (enumerator.isFrontFacing(deviceName)) {
|
||||
Logging.d(TAG, "Creating front facing camera capturer.");
|
||||
VideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null);
|
||||
|
||||
if (videoCapturer != null) {
|
||||
pipVideoView.setMirror(true);
|
||||
return videoCapturer;
|
||||
@ -1608,13 +1607,31 @@ public class CallController extends BaseController {
|
||||
public void onMessageEvent(ConfigurationChangeEvent configurationChangeEvent) {
|
||||
powerManagerUtils.setOrientation(Objects.requireNonNull(getResources()).getConfiguration().orientation);
|
||||
|
||||
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
remoteRenderersLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
} else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
remoteRenderersLayout.setOrientation(LinearLayout.VERTICAL);
|
||||
}
|
||||
|
||||
setPipVideoViewDimensions();
|
||||
}
|
||||
|
||||
private void setPipVideoViewDimensions() {
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) pipVideoView.getLayoutParams();
|
||||
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
remoteRenderersLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
layoutParams.height = (int) getResources().getDimension(R.dimen.large_preview_dimension);
|
||||
layoutParams.width = FrameLayout.LayoutParams.WRAP_CONTENT;
|
||||
pipVideoView.setLayoutParams(layoutParams);
|
||||
} else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
remoteRenderersLayout.setOrientation(LinearLayout.VERTICAL);
|
||||
layoutParams.height = FrameLayout.LayoutParams.WRAP_CONTENT;
|
||||
layoutParams.width = (int) getResources().getDimension(R.dimen.large_preview_dimension);
|
||||
pipVideoView.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(PeerConnectionEvent peerConnectionEvent) {
|
||||
if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent.PeerConnectionEventType
|
||||
|
@ -433,18 +433,14 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
messageInput.setHint(R.string.nc_readonly_hint);
|
||||
|
||||
conversationVoiceCallMenuItem.getIcon().setAlpha(99);
|
||||
conversationVoiceCallMenuItem.setEnabled(false);
|
||||
conversationVideoMenuItem.getIcon().setAlpha(99);
|
||||
conversationVideoMenuItem.setEnabled(false);
|
||||
|
||||
setChildrenState(messageInputView, false);
|
||||
} else {
|
||||
messageInput.setHint("");
|
||||
|
||||
conversationVoiceCallMenuItem.getIcon().setAlpha(255);
|
||||
conversationVoiceCallMenuItem.setEnabled(true);
|
||||
conversationVideoMenuItem.getIcon().setAlpha(255);
|
||||
conversationVideoMenuItem.setEnabled(true);
|
||||
|
||||
setChildrenState(messageInputView, true);
|
||||
}
|
||||
@ -1048,7 +1044,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
inflater.inflate(R.menu.menu_conversation, menu);
|
||||
if (conversationUser.getUserId().equals("?")) {
|
||||
@ -1058,6 +1054,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
conversationVoiceCallMenuItem = menu.findItem(R.id.conversation_voice_call);
|
||||
conversationVideoMenuItem = menu.findItem(R.id.conversation_video_call);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
|
||||
if (conversationUser.hasSpreedCapabilityWithName("read-only-rooms")) {
|
||||
checkReadOnlyState();
|
||||
@ -1072,11 +1073,17 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
||||
getRouter().popCurrentController();
|
||||
return true;
|
||||
case R.id.conversation_video_call:
|
||||
if (conversationVideoMenuItem.getIcon().getAlpha() == 255) {
|
||||
startACall(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case R.id.conversation_voice_call:
|
||||
if (conversationVoiceCallMenuItem.getIcon().getAlpha() == 255) {
|
||||
startACall(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case R.id.conversation_info:
|
||||
showConversationInfoScreen();
|
||||
return true;
|
||||
|
@ -28,7 +28,7 @@ public class ChatUtils {
|
||||
if (messageParameters != null && messageParameters.size() > 0) {
|
||||
for (String key : messageParameters.keySet()) {
|
||||
HashMap<String, String> individualHashMap = messageParameters.get(key);
|
||||
if (individualHashMap.get("type").equals("user") || individualHashMap.get("type").equals("guest")) {
|
||||
if (individualHashMap.get("type").equals("user") || individualHashMap.get("type").equals("guest") || individualHashMap.get("type").equals("call")) {
|
||||
message = message.replaceAll("\\{" + key + "\\}", "@" +
|
||||
messageParameters.get(key).get("name"));
|
||||
} else if (individualHashMap.get("type").equals("file")) {
|
||||
|
@ -101,8 +101,8 @@ public class Conversation {
|
||||
}
|
||||
|
||||
public boolean canModerate(UserEntity conversationUser) {
|
||||
return (Participant.ParticipantType.OWNER.equals(participantType)
|
||||
|| Participant.ParticipantType.MODERATOR.equals(participantType) && !isLockedOneToOne(conversationUser));
|
||||
return ((Participant.ParticipantType.OWNER.equals(participantType)
|
||||
|| Participant.ParticipantType.MODERATOR.equals(participantType)) && !isLockedOneToOne(conversationUser));
|
||||
}
|
||||
|
||||
public boolean isNameEditable(UserEntity conversationUser) {
|
||||
|
@ -209,10 +209,10 @@ public class DisplayUtils {
|
||||
}
|
||||
|
||||
|
||||
public static Spannable searchAndColor(String text, String searchText, @ColorInt int color) {
|
||||
public static Spannable searchAndColor(Spannable text, String searchText, @ColorInt int color) {
|
||||
|
||||
Spannable spannableString = new SpannableString(text);
|
||||
|
||||
String stringText = text.toString();
|
||||
if (TextUtils.isEmpty(text) || TextUtils.isEmpty(searchText)) {
|
||||
return spannableString;
|
||||
}
|
||||
@ -227,7 +227,7 @@ public class DisplayUtils {
|
||||
|
||||
int lastStartIndex = -1;
|
||||
while (m.find()) {
|
||||
int start = text.indexOf(m.group(), lastStartIndex);
|
||||
int start = stringText.indexOf(m.group(), lastStartIndex);
|
||||
int end = start + m.group().length();
|
||||
lastStartIndex = end;
|
||||
spannableString.setSpan(new ForegroundColorSpan(color), start, end,
|
||||
|
@ -82,8 +82,8 @@
|
||||
|
||||
<org.webrtc.SurfaceViewRenderer
|
||||
android:id="@+id/pip_video_view"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_width="@dimen/large_preview_dimension"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="invisible" />
|
||||
@ -94,7 +94,6 @@
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="20dp"
|
||||
|
||||
app:checked="false"
|
||||
app:enableInitialAnimation="false"
|
||||
app:frontBackgroundColor="@color/colorPrimary"
|
||||
|
@ -26,7 +26,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white">
|
||||
|
||||
<TextView
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
android:id="@+id/menu_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -25,7 +25,6 @@
|
||||
android:id="@+id/conversation_voice_call"
|
||||
android:icon="@drawable/ic_call_white_24dp"
|
||||
android:orderInCategory="0"
|
||||
android:enabled="false"
|
||||
android:title="@string/nc_conversation_menu_voice_call"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
@ -34,7 +33,6 @@
|
||||
android:icon="@drawable/ic_videocam_white_24px"
|
||||
android:orderInCategory="1"
|
||||
android:title="@string/nc_conversation_menu_video_call"
|
||||
android:enabled="false"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
|
@ -80,6 +80,7 @@ Kies er eentje van een provider.</string>
|
||||
<string name="nc_settings_vibrate_desc">Telefoon zal trillen, tenzij deze is gedempt</string>
|
||||
<string name="nc_settings_privacy">Privacy</string>
|
||||
<string name="nc_settings_screen_lock_title">Schermvergrendeling</string>
|
||||
<string name="nc_settings_screen_lock_desc">Vergrendel %1$s via de Android schermvergendeling of een ondersteunde biometrische methode</string>
|
||||
<string name="nc_settings_screen_lock_timeout_title">Schermblokkade inactiviteit time-out</string>
|
||||
<string name="nc_none">Geen</string>
|
||||
<string name="nc_settings_screen_security_title">Schermbeveiliging</string>
|
||||
@ -241,4 +242,5 @@ Je kunt proberen om aan het gesprek deel te nemen via een browser.</string>
|
||||
<string name="nc_user">Gebruiker</string>
|
||||
<string name="nc_guest">Gast</string>
|
||||
<string name="nc_following_link">Gebruiker die een openbare link volgde</string>
|
||||
</resources>
|
||||
<string name="nc_readonly_hint">Dit gesprek is gesloten</string>
|
||||
</resources>
|
||||
|
@ -16,4 +16,5 @@
|
||||
<dimen name="chat_text_size">14sp</dimen>
|
||||
<dimen name="message_bubble_corners_radius">6dp</dimen>
|
||||
<dimen name="message_bubble_corners_padding">8dp</dimen>
|
||||
<dimen name="large_preview_dimension">80dp</dimen>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user