mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Update app
This commit is contained in:
parent
493812faba
commit
e64d480565
22 changed files with 215 additions and 148 deletions
|
|
@ -1,7 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/list_details_over" />
|
||||
<item
|
||||
android:drawable="@drawable/list_details_default" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/list_details_over"/>
|
||||
<item android:drawable="@drawable/list_details_default"/>
|
||||
</selector>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/itemSelect" android:state_checked="true"/>
|
||||
<item
|
||||
android:drawable="@color/colorG"
|
||||
android:state_pressed="true"/>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -68,7 +69,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorB"
|
||||
android:orientation="horizontal"/>
|
||||
android:orientation="horizontal">
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,15 @@
|
|||
android:contentDescription="@string/content_description_back"
|
||||
android:src="@drawable/back"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="33dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.2"
|
||||
android:contentDescription="@string/content_description_call"
|
||||
android:src="@drawable/avatar_small_secure_1"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
|
|
@ -77,7 +86,7 @@
|
|||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_conversation_infos"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/chat_room_group_infos"/>
|
||||
android:src="@drawable/list_detail"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_to_call"
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="66dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:src="@drawable/avatar"/>
|
||||
android:src="@drawable/avatar_big_secure1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mask"
|
||||
|
|
@ -99,12 +99,16 @@
|
|||
android:maxLines="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contactOrganization"
|
||||
style="@style/font9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:maxLines="1"/>
|
||||
android:id="@+id/separator_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="23.3dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@color/colorN"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="appel sécurisé"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="13.3sp"/>
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/controls"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,15 @@
|
|||
android:background="@color/colorB"
|
||||
android:padding="10dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logodialer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:padding="50dp"
|
||||
android:src="@drawable/logo_secure_phone_big"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/controls"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -21,18 +21,13 @@
|
|||
android:textColor="#ffffff"
|
||||
android:textSize="13.3sp"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/colorH"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/viewHolder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@color/colorH"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
|
|
@ -110,11 +105,11 @@
|
|||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
android:ellipsize="end"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#000000"
|
||||
android:lineSpacingExtra="13.3sp"
|
||||
android:lines="1"
|
||||
android:maxLines="1"/>
|
||||
android:maxLines="1"
|
||||
android:textColor="#000000"
|
||||
android:textSize="20sp"/>
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toastRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorB"
|
||||
android:orientation="vertical" >
|
||||
android:id="@+id/toastRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorB"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toastMessage"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/colorB"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -19,24 +19,24 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toastNotOK"
|
||||
android:src="@drawable/security_pending"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:id="@+id/toastNotOK"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/security_pending"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toastOK"
|
||||
android:src="@drawable/security_ok"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:id="@+id/toastOK"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/security_ok"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@
|
|||
<color name="yellow">#fecf33</color>
|
||||
<color name="light_orange">#fdbd39</color>
|
||||
<color name="peach">#ee6723</color>
|
||||
<color name="itemSelect">#26ff6600</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
<string name="messages_date_format">yyyy/dd</string>
|
||||
<string name="messages_list_date_format">dd/MM</string>
|
||||
<string name="today_date_format">dd/MM - HH:mm</string>
|
||||
<string name="today_date_format2">HH:mm</string>
|
||||
|
||||
<!-- Phone numbers -->
|
||||
<bool name="use_phone_number_validation">true</bool><!-- Use phone number for validation -->
|
||||
|
|
|
|||
|
|
@ -365,94 +365,95 @@ public final class LinphoneService extends Service {
|
|||
Log.e(e);
|
||||
}
|
||||
|
||||
LinphoneManager.getLc().addListener(mListener = new CoreListenerStub() {
|
||||
@Override
|
||||
public void onCallStateChanged(Core lc, Call call, Call.State state, String message) {
|
||||
if (instance == null) {
|
||||
Log.i("Service not ready, discarding call state change to ",state.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (state == Call.State.IncomingReceived) {
|
||||
if(! LinphoneManager.getInstance().getCallGsmON())
|
||||
onIncomingReceived();
|
||||
}
|
||||
|
||||
if (state == State.End || state == State.Released || state == State.Error) {
|
||||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null && LinphoneManager.getLc().getCallsNb() == 0) {
|
||||
if (CallActivity.isInstanciated()) {
|
||||
removeSasNotification();
|
||||
CallActivity.instance().setisZrtpAsk(false);
|
||||
}
|
||||
if (LinphoneManager.getLc() != null) {
|
||||
LinphoneManager.getLc().addListener(mListener = new CoreListenerStub() {
|
||||
@Override
|
||||
public void onCallStateChanged(Core lc, Call call, Call.State state, String message) {
|
||||
if (instance == null) {
|
||||
Log.i("Service not ready, discarding call state change to ", state.toString());
|
||||
return;
|
||||
}
|
||||
destroyOverlay();
|
||||
}
|
||||
|
||||
if (state == State.End && call.getCallLog().getStatus() == Call.Status.Missed) {
|
||||
int missedCallCount = LinphoneManager.getLcIfManagerNotDestroyedOrNull().getMissedCallsCount();
|
||||
String body;
|
||||
if (missedCallCount > 1) {
|
||||
body = getString(R.string.missed_calls_notif_body).replace("%i", String.valueOf(missedCallCount));
|
||||
} else {
|
||||
Address address = call.getRemoteAddress();
|
||||
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
if (c != null) {
|
||||
body = c.getFullName();
|
||||
} else {
|
||||
body = address.getDisplayName();
|
||||
if (body == null) {
|
||||
body = address.asStringUriOnly();
|
||||
if (state == Call.State.IncomingReceived) {
|
||||
if (!LinphoneManager.getInstance().getCallGsmON())
|
||||
onIncomingReceived();
|
||||
}
|
||||
|
||||
if (state == State.End || state == State.Released || state == State.Error) {
|
||||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null && LinphoneManager.getLc().getCallsNb() == 0) {
|
||||
if (CallActivity.isInstanciated()) {
|
||||
removeSasNotification();
|
||||
CallActivity.instance().setisZrtpAsk(false);
|
||||
}
|
||||
}
|
||||
destroyOverlay();
|
||||
}
|
||||
|
||||
if (state == State.End && call.getCallLog().getStatus() == Call.Status.Missed) {
|
||||
int missedCallCount = LinphoneManager.getLcIfManagerNotDestroyedOrNull().getMissedCallsCount();
|
||||
String body;
|
||||
if (missedCallCount > 1) {
|
||||
body = getString(R.string.missed_calls_notif_body).replace("%i", String.valueOf(missedCallCount));
|
||||
} else {
|
||||
Address address = call.getRemoteAddress();
|
||||
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(address);
|
||||
if (c != null) {
|
||||
body = c.getFullName();
|
||||
} else {
|
||||
body = address.getDisplayName();
|
||||
if (body == null) {
|
||||
body = address.asStringUriOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent missedCallNotifIntent = new Intent(LinphoneService.this, incomingReceivedActivity);
|
||||
missedCallNotifIntent.putExtra("GoToHistory", true);
|
||||
PendingIntent intent = PendingIntent.getActivity(LinphoneService.this, 0, missedCallNotifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
Notification notif = Compatibility.createMissedCallNotification(instance, getString(R.string.missed_calls_notif_title), body, intent);
|
||||
notifyWrapper(MISSED_NOTIF_ID, notif);
|
||||
|
||||
Intent missedCallNotifIntent = new Intent(LinphoneService.this, incomingReceivedActivity);
|
||||
missedCallNotifIntent.putExtra("GoToHistory", true);
|
||||
PendingIntent intent = PendingIntent.getActivity(LinphoneService.this, 0, missedCallNotifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
Notification notif = Compatibility.createMissedCallNotification(instance, getString(R.string.missed_calls_notif_title), body, intent);
|
||||
notifyWrapper(MISSED_NOTIF_ID, notif);
|
||||
}
|
||||
|
||||
if (state == State.StreamsRunning) {
|
||||
// Workaround bug current call seems to be updated after state changed to streams running
|
||||
if (getResources().getBoolean(R.bool.enable_call_notification))
|
||||
refreshIncallIcon(call);
|
||||
} else {
|
||||
if (getResources().getBoolean(R.bool.enable_call_notification))
|
||||
refreshIncallIcon(LinphoneManager.getLc().getCurrentCall());
|
||||
}
|
||||
}
|
||||
|
||||
if (state == State.StreamsRunning) {
|
||||
// Workaround bug current call seems to be updated after state changed to streams running
|
||||
if (getResources().getBoolean(R.bool.enable_call_notification))
|
||||
refreshIncallIcon(call);
|
||||
} else {
|
||||
if (getResources().getBoolean(R.bool.enable_call_notification))
|
||||
refreshIncallIcon(LinphoneManager.getLc().getCurrentCall());
|
||||
@Override
|
||||
public void onGlobalStateChanged(Core lc, GlobalState state, String message) {
|
||||
if (!mDisableRegistrationStatus && state == GlobalState.On && displayServiceNotification()) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGlobalStateChanged(Core lc,GlobalState state, String message) {
|
||||
if (!mDisableRegistrationStatus && state == GlobalState.On && displayServiceNotification()) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig cfg, RegistrationState state, String smessage) {
|
||||
@Override
|
||||
public void onRegistrationStateChanged(Core lc, ProxyConfig cfg, RegistrationState state, String smessage) {
|
||||
// if (instance == null) {
|
||||
// Log.i("Service not ready, discarding registration state change to ",state.toString());
|
||||
// return;
|
||||
// }
|
||||
if (!mDisableRegistrationStatus) {
|
||||
if (displayServiceNotification() && state == RegistrationState.Ok && LinphoneManager.getLc().getDefaultProxyConfig() != null && LinphoneManager.getLc().getDefaultProxyConfig().getState() == RegistrationState.Ok) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_registered);
|
||||
}
|
||||
if (!mDisableRegistrationStatus) {
|
||||
if (displayServiceNotification() && state == RegistrationState.Ok && LinphoneManager.getLc().getDefaultProxyConfig() != null && LinphoneManager.getLc().getDefaultProxyConfig().getState() == RegistrationState.Ok) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_registered);
|
||||
}
|
||||
|
||||
if (displayServiceNotification() && (state == RegistrationState.Failed || state == RegistrationState.Cleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !(LinphoneManager.getLc().getDefaultProxyConfig().getState() == RegistrationState.Ok))) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_register_failure);
|
||||
}
|
||||
if (displayServiceNotification() && (state == RegistrationState.Failed || state == RegistrationState.Cleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !(LinphoneManager.getLc().getDefaultProxyConfig().getState() == RegistrationState.Ok))) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_register_failure);
|
||||
}
|
||||
|
||||
if (displayServiceNotification() && state == RegistrationState.None) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
|
||||
if (displayServiceNotification() && state == RegistrationState.None) {
|
||||
sendNotification(IC_LEVEL_ORANGE, R.string.notification_started);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
mStartForeground = getClass().getMethod("startForeground", mStartFgSign);
|
||||
|
|
|
|||
|
|
@ -200,21 +200,21 @@ public final class LinphoneUtils {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static String timestampToHumanDate(Context context, long timestamp, int resFormat) {
|
||||
return LinphoneUtils.timestampToHumanDate(context, timestamp, context.getString(resFormat));
|
||||
public static String timestampToHumanDate(Context context, long timestamp, int resFormat, boolean useToday) {
|
||||
return LinphoneUtils.timestampToHumanDate(context, timestamp, context.getString(resFormat), useToday);
|
||||
}
|
||||
|
||||
public static String timestampToHumanDate(Context context, long timestamp, String format) {
|
||||
public static String timestampToHumanDate(Context context, long timestamp, String format, boolean useToday) {
|
||||
try {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(timestamp * 1000); // Core returns timestamps in seconds...
|
||||
|
||||
SimpleDateFormat dateFormat;
|
||||
/*if (isToday(cal)) {
|
||||
if (useToday && isToday(timestamp)) {
|
||||
dateFormat = new SimpleDateFormat(context.getResources().getString(R.string.today_date_format), Locale.getDefault());
|
||||
} else {*/
|
||||
} else {
|
||||
dateFormat = new SimpleDateFormat(format, Locale.getDefault());
|
||||
//}
|
||||
}
|
||||
|
||||
return dateFormat.format(cal.getTime());
|
||||
} catch (NumberFormatException nfe) {
|
||||
|
|
@ -222,7 +222,9 @@ public final class LinphoneUtils {
|
|||
}
|
||||
}
|
||||
|
||||
static boolean isToday(Calendar cal) {
|
||||
public static boolean isToday(long timestamp) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(timestamp * 1000); // Core returns timestamps in seconds...
|
||||
return isSameDay(cal, Calendar.getInstance());
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +284,7 @@ public final class LinphoneUtils {
|
|||
}
|
||||
if (pictureUri.getScheme().startsWith("http")) {
|
||||
Bitmap bm = downloadBitmap(pictureUri);
|
||||
if (bm == null) view.setImageResource(R.drawable.avatar);
|
||||
if (bm == null) view.setImageResource(R.drawable.avatar_small_secure1);
|
||||
view.setImageBitmap(bm);
|
||||
} else {
|
||||
Bitmap bm = null;
|
||||
|
|
@ -311,7 +313,7 @@ public final class LinphoneUtils {
|
|||
}
|
||||
if (tUri.getScheme().startsWith("http")) {
|
||||
Bitmap bm = downloadBitmap(tUri);
|
||||
if (bm == null) view.setImageResource(R.drawable.avatar);
|
||||
if (bm == null) view.setImageResource(R.drawable.avatar_small_secure1);
|
||||
view.setImageBitmap(bm);
|
||||
} else {
|
||||
Bitmap bm = null;
|
||||
|
|
@ -918,7 +920,6 @@ public final class LinphoneUtils {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return ChatRoomSecurityLevel.ClearText;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1041,7 +1041,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
public Dialog displayDialog(String text){
|
||||
Dialog dialog = new Dialog(this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorC));
|
||||
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorB));
|
||||
d.setAlpha(200);
|
||||
dialog.setContentView(R.layout.dialog);
|
||||
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
|
||||
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
||||
ZRTPdialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorC));
|
||||
Drawable d = new ColorDrawable(ContextCompat.getColor(this, R.color.colorB));
|
||||
d.setAlpha(200);
|
||||
ZRTPdialog.setContentView(R.layout.dialog);
|
||||
ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||
|
|
@ -1343,10 +1343,13 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
|
||||
if (mediaEncryption == MediaEncryption.SRTP || (mediaEncryption == MediaEncryption.ZRTP && call.getAuthenticationTokenVerified()) || mediaEncryption == MediaEncryption.DTLS) {
|
||||
encryption.setImageResource(R.drawable.security_button_default);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure2);
|
||||
} else if (mediaEncryption == MediaEncryption.ZRTP && !call.getAuthenticationTokenVerified()) {
|
||||
encryption.setImageResource(R.drawable.security_button1_default);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
} else {
|
||||
encryption.setImageResource(R.drawable.security_button1_over);
|
||||
contactPicture.setImageResource(R.drawable.avatar_big_unsecure);
|
||||
}
|
||||
|
||||
if (mediaEncryption == MediaEncryption.ZRTP) {
|
||||
|
|
@ -1818,14 +1821,14 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
|
|||
|
||||
public void initCallStatsRefresher(final Call call, final View view) {
|
||||
if (mCallDisplayedInStats == call) return;
|
||||
|
||||
|
||||
if (mTimer != null && mTask != null) {
|
||||
mTimer.cancel();
|
||||
mTimer = null;
|
||||
mTask = null;
|
||||
}
|
||||
mCallDisplayedInStats = call;
|
||||
|
||||
|
||||
if (call == null) return;
|
||||
|
||||
final TextView titleAudio = (TextView) view.findViewById(R.id.call_stats_audio);
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ public class ChatEventsAdapter extends ListSelectionAdapter {
|
|||
}
|
||||
});
|
||||
}
|
||||
holder.messageDate.setText(LinphoneUtils.timestampToHumanDate(mContext, message.getTime(), R.string.today_date_format));
|
||||
holder.messageDate.setText(LinphoneUtils.timestampToHumanDate(mContext, message.getTime(), R.string.today_date_format, false));
|
||||
holder.messageDate.setVisibility(View.VISIBLE);
|
||||
|
||||
holder.bubbleLayout.setLayoutParams(layoutParams);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static android.text.format.DateUtils.isToday;
|
||||
|
||||
public class ChatRoomsAdapter extends ListSelectionAdapter {
|
||||
|
||||
private class ChatRoomViewHolder {
|
||||
|
|
@ -169,7 +171,7 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
ChatMessage lastMessage = chatRoom.getLastMessageInHistory();
|
||||
holder.lastMessageView.setText("");
|
||||
holder.lastMessageSenderView.setText("");
|
||||
holder.date.setText(LinphoneUtils.timestampToHumanDate(mContext, chatRoom.getLastUpdateTime(), R.string.messages_list_date_format));
|
||||
holder.date.setText(LinphoneUtils.timestampToHumanDate(mContext, chatRoom.getLastUpdateTime(), ((LinphoneUtils.isToday(chatRoom.getLastUpdateTime())) ? R.string.today_date_format2 : R.string.messages_list_date_format), false));
|
||||
|
||||
if (lastMessage != null) {
|
||||
if (lastMessage.getFileTransferInformation() != null || lastMessage.getExternalBodyUrl() != null || lastMessage.getAppdata() != null) {
|
||||
|
|
@ -232,13 +234,13 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
|
||||
if (chatRoom.limeAvailable()) {
|
||||
if (chatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Safe) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_big_secure2);
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_small_secure2);
|
||||
} else if (chatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Unsafe) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_big_unsecure);
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_small_unsecure);
|
||||
} else if (chatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Encrypted) {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_big_secure1);
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_small_secure1);
|
||||
} else {
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_medium_unregistered);
|
||||
holder.contactPicture.setImageResource(R.drawable.avatar_small_unregistered);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -286,7 +288,13 @@ public class ChatRoomsAdapter extends ListSelectionAdapter {
|
|||
holder.delete.setTag(position);
|
||||
holder.delete.setOnCheckedChangeListener(getDeleteListener());
|
||||
holder.date.setVisibility(View.GONE);
|
||||
if (getSelectedItemsPosition().contains(position)) {
|
||||
view.setBackgroundColor(0x26ff6600);
|
||||
} else {
|
||||
view.setBackgroundColor(0xffffff);
|
||||
}
|
||||
} else {
|
||||
view.setBackgroundColor(0xffffff);
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ import org.linphone.core.ChatMessage;
|
|||
import org.linphone.core.ChatRoom;
|
||||
import org.linphone.core.ChatRoomCapabilities;
|
||||
import org.linphone.core.ChatRoomListener;
|
||||
import org.linphone.core.ChatRoomSecurityLevel;
|
||||
import org.linphone.core.Content;
|
||||
import org.linphone.core.Core;
|
||||
import org.linphone.core.EventLog;
|
||||
|
|
@ -90,7 +91,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
|||
private static final int ADD_PHOTO = 1337;
|
||||
|
||||
private ImageView mBackButton, mCallButton, mBackToCallButton, mGroupInfosButton;
|
||||
private ImageView mAttachImageButton, mSendMessageButton;
|
||||
private ImageView mAttachImageButton, mSendMessageButton, avatarTop;
|
||||
private TextView mRoomLabel, mParticipantsLabel, mRemoteComposing;
|
||||
private EditText mMessageTextToSend;
|
||||
private LayoutInflater mInflater;
|
||||
|
|
@ -132,6 +133,8 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
|||
}
|
||||
});
|
||||
|
||||
avatarTop = view.findViewById(R.id.avatar_top);
|
||||
|
||||
mCallButton = view.findViewById(R.id.start_call);
|
||||
mCallButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
@ -534,11 +537,29 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
|||
} else {
|
||||
mRoomLabel.setText(mParticipants.get(0).getFullName());
|
||||
}
|
||||
if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.ClearText) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_unregistered);
|
||||
} else if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Encrypted) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_secure1);
|
||||
} else if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Safe) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_secure2);
|
||||
} else {
|
||||
avatarTop.setImageResource(R.drawable.avatar_small_unsecure);
|
||||
}
|
||||
} else {
|
||||
mCallButton.setVisibility(View.GONE);
|
||||
mGroupInfosButton.setVisibility(View.VISIBLE);
|
||||
mRoomLabel.setText(mChatRoom.getSubject());
|
||||
mParticipantsLabel.setVisibility(View.VISIBLE);
|
||||
if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.ClearText) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_group_small_unregistered);
|
||||
} else if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Encrypted) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_group_small_secure1);
|
||||
} else if (mChatRoom.getSecurityLevel() == ChatRoomSecurityLevel.Safe) {
|
||||
avatarTop.setImageResource(R.drawable.avatar_group_small_secure2);
|
||||
} else {
|
||||
avatarTop.setImageResource(R.drawable.avatar_group_small_unsecure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public class ImdnFragment extends Fragment {
|
|||
displayName = LinphoneUtils.getAddressDisplayName(remoteSender);
|
||||
mBubble.contactPicture.setImageBitmap(ContactsManager.getInstance().getDefaultAvatarBitmap());
|
||||
}
|
||||
mBubble.contactName.setText(LinphoneUtils.timestampToHumanDate(getActivity(), mMessage.getTime(), R.string.messages_date_format) + " - " + displayName);
|
||||
mBubble.contactName.setText(LinphoneUtils.timestampToHumanDate(getActivity(), mMessage.getTime(), R.string.messages_date_format, true) + " - " + displayName);
|
||||
|
||||
if (mMessage.hasTextContent()) {
|
||||
String msg = mMessage.getTextContent();
|
||||
|
|
@ -229,7 +229,7 @@ public class ImdnFragment extends Fragment {
|
|||
|
||||
View v = mInflater.inflate(R.layout.chat_imdn_cell, mContainer, false);
|
||||
v.findViewById(R.id.separator).setVisibility(first ? View.GONE : View.VISIBLE);
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format));
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format, true));
|
||||
((TextView)v.findViewById(R.id.name)).setText(participantDisplayName);
|
||||
/*if (participantContact != null && participantContact.hasPhoto()) {
|
||||
LinphoneUtils.setThumbnailPictureFromUri(getActivity(), ((ImageView)v.findViewById(R.id.contact_picture)), participantContact.getThumbnailUri());
|
||||
|
|
@ -253,7 +253,7 @@ public class ImdnFragment extends Fragment {
|
|||
|
||||
View v = mInflater.inflate(R.layout.chat_imdn_cell, mContainer, false);
|
||||
v.findViewById(R.id.separator).setVisibility(first ? View.GONE : View.VISIBLE);
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format));
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format, true));
|
||||
((TextView)v.findViewById(R.id.name)).setText(participantDisplayName);
|
||||
/*if (participantContact != null && participantContact.hasPhoto()) {
|
||||
LinphoneUtils.setThumbnailPictureFromUri(getActivity(), ((ImageView)v.findViewById(R.id.contact_picture)), participantContact.getThumbnailUri());
|
||||
|
|
@ -277,7 +277,7 @@ public class ImdnFragment extends Fragment {
|
|||
|
||||
View v = mInflater.inflate(R.layout.chat_imdn_cell, mContainer, false);
|
||||
v.findViewById(R.id.separator).setVisibility(first ? View.GONE : View.VISIBLE);
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format));
|
||||
((TextView)v.findViewById(R.id.time)).setText(LinphoneUtils.timestampToHumanDate(getActivity(), participant.getStateChangeTime(), R.string.messages_date_format, true));
|
||||
((TextView)v.findViewById(R.id.name)).setText(participantDisplayName);
|
||||
/*if (participantContact != null && participantContact.hasPhoto()) {
|
||||
LinphoneUtils.setThumbnailPictureFromUri(getActivity(), ((ImageView)v.findViewById(R.id.contact_picture)), participantContact.getThumbnailUri());
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
mChatRoom.addListener(mChatRoomCreationListener);
|
||||
Address participants[] = new Address[1];
|
||||
participants[0] = participant;
|
||||
mChatRoom.addParticipants(participants);
|
||||
mChatRoom.addParticipant(participant);
|
||||
} else {
|
||||
room = lc.getChatRoom(participant);
|
||||
LinphoneActivity.instance().goToChat(room.getPeerAddress().asStringUriOnly(), null);
|
||||
|
|
@ -115,14 +115,14 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
deleteContact = view.findViewById(R.id.deleteContact);
|
||||
deleteContact.setOnClickListener(this);
|
||||
|
||||
organization = view.findViewById(R.id.contactOrganization);
|
||||
/*organization = view.findViewById(R.id.contactOrganization);
|
||||
boolean isOrgVisible = getResources().getBoolean(R.bool.display_contact_organization);
|
||||
String org = contact.getOrganization();
|
||||
if (org != null && !org.isEmpty() && isOrgVisible) {
|
||||
organization.setText(org);
|
||||
} else {
|
||||
organization.setVisibility(View.GONE);
|
||||
}
|
||||
}*/
|
||||
|
||||
back = view.findViewById(R.id.back);
|
||||
if (getResources().getBoolean(R.bool.isTablet)) {
|
||||
|
|
@ -172,7 +172,7 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
|
||||
TextView contactName = view.findViewById(R.id.contact_name);
|
||||
contactName.setText(contact.getFullName());
|
||||
organization.setText((contact.getOrganization() != null) ? contact.getOrganization() : "");
|
||||
//organization.setText((contact.getOrganization() != null) ? contact.getOrganization() : "");
|
||||
|
||||
TableLayout controls = view.findViewById(R.id.controls);
|
||||
controls.removeAllViews();
|
||||
|
|
@ -191,10 +191,12 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
label.setText(R.string.phone_number);
|
||||
skip |= getResources().getBoolean(R.bool.hide_contact_phone_numbers);
|
||||
}
|
||||
label.setVisibility(View.GONE);
|
||||
|
||||
TextView tv = v.findViewById(R.id.numeroOrAddress);
|
||||
tv.setText(displayednumberOrAddress);
|
||||
tv.setSelected(true);
|
||||
tv.setVisibility(View.GONE);
|
||||
|
||||
|
||||
ProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class DialerFragment extends Fragment {
|
|||
private AddressAware numpad;
|
||||
private AddressText mAddress;
|
||||
private CallButton mCall;
|
||||
private ImageView mAddContact;
|
||||
private ImageView mAddContact, mLogo;
|
||||
private OnClickListener addContactListener, cancelListener, transferListener;
|
||||
private boolean shouldEmptyAddressField = true;
|
||||
|
||||
|
|
@ -62,6 +62,8 @@ public class DialerFragment extends Fragment {
|
|||
mAddress = (AddressText) view.findViewById(R.id.address);
|
||||
mAddress.setDialerFragment(this);
|
||||
|
||||
mLogo = (ImageView) view.findViewById(R.id.logodialer);
|
||||
|
||||
EraseButton erase = (EraseButton) view.findViewById(R.id.erase);
|
||||
erase.setAddressWidget(mAddress);
|
||||
|
||||
|
|
@ -163,8 +165,10 @@ public class DialerFragment extends Fragment {
|
|||
boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
|
||||
if(isOrientationLandscape && !getResources().getBoolean(R.bool.isTablet)) {
|
||||
((LinearLayout) numpad).setVisibility(View.GONE);
|
||||
mLogo.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
((LinearLayout) numpad).setVisibility(View.VISIBLE);
|
||||
mLogo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (shouldEmptyAddressField) {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
|
||||
time.setText(callTime == null ? "" : callTime);
|
||||
Long longDate = Long.parseLong(callDate);
|
||||
date.setText(LinphoneUtils.timestampToHumanDate(getActivity(),longDate,getString(R.string.history_detail_date_format)));
|
||||
date.setText(LinphoneUtils.timestampToHumanDate(getActivity(),longDate,getString(R.string.history_detail_date_format), false));
|
||||
|
||||
Address lAddress = null;
|
||||
lAddress = Factory.instance().createAddress(sipUri);
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
public CheckBox select;
|
||||
public ImageView callDirection;
|
||||
public ImageView contactPicture;
|
||||
public RelativeLayout CallContact;
|
||||
public RelativeLayout CallContact, viewHolder;
|
||||
|
||||
public ViewHolder(View view) {
|
||||
contact = (TextView) view.findViewById(R.id.sip_uri);
|
||||
|
|
@ -374,6 +374,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
CallContact = (RelativeLayout) view.findViewById(R.id.history_click);
|
||||
viewHolder = (RelativeLayout) view.findViewById(R.id.viewHolder);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -538,10 +539,16 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
holder.detail.setVisibility(View.INVISIBLE);
|
||||
if(historyList.isItemChecked(position)) {
|
||||
holder.select.setChecked(true);
|
||||
view.setBackgroundColor(0x26ff6600);
|
||||
holder.viewHolder.setBackgroundColor(0x26ff6600);
|
||||
} else {
|
||||
holder.select.setChecked(false);
|
||||
view.setBackgroundColor(0xffffff);
|
||||
holder.viewHolder.setBackgroundColor(0xffffff);
|
||||
}
|
||||
} else {
|
||||
view.setBackgroundColor(0xffffff);
|
||||
holder.viewHolder.setBackgroundColor(0xffffff);
|
||||
holder.select.setVisibility(View.GONE);
|
||||
holder.detail.setVisibility(View.VISIBLE);
|
||||
holder.detail.setOnClickListener(new OnClickListener() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue