Use marquee in contact view for long sip addresses

This commit is contained in:
Sylvain Berfini 2012-12-17 13:56:59 +01:00
parent 0d8200a9a8
commit 7000bc4b3d
3 changed files with 11 additions and 1 deletions

View file

@ -12,6 +12,11 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="left" /> android:gravity="left" />

View file

@ -209,6 +209,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
// Workaround for SGS3 issue // Workaround for SGS3 issue
if (savedInstanceState != null) { if (savedInstanceState != null) {
fileToUploadPath = savedInstanceState.getString("fileToUploadPath"); fileToUploadPath = savedInstanceState.getString("fileToUploadPath");
imageToUpload = savedInstanceState.getParcelable("imageToUpload");
} }
if (fileToUploadPath != null || imageToUpload != null) { if (fileToUploadPath != null || imageToUpload != null) {
sendImage.post(new Runnable() { sendImage.post(new Runnable() {
@ -225,6 +226,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
outState.putString("fileToUploadPath", fileToUploadPath); outState.putString("fileToUploadPath", fileToUploadPath);
outState.putParcelable("imageToUpload", imageToUpload);
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
} }

View file

@ -103,7 +103,10 @@ public class ContactFragment extends Fragment implements OnClickListener {
if (numberOrAddress.startsWith("sip:")) { if (numberOrAddress.startsWith("sip:")) {
displayednumberOrAddress = displayednumberOrAddress.substring(4); displayednumberOrAddress = displayednumberOrAddress.substring(4);
} }
((TextView) v.findViewById(R.id.numeroOrAddress)).setText(displayednumberOrAddress);
TextView tv = (TextView) v.findViewById(R.id.numeroOrAddress);
tv.setText(displayednumberOrAddress);
tv.setSelected(true);
if (!displayChatAddressOnly) { if (!displayChatAddressOnly) {
v.findViewById(R.id.dial).setOnClickListener(dialListener); v.findViewById(R.id.dial).setOnClickListener(dialListener);