Small fixes
This commit is contained in:
parent
657c0d7790
commit
a2c3e16158
4 changed files with 38 additions and 38 deletions
|
@ -6,9 +6,9 @@
|
||||||
android:radius="25dp" />
|
android:radius="25dp" />
|
||||||
|
|
||||||
<stroke
|
<stroke
|
||||||
android:color="@color/nmissed_calls_background" />
|
android:color="@color/missed_calls_background" />
|
||||||
|
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/nmissed_calls_background" />
|
android:color="@color/missed_calls_background" />
|
||||||
|
|
||||||
</shape>
|
</shape>
|
|
@ -9,7 +9,8 @@
|
||||||
<color name="numpad_background_bottom">#ffe4edf2</color>
|
<color name="numpad_background_bottom">#ffe4edf2</color>
|
||||||
<color name="numpad_background_dialer">#ffd8d8d8</color>
|
<color name="numpad_background_dialer">#ffd8d8d8</color>
|
||||||
<color name="numpad_background_top">#ffb1bdc3</color>
|
<color name="numpad_background_top">#ffb1bdc3</color>
|
||||||
<color name="nmissed_calls_background">#ffcf4c29</color>
|
|
||||||
|
<color name="missed_calls_background">#ffcf4c29</color>
|
||||||
|
|
||||||
<color name="transparent">#00000000</color>
|
<color name="transparent">#00000000</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -38,9 +38,7 @@ import android.preference.PreferenceManager;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -51,8 +49,6 @@ import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
|
@ -641,10 +637,6 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCallStateChanged(final LinphoneCall call, State state, String message) {
|
public void onCallStateChanged(final LinphoneCall call, State state, String message) {
|
||||||
if (state==State.Error) {
|
|
||||||
displayCustomToast(null, message, Toast.LENGTH_LONG);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LinphoneManager.getLc().getCallsNb() == 0) {
|
if (LinphoneManager.getLc().getCallsNb() == 0) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
|
@ -682,32 +674,6 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayCustomToast(final String title, final String message, final int duration) {
|
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
LayoutInflater inflater = getLayoutInflater();
|
|
||||||
View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toastRoot));
|
|
||||||
|
|
||||||
TextView toastTitle = (TextView) layout.findViewById(R.id.toastTitle);
|
|
||||||
if (title == null) {
|
|
||||||
toastTitle.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
toastTitle.setText(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextView toastText = (TextView) layout.findViewById(R.id.toastMessage);
|
|
||||||
toastText.setText(message);
|
|
||||||
|
|
||||||
final Toast toast = new Toast(getApplicationContext());
|
|
||||||
toast.setGravity(Gravity.CENTER, 0, 0);
|
|
||||||
toast.setDuration(duration);
|
|
||||||
toast.setView(layout);
|
|
||||||
toast.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCallEncryptionChanged(final LinphoneCall call, boolean encrypted, String authenticationToken) {
|
public void onCallEncryptionChanged(final LinphoneCall call, boolean encrypted, String authenticationToken) {
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
|
|
|
@ -59,7 +59,9 @@ import android.support.v4.app.Fragment.SavedState;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.OrientationEventListener;
|
import android.view.OrientationEventListener;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
@ -71,6 +73,7 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
|
@ -672,6 +675,10 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCallStateChanged(LinphoneCall call, State state, String message) {
|
public void onCallStateChanged(LinphoneCall call, State state, String message) {
|
||||||
|
if (state == State.Error) {
|
||||||
|
displayCustomToast(null, message, Toast.LENGTH_LONG);
|
||||||
|
}
|
||||||
|
|
||||||
if (state == State.IncomingReceived) {
|
if (state == State.IncomingReceived) {
|
||||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||||
} else if (state == State.OutgoingInit) {
|
} else if (state == State.OutgoingInit) {
|
||||||
|
@ -688,6 +695,32 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
||||||
displayMissedCalls(missedCalls);
|
displayMissedCalls(missedCalls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void displayCustomToast(final String title, final String message, final int duration) {
|
||||||
|
mHandler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
LayoutInflater inflater = getLayoutInflater();
|
||||||
|
View layout = inflater.inflate(R.layout.toast, (ViewGroup) findViewById(R.id.toastRoot));
|
||||||
|
|
||||||
|
TextView toastTitle = (TextView) layout.findViewById(R.id.toastTitle);
|
||||||
|
if (title == null) {
|
||||||
|
toastTitle.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
toastTitle.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView toastText = (TextView) layout.findViewById(R.id.toastMessage);
|
||||||
|
toastText.setText(message);
|
||||||
|
|
||||||
|
final Toast toast = new Toast(getApplicationContext());
|
||||||
|
toast.setGravity(Gravity.CENTER, 0, 0);
|
||||||
|
toast.setDuration(duration);
|
||||||
|
toast.setView(layout);
|
||||||
|
toast.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAddresGoToDialerAndCall(String number, String name, Uri photo) {
|
public void setAddresGoToDialerAndCall(String number, String name, Uri photo) {
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
|
|
Loading…
Reference in a new issue