mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-08 23:52:48 +00:00
Fix a few theming issues
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
b83931c13a
commit
95c0e2daff
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.adapters.items;
|
package com.nextcloud.talk.adapters.items;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -54,12 +55,15 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
private Participant participant;
|
private Participant participant;
|
||||||
private UserEntity userEntity;
|
private UserEntity userEntity;
|
||||||
private GenericTextHeaderItem header;
|
private GenericTextHeaderItem header;
|
||||||
|
private Context activityContext;
|
||||||
public boolean isOnline = true;
|
public boolean isOnline = true;
|
||||||
|
|
||||||
public UserItem(Participant participant, UserEntity userEntity, GenericTextHeaderItem genericTextHeaderItem) {
|
public UserItem(Participant participant, UserEntity userEntity,
|
||||||
|
GenericTextHeaderItem genericTextHeaderItem, Context activityContext) {
|
||||||
this.participant = participant;
|
this.participant = participant;
|
||||||
this.userEntity = userEntity;
|
this.userEntity = userEntity;
|
||||||
this.header = genericTextHeaderItem;
|
this.header = genericTextHeaderItem;
|
||||||
|
this.activityContext = activityContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -132,8 +136,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
|
|
||||||
if (adapter.hasFilter()) {
|
if (adapter.hasFilter()) {
|
||||||
FlexibleUtils.highlightText(holder.contactDisplayName, participant.getDisplayName(),
|
FlexibleUtils.highlightText(holder.contactDisplayName, participant.getDisplayName(),
|
||||||
String.valueOf(adapter.getFilter(String.class)), NextcloudTalkApplication.Companion.getSharedApplication()
|
String.valueOf(adapter.getFilter(String.class)), activityContext.getResources().getColor(R.color.colorPrimary));
|
||||||
.getResources().getColor(R.color.colorPrimary));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.contactDisplayName.setText(participant.getDisplayName());
|
holder.contactDisplayName.setText(participant.getDisplayName());
|
||||||
@ -146,8 +149,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
if (TextUtils.isEmpty(participant.getSource()) || participant.getSource().equals("users")) {
|
if (TextUtils.isEmpty(participant.getSource()) || participant.getSource().equals("users")) {
|
||||||
if (Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
if (Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
||||||
Participant.ParticipantType.USER_FOLLOWING_LINK.equals(participant.getType())) {
|
Participant.ParticipantType.USER_FOLLOWING_LINK.equals(participant.getType())) {
|
||||||
String displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
String displayName = NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_guest);
|
||||||
.getResources().getString(R.string.nc_guest);
|
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(participant.getDisplayName())) {
|
if (!TextUtils.isEmpty(participant.getDisplayName())) {
|
||||||
displayName = participant.getDisplayName();
|
displayName = participant.getDisplayName();
|
||||||
@ -173,10 +175,10 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else if ("groups".equals(participant.getSource())) {
|
} else if ("groups".equals(participant.getSource())) {
|
||||||
holder.simpleDraweeView.getHierarchy().setImage(new BitmapDrawable(DisplayUtils.getRoundedBitmapFromVectorDrawableResource(NextcloudTalkApplication.Companion.getSharedApplication().getResources(), R.drawable.ic_people_group_white_24px)), 100, true);
|
holder.simpleDraweeView.getHierarchy().setImage(new BitmapDrawable(DisplayUtils.getRoundedBitmapFromVectorDrawableResource(activityContext.getResources(), R.drawable.ic_people_group_white_24px)), 100, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Resources resources = NextcloudTalkApplication.Companion.getSharedApplication().getResources();
|
Resources resources = activityContext.getResources();
|
||||||
|
|
||||||
if (header == null) {
|
if (header == null) {
|
||||||
Participant.ParticipantFlags participantFlags = participant.getParticipantFlags();
|
Participant.ParticipantFlags participantFlags = participant.getParticipantFlags();
|
||||||
@ -184,7 +186,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
case NOT_IN_CALL:
|
case NOT_IN_CALL:
|
||||||
holder.voiceOrSimpleCallImageView.setVisibility(View.GONE);
|
holder.voiceOrSimpleCallImageView.setVisibility(View.GONE);
|
||||||
holder.videoCallImageView.setVisibility(View.GONE);
|
holder.videoCallImageView.setVisibility(View.GONE);
|
||||||
break;
|
//break;
|
||||||
case IN_CALL:
|
case IN_CALL:
|
||||||
holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_call_bubble));
|
holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_call_bubble));
|
||||||
holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
|
holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE);
|
||||||
@ -239,7 +241,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
|
|
||||||
if (!holder.contactMentionId.getText().equals(userType)) {
|
if (!holder.contactMentionId.getText().equals(userType)) {
|
||||||
holder.contactMentionId.setText(userType);
|
holder.contactMentionId.setText(userType);
|
||||||
holder.contactMentionId.setTextColor(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getColor(R.color.colorPrimary));
|
holder.contactMentionId.setTextColor(activityContext.getResources().getColor(R.color.colorPrimary));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -545,7 +545,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
participant.setUserId(sharee.getValue().getShareWith());
|
participant.setUserId(sharee.getValue().getShareWith());
|
||||||
|
|
||||||
UserItem newContactItem = new UserItem(participant, currentUser,
|
UserItem newContactItem = new UserItem(participant, currentUser,
|
||||||
userHeaderItems.get(headerTitle));
|
userHeaderItems.get(headerTitle), getActivity());
|
||||||
|
|
||||||
if (!contactItems.contains(newContactItem)) {
|
if (!contactItems.contains(newContactItem)) {
|
||||||
newUserItemList.add(newContactItem);
|
newUserItemList.add(newContactItem);
|
||||||
@ -582,7 +582,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
|
|
||||||
|
|
||||||
UserItem newContactItem = new UserItem(participant, currentUser,
|
UserItem newContactItem = new UserItem(participant, currentUser,
|
||||||
userHeaderItems.get(headerTitle));
|
userHeaderItems.get(headerTitle), getActivity());
|
||||||
|
|
||||||
if (!contactItems.contains(newContactItem)) {
|
if (!contactItems.contains(newContactItem)) {
|
||||||
newUserItemList.add(newContactItem);
|
newUserItemList.add(newContactItem);
|
||||||
|
@ -384,7 +384,7 @@ class ConversationInfoController(args: Bundle) : BaseController(), FlexibleAdapt
|
|||||||
|
|
||||||
for (i in participants.indices) {
|
for (i in participants.indices) {
|
||||||
participant = participants[i]
|
participant = participants[i]
|
||||||
userItem = UserItem(participant, conversationUser, null)
|
userItem = UserItem(participant, conversationUser, null, activity)
|
||||||
userItem.isOnline = !participant.sessionId.equals("0")
|
userItem.isOnline = !participant.sessionId.equals("0")
|
||||||
if (!TextUtils.isEmpty(participant.userId) && participant.userId == conversationUser!!.userId) {
|
if (!TextUtils.isEmpty(participant.userId) && participant.userId == conversationUser!!.userId) {
|
||||||
ownUserItem = userItem
|
ownUserItem = userItem
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
<!--
|
|
||||||
~ Nextcloud Talk application
|
|
||||||
~
|
|
||||||
~ @author Mario Danic
|
|
||||||
~ Copyright (C) 2017-2018 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/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector android:autoMirrored="true" android:height="24dp"
|
|
||||||
android:viewportHeight="24" android:viewportWidth="24"
|
|
||||||
android:width="20.57dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<path android:fillColor="#000000" android:fillType="nonZero"
|
|
||||||
android:pathData="M0.8571,0C0.3771,0 0,0.3771 0,0.8571L0,23.1429C0,23.6229 0.3771,24 0.8571,24L19.7143,24C20.1943,24 20.5714,23.6229 20.5714,23.1429L20.5714,5.1429L15.4286,0L0.8571,0ZM3.4286,3.4286L13.7143,3.4286L13.7143,5.1429L3.4286,5.1429L3.4286,3.4286ZM3.4286,8.5714L12,8.5714L12,10.2857L3.4286,10.2857L3.4286,8.5714ZM3.4286,13.7143L17.1429,13.7143L17.1429,15.4286L3.4286,15.4286L3.4286,13.7143ZM3.4286,18.8571L10.2857,18.8571L10.2857,20.5714L3.4286,20.5714L3.4286,18.8571Z"
|
|
||||||
android:strokeColor="#00000000" android:strokeWidth="1"/>
|
|
||||||
</vector>
|
|
@ -23,7 +23,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<shape
|
<shape
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/white"/>
|
<solid android:color="@color/bg_message_list_incoming_bubble"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:drawable="@drawable/ic_call_grey_600_24dp"/>
|
<item android:drawable="@drawable/ic_call_grey_600_24dp"/>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<shape
|
<shape
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/white"/>
|
<solid android:color="@color/bg_message_list_incoming_bubble"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:drawable="@drawable/ic_star_black_24dp" android:tint="@color/grey_600"/>
|
<item android:drawable="@drawable/ic_star_black_24dp" android:tint="@color/grey_600"/>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<shape
|
<shape
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/white"/>
|
<solid android:color="@color/bg_message_list_incoming_bubble"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:drawable="@drawable/ic_lock_grey600_24px"/>
|
<item android:drawable="@drawable/ic_lock_grey600_24px"/>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<shape
|
<shape
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/bg_default"/>
|
<solid android:color="@color/bg_message_list_incoming_bubble"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:drawable="@drawable/ic_videocam_grey_600_24dp"/>
|
<item android:drawable="@drawable/ic_videocam_grey_600_24dp"/>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<shape
|
<shape
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/bg_default"/>
|
<solid android:color="@color/bg_message_list_incoming_bubble"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:drawable="@drawable/ic_mic_grey_600_24dp"/>
|
<item android:drawable="@drawable/ic_mic_grey_600_24dp"/>
|
||||||
|
@ -32,13 +32,21 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginStart="@dimen/activity_horizontal_margin">
|
android:layout_marginStart="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
|
android:id="@+id/simple_drawee_view"
|
||||||
|
android:layout_width="@dimen/avatar_size"
|
||||||
|
android:layout_height="@dimen/avatar_size"
|
||||||
|
app:roundAsCircle="true"
|
||||||
|
tools:background="@tools:sample/avatars[1]"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/voiceOrSimpleCallImageView"
|
android:id="@+id/voiceOrSimpleCallImageView"
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:background="@drawable/shape_lock_bubble"
|
android:background="@drawable/shape_lock_bubble"
|
||||||
android:visibility="gone" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/videoCallImageView"
|
android:id="@+id/videoCallImageView"
|
||||||
@ -46,13 +54,8 @@
|
|||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:layout_gravity="top|end"
|
android:layout_gravity="top|end"
|
||||||
android:background="@drawable/shape_favorite_bubble"
|
android:background="@drawable/shape_favorite_bubble"
|
||||||
android:visibility="gone" />
|
android:visibility="visible" />
|
||||||
|
|
||||||
<com.facebook.drawee.view.SimpleDraweeView
|
|
||||||
android:id="@+id/simple_drawee_view"
|
|
||||||
android:layout_width="@dimen/avatar_size"
|
|
||||||
android:layout_height="@dimen/avatar_size"
|
|
||||||
app:roundAsCircle="true" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user