You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Clean up the GodotPlugin public API.
This commit is contained in:
@@ -262,7 +262,7 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe
|
||||
|
||||
// Include the returned non-null views in the Godot view hierarchy.
|
||||
for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {
|
||||
View pluginView = plugin.onMainCreateView(this);
|
||||
View pluginView = plugin.onMainCreate(this);
|
||||
if (pluginView != null) {
|
||||
layout.addView(pluginView);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.godotengine.godot.Godot;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.View;
|
||||
@@ -92,6 +93,14 @@ public abstract class GodotPlugin {
|
||||
return godot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides access to the underlying {@link Activity}.
|
||||
*/
|
||||
@Nullable
|
||||
protected Activity getActivity() {
|
||||
return godot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the plugin with Godot native code.
|
||||
*
|
||||
@@ -145,13 +154,14 @@ public abstract class GodotPlugin {
|
||||
* Invoked once during the Godot Android initialization process after creation of the
|
||||
* {@link org.godotengine.godot.GodotView} view.
|
||||
* <p>
|
||||
* This method should be overridden by descendants of this class that would like to add
|
||||
* their view/layout to the Godot view hierarchy.
|
||||
* The plugin can return a non-null {@link View} layout in order to add it to the Godot view
|
||||
* hierarchy.
|
||||
*
|
||||
* @return the view to be included; null if no views should be included.
|
||||
* @see Activity#onCreate(Bundle)
|
||||
* @return the plugin's view to be included; null if no views should be included.
|
||||
*/
|
||||
@Nullable
|
||||
public View onMainCreateView(Activity activity) {
|
||||
public View onMainCreate(Activity activity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user