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:
bors-servo 2018-10-09 01:11:35 -04:00 committed by GitHub
commit 3455d223db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);