Fix merge

This commit is contained in:
Margaux Clerc 2015-08-14 15:31:39 +02:00
parent 6c2c9266e0
commit 690cfecbba
5 changed files with 29 additions and 31 deletions

View file

@ -7,7 +7,6 @@
android:gravity="left" android:gravity="left"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <ImageView
android:id="@+id/contact_picture" android:id="@+id/contact_picture"
android:layout_width="40dp" android:layout_width="40dp"
@ -40,12 +39,21 @@
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
android:visibility="gone"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="250dp" android:maxWidth="250dp"
android:maxHeight="250dp" /> android:maxHeight="250dp" />
<Button
android:id="@+id/download"
android:visibility="gone"
android:text="@string/download_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
<ProgressBar <ProgressBar

View file

@ -52,7 +52,6 @@
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
android:text="09:12"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/contact_picture" android:layout_below="@id/contact_picture"

View file

@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import android.app.Fragment;
import android.graphics.Matrix; import android.graphics.Matrix;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -60,7 +61,6 @@ import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Parcelable; import android.os.Parcelable;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.text.Editable; import android.text.Editable;
import android.text.InputType; import android.text.InputType;
import android.text.TextWatcher; import android.text.TextWatcher;
@ -296,7 +296,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
if (isOrientationLandscape && topBar != null) { if (isOrientationLandscape && topBar != null) {
topBar.setVisibility(View.GONE); topBar.setVisibility(View.GONE);
} }
contactPicture.setVisibility(View.GONE); //contactPicture.setVisibility(View.GONE);
} }
public void hideKeyboardVisibleMode() { public void hideKeyboardVisibleMode() {

View file

@ -51,6 +51,9 @@ import org.linphone.ui.AddressText;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
@ -63,13 +66,6 @@ import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.ContactsContract; import android.provider.ContactsContract;
import android.support.v4.app.Fragment;
import android.support.v4.app.Fragment.SavedState;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -100,7 +96,7 @@ import android.support.v4.view.GravityCompat;
/** /**
* @author Sylvain Berfini * @author Sylvain Berfini
*/ */
public class LinphoneActivity extends FragmentActivity implements OnClickListener, ContactPicked { public class LinphoneActivity extends Activity implements OnClickListener, ContactPicked {
public static final String PREF_FIRST_LAUNCH = "pref_first_launch"; public static final String PREF_FIRST_LAUNCH = "pref_first_launch";
private static final int SETTINGS_ACTIVITY = 123; private static final int SETTINGS_ACTIVITY = 123;
private static final int FIRST_LOGIN_ACTIVITY = 101; private static final int FIRST_LOGIN_ACTIVITY = 101;
@ -119,7 +115,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
private List<FragmentsAvailable> fragmentsHistory; private List<FragmentsAvailable> fragmentsHistory;
private Fragment dialerFragment, messageListFragment, friendStatusListenerFragment; private Fragment dialerFragment, messageListFragment, friendStatusListenerFragment;
private ChatFragment chatFragment; private ChatFragment chatFragment;
private SavedState dialerSavedState; private Fragment.SavedState dialerSavedState;
private boolean newProxyConfig; private boolean newProxyConfig;
private boolean isAnimationDisabled = false, preferLinphoneContacts = false; private boolean isAnimationDisabled = false, preferLinphoneContacts = false;
private OrientationEventListener mOrientationHelper; private OrientationEventListener mOrientationHelper;
@ -198,7 +194,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (findViewById(R.id.fragmentContainer) != null) { if (findViewById(R.id.fragmentContainer) != null) {
dialerFragment = new DialerFragment(); dialerFragment = new DialerFragment();
dialerFragment.setArguments(getIntent().getExtras()); dialerFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, dialerFragment, currentFragment.toString()).commit(); getFragmentManager().beginTransaction().add(R.id.fragmentContainer, dialerFragment, currentFragment.toString()).commit();
selectMenu(FragmentsAvailable.DIALER); selectMenu(FragmentsAvailable.DIALER);
} }
} }
@ -575,7 +571,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (currentFragment == FragmentsAvailable.DIALER) { if (currentFragment == FragmentsAvailable.DIALER) {
try { try {
dialerSavedState = getSupportFragmentManager().saveFragmentInstanceState(dialerFragment); dialerSavedState = getFragmentManager().saveFragmentInstanceState(dialerFragment);
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -661,7 +657,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
}*/ }*/
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) { if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) {
if (newFragmentType.isRightOf(currentFragment)) { if (newFragmentType.isRightOf(currentFragment)) {
@ -687,7 +683,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
} }
transaction.replace(R.id.fragmentContainer, newFragment, newFragmentType.toString()); transaction.replace(R.id.fragmentContainer, newFragment, newFragmentType.toString());
transaction.commitAllowingStateLoss(); transaction.commitAllowingStateLoss();
getSupportFragmentManager().executePendingTransactions(); getFragmentManager().executePendingTransactions();
currentFragment = newFragmentType; currentFragment = newFragmentType;
} }
@ -706,7 +702,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2); LinearLayout ll = (LinearLayout) findViewById(R.id.fragmentContainer2);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) { if (newFragmentType.shouldAddItselfToTheRightOf(currentFragment)) {
ll.setVisibility(View.VISIBLE); ll.setVisibility(View.VISIBLE);
@ -735,7 +731,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
transaction.replace(R.id.fragmentContainer, newFragment); transaction.replace(R.id.fragmentContainer, newFragment);
} }
transaction.commitAllowingStateLoss(); transaction.commitAllowingStateLoss();
getSupportFragmentManager().executePendingTransactions(); getFragmentManager().executePendingTransactions();
currentFragment = newFragmentType; currentFragment = newFragmentType;
if (newFragmentType == FragmentsAvailable.DIALER if (newFragmentType == FragmentsAvailable.DIALER
@ -746,7 +742,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|| newFragmentType == FragmentsAvailable.CHATLIST || newFragmentType == FragmentsAvailable.CHATLIST
|| newFragmentType == FragmentsAvailable.HISTORY) { || newFragmentType == FragmentsAvailable.HISTORY) {
try { try {
getSupportFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); getFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
} catch (java.lang.IllegalStateException e) { } catch (java.lang.IllegalStateException e) {
} }
@ -781,7 +777,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
String callTime = secondsToDisplayableString(log.getCallDuration()); String callTime = secondsToDisplayableString(log.getCallDuration());
String callDate = String.valueOf(log.getTimestamp()); String callDate = String.valueOf(log.getTimestamp());
Fragment fragment2 = getSupportFragmentManager().findFragmentById(R.id.fragmentContainer2); Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.HISTORY_DETAIL) { if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.HISTORY_DETAIL) {
HistoryDetailFragment historyDetailFragment = (HistoryDetailFragment) fragment2; HistoryDetailFragment historyDetailFragment = (HistoryDetailFragment) fragment2;
historyDetailFragment.changeDisplayedHistory(sipUri, displayName, pictureUri, status, callTime, callDate); historyDetailFragment.changeDisplayedHistory(sipUri, displayName, pictureUri, status, callTime, callDate);
@ -809,7 +805,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
} }
public void displayContact(Contact contact, boolean chatOnly) { public void displayContact(Contact contact, boolean chatOnly) {
Fragment fragment2 = getSupportFragmentManager().findFragmentById(R.id.fragmentContainer2); Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT) { if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT) {
ContactFragment contactFragment = (ContactFragment) fragment2; ContactFragment contactFragment = (ContactFragment) fragment2;
contactFragment.changeDisplayedContact(contact); contactFragment.changeDisplayedContact(contact);
@ -881,7 +877,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
if (isTablet()){ if (isTablet()){
if (currentFragment == FragmentsAvailable.CHATLIST || currentFragment == FragmentsAvailable.CHAT){ if (currentFragment == FragmentsAvailable.CHATLIST || currentFragment == FragmentsAvailable.CHAT){
Fragment fragment2 = getSupportFragmentManager().findFragmentById(R.id.fragmentContainer2); Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CHAT) { if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CHAT) {
ChatFragment chatFragment = (ChatFragment) fragment2; ChatFragment chatFragment = (ChatFragment) fragment2;
chatFragment.changeDisplayedChat(sipUri, displayName, pictureUri); chatFragment.changeDisplayedChat(sipUri, displayName, pictureUri);

View file

@ -84,18 +84,13 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
} }
nativeMessage = message; nativeMessage = message;
mContext = context; mContext = context;
layoutParams.setMargins(10, 0, 10, 0);
view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
layoutParams.setMargins(10, 0, 10, 0);
view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
if (message.isOutgoing()) { if (message.isOutgoing()) {
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null); view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
view.setBackgroundResource(R.drawable.chat_bubble_outgoing); view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
} else { } else {
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null); view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
view.setBackgroundResource(R.drawable.chat_bubble_incoming); view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
} }
view.setId(message.getStorageId()); view.setId(message.getStorageId());
@ -156,7 +151,7 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
} }
} }
TextView contact = (TextView) layout.findViewById(R.id.contact_header); TextView contact = (TextView) view.findViewById(R.id.contact_header);
contact.setText(timestampToHumanDate(context, message.getTime()) + " - " + LinphoneUtils.getUsernameFromAddress(message.getFrom().asStringUriOnly())); contact.setText(timestampToHumanDate(context, message.getTime()) + " - " + LinphoneUtils.getUsernameFromAddress(message.getFrom().asStringUriOnly()));
LinphoneChatMessage.State status = message.getStatus(); LinphoneChatMessage.State status = message.getStatus();