Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not showing on devices with API level < 21? #47

Closed
dlucidone opened this issue Feb 15, 2017 · 12 comments
Closed

Not showing on devices with API level < 21? #47

dlucidone opened this issue Feb 15, 2017 · 12 comments

Comments

@dlucidone
Copy link
Contributor

FAB button is not visible on devices having api level less than 21. Is ther any workaround to resolve this.?

@dlucidone dlucidone changed the title Not showing on devices with API level 21? Not showing on devices with API level < 21? Feb 15, 2017
@bradmartin
Copy link
Collaborator

bradmartin commented Feb 15, 2017 via email

@dlucidone
Copy link
Contributor Author

Is this has something to do with webpack -
http://docs.nativescript.org/angular/tooling/bundling-with-webpack#dynamic-imports
I've not done this sorta import for FAB. but yeah I've installed my apk on devices list below -

Motorola MotoX - 4.2.2 API 17
Motorola MotoX - 4.3 API 18
Samsung Galaxy Note 2 - 4.2.2 API 17
Google Nexus 4 - 4.4.4 API 19

@dlucidone
Copy link
Contributor Author

Any Solution to this!

@bradmartin
Copy link
Collaborator

@triniwiz don't you use the FAB and webpack your apps?

@dlucidone
Copy link
Contributor Author

dlucidone commented Feb 23, 2017

Lib is working completely fine and i also use webpack to bundle my app. but the fab is juss missing from devices with API< 21

@triniwiz
Copy link
Member

Never used FAB

@dlucidone
Copy link
Contributor Author

@bradmartin Any Updates on this?

@bradmartin
Copy link
Collaborator

bradmartin commented Mar 28, 2017 via email

@dlucidone
Copy link
Contributor Author

Here is the code i'm using

    <ActionBar title="Packages" style="background-color:#ED2831; color:white">
     <ActionItem (tap)="fabTap()">

    <Label class="actionItemLabel" text="Add" color="white" ></Label>
    </ActionItem>
     </ActionBar>
      <StackLayout>
      <SearchBar class="searchBar" textFieldHintColor="#DEDEDE"  (clear)="onClear()" (loaded)="sBLoaded($event)"  id="searchP" #sb hint="Search by  Name" [(ngModel)]="searchPhrase"(ngModelChange)="onChangeP($event)"></SearchBar>
<Label [text]='total' textWrap="true" class="m-l-10"style="margin-top:5px"></Label>
<GridLayout style="margin-top:5px">
    <FAB (tap)="fabTap()" row="0" icon="res://itisfab" rippleColor="#f1f1f1" class="fab-button" hideOnSwipeOfView="list-style" swipeAnimation="slideDown"></FAB>
     <PullToRefresh (refresh)="refreshList($event)">
    <ListView [items]="pList" class="small-spacing" (loadMoreItems)="listViewLoadMoreItems()">
        <template let-item="item">
            <GridLayout columns=" *,*,*,*" rows="*, *" (tap)="viewP(item.id)" style="padding: 10;">            
                </GridLayout>
        </template>
    </ListView>
     </PullToRefresh>
</GridLayout>

@bradmartin
Copy link
Collaborator

I think your issue is a layout issue - the best approach to using a FAB and simplifying its position to be overlayed on a listview (or any other view) is to use a GridLayout as the parent of your layout. Then set the ListView and Fab on the same row. Then you need to style the FAB with alignment styles. The README and demo have good sample code for this :)

@davorpeic
Copy link

Hey @dlucidone
did you solved webpack issue? I'm expeciecing similar issue only when try to build with webpack. My template is complex, so I simplified it as much as I can and normal build shows it, but build with webpack it doesn't (android 6). Here is my simplified template. Using latest Angular 4 {NS}

<ActionBar [title]="detail.parcela" class="action-bar">
    <NavigationButton icon="res://ic_arrow_back_white_24dp" (tap)="goBack()" *ngIf="showDetail"></NavigationButton>
    <ActionItem (tap)="showInfo()" android.position="actionBar" *ngIf="!showDetail" class="detail-bar-icons" verticalAlignment="center">
        <Label [text]="'mdi-face' | fonticon" class="mdi btn-close" [class.infoOpen]="info == true" verticalAlignment="center"></Label>
    </ActionItem>
    <ActionItem (tap)="onTap($event)" android.position="actionBar" *ngIf="!showDetail" class="detail-bar-icons">
        <Label [text]="'mdi-clear' | fonticon" class="mdi btn-close"></Label>
    </ActionItem>
</ActionBar>

<GridLayout rows="*" columns="*">

   

    <StackLayout row="0" verticalAlignment="bottom" col="0" >
        <FAB icon="res://ic_keyboard_arrow_right_white_24dp" rippleColor="#f1f1f1" (tap)="onTap($event)" class="fab-button">
        </FAB>
    </StackLayout>

</GridLayout>

not sure what could be the issue, can't see any errors.

ps. I tried running demo but it gives render error so couldn't test it

@davorpeic
Copy link

Ok, solved my issue by adding
registerElement('Fab', () => require('nativescript-floatingactionbutton').Fab);
to main.aot.ts :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants