Merge with master
This commit is contained in:
commit
dcfba09cf5
10 changed files with 134 additions and 87 deletions
|
@ -181,13 +181,13 @@
|
||||||
android:choiceMode="multipleChoice"
|
android:choiceMode="multipleChoice"
|
||||||
android:stackFromBottom="true"
|
android:stackFromBottom="true"
|
||||||
android:transcriptMode="normal"
|
android:transcriptMode="normal"
|
||||||
android:dividerHeight="10dp"
|
|
||||||
android:cacheColorHint="@color/transparent"
|
android:cacheColorHint="@color/transparent"
|
||||||
android:listSelector="@color/transparent"
|
android:listSelector="@color/transparent"
|
||||||
android:layout_above="@id/remote_composing"
|
android:layout_above="@id/remote_composing"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="10dp"
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_below="@+id/top"/>
|
android:layout_below="@+id/top"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@id/delete_message"
|
android:layout_toLeftOf="@id/delete_message"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -62,10 +64,17 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@id/delete_message">
|
android:layout_toLeftOf="@id/delete_message">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/separator"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:orientation="horizontal"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/background"
|
android:id="@+id/background"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/separator"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
|
|
@ -42,6 +42,7 @@ history_max_size=100
|
||||||
enable_basic_to_client_group_chat_room_migration=0
|
enable_basic_to_client_group_chat_room_migration=0
|
||||||
enable_simple_group_chat_message_state=0
|
enable_simple_group_chat_message_state=0
|
||||||
aggregate_imdn=1
|
aggregate_imdn=1
|
||||||
|
version_check_url_root=https://www.linphone.org/releases
|
||||||
|
|
||||||
[app]
|
[app]
|
||||||
activation_code_length=4
|
activation_code_length=4
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="link_account">Link your account</string>
|
<string name="link_account">Link your account</string>
|
||||||
|
<string name="update_available">An update is available</string>
|
||||||
|
|
||||||
<!-- Launch screen -->
|
<!-- Launch screen -->
|
||||||
<string name="app_description">the <i>libre</i> SIP client</string>
|
<string name="app_description">the <i>libre</i> SIP client</string>
|
||||||
|
|
|
@ -27,6 +27,7 @@ import android.app.ProgressDialog;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
@ -691,6 +692,9 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
String versionName = mServiceContext.getPackageManager().getPackageInfo(mServiceContext.getPackageName(), 0).versionName;
|
String versionName = mServiceContext.getPackageManager().getPackageInfo(mServiceContext.getPackageName(), 0).versionName;
|
||||||
if (versionName == null) {
|
if (versionName == null) {
|
||||||
versionName = String.valueOf(mServiceContext.getPackageManager().getPackageInfo(mServiceContext.getPackageName(), 0).versionCode);
|
versionName = String.valueOf(mServiceContext.getPackageManager().getPackageInfo(mServiceContext.getPackageName(), 0).versionCode);
|
||||||
|
} else {
|
||||||
|
//Api to check version can't use version code
|
||||||
|
mLc.checkForUpdate(versionName);
|
||||||
}
|
}
|
||||||
mLc.setUserAgent("LinphoneAndroid", versionName);
|
mLc.setUserAgent("LinphoneAndroid", versionName);
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
|
@ -1618,7 +1622,29 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVersionUpdateCheckResultReceived(Core lc, VersionUpdateCheckResult result, String version, String url) {
|
public void onVersionUpdateCheckResultReceived(Core lc, VersionUpdateCheckResult result, String version, String url) {
|
||||||
|
if (result == VersionUpdateCheckResult.NewVersionAvailable) {
|
||||||
|
final String urlToUse = url;
|
||||||
|
final String versionAv = version;
|
||||||
|
mHandler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||||
|
builder.setMessage(getString(R.string.update_available) + ": " + versionAv);
|
||||||
|
builder.setCancelable(false);
|
||||||
|
builder.setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
if (urlToUse != null) {
|
||||||
|
Intent urlIntent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
urlIntent.setData(Uri.parse(urlToUse));
|
||||||
|
getContext().startActivity(urlIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -310,59 +310,13 @@ public final class LinphoneService extends Service {
|
||||||
stopForegroundCompat(NOTIF_ID);
|
stopForegroundCompat(NOTIF_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
super.onCreate();
|
super.onStartCommand(intent, flags, startId);
|
||||||
mLastNotificationId = 8; // To not interfere with other notifs ids
|
|
||||||
mChatNotifMap = new HashMap<String, Notified>();
|
|
||||||
|
|
||||||
setupActivityMonitor();
|
|
||||||
// In case restart after a crash. Main in LinphoneActivity
|
|
||||||
mNotificationTitle = getString(R.string.service_name);
|
|
||||||
|
|
||||||
// Needed in order for the two next calls to succeed, libraries must have been loaded first
|
|
||||||
LinphonePreferences.instance().setContext(getBaseContext());
|
|
||||||
Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
|
|
||||||
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
|
|
||||||
LinphoneUtils.initLoggingService(isDebugEnabled, getString(R.string.app_name));
|
|
||||||
|
|
||||||
// Dump some debugging information to the logs
|
|
||||||
Log.i(START_LINPHONE_LOGS);
|
|
||||||
dumpDeviceInformation();
|
|
||||||
dumpInstalledLinphoneInformation();
|
|
||||||
|
|
||||||
//Disable service notification for Android O
|
|
||||||
if ((Version.sdkAboveOrEqual(Version.API26_O_80))) {
|
|
||||||
LinphonePreferences.instance().setServiceNotificationVisibility(false);
|
|
||||||
mDisableRegistrationStatus = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
|
||||||
mNM.cancel(INCALL_NOTIF_ID); // in case of crash the icon is not removed
|
|
||||||
Compatibility.CreateChannel(this);
|
|
||||||
|
|
||||||
Intent notifIntent = new Intent(this, incomingReceivedActivity);
|
|
||||||
notifIntent.putExtra("Notification", true);
|
|
||||||
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
|
|
||||||
Bitmap bm = null;
|
|
||||||
try {
|
|
||||||
bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.linphone_notification_icon, R.mipmap.ic_launcher, bm, mNotifContentIntent, true,notifcationsPriority);
|
|
||||||
|
|
||||||
LinphoneManager.createAndStart(LinphoneService.this);
|
LinphoneManager.createAndStart(LinphoneService.this);
|
||||||
|
|
||||||
instance = this; // instance is ready once linphone manager has been created
|
instance = this; // instance is ready once linphone manager has been created
|
||||||
incomingReceivedActivityName = LinphonePreferences.instance().getActivityToLaunchOnIncomingReceived();
|
|
||||||
try {
|
|
||||||
incomingReceivedActivity = (Class<? extends Activity>) Class.forName(incomingReceivedActivityName);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
Log.e(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
LinphoneManager.getLc().addListener(mListener = new CoreListenerStub() {
|
LinphoneManager.getLc().addListener(mListener = new CoreListenerStub() {
|
||||||
@Override
|
@Override
|
||||||
public void onCallStateChanged(Core lc, Call call, Call.State state, String message) {
|
public void onCallStateChanged(Core lc, Call call, Call.State state, String message) {
|
||||||
|
@ -451,12 +405,8 @@ public final class LinphoneService extends Service {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (displayServiceNotification() || (Version.sdkAboveOrEqual(Version.API26_O_80) && intent.getBooleanExtra("ForceStartForeground", false))) {
|
||||||
try {
|
startForegroundCompat(NOTIF_ID, mNotif);
|
||||||
mStartForeground = getClass().getMethod("startForeground", mStartFgSign);
|
|
||||||
mStopForeground = getClass().getMethod("stopForeground", mStopFgSign);
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
Log.e(e, "Couldn't find startForeground or stopForeground");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Version.sdkAboveOrEqual(Version.API26_O_80)
|
if (!Version.sdkAboveOrEqual(Version.API26_O_80)
|
||||||
|
@ -464,10 +414,6 @@ public final class LinphoneService extends Service {
|
||||||
getContentResolver().registerContentObserver(ContactsContract.Contacts.CONTENT_URI, true, ContactsManager.getInstance());
|
getContentResolver().registerContentObserver(ContactsContract.Contacts.CONTENT_URI, true, ContactsManager.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayServiceNotification()) {
|
|
||||||
startForegroundCompat(NOTIF_ID, mNotif);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mTestDelayElapsed) {
|
if (!mTestDelayElapsed) {
|
||||||
// Only used when testing. Simulates a 5 seconds delay for launching service
|
// Only used when testing. Simulates a 5 seconds delay for launching service
|
||||||
mHandler.postDelayed(new Runnable() {
|
mHandler.postDelayed(new Runnable() {
|
||||||
|
@ -478,11 +424,71 @@ public final class LinphoneService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
//make sure the application will at least wakes up every 10 mn
|
//make sure the application will at least wakes up every 10 mn
|
||||||
Intent intent = new Intent(this, KeepAliveReceiver.class);
|
Intent keepAliveIntent = new Intent(this, KeepAliveReceiver.class);
|
||||||
PendingIntent keepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
|
PendingIntent keepAlivePendingIntent = PendingIntent.getBroadcast(this, 0, keepAliveIntent, PendingIntent.FLAG_ONE_SHOT);
|
||||||
AlarmManager alarmManager = ((AlarmManager) this.getSystemService(Context.ALARM_SERVICE));
|
AlarmManager alarmManager = ((AlarmManager) this.getSystemService(Context.ALARM_SERVICE));
|
||||||
Compatibility.scheduleAlarm(alarmManager, AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 600000, keepAlivePendingIntent);
|
Compatibility.scheduleAlarm(alarmManager, AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 600000, keepAlivePendingIntent);
|
||||||
|
|
||||||
|
return START_STICKY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
mLastNotificationId = 8; // To not interfere with other notifs ids
|
||||||
|
mChatNotifMap = new HashMap<String, Notified>();
|
||||||
|
|
||||||
|
setupActivityMonitor();
|
||||||
|
// In case restart after a crash. Main in LinphoneActivity
|
||||||
|
mNotificationTitle = getString(R.string.service_name);
|
||||||
|
|
||||||
|
// Needed in order for the two next calls to succeed, libraries must have been loaded first
|
||||||
|
LinphonePreferences.instance().setContext(getBaseContext());
|
||||||
|
Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath());
|
||||||
|
boolean isDebugEnabled = LinphonePreferences.instance().isDebugEnabled();
|
||||||
|
LinphoneUtils.initLoggingService(isDebugEnabled, getString(R.string.app_name));
|
||||||
|
|
||||||
|
// Dump some debugging information to the logs
|
||||||
|
Log.i(START_LINPHONE_LOGS);
|
||||||
|
dumpDeviceInformation();
|
||||||
|
dumpInstalledLinphoneInformation();
|
||||||
|
|
||||||
|
//Disable service notification for Android O
|
||||||
|
if ((Version.sdkAboveOrEqual(Version.API26_O_80))) {
|
||||||
|
LinphonePreferences.instance().setServiceNotificationVisibility(false);
|
||||||
|
mDisableRegistrationStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
|
mNM.cancel(INCALL_NOTIF_ID); // in case of crash the icon is not removed
|
||||||
|
Compatibility.CreateChannel(this);
|
||||||
|
|
||||||
|
Intent notifIntent = new Intent(this, incomingReceivedActivity);
|
||||||
|
notifIntent.putExtra("Notification", true);
|
||||||
|
mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
|
Bitmap bm = null;
|
||||||
|
try {
|
||||||
|
bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
mNotif = Compatibility.createNotification(this, mNotificationTitle, "", R.drawable.linphone_notification_icon, R.mipmap.ic_launcher, bm, mNotifContentIntent, true,notifcationsPriority);
|
||||||
|
|
||||||
|
incomingReceivedActivityName = LinphonePreferences.instance().getActivityToLaunchOnIncomingReceived();
|
||||||
|
try {
|
||||||
|
incomingReceivedActivity = (Class<? extends Activity>) Class.forName(incomingReceivedActivityName);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
Log.e(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
mStartForeground = getClass().getMethod("startForeground", mStartFgSign);
|
||||||
|
mStopForeground = getClass().getMethod("stopForeground", mStopFgSign);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
Log.e(e, "Couldn't find startForeground or stopForeground");
|
||||||
|
}
|
||||||
|
|
||||||
mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
|
mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class ChatBubbleViewHolder extends RecyclerView.ViewHolder implements Vie
|
||||||
public TextView eventMessage;
|
public TextView eventMessage;
|
||||||
|
|
||||||
public RelativeLayout bubbleLayout;
|
public RelativeLayout bubbleLayout;
|
||||||
|
public LinearLayout separatorLayout;
|
||||||
public LinearLayout background;
|
public LinearLayout background;
|
||||||
public ImageView contactPicture;
|
public ImageView contactPicture;
|
||||||
public ImageView contactPictureMask;
|
public ImageView contactPictureMask;
|
||||||
|
@ -93,6 +94,7 @@ public class ChatBubbleViewHolder extends RecyclerView.ViewHolder implements Vie
|
||||||
|
|
||||||
this.messageText = view.findViewById(R.id.message);
|
this.messageText = view.findViewById(R.id.message);
|
||||||
this.messageImage = view.findViewById(R.id.image);
|
this.messageImage = view.findViewById(R.id.image);
|
||||||
|
this.separatorLayout = view.findViewById(R.id.separator);
|
||||||
|
|
||||||
this.fileTransferLayout = view.findViewById(R.id.file_transfer_layout);
|
this.fileTransferLayout = view.findViewById(R.id.file_transfer_layout);
|
||||||
this.fileTransferProgressBar = view.findViewById(R.id.progress_bar);
|
this.fileTransferProgressBar = view.findViewById(R.id.progress_bar);
|
||||||
|
@ -128,6 +130,7 @@ public class ChatBubbleViewHolder extends RecyclerView.ViewHolder implements Vie
|
||||||
|
|
||||||
this.messageText = view.findViewById(R.id.message);
|
this.messageText = view.findViewById(R.id.message);
|
||||||
this.messageImage = view.findViewById(R.id.image);
|
this.messageImage = view.findViewById(R.id.image);
|
||||||
|
this.separatorLayout = view.findViewById(R.id.separator);
|
||||||
|
|
||||||
this.fileTransferLayout = view.findViewById(R.id.file_transfer_layout);
|
this.fileTransferLayout = view.findViewById(R.id.file_transfer_layout);
|
||||||
this.fileTransferProgressBar = view.findViewById(R.id.progress_bar);
|
this.fileTransferProgressBar = view.findViewById(R.id.progress_bar);
|
||||||
|
|
|
@ -59,6 +59,7 @@ import org.linphone.core.ChatMessage;
|
||||||
import org.linphone.core.ChatMessageListenerStub;
|
import org.linphone.core.ChatMessageListenerStub;
|
||||||
import org.linphone.core.ChatRoom;
|
import org.linphone.core.ChatRoom;
|
||||||
import org.linphone.core.Content;
|
import org.linphone.core.Content;
|
||||||
|
import org.linphone.core.Event;
|
||||||
import org.linphone.core.EventLog;
|
import org.linphone.core.EventLog;
|
||||||
import org.linphone.core.LimeState;
|
import org.linphone.core.LimeState;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
|
@ -77,12 +78,14 @@ import java.util.List;
|
||||||
|
|
||||||
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
|
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
|
||||||
|
|
||||||
|
|
||||||
public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
//public class ChatEventsAdapter extends RecyclerView.Adapter<ChatBubbleViewHolder> {
|
|
||||||
|
private static int MARGIN_BETWEEN_MESSAGES = 10;
|
||||||
|
private static int SIDE_MARGIN = 100;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<EventLog> mHistory;
|
private List<EventLog> mHistory;
|
||||||
private List<LinphoneContact> mParticipants;
|
private List<LinphoneContact> mParticipants;
|
||||||
// private LayoutInflater mLayoutInflater;
|
|
||||||
private int itemResource;
|
private int itemResource;
|
||||||
private Bitmap mDefaultBitmap;
|
private Bitmap mDefaultBitmap;
|
||||||
private GroupChatFragment mFragment;
|
private GroupChatFragment mFragment;
|
||||||
|
@ -90,16 +93,12 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
|
|
||||||
private ChatBubbleViewHolder.ClickListener clickListener;
|
private ChatBubbleViewHolder.ClickListener clickListener;
|
||||||
|
|
||||||
// public ChatEventsAdapter(GroupChatFragment fragment, ListSelectionHelper helper, LayoutInflater inflater, EventLog[] history, ArrayList<LinphoneContact> participants) {
|
|
||||||
public ChatEventsAdapter(GroupChatFragment fragment, SelectableHelper helper, int itemResource, EventLog[] history, ArrayList<LinphoneContact> participants, ChatBubbleViewHolder.ClickListener clickListener) {
|
public ChatEventsAdapter(GroupChatFragment fragment, SelectableHelper helper, int itemResource, EventLog[] history, ArrayList<LinphoneContact> participants, ChatBubbleViewHolder.ClickListener clickListener) {
|
||||||
// public ChatEventsAdapter(GroupChatFragment fragment, SelectableHelper helper, LayoutInflater inflater, ArrayList<EventLog> mHistory, ArrayList<LinphoneContact> participants, ChatBubbleViewHolder.ClickListener clickListener) {
|
|
||||||
|
|
||||||
super(helper);
|
super(helper);
|
||||||
this.mFragment=fragment;
|
this.mFragment=fragment;
|
||||||
this.mContext = mFragment.getActivity();
|
this.mContext = mFragment.getActivity();
|
||||||
this.itemResource = itemResource;
|
this.itemResource = itemResource;
|
||||||
// this.mLayoutInflater = inflater;
|
|
||||||
// this.mHistory = mHistory;
|
|
||||||
mHistory = new ArrayList<>(Arrays.asList(history));
|
mHistory = new ArrayList<>(Arrays.asList(history));
|
||||||
this.mParticipants = participants;
|
this.mParticipants = participants;
|
||||||
this.clickListener = clickListener;
|
this.clickListener = clickListener;
|
||||||
|
@ -224,13 +223,14 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
holder.imdmLabel.setTextColor(mContext.getResources().getColor(R.color.colorI));
|
holder.imdmLabel.setTextColor(mContext.getResources().getColor(R.color.colorI));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEditionEnabled()) {
|
|
||||||
layoutParams.addRule(RelativeLayout.LEFT_OF, holder.delete.getId());
|
if (isEditionEnabled()) {
|
||||||
layoutParams.setMargins(100, 10, 10, 10);
|
layoutParams.addRule(RelativeLayout.LEFT_OF, holder.delete.getId());
|
||||||
} else {
|
layoutParams.setMargins(SIDE_MARGIN, MARGIN_BETWEEN_MESSAGES/2, 0, MARGIN_BETWEEN_MESSAGES/2);
|
||||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
} else {
|
||||||
layoutParams.setMargins(100, 10, 10, 10);
|
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||||
}
|
layoutParams.setMargins(SIDE_MARGIN, MARGIN_BETWEEN_MESSAGES/2, 0, MARGIN_BETWEEN_MESSAGES/2);
|
||||||
|
}
|
||||||
|
|
||||||
holder.background.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
|
holder.background.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
|
||||||
Compatibility.setTextAppearance(holder.contactName, mContext, R.style.font3);
|
Compatibility.setTextAppearance(holder.contactName, mContext, R.style.font3);
|
||||||
|
@ -245,13 +245,14 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEditionEnabled()) {
|
|
||||||
layoutParams.addRule(RelativeLayout.LEFT_OF, holder.delete.getId());
|
if (isEditionEnabled()) {
|
||||||
layoutParams.setMargins(100, 10, 10, 10);
|
layoutParams.addRule(RelativeLayout.LEFT_OF, holder.delete.getId());
|
||||||
} else {
|
layoutParams.setMargins(SIDE_MARGIN, MARGIN_BETWEEN_MESSAGES/2, 0, MARGIN_BETWEEN_MESSAGES/2);
|
||||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
} else {
|
||||||
layoutParams.setMargins(10, 10, 100, 10);
|
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
||||||
}
|
layoutParams.setMargins(0, MARGIN_BETWEEN_MESSAGES/2, SIDE_MARGIN, MARGIN_BETWEEN_MESSAGES/2);
|
||||||
|
}
|
||||||
|
|
||||||
holder.background.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
holder.background.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
||||||
Compatibility.setTextAppearance(holder.contactName, mContext, R.style.font9);
|
Compatibility.setTextAppearance(holder.contactName, mContext, R.style.font9);
|
||||||
|
@ -644,7 +645,6 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
|
private BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
|
||||||
// private BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
|
|
||||||
if (imageView != null) {
|
if (imageView != null) {
|
||||||
final Drawable drawable = imageView.getDrawable();
|
final Drawable drawable = imageView.getDrawable();
|
||||||
if (drawable instanceof AsyncBitmap) {
|
if (drawable instanceof AsyncBitmap) {
|
||||||
|
|
|
@ -530,7 +530,7 @@ public class GroupChatFragment extends Fragment implements ChatRoomListener, Con
|
||||||
|
|
||||||
getContactsForParticipants();
|
getContactsForParticipants();
|
||||||
|
|
||||||
mRemoteComposing.setVisibility(View.INVISIBLE);
|
mRemoteComposing.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayChatRoomHeader() {
|
private void displayChatRoomHeader() {
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||||
if (autostart) {
|
if (autostart) {
|
||||||
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
Intent lLinphoneServiceIntent = new Intent(Intent.ACTION_MAIN);
|
||||||
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
lLinphoneServiceIntent.setClass(context, LinphoneService.class);
|
||||||
|
lLinphoneServiceIntent.putExtra("ForceStartForeground", true);
|
||||||
Compatibility.startService(context, lLinphoneServiceIntent);
|
Compatibility.startService(context, lLinphoneServiceIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue