Giter Club home page Giter Club logo

nativescript-accordion's Introduction

npm npm

NativeScript Accordion

Buy Me A Beer

Install

tns plugin add nativescript-accordion

Usage

IMPORTANT: Make sure you include xmlns:accordion="nativescript-accordion" on the Page element

Data

By default the plugin will look for the items property in each item but you can set name by setting childItems="blah" on the Accordion instance

this.items = [
      {
        title: "1", footer: "10", headerText: "First", footerText: "4",
        blah: [
          { image: "~/images/a9ff17db85f8136619feb0d5a200c0e4.png", text: "Stop" },
          { text: "Drop", image: "http://static.srcdn.com/wp-content/uploads/Superman-fighting-Goku.jpg" }
        ]
      }
    ]
selectedIndexes = [0,3]

Core

<accordion:Accordion items="{{items}}" itemHeaderTap="tapped" itemContentTap="childTapped"  allowMultiple="true" id="ac" selectedIndexes="selectedIndexes">
            <accordion:Accordion.headerTemplate>
                <GridLayout backgroundColor="green" columns="auto,*">
                    <Label text="{{title}}"/>
                    <Label col="1" text="+"/>
                </GridLayout>
            </accordion:Accordion.headerTemplate>

            <accordion:Accordion.itemHeaderTemplate>
                <StackLayout>
                    <Label text="{{text}}"/>
                </StackLayout>
            </accordion:Accordion.itemHeaderTemplate>
            
            
            <accordion:Accordion.itemContentTemplate>
                            <StackLayout>
                                <Image src="{{image}}"/>
                            </StackLayout>
              </accordion:Accordion.itemContentTemplate>

            <accordion:Accordion.footerTemplate>
                <GridLayout backgroundColor="yellow" columns="auto,*">
                    <Label text="{{footer}}"/>
                    <Label col="1" text="-"/>
                </GridLayout>
            </accordion:Accordion.footerTemplate>

        </accordion:Accordion>

Multi Template

<accordion:Accordion childItems="children" id="accordion" selectedIndexesChange="onChange" height="100%"
                             items="{{items}}" allowMultiple="true" selectedIndexes="{{selectedIndexes}}"
                             headerTemplateSelector="$index % 2 !== 0 ? 'odd' : 'even'"
                             itemHeaderTemplateSelector="$index % 2 !== 0  ? 'odd' : 'even'"
                             itemContentTemplateSelector="$childIndex % 2 !== 0  ? 'odd' : 'even'"
                             footerTemplateSelector="$index % 2 !== 0 ? 'odd' : 'even'"
        >

            <Accordion.headerTemplates>
                <template key="odd">
                    <StackLayout>
                        <Label backgroundColor="green" text="{{headerText}}"/>
                    </StackLayout>
                </template>

                <template key="even">
                    <StackLayout>
                        <Label backgroundColor="orange" text="{{headerText}}"/>
                    </StackLayout>
                </template>
            </Accordion.headerTemplates>


            <Accordion.itemHeaderTemplates>
                <template key="odd">
                    <StackLayout backgroundColor="white">
                        <Label text="{{title}}"/>
                    </StackLayout>
                </template>

                <template key="even">
                    <StackLayout backgroundColor="white">
                        <Label text="{{title}}"/>
                        <Image decodeWidth="400" decodeHeight="400" loadMode="async" src="{{image}}"/>
                    </StackLayout>
                </template>
            </Accordion.itemHeaderTemplates>

            <Accordion.itemContentTemplates>
                <template key="odd">
                    <StackLayout>
                        <Image decodeWidth="400" decodeHeight="400" loadMode="async" src="{{image}}"/>
                        <Label text="{{text}}"/>
                    </StackLayout>
                </template>

                <template key="even">
                    <StackLayout>
                        <Image decodeWidth="400" decodeHeight="400" loadMode="async" src="{{image}}"/>
                        <Label text="{{text}}"/>
                    </StackLayout>
                </template>
            </Accordion.itemContentTemplates>

            <Accordion.footerTemplates>
                <template key="odd">
                    <StackLayout>
                        <Label backgroundColor="yellow" text="{{footerText}}"/>
                    </StackLayout>
                </template>

                <template key="even">
                    <StackLayout>
                        <Label backgroundColor="blue" text="{{footerText}}"/>
                    </StackLayout>
                </template>
            </Accordion.footerTemplates>

        </accordion:Accordion>

Vue

import Vue from 'nativescript-vue'
import Pager from 'nativescript-accordion/vue'

Vue.use(Pager)
<Accordion row="1" for="item of items">

				<v-template name="header">
					<StackLayout>
						<Label backgroundColor="green" :text="item.headerText"></Label>
					</StackLayout>
				</v-template>


				<v-template name="title">
					<GridLayout backgroundColor="white">
						<Label height="100%" :text="item.title"></Label>
					</GridLayout>
				</v-template>

				<v-template name="content">
					<StackLayout>
						<Image decodeWidth="400" decodeHeight="400" loadMode="async" :src="item.image"></Image>
						<Label :text="item.text"></Label>
					</StackLayout>
				</v-template>


				<v-template name="footer">
					<StackLayout>
						<Label backgroundColor="yellow" :text="item.footerText"></Label>
					</StackLayout>
				</v-template>
			</Accordion>

Multi Template

<Accordion row="2" height="100%" ref="accordion" allowMultiple="true" childItems="children" for="item of items">
				<v-template if="$odd" name="header-odd">
					<StackLayout>
						<Label backgroundColor="green" :text="item.headerText"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$even" name="header-even">
					<StackLayout>
						<Label backgroundColor="orange" :text="item.headerText"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$odd" name="title-odd">
					<StackLayout backgroundColor="white">
						<Label :text="item.title"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$even" name="title-even">
					<StackLayout backgroundColor="white">
						<Label :text="item.title"></Label>
						<Image height="100" width="100" decodeWidth="400" decodeHeight="400" loadMode="async"
							   :src="item.image"></Image>
					</StackLayout>
				</v-template>


				<v-template if="$odd" name="content-odd">
					<StackLayout>
						<Image decodeWidth="400" decodeHeight="400" loadMode="async" :src="item.image"></Image>
						<Label :text="item.text"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$even" name="content-even">
					<StackLayout>
						<Image decodeWidth="400" decodeHeight="400" loadMode="async" :src="item.image"></Image>
						<Label :text="item.text"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$odd" name="footer-odd">
					<StackLayout>
						<Label backgroundColor="yellow" :text="item.footerText"></Label>
					</StackLayout>
				</v-template>

				<v-template if="$even" name="footer-even">
					<StackLayout>
						<Label backgroundColor="blue" :text="item.footerText"></Label>
					</StackLayout>
				</v-template>
			</Accordion>

Angular

import { AccordionModule } from "nativescript-accordion/angular";

@NgModule({
    imports: [
        AccordionModule
    ]
    })
<Accordion height="100%" [items]="items" allowMultiple="false" [selectedIndexes]="selectedIndexes">

		<ng-template let-i="index" let-item="item" acTemplateKey="header">
			<StackLayout>
				<Label backgroundColor="green" [text]="item.headerText"></Label>
			</StackLayout>
		</ng-template>


		<ng-template let-i="index" let-item="item" acTemplateKey="title">
			<GridLayout backgroundColor="white">
				<Label height="100%" [text]="item.title"></Label>
			</GridLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="content">
			<StackLayout>
				<Image width="300" height="300" decodeWidth="400" decodeHeight="400" [src]="item.image"></Image>
				<Label [text]="item.text"></Label>
			</StackLayout>
		</ng-template>


		<ng-template let-i="index" let-item="item" acTemplateKey="footer">
			<StackLayout>
				<Label backgroundColor="yellow" [text]="item.footerText"></Label>
			</StackLayout>
		</ng-template>
	</Accordion>

Multi Template

<Accordion #accordion row="2" height="100%" allowMultiple="true" childItems="children" [items]="items"
			   [headerTemplateSelector]="headerTemplateSelector"
			   [itemHeaderTemplateSelector]="itemHeaderTemplateSelector"
			   [itemContentTemplateSelector]="itemContentTemplateSelector"
			   [footerTemplateSelector]="footerTemplateSelector"
	>
		<ng-template let-i="index" let-item="item" acTemplateKey="header-odd">
			<StackLayout>
				<Label backgroundColor="green" [text]="item.headerText"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="header-even">
			<StackLayout>
				<Label backgroundColor="orange" [text]="item.headerText"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="title-odd">
			<StackLayout backgroundColor="white">
				<Label [text]="item.title"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="title-even">
			<StackLayout backgroundColor="white">
				<Label [text]="item.title"></Label>
				<Image height="100" width="100" decodeWidth="400" decodeHeight="400" loadMode="async"
					   [src]="item.image"></Image>
			</StackLayout>
		</ng-template>


		<ng-template let-i="index" let-item="item" acTemplateKey="content-odd">
			<StackLayout>
				<Image decodeWidth="400" decodeHeight="400" loadMode="async" [src]="item.image"></Image>
				<Label [text]="item.text"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="content-even">
			<StackLayout>
				<Image decodeWidth="400" decodeHeight="400" loadMode="async" [src]="item.image"></Image>
				<Label [text]="item.text"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="footer-odd">
			<StackLayout>
				<Label backgroundColor="yellow" [text]="item.footerText"></Label>
			</StackLayout>
		</ng-template>

		<ng-template let-i="index" let-item="item" acTemplateKey="footer-even">
			<StackLayout>
				<Label backgroundColor="blue" [text]="item.footerText"></Label>
			</StackLayout>
		</ng-template>
	</Accordion>

Config

public selectedIndexes = [0,3]
<Accordion allowMultiple="true" [selectedIndexes]="selectedIndexes">

ScreenShots

Android IOS
SS SS

nativescript-accordion's People

Contributors

horeyes avatar lukeramsden avatar triniwiz avatar westlakem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nativescript-accordion's Issues

How to remove padding between items?

Hello

this is my code:

            <Accordion class="accordion" [items]="items" itemTapped="tapped" headerTextBold="true" headerTextColor="white" headerColor="pink"
                headerTextColor="blue" allowMultiple="false" selectedIndex="2">
            
                <ng-template accordionHeaderTemplate let-item="item" let-i="index">
                    <GridLayout class="header" columns="auto,*">
                        <Label [text]="item.title" textWrap="true"></Label>
                    </GridLayout>
                </ng-template>
            
                <ng-template accordionItemTemplate let-item="item" let-parent="parentIndex" let-even="even" let-child="childIndex">
                    <StackLayout class="body">
                        <Label [text]="item.text" textWrap="true"></Label>
                    </StackLayout>
                </ng-template>
            
            </Accordion>

this is my css:

.accordion{
  border-width: 1px;
  border-color: #f3f3f3;
}

.header{
  box-shadow: 4;
  background-color: #fff;
  padding: 10 15;
}
.body{
  padding: 10 15;
  background-color: #fff;
}

and this is output of that:
image

how can i remove gray padding or change height of that?
thanks

Feature: Floating header

In the previous versions (5.0.4 and before), on iOS, the accordion header is floating, which means that it will remain on top of the list when scroll down. In the new beta versions (6.0.0 onward), this feature is removed (or not work on my devices?). Is it possible to keep this feature in the new versions?

Thank you,

Which platform(s) does your issue occur on?

  • iOS

Please, provide the following version numbers that your issue occurs with:

  • CLI: 5.1.0
  • Cross-platform modules: 5.1.1
  • Runtimes: 5.0.0
  • Plugin: 6.0.0-beta.2

Error on latest update of nativescript-angular

Hi,

Just a heads-up.
After latest upgrade to my npm's, I got the following error:

Error: Uncaught (in promise): Error: Could not find module 'nativescript-angular/collection-facade'. Computed path '/var/mobile/Containers/Data/Application/8A8784B5-26A7-4280-8B9E-E49DC6200809/Library/Application Support/LiveSync/app/tns_modules/nativescript-angular/collection-facade'.
require@[native code]
anonymous@file:///app/tns_modules/nativescript-accordion/angular/index.js:7:34
evaluate@[native code]
moduleEvaluation@[native code]
[native code]
promiseReactionJob@[native code]
require@[native code]
anonymous@file:///app/job/job.module.js:9:24
evaluate@[native code]
moduleEvaluation@[native code]
[native code]
promiseReactionJob@[native code]
require@[native code]
requireModule@file:///app/tns_modules/nativescript-angular/router/ns-module-factory-loader.js:30:38
loadAndCompile@file:///app/tns_modules/nativescript-angular/router/ns-module-factory-loader.js:17:35
load@file:///app/tns_modules/nativescript-angular/router/ns-module-factory-loader.js:14:32
loadModuleFactory@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:3546:76
load@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:3530:69
file:///app/tns_modules/@angular/router/./bundles/router.umd.js:1694:78
_tryNext@file:///app/tns_modules/rxjs/operator/mergeMap.js:120:34
_next@file:///app/tns_modules/rxjs/operator/mergeMap.js:110:26
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23
_subscribe@file:///app/tns_modules/rxjs/observable/ScalarObservable.js:49:28
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:171:35
subscribe@file:///app/tns_modules/rxjs/Observable.js:159:78
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
_next@file:///app/tns_modules/rxjs/operator/mergeAll.js:85:59
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23
_next@file:///app/tns_modules/rxjs/operator/map.js:83:30
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23
_subscribe@file:///app/tns_modules/rxjs/observable/ArrayObservable.js:114:32
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:171:35
subscribe@file:///app/tns_modules/rxjs/Observable.js:159:78
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
_next@file:///app/tns_modules/rxjs/operator/mergeAll.js:85:59
next@file:///app/tns_modules/rxjs/Subscriber.js:89:23
_subscribe@file:///app/tns_modules/rxjs/observable/ScalarObservable.js:49:28
_trySubscribe@file:///app/tns_modules/rxjs/Observable.js:171:35
subscribe@file:///app/tns_modules/rxjs/Observable.js:159:78
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
subscribe@file:///app/tns_modules/rxjs/Observable.js:156:26
file:///app/tns_modules/rxjs/Observable.js:203:43
ZoneAwarePromise@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:776:37
forEach@file:///app/tns_modules/rxjs/Observable.js:199:31
file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4166:25
ZoneAwarePromise@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:776:37
runNavigate@file:///app/tns_modules/@angular/router/./bundles/router.umd.js:4091:27
onInvoke@file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3922:39
run@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:125:49
file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:760:60
onInvokeTask@file:///app/tns_modules/@angular/core/./bundles/core.umd.js:3913:43
runTask@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:165:57
drainMicroTaskQueue@file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:593:42
promiseReactionJob@[native code]
UIApplicationMain@[native code]
start@file:///app/tns_modules/tns-core-modules/application/application.js:212:26
bootstrapApp@file:///app/tns_modules/nativescript-angular/platform-common.js:84:28
bootstrapModule@file:///app/tns_modules/nativescript-angular/platform-common.js:72:26
anonymous@file:///app/main.js:6:57
evaluate@[native code]
moduleEvaluation@[native code]
[native code]
promiseReactionJob@[native code] โ€” zone-nativescript.js:993

Apparently, nativescript-angular/collection-facade doesn't exist anymore.

Here's the relevant part of my new package.json after update:

"dependencies": {
    "@angular/animations": "4.4.4",
    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/forms": "4.4.4",
    "@angular/http": "4.4.4",
    "@angular/platform-browser": "4.4.4",
    "@angular/router": "4.4.4",
    "angular2-jwt": "^0.2.3",
    "base-64": "^0.1.0",
    "nativescript-accordion": "^5.0.1",
    "nativescript-angular": "4.4.0",
    "nativescript-camera": "^3.0.2",
    "nativescript-cardview": "^2.0.2",
    "nativescript-floatingactionbutton": "^4.1.0",
    "nativescript-ngx-fonticon": "^2.2.3",
    "nativescript-pro-ui": "3.1.4",
    "nativescript-theme-core": "1.0.4",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.4.3",
    "s": "^0.1.1",
    "tns-core-modules": "^3.2.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "4.4.4",
    "@ngtools/webpack": "~1.7.3",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "codelyzer": "3.2.1",
    "copy-webpack-plugin": "~4.1.1",
    "extract-text-webpack-plugin": "~3.0.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-sass": "1.3.2",
    "nativescript-dev-typescript": "0.5.1",
    "nativescript-dev-webpack": "^0.8.0",
    "nativescript-worker-loader": "~0.8.1",
    "node-sass": "4.5.3",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.1.0",
    "tslint": "5.7.0",
    "typescript": "2.5.3",
    "webpack": "~3.7.1",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1"
  },

Type 'Accordion' is not assignable to type 'AccordionItemsView

Hi, i found a new issues when i try to build the project.

[18-10-23 11:03:23.238] (CLI) node_modules/nativescript-accordion/angular/index.d.ts(103,14): error TS2416: Property 'nativeElement' in type 'AccordionComponent' is not assignable to the same property in base type 'AccordionItemsComponent'.
[18-10-23 11:03:23.238] (CLI) Type 'Accordion' is not assignable to type 'AccordionItemsView'.
[18-10-23 11:03:23.238] (CLI) Types of property 'itemContentTemplateSelector' are incompatible.
[18-10-23 11:03:23.238] (CLI) Type 'string | ((item: any, parentIndex: number, index: number, items: any) => string)' is not assignable to type 'string | ((item: any, index: number, items: any) => string)'.
[18-10-23 11:03:23.238] (CLI) Type '(item: any, parentIndex: number, index: number, items: any) => string' is not assignable to type 'string | ((item: any, index: number, items: any) => string)'.
[18-10-23 11:03:23.238] (CLI) Type '(item: any, parentIndex: number, index: number, items: any) => string' is not assignable to type '(item: any, index: number, items: any) => string'.
[18-10-23 11:03:23.238] (CLI) node_modules/nativescript-accordion/angular/index.d.ts(104,15): error TS2416: Property 'accordionItemsView' in type 'AccordionComponent' is not assignable to the same property in base type 'AccordionItemsComponent'.
[18-10-23 11:03:23.238] (CLI) Type 'Accordion' is not assignable to type 'AccordionItemsView'.

android.widget.AbsListView$LayoutParams cannot be cast to org.nativescr

I am trying nativescript-accordion plugin in NS with angular app. I have followed the documentation.
But i have got this below mentioned error,

Its works perfectly If i clone this repository and tried with my local.

Console logs
`

JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
System.err: java.lang.ClassCastException: android.widget.AbsListView$LayoutParams cannot be cast to org.nativescr
ipt.widgets.CommonLayoutParams
System.err: at org.nativescript.widgets.GridLayout.updateMeasureSpecs(GridLayout.java:200)
System.err: at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:275)
System.err: at android.view.View.measure(View.java:17478)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
System.err: at android.view.View.measure(View.java:17478)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
System.err: at android.view.View.measure(View.java:17478)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
System.err: at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
System.err: at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
System.err: at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
System.err: at android.view.View.measure(View.java:17478)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
System.err: at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2548)
System.err: at android.view.View.measure(View.java:17478)
System.err: at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2285)
System.err: at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1396)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1595)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6624)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:812)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:612)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:582)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:798)
System.err: at android.os.Handler.handleCallback(Handler.java:733)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:146)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5602)
System.err: at java.lang.reflect.Method.invokeNative(Native Method)
System.err: at java.lang.reflect.Method.invoke(Method.java:515)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
System.err: at dalvik.system.NativeStart.main(Native Method)
ActivityManager: Process org.nativescript.accordian (pid 8296) (adj 0) has died.
1:41:32 PM - Compilation complete. Watching for file changes.`

What i missed? Please Suggest!

Not working in angular version

In iOS, When i try to implement i have following error

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x7302a9 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2   0xbe4155 ffi_closure_inner_SYSV
3   0xbe80b8 ffi_closure_SYSV
4   0x1ff41841 <redacted>
5   0x1ff3578f <redacted>
6   0x221423af <redacted>
7   0xbe802c ffi_call_SYSV
8   0xbe3e99 ffi_call
9   0x6fc397 NativeScript::FFICall::call(JSC::ExecState*)
10  0x9c7daf JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
11  0x9c782b llint_slow_path_call
12  0x9cef4b llint_entry
13  0x9cef0d llint_entry
14  0x9c9801 vmEntryToJavaScr
ipt
15  0x97fedf JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
16  0x96281f JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
17  0xa8db77 JSC::call(JSC::ExecSt
ate*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
18  0x72ff9f NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::callFunction(JSC::JSValue const&, JSC::ArgList const&, void*)
19  0x72fc07 NativeScript:
:ObjCMethodCallback::ffiClosureCallback(void*, void**, void*)
20  0x73028d NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
21  0xbe4155 ffi_closure_inner_SYSV
22  0xbe80b8 ffi_closure_SYSV
23  0x22148299 <redacted>
24  0x222ced2d <redacted>
25  0x221e74ef <redacted>
26  0x221e7197 <redacted>
27  0x221e7115 <redacted>
28  0x2212dd6d <redacted>
29  0x1ff41841 <redacted>
30  0x1ff3578f <redacted>
31  0x1ff3561f <redacted>
JavaScript stack trace:
1   onLayout@file:///app/tns_modules/nativ
escript-accordion/accordion.js:93:19
2   layout@file:///app/tns_modules/ui/core/view.js:104:26
3   layoutChild@file:///app/tns_modules/ui/core/view-common.js:962:21
4   @file:///app/tns_modules/ui/layouts/stack-layout/stack-layout.js:112:36
5   eachLay
outChild@file:///app/tns_modules/ui/layouts/layout-base-common.js:162:21
6   layoutVertical@file:///app/tns_modules/ui/layouts/stack-layout/stack-layout.js:109:29
7   onLayout@file:///app/tns_modules/ui/layouts/stack-layout/stack-layout.js:78:32
8   lay
out@file:///app/tns_modules/ui/core/view.js:104:26
9   layoutChild@file:///app/tns_modules/ui/core/view-common.js:962:21
10  onLayout@file:///app/tns_modules/ui/page/page.js:394:32
11  layout@file:///app/tns_modules/ui/core/view.js:104:26
12  layoutCh

In Android

An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: 
Calling js method onCreateView failed

TypeError: Cannot read property 'length' of undefined
File: "/data/data/org.nativescript.LazyFetch/files/app/tns_modules/nativescript-accordion/accordion.js, line: 75, column: 22

StackTrace: 
	Frame: function:'AccordionListAdapter.getGroupCount', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/nativescript-accordion/accordion.js', line: 146, column: 32
	Frame: function:'Accordion._createUI', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/nativescript-accordion/accordion.js', line: 75, column: 23
	Frame: function:'View._onContextChanged', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 202, column: 14
	Frame: function:'View._onAttached', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 153, column: 14
	Frame: function:'eachChild', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 158, column: 23
	Frame: function:'LayoutBase._eachChildView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/layouts/layout-base-common.js', line: 144, column: 22
	Frame: function:'View._onAttached', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
	Frame: function:'eachChild', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 158, column: 23
	Frame: function:'LayoutBase._eachChildView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/layouts/layout-base-common.js', line: 144, column: 22
	Frame: function:'View._onAttached', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
	Frame: function:'eachChild', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 158, column: 23
	Frame: function:'ContentView._eachChildView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/content-view/content-view.js', line: 65, column: 13
	Frame: function:'Page._eachChildView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/page/page-common.js', line: 285, column: 41
	Frame: function:'View._onAttached', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
	Frame: function:'View._addViewCore', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view.js', line: 126, column: 18
	Frame: function:'View._addView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/core/view-common.js', line: 1163, column: 14
	Frame: function:'onFragmentShown', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/frame/frame.js', line: 40, column: 11
	Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/frame/frame.js', line: 612, column: 13
	Frame: function:'FragmentClass.onCreateView', file:'/data/data/org.nativescript.LazyFetch/files/app/tns_modules/ui/frame/fragment.js', line: 23, column: 38


	at com.tns.Runtime.callJSMethodNative(Native Method)
	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1022)
	at com.tns.Runtime.callJSMethodImpl(Runtime.java:907)
	at com.tns.Runtime.callJSMethod(Runtime.java:895)
	at com.tns.Runtime.callJSMethod(Runtime.java:879)
	at com.tns.Runtime.callJSMethod(Runtime.java:871)
	at com.tns.FragmentClass.onCreateView(android.app.Fragment.java)
	at android.app.Fragment.performCreateView(Fragment.java:2053)
	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894)
	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
	at android.app.BackStackRecord.run(BackStackRecord.java:834)
	at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1454)
	at android.app.FragmentManagerImpl$1.run(FragmentManager.java:447)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5343)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

Thanks in advance

V6

  • Allow setting children items prop #15
  • Multi templates
  • Item cache
  • is group expanded
  • expand all #38
  • collapse all
  • Vue support

Styling not applied to header on iOS

For some reason, none of the styles I'm putting on the class are actually being applied on iOS. It's applying to the text, but just not the header.

Here's my XML:

<accordion:Accordion items="{{ items }}" class="accordion" allowMultiple="false">
  <accordion:Accordion.headerTemplate>
    <StackLayout>
      <GridLayout rows="*" columns="2*, 2*, 2*, 20*, *" class="header">
        <StackLayout row="0" col="1" colSpan="3" class="header-bg" />
        <StackLayout row="0" col="0" colSpan="2" class="key-bg" verticalAlignment="middle">
          <Label text="{{ key }}" class="key" textWrap="false" />
        </StackLayout>
        <StackLayout row="0" col="2" colSpan="2" verticalAlignment="middle">
          <Label text="{{ title }}" class="title" textWrap="true" />
        </StackLayout>
      </GridLayout>
    </StackLayout>
  </accordion:Accordion.headerTemplate>
  <accordion:Accordion.itemTemplate>
    <Label text="{{ text }}" class="text" textWrap="true" />
  </accordion:Accordion.itemTemplate>
</accordion:Accordion>

and my CSS:

Page {
  background-color: #F3721F;
}

.header {
  margin: 10;
  margin-left: 0;
}

.header-bg {
  padding: 25, 5;
  background-color: #151515;
  border-color: #FFFFFF;
  border-width: 1;
}

.title {
  font-size: 16px;
  color: #FFFFFF;
  margin: 0, 10;
}

.key-bg {
  background-color: #F3721F;
  border-color: #FFFFFF;
  border-width: 1;
  border-radius: 50%;
  width: 35;
  height: 35;
  padding: 0;
  margin: 1;
}

.key {
  font-family: 'Montserrat';
  text-align: center;
  vertical-align: middle;
  color: #FFFFFF;
  font-size: 18px;
  margin-top: 1;
}

.text {
  border-top-color: #FFFFFF;
  border-top-width: 1;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 1;
  color: #FFFFFF;
  padding: 10, 40;
  background-color: #151515;
  vertical-align: middle;
  horizontal-align: center;
}

headerTextAligment don't align properly.

I'm playing a bit with the library and I noticed while left works fine, center and right alignment doesn't apply correctly. Is it a bug or am I missing any setting?
Center:
center alignment
Right:
right alignment

Typeerror: rootLocator is not a function

I am getting this error :

System.err: com.tns.NativeScriptException:
System.err: Calling js method getGroupView failed
System.err:
System.err: TypeError: rootLocator is not a function
System.err: File: "file:///data/data/com.demotuc/files/app/tns_modules/nativescript-accordion/angular/index.js, line: 17, column: 11
System.err:
System.err: StackTrace:
System.err: Frame: function:'getItemViewRoot', file:'file:///data/data/com.demotuc/files/app/tns_modules/nativescript-accordion/angular/index.js', line: 17, column: 12
System.err: Frame: function:'AccordionComponent.headerLoading', file:'file:///data/data/com.demotuc/files/app/tns_modules/nativescript-accordion/angular/index.js', line: 131, column: 25
System.err: Frame: function:'Observable.notify', file:'file:///data/data/com.demotuc/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 100, column: 32
System.err: Frame: function:'notifyForHeaderOrFooterAtIndex', file:'file:///data/data/com.demotuc/files/app/tns_modules/nativescript-accordion/src/android/accordion.js', line: 25, column: 11
System.err: Frame: function:'AccordionListAdapter.getGroupView', file:'file:///data/data/com.demotuc/files/app/tns_modules/nativescript-accordion/src/android/accordion.js', line: 225, column: 21
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: at com.tns.gen.android.widget.BaseExpandableListAdapter_frnal_ts_helpers_l58_c38__AccordionListAdapter.getGroupView(BaseExpandableListAdapter_frnal_ts_helpers_l58_c38__AccordionListAdapter.java:33)
System.err: at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
System.err: at android.widget.AbsListView.obtainView(AbsListView.java:2362)
System.err: at android.widget.ListView.onMeasure(ListView.java:1203)
System.err: at android.view.View.measure(View.java:19734)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.VerticalScrollView.onMeasure(VerticalScrollView.java:118)
System.err: at android.view.View.measure(View.java:19734)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
System.err: at android.view.View.measure(View.java:19734)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at android.view.View.measure(View.java:19734)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
System.err: at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
System.err: at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
System.err: at android.view.View.measure(View.java:19734)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
System.err: at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
System.err: at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
System.err: at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at com.android.internal.policy.DecorView.onMeasure(DecorView.java:687)
System.err: at android.view.View.measure(View.java:19734)
System.err: at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2271)
System.err: at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1358)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1607)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:683)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:619)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
System.err: at android.os.Handler.handleCallback(Handler.java:751)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6077)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

Package.json:
"dependencies": {
"@angular/animations": "~4.0.0",
"@angular/common": "~4.0.0",
"@angular/compiler": "~4.0.0",
"@angular/core": "~4.0.0",
"@angular/forms": "~4.0.0",
"@angular/http": "~4.0.0",
"@angular/platform-browser": "~4.0.0",
"@angular/platform-browser-dynamic": "~4.0.0",
"@angular/router": "~4.0.0",
"base-64": "^0.1.0",
"nativescript-accordion": "^5.0.3",
"nativescript-angular": "~3.0.0",
"nativescript-downloader": "^1.0.3",
"nativescript-drop-down": "^3.1.3",
"nativescript-pdf-view": "^2.0.1",
"nativescript-plugin-firebase": "^4.1.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-snackbar": "^1.1.7",
"nativescript-social-login": "^1.8.2",
"nativescript-social-share": "^1.4.0",
"nativescript-sqlite": "^1.1.7",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-webview-interface": "^1.4.1",
"nativescript-xml2js": "^0.5.2",
"nativescript-zip": "^1.3.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.2.0",
"tns-core-modules": "^3.3.0",
"zone.js": "0.8.2"
},
"devDependencies": {
"@angular/compiler-cli": "~4.0.0",
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-android-snapshot": "^0..",
"nativescript-dev-typescript": "^0.4.0",
"nativescript-worker-loader": "~0.8.1",
"raw-loader": "~0.5.1",
"typescript": "^2.4.0",
"resolve-url-loader": "~2.1.0"
},

Android version: 3.3.1

Getting error Calling js method onCreateView failed

System.err: com.tns.NativeScriptException:
System.err: Calling js method onCreateView failed
System.err:
System.err: TypeError: Cannot read property 'length' of undefined
System.err: File: "file:///data/data/org.nativescript.ofypets/files/app/tns_modules/nativescript-accordion/accordion.js, line: 170, column: 33
System.err:
System.err: StackTrace:
System.err: 	Frame: function:'AccordionListAdapter.getChildrenCount', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/nativescript-accordion/accordion.js', line: 632, column: 77
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/nativescript-accordion/accordion.js', line: 170, column: 34
System.err: 	Frame: function:'Accordion.initNativeView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/nativescript-accordion/accordion.js', line: 169, column: 34
System.err: 	Frame: function:'ViewBase.setNativeView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 547, column: 18
System.err: 	Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 526, column: 14
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 19
System.err: 	Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 532, column: 14
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 19
System.err: 	Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 532, column: 14
System.err: 	Frame: function:'', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 19
System.err: 	Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
System.err: 	Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 120, column: 40
System.err: 	Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
System.err: 	Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 532, column: 14
System.err: 	Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 431, column: 18
System.err: 	Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 420, column: 14
System.err: 	Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 642, column: 19
System.err: 	Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.ofypets/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38
System.err:
System.err: 	at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: 	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
System.err: 	at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:983)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:967)
System.err: 	at com.tns.Runtime.callJSMethod(Runtime.java:959)
System.err: 	at com.tns.FragmentClass.onCreateView(FragmentClass.java:45)
System.err: 	at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
System.err: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
System.err: 	at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
System.err: 	at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
System.err: 	at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
System.err: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
System.err: 	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
System.err: 	at android.os.Handler.handleCallback(Handler.java:790)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: 	at android.os.Looper.loop(Looper.java:171)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6635)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Executing before-shouldPrepare hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Executing before-prepare hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/before-prepare/nativescript-dev-sass.js
Hook skipped because either bundling or livesync is in progress.
Executing before-prepare hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/before-prepare/nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /Users/gopal/Projects/nativeapps/Ofypets/hooks/after-prepare/nativescript-dev-webpack.js
Successfully transferred payment-modes.component.html on device 51f6c407.
Refreshing application on device 51f6c407...
Successfully synced application org.nativescript.ofypets on device 51f6c407.
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: Warning: Setting the 'itemHeight' property of 'ListViewGridLayout' is not supported by the Android platform.
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1116)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:996)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.Object[]) (Runtime.java:983)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, boolean, java.lang.Object[]) (Runtime.java:967)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object, java.lang.String, java.lang.Class, java.lang.Object[]) (Runtime.java:959)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[]) (Runtime.java:-2)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int, java.lang.String, boolean, long, java.lang.Class, java.lang.Object[]) (Runtime.java:1116)
12-28 11:49:07.411  7095  7095 I zygote  :   at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object, java.lang.String, java.lang.Class, boolean, long, java.lang.

Questiom

Hi, the plugin is working very good. But I ask me if it is posible not use a template in create each item with diferent element?.

Not working for me

wondering if i need code behind or just the xml to make accordion work??

itemContentTap returns wrong childIndex / data

itemContentTap returns wrong childIndex / data, clicking on 0th index returns 1 at childIndex and data from 1st index. If I click on last content item, data will be undefined.

Which platform(s) does your issue occur on?

  • iOS
  • iOS 12.1
  • iPhone XR / iPad 6th Gen

Please, provide the following version numbers that your issue occurs with:

  • CLI: 5.0.3
  • Cross-platform modules: 5.1.0
  • Runtime(s): 5.1.0
  • Plugin(s): 6.0.0-beta.2

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

HTML

 <Accordion class="list-group" [items]="groups"
            (itemContentTap)="onItemContentTap($event)">
            <ng-template let-group="item" acTemplateKey="title">
                <GridLayout class="p-10 bg-muted header-separator">
                    <Label class="font-weight-bold" [text]="group.title"></Label>
                </GridLayout>
            </ng-template>
            <ng-template let-item="item" acTemplateKey="content">
                <Label class="list-group-item" [text]="item.display"></Label>
            </ng-template>
        </Accordion>

TS

 groups: { title: string, items: { display: string }[] }[] = [
    {
        title: "Group 1",
        items: [
              { display: "Item 1" },
              { display: "Item 2" },
              { display: "Item 3" },
        ]
    },
   {
        title: "Group 2",
        items: [
              { display: "Item 1" },
              { display: "Item 2" },
              { display: "Item 3" },
        ]
    }
];

  onItemContentTap(event) {
        const data = event.data;
        console.log(event.index);
        console.log(event.childIndex); // Index is always one more than what user taps
        console.log(data);  
    }

"Calling js method getGroupView failed" in Angular-NS

Hello,

I get the following error on a simple Angular-NS project:

com.tns.NativeScriptException:
Calling js method getGroupView failed

TypeError: Cannot read property 'setBackgroundColor' of undefined
File: "file:///data/data/org.nativescript.CDC/files/app/tns_modules/nativescript-accordion/src/android/accordion.js, line: 251, column: 30

StackTrace:
    Frame: function:'AccordionListAdapter.getGroupView', file:'file:///data/data/org.nativescript.CDC/files/app/tns_modules/nativescript-accordion/src/android/accordion.js', line: 251, column: 31

    at com.tns.Runtime.callJSMethodNative(Native Method)
    at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
    at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
    at com.tns.Runtime.callJSMethod(Runtime.java:983)
    at com.tns.Runtime.callJSMethod(Runtime.java:967)
    at com.tns.Runtime.callJSMethod(Runtime.java:959)
    at com.tns.gen.android.widget.BaseExpandableListAdapter_accordion_209_28_AccordionListAdapter.getGroupView(BaseExpandableListAdapter_accordion_209_28_AccordionListAdapter.java:38)
    at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
    at android.widget.AbsListView.obtainView(AbsListView.java:2372)
    at android.widget.ListView.measureHeightOfChildren(ListView.java:1408)
    at android.widget.ListView.onMeasure(ListView.java:1315)
    at android.view.View.measure(View.java:22002)
    at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
    at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
    at android.view.View.measure(View.java:22002)
    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1629)
    at android.view.View.measure(View.java:22002)
    at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
    at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
    at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
    at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
    at android.view.View.measure(View.java:22002)
    at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
    at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
    at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
    at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
    at android.view.View.measure(View.java:22002)
    at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
    at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
    at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
    at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
    at android.view.View.measure(View.java:22002)
    at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
    at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:721)
    at android.view.View.measure(View.java:22002)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2410)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1498)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1751)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
    at android.view.Choreographer.doCallbacks(Choreographer.java:723)
    at android.view.Choreographer.doFrame(Choreographer.java:658)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Here is my HTML template:

<Accordion [items]="myItems" itemTapped="tapped" headerTextBold="true" headerTextColor="gray" headerColor="blue" allowMultiple="true" selectedIndex="2">

	<ng-template accordionHeaderTemplate let-item="item" let-i="index">
		<GridLayout>
			<Label [text]="item.name"></Label>
		</GridLayout>
	</ng-template>

	<ng-template accordionItemTemplate let-item="item" let-parent="parentIndex" let-even="even" let-child="childIndex">
		<GridLayout>
			<Label [text]="item.text"></Label>
		</GridLayout>
	</ng-template>

</Accordion>

I first tried with this myItems array:

public myItems = [
	{ name: "Name 1", text: "Text 1" },
	{ name: "Name 2", text: "Text 2" },
];

Then I tried to copy the README's array:

public myItems = [
	{
		title: "1", footer: "10", headerText: "First", footerText: "4",
		items: [
			{ name: "Name 1", text: "Text 1" },
			{ name: "Name 2", text: "Text 2" },
		]
	}
]

But I had no luck with both.
What am I doing wrong?

Support

Is anyone supporting this plugin anymore? There doesn't seem to be any communication on any of the issues.

Nested Accordion

I'm trying to have a nested accordion, is this possible ?

Thanks

Feature: Option to prevent expand / collapse

Allow an event to be triggered upon tapping on accordion header, setting the cancel flag true on the event context should prevent the item from being processed further for expand / collapse.

This feature allows to disable certain items on the accordion, at same time the plugin can be used as an alternative to sectioned list view.

Sample won't compile

I just cloned the repo and did a npm i, then tns platform add android, then a tns run android and received these errors.

C:\git\nativescript-accordion\demo-ng>tns run android
Searching for devices...
Executing before-liveSync hook from C:\git\nativescript-accordion\demo-ng\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-prepare hook from C:\git\nativescript-accordion\demo-ng\hooks\before-prepare\nativescript-dev-android-snapshot.js
Executing before-prepare hook from C:\git\nativescript-accordion\demo-ng\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.3.4
../angular/index.ts(16,8): error TS2307: Cannot find module '@angular/core'.

../angular/index.ts(17,57): error TS2307: Cannot find module 'nativescript-angular/element-registry'.

../angular/index.ts(18,22): error TS2307: Cannot find module 'ui/core/view'.
../angular/index.ts(19,33): error TS2307: Cannot find module 'data/observable-array'.
../angular/index.ts(20,28): error TS2307: Cannot find module 'data/observable'.
../angular/index.ts(21,25): error TS2307: Cannot find module 'nativescript-angular/lang-facade'.

node_modules/@angular/common/src/directives/ng_class.d.ts(48,34): error TS2304: Cannot find name 'Set'.
node_modules/@angular/compiler/src/aot/compiler.d.ts(48,32): error TS2304: Cannot find name 'Map'.

node_modules/@angular/compiler/src/compile_metadata.d.ts(369,20): error TS2304: Cannot find name 'Set'.

node_modules/@angular/compiler/src/compile_metadata.d.ts(371,28): error TS2304: Cannot find name 'Set'.
node_modules/@angular/compiler/src/compile_metadata.d.ts(373,15): error TS2304: Cannot find name 'Set'.
node_modules/@angular/compiler/src/compile_metadata.d.ts(375,23): error TS2304: Cannot find name 'Set'.
node_modules/@angular/compiler/src/compile_metadata.d.ts(377,17): error TS2304: Cannot find name 'Set'.
node_modules/@angular/compiler/src/compile_metadata.d.ts(379,25): error TS2304: Cannot find name 'Set'.

node_modules/@angular/compiler/src/output/output_ast.d.ts(444,63): error TS2304: Cannot find name 'Set'.

node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts(28,32): error TS2304: Cannot find name 'Iterable'.
node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,16): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(32,16): error TS2304: Cannot find name 'Map'.

node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts(15,48): error TS2304: Cannot find name 'Iterable'.

node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts(23,18): error TS2304: Cannot find name 'Map'.

node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'.
node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'.

node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts(79,33): error TS2304: Cannot find name 'Map'.

node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(97,42): error TS2304: Cannot find name 'Map'.

node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(11,30): error TS2304: Cannot find name 'Set'.
node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(22,30): error TS2304: Cannot find name 'Set'.

node_modules/nativescript-angular/dom-adapter.d.ts(79,34): error TS2304: Cannot find name 'Map'.

node_modules/rxjs/Observable.d.ts(68,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here.

node_modules/tns-core-modules/ui/core/view-base/view-base.d.ts(188,24): error TS2304: Cannot find name 'Set'.

node_modules/tns-core-modules/ui/core/view-base/view-base.d.ts(189,30): error TS2304: Cannot find name 'Set'.

node_modules/tns-core-modules/ui/core/view/view.d.ts(309,17): error TS2304: Cannot find name 'Set'.

node_modules/tns-core-modules/ui/core/view/view.d.ts(310,23): error TS2304: Cannot find name 'Set'.
node_modules/tns-core-modules/ui/styling/css-selector/css-selector.d.ts(16,18): error TS2304: Cannot find name 'Set'.

node_modules/tns-core-modules/ui/styling/css-selector/css-selector.d.ts(17,24): error TS2304: Cannot find name 'Set'.
node_modules/tns-core-modules/ui/styling/css-selector/css-selector.d.ts(57,41): error TS2304: Cannot find name 'Map'.
node_modules/tns-core-modules/ui/styling/css-selector/css-selector.d.ts(60,18): error TS2304: Cannot find name 'Set'.
node_modules/tns-core-modules/ui/styling/css-selector/css-selector.d.ts(61,21): error TS2304: Cannot find name 'Set'.
references.d.ts(1,1): error TS6053: File 'C:/git/nativescript-accordion/node_modules/tns-platform-declarations/ios.d.ts' not found.

Preparing project...

It never finishes..

Thanks
Ralph

Separator on iOS

Hi! The accordion works very well, but there's some form of a separator showing only on iOS. It looks to be some form of a footer as it moves down when the items expand.

I can't find a way to change its color, visibility or height. On Android there is no such issue.

Accordion demo-ng not working

Hi,
I am new to nativescript angular.I need to show a collapsible list in my project So wanted to use the accordion plugin But the Sample code is not working for angular .When I run demo-ng sample for angular I get the following error :

../Downloads/nativescript-accordion-master/demo-ng/node_modules/nativescript-accordion/index"' has no exported member 'Accordion'.

node_modules/nativescript-accordion/index.d.ts(1,15): error TS2307: Cannot find module './accordion'.
../src/accordion.android.ts(67,37): error TS2503: Cannot find namespace 'android'.

Custom accordion header

Hello,

Nice to use your plugin!
And I wonder It's so good if you can add a right icon for Accordion header.
Like this image:
accordion

This is my suggest for your plugin,

Thanks.

[Object Object]

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?

  • iOS/Android/Both
  • iOS/Android versions
  • emulator or device. What type of device?

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

Item in items?

I'm really confused by this part of the docs:

"By default the plugin will look for the items property in each item but you can set name by setting childItems="blah" on the Accordion instance"

So... we have a set of items that represents each accordion pane. That makes sense. But it looks like the content of each pane is expected to be driven by another set of items? What if the content of the pane is just a label, or whatever?

not working in Nativescript 2.5

hi , i have tried to run the demo from this repository , but failed on both iOS and Android platforms !
on iOS(simulator) just crashed , from terminal i can see message as below :

`
Command xcrun with arguments simctl launch B4938CAB-C64B-4BF3-B4DA-7F31F2607E39 org.nativescript.demo failed with exit code 1. Error output:
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "org.nativescript.demo" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "org.nativescript.demo" is unknown to FrontBoard").

`

on Android (device):

`
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.demo/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed

Error: Building UI from XML. @file:///app/main-page.xml:4:9

Module '/data/data/org.nativescript.demo/files/app/nativescript-accordion' not found for element 'nativescript-accordion:Accordion'.
com.tns.NativeScriptException: Failed to find module: "/data/data/org.nativescript.demo/files/app/nativescript-accordion", relative to: app//
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
com.tns.Runtime.callJSMethod(Runtime.java:1047)
com.tns.Runtime.callJSMethod(Runtime.java:1028)
com.tns.Runtime.callJSMethod(Runtime.java:1018)
com.tns.NativeScriptActivity.onCreate(android.app.Activity.java)
android.app.Activity.performCreate(Activity.java:6367)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
android.app.ActivityThread.access$900(ActivityThread.java:165)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:150)
android.app.ActivityThread.main(ActivityThread.java:5546)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
File: "file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 175, column: 20

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 175, column: 21
Frame: function:'', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
Frame: function:'EasySAXParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
Frame: function:'XmlParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
Frame: function:'XmlStringParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 181, column: 27
Frame: function:'parseInternal', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 48, column: 11
Frame: function:'loadInternal', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 133, column: 27
Frame: function:'load', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 117, column: 27
Frame: function:'pageFromBuilder', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 111, column: 27
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 89, column: 20
Frame: function:'Frame.navigate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 13, column: 25

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
at android.app.ActivityThread.access$900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: com.tns.NativeScriptException:
Calling js method onCreate failed

Error: Building UI from XML. @file:///app/main-page.xml:4:9

Module '/data/data/org.nativescript.demo/files/app/nativescript-accordion' not found for element 'nativescript-accordion:Accordion'.
com.tns.NativeScriptException: Failed to find module: "/data/data/org.nativescript.demo/files/app/nativescript-accordion", relative to: app//
com.tns.Module.resolvePathHelper(Module.java:159)
com.tns.Module.resolvePath(Module.java:60)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
com.tns.Runtime.callJSMethod(Runtime.java:1047)
com.tns.Runtime.callJSMethod(Runtime.java:1028)
com.tns.Runtime.callJSMethod(Runtime.java:1018)
com.tns.NativeScriptActivity.onCreate(android.app.Activity.java)
android.app.Activity.performCreate(Activity.java:6367)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
android.app.ActivityThread.access$900(ActivityThread.java:165)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:150)
android.app.ActivityThread.main(ActivityThread.java:5546)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
File: "file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 175, column: 20

StackTrace:
Frame: function:'', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 175, column: 21
Frame: function:'', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
Frame: function:'EasySAXParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
Frame: function:'XmlParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
Frame: function:'XmlStringParser.parse', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 181, column: 27
Frame: function:'parseInternal', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 48, column: 11
Frame: function:'loadInternal', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 133, column: 27
Frame: function:'load', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 117, column: 27
Frame: function:'pageFromBuilder', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 111, column: 27
Frame: function:'resolvePageFromEntry', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 89, column: 20
Frame: function:'Frame.navigate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 165, column: 20
Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 690, column: 19
Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/org.nativescript.demo/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 13, column: 25

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
at com.tns.Runtime.callJSMethod(Runtime.java:1047)
at com.tns.Runtime.callJSMethod(Runtime.java:1028)
at com.tns.Runtime.callJSMethod(Runtime.java:1018)
at com.tns.NativeScriptActivity.onCreate(android.app.Activity.java)
at android.app.Activity.performCreate(Activity.java:6367)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
... 9 more

`

thanks

Template Reference returns Undefined

I just noticed using a template reference (<Accordion #foo ) always return undefined. There seems to be some code commented at /angular/index.ts file. Is it supposed to be working or it's not implemented at the moment?

Invoke virtual method error

Hey, when I try to put in a Repeater inside the accordion, I get this error:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference

I get this on Android, haven't tested on iOS.

Heres the full error log: http://pastebin.com/80kjR0LM

The reason I am using a repeater is because the accordion is based upon a JavaScript array, but I'm not sure of the proper way to create accordion items from code.

Can't use custom data objects

The accordion doesn't accept a custom data object, it provides the following error. Why is it looking for a property Symbol?

26:27 caused by: Cannot read property 'Symbol' of undefined
JS: ORIGINAL STACKTRACE:
JS: Error: Uncaught (in promise): Error: Error in /data/data/org.nativescript.SMBarcode/files/app/scanTypeViews/worksOrder/worksOrder.html:26:2
7 caused by: Cannot read property 'Symbol' of undefined
JS:     at resolvePromise (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescri
pt.js:416:31)
JS:     at resolvePromise (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescri
pt.js:401:17)
JS:     at file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:449:17
JS:     at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-n
ativescript.js:223:37)
JS:     at Object.onInvokeTask (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/@angular/core/bundles/core.umd.js:5966:41)
JS:     at ZoneDelegate.invokeTask (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-n
ativescript.js:222:42)
JS:     at Zone.runTask (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript
.js:123:47)
JS:     at drainMicroTaskQueue (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativ
escript.js:355:35)
JS: Unhandled Promise rejection: Error in /data/data/org.nativescript.SMBarcode/files/app/scanTypeViews/worksOrder/worksOrder.html:26:27 caused
 by: Cannot read property 'Symbol' of undefined ; Zone: angular ; Task: Promise.then ; Value: Error: Error in /data/data/org.nativescript.SMBar
code/files/app/scanTypeViews/worksOrder/worksOrder.html:26:27 caused by: Cannot read property 'Symbol' of undefined TypeError: Cannot read prop
erty 'Symbol' of undefined
JS:     at Object.getSymbolIterator (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/lang-facade.js:36:
34)
JS:     at Object.isListLikeIterable (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-angular/collection-facade
.js:9:27)
JS:     at AccordionComponent.set [as items] (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/nativescript-accordion/angular
/index.js:127:68)
JS:     at Wrapper_AccordionComponent.check_items (/AccordionModule/AccordionComponent/wrapper.ngfactory.js:19:24)
JS:     at CompiledTemplate.proxyViewClass.View_WorksOrderComponent0.detectChangesInternal (/AppModule/WorksOrderComponent/component.ngfactory.
js:97:32)
JS:     at CompiledTemplate.proxyViewClass.AppView.detectChanges (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/@angular/c
ore/bundles/core.umd.js:9354:18)
JS:     at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/@angu
lar/core/bundles/core.umd.js:9447:48)
JS:     at CompiledTemplate.proxyViewClass.View_WorksOrderComponent_Host0.detectChangesInternal (/AppModule/WorksOrderComponent/host.ngfactory.
js:29:19)
JS:     at CompiledTemplate.proxyViewClass.AppView.detectChanges (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/@angular/c
ore/bundles/core.umd.js:9354:18)
JS:     at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (file:///data/data/org.nativescript.SMBarcode/files/app/tns_modules/@angu
lar/core/bundles/core.umd.js:9447:48)
JS: Error: Uncaught (in promise): Error: Error in /data/data/org.nativescript.SMBarcode/files/app/scanTypeViews/worksOrder/worksOrder.html:26:2
7 caused by: Cannot read property 'Symbol' of undefined

issue in item rendering

11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.callJSMethodNative(Native Method)
11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.callJSMethod(Runtime.java:957)
11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.callJSMethod(Runtime.java:941)
11-18 14:04:46.914  7562  7562 E AndroidRuntime:        at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptException:
System.err: Calling js method getChildrenCount failed
System.err:
System.err: TypeError: Cannot read property 'length' of undefined
System.err: File: "file:///data/data/org.nativescript.shyft/files/app/tns_modules/nativescript-accordion/src/android/accordion.js, line: 296, column: 67
System.err:
System.err: StackTrace:
System.err:     Frame: function:'AccordionListAdapter.getChildrenCount', file:'file:///data/data/org.nativescript.shyft/files/app/tns_modules/nativescript-accordion/src/android/accordion.js', line: 296, column: 68
System.err:
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     at com.tns.gen.android.widget.BaseExpandableListAdapter_frnal_ts_helpers_l58_c38__AccordionListAdapter.getChildrenCount(BaseExpandableListAdapter_frnal_ts_helpers_l58_c38__AccordionListAdapter.java:67)
System.err:     at android.widget.ExpandableListConnector.refreshExpGroupMetadataList(ExpandableListConnector.java:563)
System.err:     at android.widget.ExpandableListConnector.expandGroup(ExpandableListConnector.java:688)
System.err:     at android.widget.ExpandableListView.handleItemClick(ExpandableListView.java:693)
System.err:     at android.widget.ExpandableListView.performItemClick(ExpandableListView.java:653)
System.err:     at android.widget.AbsListView$PerformClick.run(AbsListView.java:3134)
System.err:     at android.widget.AbsListView$3.run(AbsListView.java:4049)
System.err:     at android.os.Handler.handleCallback(Handler.java:789)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:98)
System.err:     at android.os.Looper.loop(Looper.java:164)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6541)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

TypeError: this._trackByFn is not a function

Just added this to my existing project, and got the following error:

JS: ERROR TypeError: this._trackByFn is not a function
JS: ERROR CONTEXT [object Object]

Unfortunately I don't have anymore information in the log than that

Nativescript+Angular

Problem rendering within a ScrollView layout

I'm using Accordion in my nativescript-angular app. Accordion works great within a Stack ou Grid Layout. But It does not render correctly within a ScrollView.

To reproduce :

<ScrollView>
    <GridLayout>
    <Accordion [items]="items">

        <ng-template accordionHeaderTemplate let-item="item" let-i="index">
            <GridLayout backgroundColor="blue" columns="auto,*">
                <Label [text]="item.name"></Label>
            </GridLayout>
        </ng-template>

        <ng-template accordionItemTemplate let-item="item">
            <StackLayout>
                <Label [text]="item.name"></Label>
            </StackLayout>
        </ng-template>

    </Accordion>
    </GridLayout>
</ScrollView>

Get The Header State

Hi guys,
I'm actually looking for a way to get the state of the header, it means if it is open or not (expand or not).
I'm working with typescript and angular.

I tried to put a tap event on my gridLayout but it override the expand action, and didn't do the action of expanding anymore but only what I put in my method , here is my .html

image

here is the code of my .ts
image

I also tried with the $event

image

same ts as before

Is there a way to trigger the expand event by passing an attribute to true or something like that

Any solutions ?

In advance thanks

Xavier

Undefined Exception while adding to angular nativescript

I tried following the example for angular native but am recieving the following exception

System.err: com.tns.NativeScriptException:
System.err: Calling js method getGroupView failed
System.err: TypeError: Cannot read property 'setBackgroundColor' of undefined
System.err: File: "file:///data/data/com.FreeQuote/files/app/tns_modules/nativescript-accordion/src/android/accordion.js, line: 251, column: 29
System.err: StackTrace:
System.err: Frame: function:'AccordionListAdapter.getGroupView', file:'file:///data/data/com.FreeQuote/files/app/tns_modules/nativescript-accordion/src/android/
accordion.js', line: 251, column: 30
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1084)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:966)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:953)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:937)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:929)
System.err: at com.tns.gen.android.widget.BaseExpandableListAdapter_frnal_ts_helpers_l58_c38__AccordionListAdapter.getGroupView(BaseExpandableListAdapter_frnal_
ts_helpers_l58_c38__AccordionListAdapter.java:33)
System.err: at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)
System.err: at android.widget.AbsListView.obtainView(AbsListView.java:2346)
System.err: at android.widget.ListView.measureHeightOfChildren(ListView.java:1280)
System.err: at android.widget.ListView.onMeasure(ListView.java:1188)
System.err: at android.view.View.measure(View.java:18788)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
System.err: at android.view.View.measure(View.java:18788)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err: at android.view.View.measure(View.java:18788)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
System.err: at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
System.err: at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
System.err: at android.view.View.measure(View.java:18788)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
System.err: at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
System.err: at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
System.err: at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err: at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
System.err: at android.view.View.measure(View.java:18788)
System.err: at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
System.err: at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:606)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
System.err: at android.os.Handler.handleCallback(Handler.java:739)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:148)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
ActivityManager: Process com.FreeQuote (pid 5728) has died

package.json details are
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "com.FreeQuote",
"tns-android": {
"version": "3.2.0"
}
},
"scripts": {
"lint": "tslint "app/**/*.ts""
},
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/router": "4.2.5",
"angular2-signaturepad": "^2.6.1",
"nativescript-accordion": "^5.0.2",
"nativescript-angular": "4.2.0",
"nativescript-autocomplete": "^1.0.0",
"nativescript-contacts": "^1.5.3",
"nativescript-couchbase": "^1.0.18",
"nativescript-drop-down": "^3.1.1",
"nativescript-feedback": "^1.0.6",
"nativescript-floatingactionbutton": "^3.0.1",
"nativescript-telerik-ui": "3.0.4",
"nativescript-theme-core": "1.0.4",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.3",
"tns-core-modules": "^3.2.0",
"zone.js": "0.8.16"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"codelyzer": "3.1.2",
"lazy": "1.0.11",
"nativescript-dev-sass": "1.3.0",
"nativescript-dev-typescript": "0.5.0",
"node-sass": "4.5.3",
"tslint": "5.6.0",
"typescript": "2.4.2",
"tns-core-modules": "^3.2.0 || ^3.3.0-2017-09-08-9851"
}
}

My Summary.component.html file details are
<Accordion [items]="items" itemTapped="tapped" headerTextBold="true" headerTextColor="white" headerColor="pink" headerTextColor="blue"
allowMultiple="true" id="ac" selectedIndex="2">

    <ng-template accordionHeaderTemplate let-item="item" let-i="index">
        <GridLayout backgroundColor="blue" columns="auto,*">
            <Label [text]="item.title"></Label>
        </GridLayout>
    </ng-template>

    <ng-template accordionItemTemplate let-item="item" let-parent="parentIndex" let-even="even" let-child="childIndex">
        <StackLayout>
            <Image [src]="item.image"></Image>
            <Label [text]="item.text"></Label>
        </StackLayout>
    </ng-template>

    <!-- IOS Only -->
    <ng-template accordionFooterTemplate let-item="item" let-i="index">
        <GridLayout backgroundColor="yellow" columns="auto,*">
            <Label [text]="item.footer"></Label>
            <Label col="1" text="-"></Label>
        </GridLayout>
    </ng-template>
</Accordion>

Have also added, items array inside component constructor, still getting this error.

Any help would be appreciated.

Angular ngFor Support

Hi,

@triniwiz, does nativescript-accordion supports *ngFor to repete items?

I just tried to do so, but it didn't work in my project.

Thanks in advance.

itemTapped not working

itemTapped not working
here is my code:

                 ` <accordion:Accordion items="{{items}}" itemTapped="{{tapped}}" 
                      selectedIndex="0">
                        <accordion:Accordion.headerTemplate>
                            <StackLayout orientation="vertical" class="acordionHeader">
                                <Label text="{{text}}"/>
                            </StackLayout>
                        </accordion:Accordion.headerTemplate>

                        <accordion:Accordion.itemTemplate>
                            <StackLayout class="accordionItem">
                                <Label text="{{text}}"/>
                            </StackLayout>
                        </accordion:Accordion.itemTemplate>


                    </accordion:Accordion>
               `

the source:
let items=[{ text:"pick item", items:[ {text:"text 1"}, {text:"text 2"}, {text:"text 1"}, {text:"text 2"}, ] }]

plus i'm getting warning in console:
CONSOLE WARN file:///app/tns_modules/nativescript-accordion/src/ios/accordion.js:282:14: Objective-C class name "UITableViewDelegateImpl" is already in use - using "UITableViewDelegateImpl1" instead.

Header's template instead of only text.

Hi,

is there any way to implement each item's header as a template istead of applying just headerText in angular projects ?

By the way, the Angular's version work fine now.

Thanks in advance.

Don't want to set the item template

Hi,
I do not want to set a item template as every header in my application will have different layouts of expansion panels. So how do I achieve this?

itemTapped not working

itemTapped event not working on Android

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "************",
    "tns-android": {
      "version": "3.0.0"
    }
  },
  "dependencies": {
    "nativescript-accordion": "^3.1.2",
    "nativescript-plugin-firebase": "^3.11.4",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toast": "^1.4.5",
    "tns-core-modules": "2.5.2"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*"
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.