Skip to content
Snippets Groups Projects
Commit 84208a3f authored by Alexandre Lision's avatar Alexandre Lision
Browse files

* #30590: show/hide keyboard in call

parent 8e21b1e5
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,8 @@ as that of the covered work. ...@@ -90,7 +90,8 @@ as that of the covered work.
<activity <activity
android:name="com.savoirfairelinux.sflphone.client.CallActivity" android:name="com.savoirfairelinux.sflphone.client.CallActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="portrait" > android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" /> <action android:name="android.intent.action.CALL_PRIVILEGED" />
......
...@@ -52,8 +52,11 @@ import android.view.LayoutInflater; ...@@ -52,8 +52,11 @@ import android.view.LayoutInflater;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback; import android.view.SurfaceHolder.Callback;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -275,7 +278,7 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe ...@@ -275,7 +278,7 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.frag_call, container, false); final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.frag_call, container, false);
view = (BubblesView) rootView.findViewById(R.id.main_view); view = (BubblesView) rootView.findViewById(R.id.main_view);
view.setFragment(this); view.setFragment(this);
...@@ -288,6 +291,15 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe ...@@ -288,6 +291,15 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
call_icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_call); call_icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_call);
transfer_icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_phones_call_transfer_icon); transfer_icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_phones_call_transfer_icon);
((ImageButton) rootView.findViewById(R.id.dialpad_btn)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_IMPLICIT_ONLY);
}
});
// Do nothing here, the view is not initialized yet. // Do nothing here, the view is not initialized yet.
return rootView; return rootView;
} }
...@@ -382,7 +394,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe ...@@ -382,7 +394,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
getBubbleFor(myself, model.width / 2, model.height / 2 + radiusCalls); getBubbleFor(myself, model.width / 2, model.height / 2 + radiusCalls);
getBubbleFor(conf.getParticipants().get(0), model.width / 2, model.height / 2 - radiusCalls); getBubbleFor(conf.getParticipants().get(0), model.width / 2, model.height / 2 - radiusCalls);
model.clearAttractors(); model.clearAttractors();
model.addAttractor(new Attractor(new PointF(model.width / 2, model.height / 2), ATTRACTOR_SIZE, new Attractor.Callback() { model.addAttractor(new Attractor(new PointF(model.width / 2, model.height / 2), ATTRACTOR_SIZE, new Attractor.Callback() {
@Override @Override
...@@ -505,7 +516,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe ...@@ -505,7 +516,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
if (conf.getParticipants().size() == 1) { if (conf.getParticipants().size() == 1) {
if (conf.getParticipants().get(0).isIncoming() && conf.getParticipants().get(0).isRinging()) { if (conf.getParticipants().get(0).isIncoming() && conf.getParticipants().get(0).isRinging()) {
initIncomingCallDisplay(); initIncomingCallDisplay();
} else { } else {
...@@ -551,6 +561,9 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe ...@@ -551,6 +561,9 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
@Override @Override
public void surfaceDestroyed(SurfaceHolder holder) { public void surfaceDestroyed(SurfaceHolder holder) {
// check that soft input is hidden
InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
} }
public BubblesView getBubbleView() { public BubblesView getBubbleView() {
......
...@@ -35,7 +35,6 @@ import android.app.Activity; ...@@ -35,7 +35,6 @@ import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -162,7 +161,6 @@ public class DialingFragment extends Fragment implements OnTouchListener { ...@@ -162,7 +161,6 @@ public class DialingFragment extends Fragment implements OnTouchListener {
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.showSoftInput(textField.getEdit_text(), 0);
textField.setError(null); textField.setError(null);
lManager.hideSoftInputFromWindow(textField.getWindowToken(), 0); lManager.hideSoftInputFromWindow(textField.getWindowToken(), 0);
return false; return false;
......
...@@ -137,6 +137,10 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, ...@@ -137,6 +137,10 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback,
@Override @Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.w(TAG, "surfaceChanged " + width + "-" + height); Log.w(TAG, "surfaceChanged " + width + "-" + height);
if(height < model.height) // probably showing the keyboard, don't move!
return;
thread.setSurfaceSize(width, height); thread.setSurfaceSize(width, height);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment