Final icons for bluetooth + some fixes

This commit is contained in:
Sylvain Berfini 2013-04-03 09:58:22 +02:00
parent 71fda6cced
commit 53933a4105
41 changed files with 73 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -1,9 +1,9 @@
<?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/route_bluetooth_off_over" />
android:drawable="@drawable/routes_bluetooth_off_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_bluetooth_off_disabled" />
android:drawable="@drawable/routes_bluetooth_off_disabled" />
<item
android:drawable="@drawable/route_bluetooth_off_default" />
android:drawable="@drawable/routes_bluetooth_off_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?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/route_bluetooth_off_over" />
android:drawable="@drawable/routes_bluetooth_on_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_bluetooth_off_disabled" />
android:drawable="@drawable/routes_bluetooth_on_disabled" />
<item
android:drawable="@drawable/route_bluetooth_on_default" />
android:drawable="@drawable/routes_bluetooth_on_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?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/route_phone_off_over" />
android:drawable="@drawable/routes_phone_off_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_phone_off_disabled" />
android:drawable="@drawable/routes_phone_off_disabled" />
<item
android:drawable="@drawable/route_phone_off_default" />
android:drawable="@drawable/routes_phone_off_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?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/route_phone_off_over" />
android:drawable="@drawable/routes_phone_on_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_phone_off_disabled" />
android:drawable="@drawable/routes_phone_on_disabled" />
<item
android:drawable="@drawable/route_phone_on_default" />
android:drawable="@drawable/routes_phone_on_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?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/route_speaker_off_over" />
android:drawable="@drawable/routes_speaker_off_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_speaker_off_disabled" />
android:drawable="@drawable/routes_speaker_off_disabled" />
<item
android:drawable="@drawable/route_speaker_off_default" />
android:drawable="@drawable/routes_speaker_off_default" />
</selector>

View file

@ -1,9 +1,9 @@
<?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/route_speaker_off_over" />
android:drawable="@drawable/routes_speaker_on_over" />
<item android:state_enabled="false"
android:drawable="@drawable/route_speaker_off_disabled" />
android:drawable="@drawable/routes_speaker_on_disabled" />
<item
android:drawable="@drawable/route_speaker_on_default" />
android:drawable="@drawable/routes_speaker_on_default" />
</selector>

45
res/raw/lpconfig.xsd Normal file
View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.linphone.org/xsds/lpconfig.xsd"
xmlns:tns="http://www.linphone.org/xsds/lpconfig.xsd"
elementFormDefault="qualified">
<xs:element name="config" type="tns:LPConfig"></xs:element>
<xs:complexType name="LPConfig">
<xs:sequence>
<xs:element name="section" type="tns:LPSection" minOccurs="0" maxOccurs="unbounded"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LPSection">
<xs:sequence>
<xs:element name="entry" type="tns:LPEntry" maxOccurs="unbounded" minOccurs="0">
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="LPEntry">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="overwrite" type="xs:boolean"
use="optional" default="false">
</xs:attribute>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"></xs:minLength>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>

View file

@ -407,6 +407,7 @@ public class InCallActivity extends FragmentActivity implements
}
else if (id == R.id.routeBluetooth) {
LinphoneManager.getInstance().routeAudioToBluetooth();
isSpeakerEnabled = false;
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_on);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
@ -414,6 +415,7 @@ public class InCallActivity extends FragmentActivity implements
}
else if (id == R.id.routeReceiver) {
LinphoneManager.getInstance().routeAudioToReceiver();
isSpeakerEnabled = false;
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
@ -421,6 +423,7 @@ public class InCallActivity extends FragmentActivity implements
}
else if (id == R.id.routeSpeaker) {
LinphoneManager.getInstance().routeAudioToSpeaker();
isSpeakerEnabled = true;
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
@ -940,24 +943,7 @@ public class InCallActivity extends FragmentActivity implements
}
private void hideOrDisplayAudioRoutes()
{
if (isSpeakerEnabled) {
speaker.setBackgroundResource(R.drawable.speaker_on);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_on);
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
} else {
speaker.setBackgroundResource(R.drawable.speaker_off);
routeSpeaker.setBackgroundResource(R.drawable.route_speaker_off);
if (LinphoneManager.getInstance().isUsingBluetoothAudioRoute) {
routeReceiver.setBackgroundResource(R.drawable.route_receiver_off);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_on);
} else {
routeReceiver.setBackgroundResource(R.drawable.route_receiver_on);
routeBluetooth.setBackgroundResource(R.drawable.route_bluetooth_off);
}
}
{
if (routeSpeaker.getVisibility() == View.VISIBLE) {
routeSpeaker.setVisibility(View.INVISIBLE);
routeBluetooth.setVisibility(View.INVISIBLE);

View file

@ -954,7 +954,13 @@ public final class LinphoneManager implements LinphoneCoreListener {
mLc.enablePayloadType(videoCodec, enable);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void doDestroy() {
try {
if (Version.sdkAboveOrEqual(Version.API11_HONEYCOMB_30))
mBluetoothAdapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset);
} catch (Exception e) {}
try {
mTimer.cancel();
mLc.destroy();