-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove NativeScriptActivity and NativeScriptApplication from git…
…ignore
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
test-app/runtime/src/main/java/com/tns/NativeScriptActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.tns; | ||
|
||
public class NativeScriptActivity extends org.nativescript.NativeScriptActivity { | ||
|
||
} |
110 changes: 110 additions & 0 deletions
110
test-app/runtime/src/main/java/org/nativescript/NativeScriptActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package org.nativescript; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import com.tns.embedding.CallbacksStore; | ||
import com.tns.embedding.EmbeddableActivityCallbacks; | ||
|
||
import org.nativescript.android.runtime.R; | ||
|
||
public class NativeScriptActivity extends AppCompatActivity { | ||
|
||
private final EmbeddableActivityCallbacks callbacks = CallbacksStore.getActivityCallbacks(); | ||
static View nativeScriptView = null; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
callbacks.setActivity(this); | ||
callbacks.onCreate(savedInstanceState); | ||
// drawNativeScriptApp(savedInstanceState); | ||
} | ||
|
||
@Override | ||
public void onCreate(android.os.Bundle savedInstanceState, android.os.PersistableBundle persistableBundle) { | ||
super.onCreate(savedInstanceState, persistableBundle); | ||
callbacks.setActivity(this); | ||
callbacks.onCreate(savedInstanceState, persistableBundle); | ||
// drawNativeScriptApp(savedInstanceState); | ||
} | ||
|
||
private void drawNativeScriptApp(Bundle savedInstanceState) { | ||
setContentView(R.layout.main); | ||
if (savedInstanceState == null) { | ||
getSupportFragmentManager().beginTransaction() | ||
.replace(R.id.container, new NativeScriptFragment()) | ||
.commitNow(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onPostResume() { | ||
super.onPostResume(); | ||
callbacks.onPostResume(); | ||
} | ||
|
||
@Override | ||
protected void onStart() { | ||
super.onStart(); | ||
callbacks.onStart(); | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
super.onStop(); | ||
callbacks.onStop(); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
try { | ||
callbacks.onDestroy(); | ||
nativeScriptView = null; | ||
} finally { | ||
super.onDestroy(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onActivityResult(int param_0, int param_1, android.content.Intent param_2) { | ||
super.onActivityResult(param_0, param_1, param_2); | ||
callbacks.onActivityResult(param_0, param_1, param_2); | ||
} | ||
|
||
@SuppressLint("MissingSuperCall") | ||
@Override | ||
public void onRequestPermissionsResult(int param_0, java.lang.String[] param_1, int[] param_2) { | ||
callbacks.onRequestPermissionsResult(param_0, param_1, param_2); | ||
} | ||
|
||
@Override | ||
protected void onSaveInstanceState(android.os.Bundle param_0) { | ||
super.onSaveInstanceState(param_0); | ||
callbacks.onSaveInstanceState(param_0); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
callbacks.onBackPressed(); | ||
} | ||
|
||
@Override | ||
protected void onNewIntent(android.content.Intent param_0) { | ||
super.onNewIntent(param_0); | ||
super.setIntent(param_0); | ||
callbacks.onNewIntent(param_0); | ||
} | ||
|
||
@Override | ||
public void onSaveInstanceState(android.os.Bundle param_0, android.os.PersistableBundle param_1) { | ||
super.onSaveInstanceState(param_0, param_1); | ||
} | ||
|
||
public void superOnBackPressed() { | ||
super.onBackPressed(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test-app/runtime/src/main/java/org/nativescript/NativeScriptApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.nativescript; | ||
|
||
import static org.nativescript.Bootstrap.bootstrapNativeScriptRuntime; | ||
|
||
import android.app.Application; | ||
|
||
public class NativeScriptApplication extends Application { | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
bootstrapNativeScriptRuntime(this); | ||
} | ||
} |