Kaydet (Commit) e1f9b539 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: Actually we don't need ViewFactory

Change-Id: I2d1ccafefe9c52d0536601ba7ff219e6547ceb20
üst aecce900
...@@ -96,8 +96,6 @@ public class LibreOfficeMainActivity extends LOAbout { ...@@ -96,8 +96,6 @@ public class LibreOfficeMainActivity extends LOAbout {
mMainHandler = new Handler(); mMainHandler = new Handler();
LayoutInflater.from(this).setFactory(ViewFactory.getInstance());
if (getIntent().getData() != null) { if (getIntent().getData() != null) {
mInputFile = getIntent().getData().getPath(); mInputFile = getIntent().getData().getPath();
} else { } else {
......
package org.libreoffice;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import org.mozilla.gecko.TextSelectionHandle;
import org.mozilla.gecko.gfx.LayerView;
public class ViewFactory implements LayoutInflater.Factory {
private static final String LOGTAG = ViewFactory.class.getSimpleName();
private static final String LAYER_VIEW_ID = "org.mozilla.gecko.gfx.LayerView";
private static final String TEXT_SELECTION_HANDLE_ID = "org.mozilla.gecko.TextSelectionHandle";
private static final ViewFactory INSTANCE = new ViewFactory();
private ViewFactory() {
}
public static LayoutInflater.Factory getInstance() {
return INSTANCE;
}
@Override
public View onCreateView(String name, Context context, AttributeSet attrs) {
if (name.equals(LAYER_VIEW_ID)) {
Log.i(LOGTAG, "Creating custom Gecko view: " + name);
return new LayerView(context, attrs);
} else if (name.equals(TEXT_SELECTION_HANDLE_ID)) {
Log.i(LOGTAG, "Creating custom Gecko view: " + name);
return new TextSelectionHandle(context, attrs);
}
return null;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment