2121 }
2222 }
2323*/
24+ const benchmarkRunner = require ( "./benchmark.js" ) ;
2425var MyActivity = ( function ( _super ) {
2526 __extends ( MyActivity , _super ) ;
2627 function MyActivity ( ) {
@@ -30,18 +31,23 @@ var MyActivity = (function (_super) {
3031 _super . prototype . onCreate . call ( this , bundle ) ;
3132 require ( './tests/testsWithContext' ) . run ( this ) ;
3233 //run jasmine
33- execute ( ) ;
34+ // execute();
3435 var layout = new android . widget . LinearLayout ( this ) ;
3536 layout . setOrientation ( 1 ) ;
3637 this . setContentView ( layout ) ;
3738 var textView = new android . widget . TextView ( this ) ;
3839 textView . setText ( "It's a button!" ) ;
40+ textView . setTextIsSelectable ( true ) ;
3941 layout . addView ( textView ) ;
4042
4143 var button = new android . widget . Button ( this ) ;
4244 button . setText ( "Hit me" ) ;
4345 layout . addView ( button ) ;
4446
47+ var button2 = new android . widget . Button ( this ) ;
48+ button2 . setText ( "Run Benchmark" ) ;
49+ layout . addView ( button2 ) ;
50+
4551 var Color = android . graphics . Color ;
4652 var colors = [
4753 Color . BLUE ,
@@ -62,6 +68,17 @@ var MyActivity = (function (_super) {
6268 } ,
6369 } )
6470 ) ;
71+ button2 . setOnClickListener (
72+ new android . view . View . OnClickListener ( "AppClickListener" , {
73+ onClick : function ( ) {
74+ const result = benchmarkRunner . runBenchmark ( ) ;
75+ setTimeout ( ( ) => {
76+ globalThis . gc ( ) ;
77+ } ) ;
78+ textView . setText ( result ) ;
79+ } ,
80+ } )
81+ ) ;
6582 } ;
6683 MyActivity = __decorate (
6784 [ JavaProxy ( "com.tns.NativeScriptActivity" ) ] ,
0 commit comments