Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 4036a27

Browse files
manoldonevdtopuzov
authored andcommitted
chore: update demos inherit from supportlib activity (#624)
1 parent 6ad04c8 commit 4036a27

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

‎demo/AngularApp/app/activity.android.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {setActivityCallbacks, AndroidActivityCallbacks} from "ui/frame";
22

33
@JavaProxy("org.myApp.MainActivity")
4-
class Activity extends android.app.Activity {
4+
class Activity extends android.support.v7.app.AppCompatActivity {
55
private _callbacks: AndroidActivityCallbacks;
66

77
protected onCreate(savedInstanceState: any): void { // android.os.Bundle

‎demo/AngularApp/webpack.config.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module.exports = env => {
4141
snapshot, // --env.snapshot
4242
uglify, // --env.uglify
4343
report, // --env.report
44+
sourceMap, // --env.sourceMap
4445
} = env;
4546

4647
const appFullPath = resolve(projectRoot, appPath);
@@ -98,7 +99,7 @@ module.exports = env => {
9899
"fs": "empty",
99100
"__dirname": false,
100101
},
101-
devtool: "none",
102+
devtool: sourceMap ? "inline-source-map" : "none",
102103
optimization: {
103104
splitChunks: {
104105
cacheGroups: {
@@ -196,6 +197,7 @@ module.exports = env => {
196197
// Define useful constants like TNS_WEBPACK
197198
new webpack.DefinePlugin({
198199
"global.TNS_WEBPACK": "true",
200+
"process": undefined,
199201
}),
200202
// Remove all files from the out dir.
201203
new CleanWebpackPlugin([ `${dist}/**/*` ]),
@@ -227,6 +229,7 @@ module.exports = env => {
227229
entryModule: resolve(appPath, "app.module#AppModule"),
228230
tsConfigPath: join(__dirname, "tsconfig.esm.json"),
229231
skipCodeGeneration: !aot,
232+
sourceMap: !!sourceMap,
230233
}),
231234
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
232235
new nsWebpack.WatchStateLoggerPlugin(),

‎demo/JavaScriptApp/app/activity.android.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const frame = require("ui/frame");
22

3-
const superProto = android.app.Activity.prototype;
4-
android.app.Activity.extend("org.myApp.MainActivity", {
3+
const superProto = android.support.v7.app.AppCompatActivity.prototype;
4+
android.support.v7.app.AppCompatActivity.extend("org.myApp.MainActivity", {
55
onCreate: function(savedInstanceState) {
66
if(!this._callbacks) {
77
frame.setActivityCallbacks(this);

‎demo/JavaScriptApp/webpack.config.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = env => {
4040
snapshot, // --env.snapshot
4141
uglify, // --env.uglify
4242
report, // --env.report
43+
sourceMap, // --env.sourceMap
4344
} = env;
4445

4546
const appFullPath = resolve(projectRoot, appPath);
@@ -95,7 +96,7 @@ module.exports = env => {
9596
"fs": "empty",
9697
"__dirname": false,
9798
},
98-
devtool: "none",
99+
devtool: sourceMap ? "inline-source-map" : "none",
99100
optimization: {
100101
splitChunks: {
101102
cacheGroups: {
@@ -171,6 +172,7 @@ module.exports = env => {
171172
// Define useful constants like TNS_WEBPACK
172173
new webpack.DefinePlugin({
173174
"global.TNS_WEBPACK": "true",
175+
"process": undefined,
174176
}),
175177
// Remove all files from the out dir.
176178
new CleanWebpackPlugin([ `${dist}/**/*` ]),

‎demo/TypeScriptApp/app/activity.android.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {setActivityCallbacks, AndroidActivityCallbacks} from "ui/frame";
22

33
@JavaProxy("org.myApp.MainActivity")
4-
class Activity extends android.app.Activity {
4+
class Activity extends android.support.v7.app.AppCompatActivity {
55
private _callbacks: AndroidActivityCallbacks;
66

77
protected onCreate(savedInstanceState: any): void { // android.os.Bundle

‎demo/TypeScriptApp/webpack.config.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = env => {
4040
snapshot, // --env.snapshot
4141
uglify, // --env.uglify
4242
report, // --env.report
43+
sourceMap, // --env.sourceMap
4344
} = env;
4445

4546
const appFullPath = resolve(projectRoot, appPath);
@@ -97,7 +98,7 @@ module.exports = env => {
9798
"fs": "empty",
9899
"__dirname": false,
99100
},
100-
devtool: "none",
101+
devtool: sourceMap ? "inline-source-map" : "none",
101102
optimization: {
102103
splitChunks: {
103104
cacheGroups: {
@@ -181,6 +182,7 @@ module.exports = env => {
181182
// Define useful constants like TNS_WEBPACK
182183
new webpack.DefinePlugin({
183184
"global.TNS_WEBPACK": "true",
185+
"process": undefined,
184186
}),
185187
// Remove all files from the out dir.
186188
new CleanWebpackPlugin([ `${dist}/**/*` ]),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /