FairEmail/app/src/main/java/eu/faircode/email/EditTextMultiAutoComplete.java

85 lines
2.5 KiB
Java
Raw Normal View History

2021-01-17 13:47:24 +00:00
package eu.faircode.email;
/*
This file is part of FairEmail.
FairEmail is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FairEmail is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
2022-01-01 08:46:36 +00:00
Copyright 2018-2022 by Marcel Bokhorst (M66B)
2021-01-17 13:47:24 +00:00
*/
import android.content.Context;
2021-12-15 16:51:06 +00:00
import android.graphics.Canvas;
2021-01-17 13:47:24 +00:00
import android.util.AttributeSet;
2021-12-15 16:51:06 +00:00
import android.view.MotionEvent;
2021-01-17 13:47:24 +00:00
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView;
public class EditTextMultiAutoComplete extends AppCompatMultiAutoCompleteTextView {
public EditTextMultiAutoComplete(@NonNull Context context) {
super(context);
Helper.setKeyboardIncognitoMode(this, context);
}
public EditTextMultiAutoComplete(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
Helper.setKeyboardIncognitoMode(this, context);
}
public EditTextMultiAutoComplete(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
Helper.setKeyboardIncognitoMode(this, context);
}
2021-12-15 16:51:06 +00:00
@Override
public boolean onPreDraw() {
try {
return super.onPreDraw();
} catch (Throwable ex) {
Log.w(ex);
return true;
}
}
@Override
protected void onDraw(Canvas canvas) {
try {
super.onDraw(canvas);
} catch (Throwable ex) {
Log.w(ex);
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
try {
return super.dispatchTouchEvent(event);
} catch (Throwable ex) {
Log.w(ex);
return false;
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
try {
return super.onTouchEvent(event);
} catch (Throwable ex) {
Log.w(ex);
return false;
}
}
}