Improved avatar in call related code
This commit is contained in:
parent
4537c52346
commit
86e8b49460
26 changed files with 206 additions and 128 deletions
|
@ -87,9 +87,9 @@ import org.linphone.fragments.StatusFragment;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.receivers.BluetoothManager;
|
import org.linphone.receivers.BluetoothManager;
|
||||||
import org.linphone.settings.LinphonePreferences;
|
import org.linphone.settings.LinphonePreferences;
|
||||||
import org.linphone.utils.ImageUtils;
|
|
||||||
import org.linphone.utils.LinphoneGenericActivity;
|
import org.linphone.utils.LinphoneGenericActivity;
|
||||||
import org.linphone.utils.LinphoneUtils;
|
import org.linphone.utils.LinphoneUtils;
|
||||||
|
import org.linphone.views.ContactAvatar;
|
||||||
import org.linphone.views.Numpad;
|
import org.linphone.views.Numpad;
|
||||||
|
|
||||||
public class CallActivity extends LinphoneGenericActivity
|
public class CallActivity extends LinphoneGenericActivity
|
||||||
|
@ -119,7 +119,6 @@ public class CallActivity extends LinphoneGenericActivity
|
||||||
mTransfer,
|
mTransfer,
|
||||||
mConference,
|
mConference,
|
||||||
mConferenceStatus,
|
mConferenceStatus,
|
||||||
mContactPicture,
|
|
||||||
mRecordCall,
|
mRecordCall,
|
||||||
mRecording;
|
mRecording;
|
||||||
private ImageView mAudioRoute, mRouteSpeaker, mRouteEarpiece, mRouteBluetooth, mMenu, mChat;
|
private ImageView mAudioRoute, mRouteSpeaker, mRouteEarpiece, mRouteBluetooth, mMenu, mChat;
|
||||||
|
@ -425,7 +424,6 @@ public class CallActivity extends LinphoneGenericActivity
|
||||||
mNoCurrentCall = findViewById(R.id.no_current_call);
|
mNoCurrentCall = findViewById(R.id.no_current_call);
|
||||||
mCallPaused = findViewById(R.id.remote_pause);
|
mCallPaused = findViewById(R.id.remote_pause);
|
||||||
|
|
||||||
mContactPicture = findViewById(R.id.contact_picture);
|
|
||||||
mAvatarLayout = findViewById(R.id.avatar_layout);
|
mAvatarLayout = findViewById(R.id.avatar_layout);
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
|
@ -1423,7 +1421,7 @@ public class CallActivity extends LinphoneGenericActivity
|
||||||
private void displayCurrentCall(Call call) {
|
private void displayCurrentCall(Call call) {
|
||||||
Address lAddress = call.getRemoteAddress();
|
Address lAddress = call.getRemoteAddress();
|
||||||
TextView contactName = findViewById(R.id.current_contact_name);
|
TextView contactName = findViewById(R.id.current_contact_name);
|
||||||
setContactInformation(contactName, mContactPicture, lAddress);
|
setContactInformation(contactName, lAddress);
|
||||||
registerCallDurationTimer(null, call);
|
registerCallDurationTimer(null, call);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1449,29 +1447,35 @@ public class CallActivity extends LinphoneGenericActivity
|
||||||
callView.setId(index + 1);
|
callView.setId(index + 1);
|
||||||
|
|
||||||
TextView contactName = callView.findViewById(R.id.contact_name);
|
TextView contactName = callView.findViewById(R.id.contact_name);
|
||||||
ImageView contactImage = callView.findViewById(R.id.contact_picture);
|
|
||||||
|
|
||||||
Address lAddress = call.getRemoteAddress();
|
Address lAddress = call.getRemoteAddress();
|
||||||
setContactInformation(contactName, contactImage, lAddress);
|
LinphoneContact lContact =
|
||||||
|
ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
|
|
||||||
|
if (lContact == null) {
|
||||||
|
String displayName = LinphoneUtils.getAddressDisplayName(lAddress);
|
||||||
|
contactName.setText(displayName);
|
||||||
|
ContactAvatar.displayAvatar(displayName, callView.findViewById(R.id.avatar_layout));
|
||||||
|
} else {
|
||||||
|
contactName.setText(lContact.getFullName());
|
||||||
|
ContactAvatar.displayAvatar(lContact, callView.findViewById(R.id.avatar_layout));
|
||||||
|
}
|
||||||
|
|
||||||
displayCallStatusIconAndReturnCallPaused(callView, call);
|
displayCallStatusIconAndReturnCallPaused(callView, call);
|
||||||
registerCallDurationTimer(callView, call);
|
registerCallDurationTimer(callView, call);
|
||||||
}
|
}
|
||||||
mCallsList.addView(callView);
|
mCallsList.addView(callView);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setContactInformation(
|
private void setContactInformation(TextView contactName, Address lAddress) {
|
||||||
TextView contactName, ImageView contactPicture, Address lAddress) {
|
|
||||||
LinphoneContact lContact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
LinphoneContact lContact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||||
if (lContact == null) {
|
if (lContact == null) {
|
||||||
contactName.setText(LinphoneUtils.getAddressDisplayName(lAddress));
|
String displayName = LinphoneUtils.getAddressDisplayName(lAddress);
|
||||||
ImageUtils.setDefaultContactImage(contactPicture);
|
contactName.setText(displayName);
|
||||||
|
ContactAvatar.displayAvatar(displayName, mAvatarLayout, R.drawable.avatar_mask_border);
|
||||||
} else {
|
} else {
|
||||||
contactName.setText(lContact.getFullName());
|
contactName.setText(lContact.getFullName());
|
||||||
ImageUtils.setImagePictureFromUri(
|
ContactAvatar.displayAvatar(lContact, mAvatarLayout, R.drawable.avatar_mask_border);
|
||||||
contactPicture.getContext(),
|
|
||||||
contactPicture,
|
|
||||||
lContact.getPhotoUri(),
|
|
||||||
lContact.getThumbnailUri());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,18 +45,18 @@ import org.linphone.core.Core;
|
||||||
import org.linphone.core.CoreListenerStub;
|
import org.linphone.core.CoreListenerStub;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
import org.linphone.settings.LinphonePreferences;
|
import org.linphone.settings.LinphonePreferences;
|
||||||
import org.linphone.utils.ImageUtils;
|
|
||||||
import org.linphone.utils.LinphoneGenericActivity;
|
import org.linphone.utils.LinphoneGenericActivity;
|
||||||
import org.linphone.utils.LinphoneUtils;
|
import org.linphone.utils.LinphoneUtils;
|
||||||
import org.linphone.views.CallIncomingAnswerButton;
|
import org.linphone.views.CallIncomingAnswerButton;
|
||||||
import org.linphone.views.CallIncomingButtonListener;
|
import org.linphone.views.CallIncomingButtonListener;
|
||||||
import org.linphone.views.CallIncomingDeclineButton;
|
import org.linphone.views.CallIncomingDeclineButton;
|
||||||
|
import org.linphone.views.ContactAvatar;
|
||||||
|
|
||||||
public class CallIncomingActivity extends LinphoneGenericActivity {
|
public class CallIncomingActivity extends LinphoneGenericActivity {
|
||||||
private static CallIncomingActivity sInstance;
|
private static CallIncomingActivity sInstance;
|
||||||
|
|
||||||
private TextView mName, mNumber;
|
private TextView mName, mNumber;
|
||||||
private ImageView mContactPicture, mAcceptIcon;
|
private ImageView mAcceptIcon;
|
||||||
private CallIncomingAnswerButton mAccept;
|
private CallIncomingAnswerButton mAccept;
|
||||||
private CallIncomingDeclineButton mDecline;
|
private CallIncomingDeclineButton mDecline;
|
||||||
private Call mCall;
|
private Call mCall;
|
||||||
|
@ -85,7 +85,6 @@ public class CallIncomingActivity extends LinphoneGenericActivity {
|
||||||
|
|
||||||
mName = findViewById(R.id.contact_name);
|
mName = findViewById(R.id.contact_name);
|
||||||
mNumber = findViewById(R.id.contact_number);
|
mNumber = findViewById(R.id.contact_number);
|
||||||
mContactPicture = findViewById(R.id.contact_picture);
|
|
||||||
|
|
||||||
// set this flag so this activity will stay in front of the keyguard
|
// set this flag so this activity will stay in front of the keyguard
|
||||||
int flags =
|
int flags =
|
||||||
|
@ -187,11 +186,14 @@ public class CallIncomingActivity extends LinphoneGenericActivity {
|
||||||
Address address = mCall.getRemoteAddress();
|
Address address = mCall.getRemoteAddress();
|
||||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
ImageUtils.setImagePictureFromUri(
|
ContactAvatar.displayAvatar(
|
||||||
this, mContactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
contact, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||||
mName.setText(contact.getFullName());
|
mName.setText(contact.getFullName());
|
||||||
} else {
|
} else {
|
||||||
mName.setText(LinphoneUtils.getAddressDisplayName(address));
|
String displayName = LinphoneUtils.getAddressDisplayName(address);
|
||||||
|
ContactAvatar.displayAvatar(
|
||||||
|
displayName, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||||
|
mName.setText(displayName);
|
||||||
}
|
}
|
||||||
mNumber.setText(address.asStringUriOnly());
|
mNumber.setText(address.asStringUriOnly());
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,13 +48,13 @@ import org.linphone.core.CoreListenerStub;
|
||||||
import org.linphone.core.Reason;
|
import org.linphone.core.Reason;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
import org.linphone.settings.LinphonePreferences;
|
import org.linphone.settings.LinphonePreferences;
|
||||||
import org.linphone.utils.ImageUtils;
|
|
||||||
import org.linphone.utils.LinphoneGenericActivity;
|
import org.linphone.utils.LinphoneGenericActivity;
|
||||||
import org.linphone.utils.LinphoneUtils;
|
import org.linphone.utils.LinphoneUtils;
|
||||||
|
import org.linphone.views.ContactAvatar;
|
||||||
|
|
||||||
public class CallOutgoingActivity extends LinphoneGenericActivity implements OnClickListener {
|
public class CallOutgoingActivity extends LinphoneGenericActivity implements OnClickListener {
|
||||||
private TextView mName, mNumber;
|
private TextView mName, mNumber;
|
||||||
private ImageView mContactPicture, mMicro, mSpeaker, mHangUp;
|
private ImageView mMicro, mSpeaker, mHangUp;
|
||||||
private Call mCall;
|
private Call mCall;
|
||||||
private CoreListenerStub mListener;
|
private CoreListenerStub mListener;
|
||||||
private boolean mIsMicMuted, mIsSpeakerEnabled;
|
private boolean mIsMicMuted, mIsSpeakerEnabled;
|
||||||
|
@ -72,7 +72,6 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
|
||||||
|
|
||||||
mName = findViewById(R.id.contact_name);
|
mName = findViewById(R.id.contact_name);
|
||||||
mNumber = findViewById(R.id.contact_number);
|
mNumber = findViewById(R.id.contact_number);
|
||||||
mContactPicture = findViewById(R.id.contact_picture);
|
|
||||||
|
|
||||||
mIsMicMuted = false;
|
mIsMicMuted = false;
|
||||||
mIsSpeakerEnabled = false;
|
mIsSpeakerEnabled = false;
|
||||||
|
@ -186,11 +185,14 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
|
||||||
Address address = mCall.getRemoteAddress();
|
Address address = mCall.getRemoteAddress();
|
||||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||||
if (contact != null) {
|
if (contact != null) {
|
||||||
ImageUtils.setImagePictureFromUri(
|
ContactAvatar.displayAvatar(
|
||||||
this, mContactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
contact, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||||
mName.setText(contact.getFullName());
|
mName.setText(contact.getFullName());
|
||||||
} else {
|
} else {
|
||||||
mName.setText(LinphoneUtils.getAddressDisplayName(address));
|
String displayName = LinphoneUtils.getAddressDisplayName(address);
|
||||||
|
ContactAvatar.displayAvatar(
|
||||||
|
displayName, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||||
|
mName.setText(displayName);
|
||||||
}
|
}
|
||||||
mNumber.setText(LinphoneUtils.getDisplayableAddress(address));
|
mNumber.setText(LinphoneUtils.getDisplayableAddress(address));
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,6 @@ public class ChatMessagesOldAdapter extends SelectableAdapter<ChatMessageOldView
|
||||||
holder.fileTransferAction, mContext, R.style.font15);
|
holder.fileTransferAction, mContext, R.style.font15);
|
||||||
holder.fileTransferAction.setBackgroundResource(
|
holder.fileTransferAction.setBackgroundResource(
|
||||||
R.drawable.resizable_confirm_delete_button);
|
R.drawable.resizable_confirm_delete_button);
|
||||||
ContactAvatar.setAvatarMask(holder.avatarLayout, R.drawable.avatar_mask);
|
|
||||||
} else {
|
} else {
|
||||||
for (LinphoneContact c : mParticipants) {
|
for (LinphoneContact c : mParticipants) {
|
||||||
if (c != null && c.hasAddress(remoteSender.asStringUriOnly())) {
|
if (c != null && c.hasAddress(remoteSender.asStringUriOnly())) {
|
||||||
|
@ -291,7 +290,6 @@ public class ChatMessagesOldAdapter extends SelectableAdapter<ChatMessageOldView
|
||||||
Compatibility.setTextAppearance(holder.fileTransferAction, mContext, R.style.font8);
|
Compatibility.setTextAppearance(holder.fileTransferAction, mContext, R.style.font8);
|
||||||
holder.fileTransferAction.setBackgroundResource(
|
holder.fileTransferAction.setBackgroundResource(
|
||||||
R.drawable.resizable_assistant_button);
|
R.drawable.resizable_assistant_button);
|
||||||
ContactAvatar.setAvatarMask(holder.avatarLayout, R.drawable.avatar_mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contact == null) {
|
if (contact == null) {
|
||||||
|
|
|
@ -148,7 +148,6 @@ public class ImdnOldFragment extends Fragment {
|
||||||
mBubble.fileTransferAction, getActivity(), R.style.font15);
|
mBubble.fileTransferAction, getActivity(), R.style.font15);
|
||||||
mBubble.fileTransferAction.setBackgroundResource(
|
mBubble.fileTransferAction.setBackgroundResource(
|
||||||
R.drawable.resizable_confirm_delete_button);
|
R.drawable.resizable_confirm_delete_button);
|
||||||
ContactAvatar.setAvatarMask(mBubble.avatarLayout, R.drawable.avatar_chat_mask_outgoing);
|
|
||||||
} else {
|
} else {
|
||||||
mBubble.background.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
mBubble.background.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
||||||
Compatibility.setTextAppearance(
|
Compatibility.setTextAppearance(
|
||||||
|
@ -156,7 +155,6 @@ public class ImdnOldFragment extends Fragment {
|
||||||
Compatibility.setTextAppearance(
|
Compatibility.setTextAppearance(
|
||||||
mBubble.fileTransferAction, getActivity(), R.style.font8);
|
mBubble.fileTransferAction, getActivity(), R.style.font8);
|
||||||
mBubble.fileTransferAction.setBackgroundResource(R.drawable.resizable_assistant_button);
|
mBubble.fileTransferAction.setBackgroundResource(R.drawable.resizable_assistant_button);
|
||||||
ContactAvatar.setAvatarMask(mBubble.avatarLayout, R.drawable.avatar_mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
|
|
@ -96,12 +96,7 @@ public class ContactAvatar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAvatarMask(View v, int resourceId) {
|
public static void displayAvatar(String displayName, View v, int maskResource) {
|
||||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
|
||||||
holder.avatarMask.setImageResource(resourceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void displayAvatar(String displayName, View v) {
|
|
||||||
if (displayName == null || v == null) return;
|
if (displayName == null || v == null) return;
|
||||||
|
|
||||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||||
|
@ -112,10 +107,23 @@ public class ContactAvatar {
|
||||||
// +...
|
// +...
|
||||||
holder.generatedAvatar.setVisibility(View.GONE);
|
holder.generatedAvatar.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
holder.generatedAvatar.setText(generateAvatar(displayName));
|
String generatedAvatar = generateAvatar(displayName);
|
||||||
holder.generatedAvatar.setVisibility(View.VISIBLE);
|
if (generatedAvatar != null && generatedAvatar.length() > 0) {
|
||||||
|
holder.generatedAvatar.setText(generatedAvatar);
|
||||||
|
holder.generatedAvatar.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.generatedAvatar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
holder.securityLevel.setVisibility(View.GONE);
|
holder.securityLevel.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (maskResource != 0) {
|
||||||
|
holder.avatarMask.setImageResource(maskResource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void displayAvatar(String displayName, View v) {
|
||||||
|
displayAvatar(displayName, v, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayAvatar(
|
public static void displayAvatar(
|
||||||
|
@ -124,7 +132,7 @@ public class ContactAvatar {
|
||||||
setSecurityLevel(securityLevel, v);
|
setSecurityLevel(securityLevel, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayAvatar(LinphoneContact contact, View v) {
|
public static void displayAvatar(LinphoneContact contact, View v, int maskResource) {
|
||||||
if (contact == null || v == null) return;
|
if (contact == null || v == null) return;
|
||||||
|
|
||||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||||
|
@ -162,6 +170,14 @@ public class ContactAvatar {
|
||||||
: contact.getFullName()));
|
: contact.getFullName()));
|
||||||
holder.generatedAvatar.setVisibility(View.VISIBLE);
|
holder.generatedAvatar.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (maskResource != 0) {
|
||||||
|
holder.avatarMask.setImageResource(maskResource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void displayAvatar(LinphoneContact contact, View v) {
|
||||||
|
displayAvatar(contact, v, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayAvatar(
|
public static void displayAvatar(
|
||||||
|
|
4
app/src/main/res/drawable-xhdpi/.directory
Normal file
4
app/src/main/res/drawable-xhdpi/.directory
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[Dolphin]
|
||||||
|
PreviewsShown=true
|
||||||
|
Timestamp=2019,3,5,11,4,59
|
||||||
|
Version=4
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB |
|
@ -8,6 +8,10 @@
|
||||||
<bitmap android:src="@drawable/camera_default"
|
<bitmap android:src="@drawable/camera_default"
|
||||||
android:tint="?attr/drawableTintDisabledColor"/>
|
android:tint="?attr/drawableTintDisabledColor"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<bitmap android:src="@drawable/camera_default"
|
||||||
|
android:tint="?attr/drawableTintOverColor"/>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<bitmap android:src="@drawable/camera_default"
|
<bitmap android:src="@drawable/camera_default"
|
||||||
android:tint="?attr/drawableTintColor"/>
|
android:tint="?attr/drawableTintColor"/>
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
<bitmap android:src="@drawable/options_default"
|
<bitmap android:src="@drawable/options_default"
|
||||||
android:tint="?attr/drawableTintDisabledColor"/>
|
android:tint="?attr/drawableTintDisabledColor"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<bitmap android:src="@drawable/options_default"
|
||||||
|
android:tint="?attr/drawableTintOverColor"/>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<bitmap android:src="@drawable/options_default"
|
<bitmap android:src="@drawable/options_default"
|
||||||
android:tint="?attr/drawableTintColor"/>
|
android:tint="?attr/drawableTintColor"/>
|
||||||
|
|
|
@ -80,21 +80,7 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<include layout="@layout/contact_avatar_200" />
|
||||||
android:id="@+id/contact_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mask"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar_mask_border" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -81,21 +81,7 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<include layout="@layout/contact_avatar_200" />
|
||||||
android:id="@+id/contact_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mask"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar_mask_border" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,20 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:alpha="0.5"
|
android:background="?attr/accentColor50"
|
||||||
android:background="?attr/accentColor"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp">
|
android:padding="5dp">
|
||||||
|
|
||||||
<ImageView
|
<RelativeLayout
|
||||||
android:id="@+id/contact_picture"
|
android:id="@+id/avatar_layout"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@drawable/avatar" />
|
android:gravity="center">
|
||||||
|
|
||||||
|
<include layout="@layout/contact_avatar_call_paused" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/contact_name"
|
android:id="@+id/contact_name"
|
||||||
|
|
|
@ -67,20 +67,7 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<include layout="@layout/contact_avatar_200" />
|
||||||
android:id="@+id/contact_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:src="@drawable/avatar_mask_border"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -68,20 +68,7 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<include layout="@layout/contact_avatar_200" />
|
||||||
android:id="@+id/contact_picture"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:src="@drawable/avatar" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:src="@drawable/avatar_mask_border" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<include layout="@layout/contact_avatar_big" />
|
<include layout="@layout/contact_avatar_100" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -12,15 +12,6 @@
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/avatar" />
|
android:src="@drawable/avatar" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mask"
|
|
||||||
android:layout_width="35dp"
|
|
||||||
android:layout_height="35dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:tint="?attr/backgroundColor"
|
|
||||||
android:src="@drawable/avatar_mask" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/generated_avatar"
|
android:id="@+id/generated_avatar"
|
||||||
style="@style/generated_contact_avatar_font"
|
style="@style/generated_contact_avatar_font"
|
||||||
|
@ -31,6 +22,14 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1" />
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar_mask" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/security_level"
|
android:id="@+id/security_level"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
|
|
|
@ -12,18 +12,9 @@
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/avatar" />
|
android:src="@drawable/avatar" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mask"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:tint="?attr/backgroundColor"
|
|
||||||
android:src="@drawable/avatar_mask" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/generated_avatar"
|
android:id="@+id/generated_avatar"
|
||||||
style="@style/generated_contact_avatar_big_font"
|
style="@style/generated_contact_avatar_100_font"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
@ -31,6 +22,14 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1" />
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar_mask" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/security_level"
|
android:id="@+id/security_level"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
42
app/src/main/res/layout/contact_avatar_200.xml
Normal file
42
app/src/main/res/layout/contact_avatar_200.xml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/avatar_layout"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/contact_picture"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/generated_avatar"
|
||||||
|
style="@style/generated_contact_avatar_100_font"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:background="@drawable/generated_avatar_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar_mask" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/security_level"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:src="@drawable/security_alert_indicator"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
43
app/src/main/res/layout/contact_avatar_call_paused.xml
Normal file
43
app/src/main/res/layout/contact_avatar_call_paused.xml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/avatar_layout"
|
||||||
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="35dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/contact_picture"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/generated_avatar"
|
||||||
|
style="@style/generated_contact_avatar_font"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:background="@drawable/generated_avatar_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/avatar_mask"
|
||||||
|
android:tint="?attr/accentColor50"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/security_level"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:src="@drawable/security_alert_indicator"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
|
@ -73,7 +73,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<include layout="@layout/contact_avatar_big" />
|
<include layout="@layout/contact_avatar_100" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<include layout="@layout/contact_avatar_big"/>
|
<include layout="@layout/contact_avatar_100"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
android:id="@+id/toastRoot"
|
android:id="@+id/toastRoot"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/backgroundColor"
|
android:background="?attr/backgroundContastColor"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -12,6 +12,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="?attr/primaryTextColor" />
|
android:textColor="?attr/secondaryTextColor" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<declare-styleable name="LinphoneAppTheme">
|
<declare-styleable name="LinphoneAppTheme">
|
||||||
<attr name="accentColor" format="color"/>
|
<attr name="accentColor" format="color"/>
|
||||||
|
<attr name="accentColor50" format="color"/>
|
||||||
|
|
||||||
<attr name="accentTextColor" format="color"/>
|
<attr name="accentTextColor" format="color"/>
|
||||||
<attr name="primaryTextColor" format="color"/>
|
<attr name="primaryTextColor" format="color"/>
|
||||||
|
@ -10,6 +11,7 @@
|
||||||
<attr name="primarySubtextLightColor" format="color"/>
|
<attr name="primarySubtextLightColor" format="color"/>
|
||||||
|
|
||||||
<attr name="backgroundColor" format="color"/>
|
<attr name="backgroundColor" format="color"/>
|
||||||
|
<attr name="backgroundContastColor" format="color"/>
|
||||||
<attr name="dividerColor" format="color"/>
|
<attr name="dividerColor" format="color"/>
|
||||||
|
|
||||||
<attr name="drawableTintColor" format="color"/>
|
<attr name="drawableTintColor" format="color"/>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<color name="colorA">#ff5e00</color>
|
<color name="colorA">#ff5e00</color>
|
||||||
<!-- You can use https://material.io/design/color/#tools-for-picking-colors to get dark color value from primary -->
|
<!-- You can use https://material.io/design/color/#tools-for-picking-colors to get dark color value from primary -->
|
||||||
<color name="colorADark">#e65000</color>
|
<color name="colorADark">#e65000</color>
|
||||||
|
<color name="colorA50">#80ff5e00</color>
|
||||||
<color name="colorB">#000000</color>
|
<color name="colorB">#000000</color>
|
||||||
<color name="colorC">#444444</color>
|
<color name="colorC">#444444</color>
|
||||||
<color name="colorD">#808080</color>
|
<color name="colorD">#808080</color>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<item name="android:textColorPrimaryInverse">@color/colorH</item>
|
<item name="android:textColorPrimaryInverse">@color/colorH</item>
|
||||||
|
|
||||||
<item name="accentColor">@color/colorA</item>
|
<item name="accentColor">@color/colorA</item>
|
||||||
|
<item name="accentColor50">@color/colorA50</item>
|
||||||
<item name="accentTextColor">@color/colorH</item>
|
<item name="accentTextColor">@color/colorH</item>
|
||||||
<item name="primaryTextColor">@color/colorC</item>
|
<item name="primaryTextColor">@color/colorC</item>
|
||||||
<item name="secondaryTextColor">@color/colorH</item>
|
<item name="secondaryTextColor">@color/colorH</item>
|
||||||
|
@ -18,6 +19,7 @@
|
||||||
<item name="primarySubtextLightColor">@color/colorE</item>
|
<item name="primarySubtextLightColor">@color/colorE</item>
|
||||||
|
|
||||||
<item name="backgroundColor">@color/colorH</item>
|
<item name="backgroundColor">@color/colorH</item>
|
||||||
|
<item name="backgroundContastColor">@color/colorC</item>
|
||||||
<item name="dividerColor">@color/colorE</item>
|
<item name="dividerColor">@color/colorE</item>
|
||||||
|
|
||||||
<item name="drawableTintColor">@color/colorC</item>
|
<item name="drawableTintColor">@color/colorC</item>
|
||||||
|
@ -42,6 +44,8 @@
|
||||||
<item name="android:colorBackground">@color/colorC</item>
|
<item name="android:colorBackground">@color/colorC</item>
|
||||||
<item name="android:textColorPrimaryInverse">@color/colorC</item>
|
<item name="android:textColorPrimaryInverse">@color/colorC</item>
|
||||||
|
|
||||||
|
<item name="accentColor">@color/colorA</item>
|
||||||
|
<item name="accentColor50">@color/colorA50</item>
|
||||||
<item name="accentTextColor">@color/colorH</item>
|
<item name="accentTextColor">@color/colorH</item>
|
||||||
<item name="primaryTextColor">@color/colorH</item>
|
<item name="primaryTextColor">@color/colorH</item>
|
||||||
<item name="secondaryTextColor">@color/colorC</item>
|
<item name="secondaryTextColor">@color/colorC</item>
|
||||||
|
@ -49,6 +53,7 @@
|
||||||
<item name="primarySubtextLightColor">@color/colorF</item>
|
<item name="primarySubtextLightColor">@color/colorF</item>
|
||||||
|
|
||||||
<item name="backgroundColor">@color/colorC</item>
|
<item name="backgroundColor">@color/colorC</item>
|
||||||
|
<item name="backgroundContastColor">@color/colorH</item>
|
||||||
<item name="dividerColor">@color/colorE</item>
|
<item name="dividerColor">@color/colorE</item>
|
||||||
|
|
||||||
<item name="drawableTintColor">@color/colorH</item>
|
<item name="drawableTintColor">@color/colorH</item>
|
||||||
|
@ -256,12 +261,18 @@
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="generated_contact_avatar_big_font" parent="@android:style/TextAppearance.Large">
|
<style name="generated_contact_avatar_100_font" parent="@android:style/TextAppearance.Large">
|
||||||
<item name="android:textColor">?attr/secondaryTextColor</item>
|
<item name="android:textColor">?attr/secondaryTextColor</item>
|
||||||
<item name="android:textSize">70sp</item>
|
<item name="android:textSize">70sp</item>
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="generated_contact_avatar_200_font" parent="@android:style/TextAppearance.Large">
|
||||||
|
<item name="android:textColor">?attr/secondaryTextColor</item>
|
||||||
|
<item name="android:textSize">1500sp</item>
|
||||||
|
<item name="android:textStyle">bold</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="imdn_read_font" parent="@android:style/TextAppearance.Medium">
|
<style name="imdn_read_font" parent="@android:style/TextAppearance.Medium">
|
||||||
<item name="android:textColor">@color/colorK</item>
|
<item name="android:textColor">@color/colorK</item>
|
||||||
<item name="android:textSize">15sp</item>
|
<item name="android:textSize">15sp</item>
|
||||||
|
|
Loading…
Reference in a new issue