mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #21890 - pocmo:servoview-default-constructor, r=paulrouget
ServoView: Add default constructor. Android's `View` has multiple constructors. Currently only `ServoView(Context, AttributeSet)` is available. This constructor is usually used by Android when inflating a View from a layout XML file. However when creating the `View` in code no `AttributeSet` is available. --- - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21890) <!-- Reviewable:end -->
This commit is contained in:
commit
3455d223db
1 changed files with 9 additions and 0 deletions
|
@ -60,8 +60,17 @@ public class ServoView extends GLSurfaceView
|
|||
|
||||
private boolean mRedrawing;
|
||||
|
||||
public ServoView(Context context) {
|
||||
super(context);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public ServoView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
mActivity = (Activity) context;
|
||||
setFocusable(true);
|
||||
setFocusableInTouchMode(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue