Fix numpad/call insensitive buttons if drawer locked
This commit is contained in:
parent
53d878f764
commit
ee2677365d
3 changed files with 40 additions and 2 deletions
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<SlidingDrawer
|
<org.linphone.ui.LockableSlidingDrawer
|
||||||
android:id="@+id/drawer"
|
android:id="@+id/drawer"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent" />
|
android:layout_height="fill_parent" />
|
||||||
|
|
||||||
</SlidingDrawer>
|
</org.linphone.ui.LockableSlidingDrawer>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,9 @@ import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.View.OnTouchListener;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.Adapter;
|
import android.widget.Adapter;
|
||||||
|
@ -265,6 +267,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
|
||||||
boolean disable_sliding_drawer = getResources().getBoolean(R.bool.disable_dialer_sliding_drawer);
|
boolean disable_sliding_drawer = getResources().getBoolean(R.bool.disable_dialer_sliding_drawer);
|
||||||
|
|
||||||
if (disable_sliding_drawer) {
|
if (disable_sliding_drawer) {
|
||||||
|
drawer.close();
|
||||||
drawer.lock();
|
drawer.lock();
|
||||||
} else {
|
} else {
|
||||||
drawer.setOnDrawerScrollListener(new OnDrawerScrollListener() {
|
drawer.setOnDrawerScrollListener(new OnDrawerScrollListener() {
|
||||||
|
|
35
src/org/linphone/ui/LockableSlidingDrawer.java
Normal file
35
src/org/linphone/ui/LockableSlidingDrawer.java
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
package org.linphone.ui;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.widget.SlidingDrawer;
|
||||||
|
|
||||||
|
public class LockableSlidingDrawer extends SlidingDrawer {
|
||||||
|
private boolean locked = false;
|
||||||
|
|
||||||
|
public LockableSlidingDrawer(Context context) {
|
||||||
|
super(context, null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LockableSlidingDrawer(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LockableSlidingDrawer(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
if (this.locked) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void lock() {
|
||||||
|
this.locked = true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue