Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

chore: update demos inherit from supportlib activity #624

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/AngularApp/app/activity.android.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {setActivityCallbacks, AndroidActivityCallbacks} from "ui/frame";

@JavaProxy("org.myApp.MainActivity")
class Activity extends android.app.Activity {
class Activity extends android.support.v7.app.AppCompatActivity {
private _callbacks: AndroidActivityCallbacks;

protected onCreate(savedInstanceState: any): void { // android.os.Bundle
Expand Down
5 changes: 4 additions & 1 deletion demo/AngularApp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = env => {
snapshot, // --env.snapshot
uglify, // --env.uglify
report, // --env.report
sourceMap, // --env.sourceMap
} = env;

const appFullPath = resolve(projectRoot, appPath);
Expand Down Expand Up @@ -98,7 +99,7 @@ module.exports = env => {
"fs": "empty",
"__dirname": false,
},
devtool: "none",
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
splitChunks: {
cacheGroups: {
Expand Down Expand Up @@ -196,6 +197,7 @@ module.exports = env => {
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"process": undefined,
}),
// Remove all files from the out dir.
new CleanWebpackPlugin([ `${dist}/**/*` ]),
Expand Down Expand Up @@ -227,6 +229,7 @@ module.exports = env => {
entryModule: resolve(appPath, "app.module#AppModule"),
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
skipCodeGeneration: !aot,
sourceMap: !!sourceMap,
}),
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
new nsWebpack.WatchStateLoggerPlugin(),
Expand Down
4 changes: 2 additions & 2 deletions demo/JavaScriptApp/app/activity.android.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const frame = require("ui/frame");

const superProto = android.app.Activity.prototype;
android.app.Activity.extend("org.myApp.MainActivity", {
const superProto = android.support.v7.app.AppCompatActivity.prototype;
android.support.v7.app.AppCompatActivity.extend("org.myApp.MainActivity", {
onCreate: function(savedInstanceState) {
if(!this._callbacks) {
frame.setActivityCallbacks(this);
Expand Down
4 changes: 3 additions & 1 deletion demo/JavaScriptApp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = env => {
snapshot, // --env.snapshot
uglify, // --env.uglify
report, // --env.report
sourceMap, // --env.sourceMap
} = env;

const appFullPath = resolve(projectRoot, appPath);
Expand Down Expand Up @@ -95,7 +96,7 @@ module.exports = env => {
"fs": "empty",
"__dirname": false,
},
devtool: "none",
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
splitChunks: {
cacheGroups: {
Expand Down Expand Up @@ -171,6 +172,7 @@ module.exports = env => {
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"process": undefined,
}),
// Remove all files from the out dir.
new CleanWebpackPlugin([ `${dist}/**/*` ]),
Expand Down
2 changes: 1 addition & 1 deletion demo/TypeScriptApp/app/activity.android.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {setActivityCallbacks, AndroidActivityCallbacks} from "ui/frame";

@JavaProxy("org.myApp.MainActivity")
class Activity extends android.app.Activity {
class Activity extends android.support.v7.app.AppCompatActivity {
private _callbacks: AndroidActivityCallbacks;

protected onCreate(savedInstanceState: any): void { // android.os.Bundle
Expand Down
4 changes: 3 additions & 1 deletion demo/TypeScriptApp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = env => {
snapshot, // --env.snapshot
uglify, // --env.uglify
report, // --env.report
sourceMap, // --env.sourceMap
} = env;

const appFullPath = resolve(projectRoot, appPath);
Expand Down Expand Up @@ -97,7 +98,7 @@ module.exports = env => {
"fs": "empty",
"__dirname": false,
},
devtool: "none",
devtool: sourceMap ? "inline-source-map" : "none",
optimization: {
splitChunks: {
cacheGroups: {
Expand Down Expand Up @@ -181,6 +182,7 @@ module.exports = env => {
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"process": undefined,
}),
// Remove all files from the out dir.
new CleanWebpackPlugin([ `${dist}/**/*` ]),
Expand Down