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.
<activity
android:name="com.savoirfairelinux.sflphone.client.CallActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
......
......@@ -52,8 +52,11 @@ import android.view.LayoutInflater;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
......@@ -275,7 +278,7 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
@Override
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.setFragment(this);
......@@ -288,6 +291,15 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
call_icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_call);
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.
return rootView;
}
......@@ -381,7 +393,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
int radiusCalls = (int) (model.width / 2 - BUBBLE_SIZE);
getBubbleFor(myself, model.width / 2, model.height / 2 + radiusCalls);
getBubbleFor(conf.getParticipants().get(0), model.width / 2, model.height / 2 - radiusCalls);
model.clearAttractors();
model.addAttractor(new Attractor(new PointF(model.width / 2, model.height / 2), ATTRACTOR_SIZE, new Attractor.Callback() {
......@@ -505,7 +516,6 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
if (conf.getParticipants().size() == 1) {
if (conf.getParticipants().get(0).isIncoming() && conf.getParticipants().get(0).isRinging()) {
initIncomingCallDisplay();
} else {
......@@ -551,6 +561,9 @@ public class CallFragment extends Fragment implements Callback, SensorEventListe
@Override
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() {
......
......@@ -35,7 +35,6 @@ import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
......@@ -162,7 +161,6 @@ public class DialingFragment extends Fragment implements OnTouchListener {
@Override
public boolean onTouch(View v, MotionEvent event) {
InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.showSoftInput(textField.getEdit_text(), 0);
textField.setError(null);
lManager.hideSoftInputFromWindow(textField.getWindowToken(), 0);
return false;
......
......@@ -137,6 +137,10 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback,
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.w(TAG, "surfaceChanged " + width + "-" + height);
if(height < model.height) // probably showing the keyboard, don't move!
return;
thread.setSurfaceSize(width, height);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment