diff --git a/app/src/gplay/AndroidManifest.xml b/app/src/gplay/AndroidManifest.xml
index 1474521d4..2f388c5f5 100644
--- a/app/src/gplay/AndroidManifest.xml
+++ b/app/src/gplay/AndroidManifest.xml
@@ -11,11 +11,12 @@
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme"
- tools:replace="label, icon, theme, name, allowBackup">
+ tools:replace="label, icon, theme, name, allowBackup"
+ tools:ignore="UnusedAttribute, ExportedService">
-
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 06906a3c3..196a9b162 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -43,7 +43,8 @@
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme"
- tools:replace="label, icon, theme, name, allowBackup">
+ tools:replace="label, icon, theme, name, allowBackup"
+ tools:ignore="UnusedAttribute">
if (header != null) {
return R.layout.rv_item_contact;
} else {
- return R.layout.rv_item_mention;
+ return R.layout.rv_item_conversation_info_participant;
}
}
@@ -177,22 +177,45 @@ public class UserItem extends AbstractFlexibleItem
holder.itemView.setAlpha(1.0f);
}
- // TODO: show what the user is doing currently
- long participantFlags = participant.getParticipantFlags();
- if (participantFlags == 0) {
- } else if (participantFlags == 1) {
- // do nothing, just in call
- } else if (participantFlags == 2) {
- // with audio
- } else if (participantFlags == 4) {
- // with video
- } else if (participantFlags == 7) {
- // video and audio
- }
-
- String userType = "";
+ Resources resources = NextcloudTalkApplication.getSharedApplication().getResources();
if (header == null) {
+ Participant.ParticipantFlags participantFlags = participant.getParticipantFlags();
+ switch (participantFlags) {
+ case NOT_IN_CALL:
+ holder.voiceOrSimpleCallImageView.setVisibility(View.GONE);
+ holder.videoCallImageView.setVisibility(View.GONE);
+ break;
+ case IN_CALL:
+ holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_call_bubble));
+ holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
+ holder.videoCallImageView.setVisibility(View.GONE);
+ break;
+ case IN_CALL_WITH_AUDIO:
+ holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_voice_bubble));
+ holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
+ holder.videoCallImageView.setVisibility(View.GONE);
+ break;
+ case IN_CALL_WITH_VIDEO:
+ holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_call_bubble));
+ holder.videoCallImageView.setBackground(resources.getDrawable(R.drawable.shape_video_bubble));
+ holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
+ holder.videoCallImageView.setVisibility(View.VISIBLE);
+ break;
+ case IN_CALL_WITH_AUDIO_AND_VIDEO:
+ holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_voice_bubble));
+ holder.videoCallImageView.setBackground(resources.getDrawable(R.drawable.shape_video_bubble));
+ holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
+ holder.videoCallImageView.setVisibility(View.VISIBLE);
+ break;
+ default:
+ holder.voiceOrSimpleCallImageView.setVisibility(View.GONE);
+ holder.videoCallImageView.setVisibility(View.GONE);
+ break;
+ }
+
+ String userType = "";
+
switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) {
case 1:
userType = NextcloudTalkApplication.getSharedApplication().getString(R.string.nc_owner);
@@ -210,11 +233,11 @@ public class UserItem extends AbstractFlexibleItem
userType = NextcloudTalkApplication.getSharedApplication().getString(R.string.nc_following_link);
break;
default:
- // do nothing
+ break;
}
holder.contactMentionId.setText(userType);
- holder.contactMentionId.setTextColor(NextcloudTalkApplication.getSharedApplication().getColor(R.color.colorPrimary));
+ holder.contactMentionId.setTextColor(NextcloudTalkApplication.getSharedApplication().getResources().getColor(R.color.colorPrimary));
}
}
@@ -244,6 +267,12 @@ public class UserItem extends AbstractFlexibleItem
@Nullable
@BindView(R.id.secondary_text)
public TextView contactMentionId;
+ @Nullable
+ @BindView(R.id.voiceOrSimpleCallImageView)
+ ImageView voiceOrSimpleCallImageView;
+ @Nullable
+ @BindView(R.id.videoCallImageView)
+ ImageView videoCallImageView;
/**
* Default constructor.
diff --git a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.java b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.java
index daab3ad7c..434f352af 100644
--- a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.java
+++ b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.java
@@ -50,7 +50,6 @@ import javax.inject.Singleton;
import androidx.lifecycle.LifecycleObserver;
import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
-import androidx.work.Configuration;
import androidx.work.OneTimeWorkRequest;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;
diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java
index 5abe89da7..0bb90d974 100644
--- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java
+++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java
@@ -216,7 +216,7 @@ public class CallNotificationController extends BaseController {
boolean inCallOnDifferentDevice = false;
List participantList = participantsOverall.getOcs().getData();
for (Participant participant : participantList) {
- if (participant.isInCall() || (userBeingCalled.hasSpreedCapabilityWithName("in-call-flags") && participant.getParticipantFlags() != 0)) {
+ if (participant.getParticipantFlags() != Participant.ParticipantFlags.NOT_IN_CALL) {
hasParticipantsInCall = true;
if (participant.getUserId().equals(userBeingCalled.getUserId())) {
@@ -436,38 +436,38 @@ public class CallNotificationController extends BaseController {
(getActivity()).getBitmapPool(), resource, avatarSize, avatarSize));
}
- if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 200 &&
- userBeingCalled.hasSpreedCapabilityWithName("no-ping")) {
- final Allocation input = Allocation.createFromBitmap(renderScript, resource);
- final Allocation output = Allocation.createTyped(renderScript, input.getType());
- final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(renderScript, Element
- .U8_4(renderScript));
- script.setRadius(15f);
- script.setInput(input);
- script.forEach(output);
- output.copyTo(resource);
+ if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 200 &&
+ userBeingCalled.hasSpreedCapabilityWithName("no-ping")) {
+ final Allocation input = Allocation.createFromBitmap(renderScript, resource);
+ final Allocation output = Allocation.createTyped(renderScript, input.getType());
+ final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(renderScript, Element
+ .U8_4(renderScript));
+ script.setRadius(15f);
+ script.setInput(input);
+ script.forEach(output);
+ output.copyTo(resource);
- if (getResources() != null) {
- incomingTextRelativeLayout.setBackground(getResources().getDrawable(R.drawable
- .incoming_gradient));
- constraintLayout.setBackground(new BitmapDrawable(resource));
+ if (getResources() != null) {
+ incomingTextRelativeLayout.setBackground(getResources().getDrawable(R.drawable
+ .incoming_gradient));
+ constraintLayout.setBackground(new BitmapDrawable(resource));
+ }
+ } else if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 201) {
+ Palette palette = Palette.from(resource).generate();
+ if (getResources() != null) {
+ int color = palette.getDominantColor(getResources().getColor(R.color.grey950));
+
+ if (color != getResources().getColor(R.color.grey950)) {
+ float[] hsv = new float[3];
+ Color.colorToHSV(color, hsv);
+ hsv[2] *= 0.75f;
+ color = Color.HSVToColor(hsv);
}
- } else if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 201) {
- Palette palette = Palette.from(resource).generate();
- if (getResources() != null) {
- int color = palette.getDominantColor(getResources().getColor(R.color.grey950));
- if (color != getResources().getColor(R.color.grey950)) {
- float[] hsv = new float[3];
- Color.colorToHSV(color, hsv);
- hsv[2] *= 0.75f;
- color = Color.HSVToColor(hsv);
- }
-
- constraintLayout.setBackgroundColor(color);
- }
+ constraintLayout.setBackgroundColor(color);
}
}
+ }
});
diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java
index 3a129e4db..ebe83ef68 100644
--- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java
+++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java
@@ -42,7 +42,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.controllers.base.BaseController;
import com.nextcloud.talk.models.database.UserEntity;
import com.nextcloud.talk.models.json.converters.EnumNotificationLevelConverter;
-import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
import com.nextcloud.talk.models.json.participants.Participant;
import com.nextcloud.talk.models.json.participants.ParticipantsOverall;
import com.nextcloud.talk.models.json.rooms.Conversation;
@@ -58,9 +57,6 @@ import com.yarolegovich.mp.MaterialPreferenceScreen;
import org.parceler.Parcels;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
import java.util.List;
import javax.inject.Inject;
diff --git a/app/src/main/java/com/nextcloud/talk/models/database/ArbitraryStorage.java b/app/src/main/java/com/nextcloud/talk/models/database/ArbitraryStorage.java
index 77ae21451..c095f0e53 100644
--- a/app/src/main/java/com/nextcloud/talk/models/database/ArbitraryStorage.java
+++ b/app/src/main/java/com/nextcloud/talk/models/database/ArbitraryStorage.java
@@ -26,7 +26,6 @@ import java.io.Serializable;
import io.requery.Entity;
import io.requery.Key;
-import io.requery.Nullable;
import io.requery.Persistable;
@Entity
diff --git a/app/src/main/java/com/nextcloud/talk/models/json/converters/ObjectParcelConverter.java b/app/src/main/java/com/nextcloud/talk/models/json/converters/ObjectParcelConverter.java
new file mode 100644
index 000000000..d536d8816
--- /dev/null
+++ b/app/src/main/java/com/nextcloud/talk/models/json/converters/ObjectParcelConverter.java
@@ -0,0 +1,38 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * Copyright (C) 2017-2018 Mario Danic
+ *
+ * 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 .
+ */
+
+package com.nextcloud.talk.models.json.converters;
+
+import android.os.Parcel;
+
+import org.parceler.ParcelConverter;
+import org.parceler.Parcels;
+
+public class ObjectParcelConverter implements ParcelConverter