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.receivers.BluetoothManager;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.utils.ImageUtils;
|
||||
import org.linphone.utils.LinphoneGenericActivity;
|
||||
import org.linphone.utils.LinphoneUtils;
|
||||
import org.linphone.views.ContactAvatar;
|
||||
import org.linphone.views.Numpad;
|
||||
|
||||
public class CallActivity extends LinphoneGenericActivity
|
||||
|
@ -119,7 +119,6 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
mTransfer,
|
||||
mConference,
|
||||
mConferenceStatus,
|
||||
mContactPicture,
|
||||
mRecordCall,
|
||||
mRecording;
|
||||
private ImageView mAudioRoute, mRouteSpeaker, mRouteEarpiece, mRouteBluetooth, mMenu, mChat;
|
||||
|
@ -425,7 +424,6 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
mNoCurrentCall = findViewById(R.id.no_current_call);
|
||||
mCallPaused = findViewById(R.id.remote_pause);
|
||||
|
||||
mContactPicture = findViewById(R.id.contact_picture);
|
||||
mAvatarLayout = findViewById(R.id.avatar_layout);
|
||||
|
||||
// Options
|
||||
|
@ -1423,7 +1421,7 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
private void displayCurrentCall(Call call) {
|
||||
Address lAddress = call.getRemoteAddress();
|
||||
TextView contactName = findViewById(R.id.current_contact_name);
|
||||
setContactInformation(contactName, mContactPicture, lAddress);
|
||||
setContactInformation(contactName, lAddress);
|
||||
registerCallDurationTimer(null, call);
|
||||
}
|
||||
|
||||
|
@ -1449,29 +1447,35 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
callView.setId(index + 1);
|
||||
|
||||
TextView contactName = callView.findViewById(R.id.contact_name);
|
||||
ImageView contactImage = callView.findViewById(R.id.contact_picture);
|
||||
|
||||
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);
|
||||
registerCallDurationTimer(callView, call);
|
||||
}
|
||||
mCallsList.addView(callView);
|
||||
}
|
||||
|
||||
private void setContactInformation(
|
||||
TextView contactName, ImageView contactPicture, Address lAddress) {
|
||||
private void setContactInformation(TextView contactName, Address lAddress) {
|
||||
LinphoneContact lContact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||
if (lContact == null) {
|
||||
contactName.setText(LinphoneUtils.getAddressDisplayName(lAddress));
|
||||
ImageUtils.setDefaultContactImage(contactPicture);
|
||||
String displayName = LinphoneUtils.getAddressDisplayName(lAddress);
|
||||
contactName.setText(displayName);
|
||||
ContactAvatar.displayAvatar(displayName, mAvatarLayout, R.drawable.avatar_mask_border);
|
||||
} else {
|
||||
contactName.setText(lContact.getFullName());
|
||||
ImageUtils.setImagePictureFromUri(
|
||||
contactPicture.getContext(),
|
||||
contactPicture,
|
||||
lContact.getPhotoUri(),
|
||||
lContact.getThumbnailUri());
|
||||
ContactAvatar.displayAvatar(lContact, mAvatarLayout, R.drawable.avatar_mask_border);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,18 +45,18 @@ import org.linphone.core.Core;
|
|||
import org.linphone.core.CoreListenerStub;
|
||||
import org.linphone.core.tools.Log;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.utils.ImageUtils;
|
||||
import org.linphone.utils.LinphoneGenericActivity;
|
||||
import org.linphone.utils.LinphoneUtils;
|
||||
import org.linphone.views.CallIncomingAnswerButton;
|
||||
import org.linphone.views.CallIncomingButtonListener;
|
||||
import org.linphone.views.CallIncomingDeclineButton;
|
||||
import org.linphone.views.ContactAvatar;
|
||||
|
||||
public class CallIncomingActivity extends LinphoneGenericActivity {
|
||||
private static CallIncomingActivity sInstance;
|
||||
|
||||
private TextView mName, mNumber;
|
||||
private ImageView mContactPicture, mAcceptIcon;
|
||||
private ImageView mAcceptIcon;
|
||||
private CallIncomingAnswerButton mAccept;
|
||||
private CallIncomingDeclineButton mDecline;
|
||||
private Call mCall;
|
||||
|
@ -85,7 +85,6 @@ public class CallIncomingActivity extends LinphoneGenericActivity {
|
|||
|
||||
mName = findViewById(R.id.contact_name);
|
||||
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
|
||||
int flags =
|
||||
|
@ -187,11 +186,14 @@ public class CallIncomingActivity extends LinphoneGenericActivity {
|
|||
Address address = mCall.getRemoteAddress();
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
if (contact != null) {
|
||||
ImageUtils.setImagePictureFromUri(
|
||||
this, mContactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
ContactAvatar.displayAvatar(
|
||||
contact, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||
mName.setText(contact.getFullName());
|
||||
} 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());
|
||||
}
|
||||
|
|
|
@ -48,13 +48,13 @@ import org.linphone.core.CoreListenerStub;
|
|||
import org.linphone.core.Reason;
|
||||
import org.linphone.core.tools.Log;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
import org.linphone.utils.ImageUtils;
|
||||
import org.linphone.utils.LinphoneGenericActivity;
|
||||
import org.linphone.utils.LinphoneUtils;
|
||||
import org.linphone.views.ContactAvatar;
|
||||
|
||||
public class CallOutgoingActivity extends LinphoneGenericActivity implements OnClickListener {
|
||||
private TextView mName, mNumber;
|
||||
private ImageView mContactPicture, mMicro, mSpeaker, mHangUp;
|
||||
private ImageView mMicro, mSpeaker, mHangUp;
|
||||
private Call mCall;
|
||||
private CoreListenerStub mListener;
|
||||
private boolean mIsMicMuted, mIsSpeakerEnabled;
|
||||
|
@ -72,7 +72,6 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
|
|||
|
||||
mName = findViewById(R.id.contact_name);
|
||||
mNumber = findViewById(R.id.contact_number);
|
||||
mContactPicture = findViewById(R.id.contact_picture);
|
||||
|
||||
mIsMicMuted = false;
|
||||
mIsSpeakerEnabled = false;
|
||||
|
@ -186,11 +185,14 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
|
|||
Address address = mCall.getRemoteAddress();
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
if (contact != null) {
|
||||
ImageUtils.setImagePictureFromUri(
|
||||
this, mContactPicture, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
ContactAvatar.displayAvatar(
|
||||
contact, findViewById(R.id.avatar_layout), R.drawable.avatar_mask_border);
|
||||
mName.setText(contact.getFullName());
|
||||
} 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));
|
||||
}
|
||||
|
|
|
@ -260,7 +260,6 @@ public class ChatMessagesOldAdapter extends SelectableAdapter<ChatMessageOldView
|
|||
holder.fileTransferAction, mContext, R.style.font15);
|
||||
holder.fileTransferAction.setBackgroundResource(
|
||||
R.drawable.resizable_confirm_delete_button);
|
||||
ContactAvatar.setAvatarMask(holder.avatarLayout, R.drawable.avatar_mask);
|
||||
} else {
|
||||
for (LinphoneContact c : mParticipants) {
|
||||
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);
|
||||
holder.fileTransferAction.setBackgroundResource(
|
||||
R.drawable.resizable_assistant_button);
|
||||
ContactAvatar.setAvatarMask(holder.avatarLayout, R.drawable.avatar_mask);
|
||||
}
|
||||
|
||||
if (contact == null) {
|
||||
|
|
|
@ -148,7 +148,6 @@ public class ImdnOldFragment extends Fragment {
|
|||
mBubble.fileTransferAction, getActivity(), R.style.font15);
|
||||
mBubble.fileTransferAction.setBackgroundResource(
|
||||
R.drawable.resizable_confirm_delete_button);
|
||||
ContactAvatar.setAvatarMask(mBubble.avatarLayout, R.drawable.avatar_chat_mask_outgoing);
|
||||
} else {
|
||||
mBubble.background.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
||||
Compatibility.setTextAppearance(
|
||||
|
@ -156,7 +155,6 @@ public class ImdnOldFragment extends Fragment {
|
|||
Compatibility.setTextAppearance(
|
||||
mBubble.fileTransferAction, getActivity(), R.style.font8);
|
||||
mBubble.fileTransferAction.setBackgroundResource(R.drawable.resizable_assistant_button);
|
||||
ContactAvatar.setAvatarMask(mBubble.avatarLayout, R.drawable.avatar_mask);
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
|
@ -96,12 +96,7 @@ public class ContactAvatar {
|
|||
}
|
||||
}
|
||||
|
||||
public static void setAvatarMask(View v, int resourceId) {
|
||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||
holder.avatarMask.setImageResource(resourceId);
|
||||
}
|
||||
|
||||
public static void displayAvatar(String displayName, View v) {
|
||||
public static void displayAvatar(String displayName, View v, int maskResource) {
|
||||
if (displayName == null || v == null) return;
|
||||
|
||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||
|
@ -112,10 +107,23 @@ public class ContactAvatar {
|
|||
// +...
|
||||
holder.generatedAvatar.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.generatedAvatar.setText(generateAvatar(displayName));
|
||||
String generatedAvatar = generateAvatar(displayName);
|
||||
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);
|
||||
|
||||
if (maskResource != 0) {
|
||||
holder.avatarMask.setImageResource(maskResource);
|
||||
}
|
||||
}
|
||||
|
||||
public static void displayAvatar(String displayName, View v) {
|
||||
displayAvatar(displayName, v, 0);
|
||||
}
|
||||
|
||||
public static void displayAvatar(
|
||||
|
@ -124,7 +132,7 @@ public class ContactAvatar {
|
|||
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;
|
||||
|
||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||
|
@ -162,6 +170,14 @@ public class ContactAvatar {
|
|||
: contact.getFullName()));
|
||||
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(
|
||||
|
|
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"
|
||||
android:tint="?attr/drawableTintDisabledColor"/>
|
||||
</item>
|
||||
<item android:state_selected="true">
|
||||
<bitmap android:src="@drawable/camera_default"
|
||||
android:tint="?attr/drawableTintOverColor"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/camera_default"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
<bitmap android:src="@drawable/options_default"
|
||||
android:tint="?attr/drawableTintDisabledColor"/>
|
||||
</item>
|
||||
<item android:state_selected="true">
|
||||
<bitmap android:src="@drawable/options_default"
|
||||
android:tint="?attr/drawableTintOverColor"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:src="@drawable/options_default"
|
||||
android:tint="?attr/drawableTintColor"/>
|
||||
|
|
|
@ -80,21 +80,7 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
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" />
|
||||
<include layout="@layout/contact_avatar_200" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -81,21 +81,7 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
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" />
|
||||
<include layout="@layout/contact_avatar_200" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -2,17 +2,20 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:alpha="0.5"
|
||||
android:background="?attr/accentColor"
|
||||
android:background="?attr/accentColor50"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/avatar" />
|
||||
android:gravity="center">
|
||||
|
||||
<include layout="@layout/contact_avatar_call_paused" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contact_name"
|
||||
|
|
|
@ -67,20 +67,7 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
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"/>
|
||||
<include layout="@layout/contact_avatar_200" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -68,20 +68,7 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
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" />
|
||||
<include layout="@layout/contact_avatar_200" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<include layout="@layout/contact_avatar_big" />
|
||||
<include layout="@layout/contact_avatar_100" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -12,15 +12,6 @@
|
|||
android:adjustViewBounds="true"
|
||||
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
|
||||
android:id="@+id/generated_avatar"
|
||||
style="@style/generated_contact_avatar_font"
|
||||
|
@ -31,6 +22,14 @@
|
|||
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" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/security_level"
|
||||
android:layout_width="20dp"
|
||||
|
|
|
@ -12,18 +12,9 @@
|
|||
android:adjustViewBounds="true"
|
||||
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
|
||||
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_height="100dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
@ -31,6 +22,14 @@
|
|||
android:gravity="center"
|
||||
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
|
||||
android:id="@+id/security_level"
|
||||
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:gravity="center">
|
||||
|
||||
<include layout="@layout/contact_avatar_big" />
|
||||
<include layout="@layout/contact_avatar_100" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
|
||||
<include layout="@layout/contact_avatar_big"/>
|
||||
<include layout="@layout/contact_avatar_100"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
android:id="@+id/toastRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/backgroundColor"
|
||||
android:background="?attr/backgroundContastColor"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -12,6 +12,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:padding="5dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
android:textColor="?attr/secondaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<resources>
|
||||
<declare-styleable name="LinphoneAppTheme">
|
||||
<attr name="accentColor" format="color"/>
|
||||
<attr name="accentColor50" format="color"/>
|
||||
|
||||
<attr name="accentTextColor" format="color"/>
|
||||
<attr name="primaryTextColor" format="color"/>
|
||||
|
@ -10,6 +11,7 @@
|
|||
<attr name="primarySubtextLightColor" format="color"/>
|
||||
|
||||
<attr name="backgroundColor" format="color"/>
|
||||
<attr name="backgroundContastColor" format="color"/>
|
||||
<attr name="dividerColor" format="color"/>
|
||||
|
||||
<attr name="drawableTintColor" format="color"/>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<color name="colorA">#ff5e00</color>
|
||||
<!-- 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="colorA50">#80ff5e00</color>
|
||||
<color name="colorB">#000000</color>
|
||||
<color name="colorC">#444444</color>
|
||||
<color name="colorD">#808080</color>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<item name="android:textColorPrimaryInverse">@color/colorH</item>
|
||||
|
||||
<item name="accentColor">@color/colorA</item>
|
||||
<item name="accentColor50">@color/colorA50</item>
|
||||
<item name="accentTextColor">@color/colorH</item>
|
||||
<item name="primaryTextColor">@color/colorC</item>
|
||||
<item name="secondaryTextColor">@color/colorH</item>
|
||||
|
@ -18,6 +19,7 @@
|
|||
<item name="primarySubtextLightColor">@color/colorE</item>
|
||||
|
||||
<item name="backgroundColor">@color/colorH</item>
|
||||
<item name="backgroundContastColor">@color/colorC</item>
|
||||
<item name="dividerColor">@color/colorE</item>
|
||||
|
||||
<item name="drawableTintColor">@color/colorC</item>
|
||||
|
@ -42,6 +44,8 @@
|
|||
<item name="android:colorBackground">@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="primaryTextColor">@color/colorH</item>
|
||||
<item name="secondaryTextColor">@color/colorC</item>
|
||||
|
@ -49,6 +53,7 @@
|
|||
<item name="primarySubtextLightColor">@color/colorF</item>
|
||||
|
||||
<item name="backgroundColor">@color/colorC</item>
|
||||
<item name="backgroundContastColor">@color/colorH</item>
|
||||
<item name="dividerColor">@color/colorE</item>
|
||||
|
||||
<item name="drawableTintColor">@color/colorH</item>
|
||||
|
@ -256,12 +261,18 @@
|
|||
<item name="android:textStyle">bold</item>
|
||||
</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:textSize">70sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</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">
|
||||
<item name="android:textColor">@color/colorK</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
|
|
Loading…
Reference in a new issue