Added paused/running icon for each call

This commit is contained in:
Sylvain Berfini 2012-07-10 17:27:14 +02:00
parent ca7c941930
commit 30becf5989
9 changed files with 28 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
res/drawable/pause_default Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/drawable/pause_over Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/drawable/play_default Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
res/drawable/play_over Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -15,19 +15,29 @@
android:id="@+id/contactNameOrNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:gravity="left"
android:layout_weight="0.4"
android:gravity="center_vertical|left"
android:paddingLeft="20dp"
android:textColor="@android:color/white"
android:textSize="22dp" />
<ImageView
android:id="@+id/callStatus"
android:layout_width="35dp"
android:layout_height="35dp"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:scaleType="fitCenter"
android:src="@drawable/pause_default" />
<Chronometer
android:id="@+id/callTimer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="20dp"
android:gravity="right"
android:gravity="center_vertical|right"
android:textColor="@android:color/white"
android:textSize="22dp" />

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCoreFactory;
import android.app.Activity;
@ -71,6 +72,13 @@ public class AudioCallFragment extends Fragment {
contact.setText(lAddress.getDisplayName());
}
ImageView callState = (ImageView) callView.findViewById(R.id.callStatus);
if (call.getState() == State.Paused || call.getState() == State.PausedByRemote) {
callState.setImageResource(R.drawable.pause_default);
} else {
callState.setImageResource(R.drawable.play_default);
}
ImageView contactPicture = (ImageView) callView.findViewById(R.id.contactPicture);
if (pictureUri != null) {
LinphoneUtils.setImagePictureFromUri(callView.getContext(), contactPicture, Uri.parse(pictureUri.toString()), R.drawable.unknown_small);

View file

@ -438,7 +438,6 @@ public class InCallActivity extends FragmentActivity implements
enableAndRefreshInCallActions();
}
if (state == State.CallEnd || state == State.CallReleased || state == State.Error) {
if (audioCallFragment != null) {
mHandler.post(new Runnable() {
@Override
@ -448,7 +447,6 @@ public class InCallActivity extends FragmentActivity implements
});
}
}
}
@Override
public void onCallEncryptionChanged(LinphoneCall call, boolean encrypted,