What Should I Do If a User is Unable to Switch Between Tab Pages by Swiping When the Tab Page Contains a Video? - huawei-mobile-services

When the tab-content component (a subcomponent of tabs) contains a video, the user is unable to swipe to switch between tab pages, with the result that the progress bar is dragged instead.
The code where the exception occurs is as follows:
<template>
<div style="background-color: #00bfff;">
<tabs index="0" >
<tab-bar mode="fixed">
</tab-bar>
<tab-content>
<div style="flex-direction: column;">
<text style="color: red">1</text>
<stack class="video" >
<video class="video1" id="111"
src="https://ss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/cae-legoup-video-target/93be3d88-9fc2-4fbd-bd14-833bca731ca7.mp4">
</video>
</stack>
</div>
<div style="flex-direction: column;">
<text style="color: red">2</text>
</div>
<div style="flex-direction: column;">
<text style="color: red">3</text>
</div>
</tab-content>
</tabs>
</div>
</template>
Cause Analysis:
The video component is set as a subcomponent of tabs, while both components support swiping. When the user swipes across the video area, the system will respond to the sliding of the progress bar prior to the tab page switchover, given the event bubbling framework.

Add a div component between video and its parent node stack to cover the video. Make sure that div is lower than video in height to ensure that the progress bar and buttons are not hidden. When the user swipes across the video area, they are swiping on the div component instead. Because div and video are sibling nodes, the video progress bar will not be dragged.
The sample code is as follows:
<template>
<div style="background-color: #00bfff;">
<tabs index="0" >
<tab-bar mode="fixed">
</tab-bar>
<tab-content>
<div style="flex-direction: column;">
<text style="color: red">1</text>
<stack class="video">
<video class="video1" id="111"
src="https://ss0.bdstatic.com/-0U0bnSm1A5BphGlnYG/cae-legoup-video-target/93be3d88-9fc2-4fbd-bd14-833bca731ca7.mp4"
onstart="start" ontouchmove="move" onseeked="seeked">
</video>
<div style="width: 100%;height:300px;" onclick="bof">
</div>
</stack>
</div>
<div style="flex-direction: column;">
<text style="color: red">2</text>
</div>
<div style="flex-direction: column;">
<text style="color: red">3</text>
</div>
</tab-content>
</tabs>
</div>
</template>
References:
tabs component
video component

The layout needs to differentiate between touching video progress and touching video tab.
So we need to have element besides video in the tab, for example
<stack class="video">
<video
</video>
<div >
</div>
</stack>
The extra div or anything to cover the video without color
So that the tab is detecting click.
Assuming user knows not to touch the lower part of the video to swap tab, this is common behavior seems.

Related

Office Fluent UI / Fabric UI Modal - how can I control where it appears?

I'm currently using the MS Fluent UI controls (formerly known as Office Fabric UI | https://developer.microsoft.com/en-us/fluentui#/controls/web) and I'm getting stuck with the 'Modal' control.
I am triggering a Modal dialog control as the onClick event for a DocumentCard control. The problem is I can't see any way to keep the new model dialog centred on the screen.
It appears to always center on the element which contains all of the document cards (and there are a lot of cards.. so you end up having to scroll down quite a lot to see the modal dialog).
Is there any way of simply setting it to "center on the (visible) window"?
Below is a snippet from the React Component which hosts the Document Card and Modal dialog..
return (
<DocumentCard onClick={showModal}>
<DocumentCardTitle title={this.props.Title} shouldTruncate />
<Image {...imageProps} className={styles.image} />
<DocumentCardTitle title={this.props.event.Description}
shouldTruncate showAsSecondaryTitle />
<Modal isOpen={isModalOpen} onDismiss={hideModal} isBlocking={true}>
<div>
<span id={titleId}>{this.props.Title}</span>
</div>
<div>
<p>
{this.props.event.Description}
</p>
</div>
</Modal>
</DocumentCard>
);
I think you just need to raise the modal out of the DocumentCard. The following might be what you're looking for
return (
<>
<DocumentCard onClick={showModal}>
<DocumentCardTitle title={this.props.Title} shouldTruncate />
<Image {...imageProps} className={styles.image} />
<DocumentCardTitle title={this.props.event.Description} shouldTruncate showAsSecondaryTitle />
</DocumentCard>
<Modal isOpen={isModalOpen} onDismiss={hideModal} isBlocking={true}>
<div>
<span id={titleId}>{this.props.Title}</span>
</div>
<div>
<p>{this.props.event.Description}</p>
</div>
</Modal>
</>
);

How to make ion-header unmovable in ionic 2,3?

I want the ion-header with fixed position. When keyboard appears it also scroll up with the rest of the screen in iOS. How to make ion-header remain stick to the top while other part of a screen scroll up?
<ion-header no-border>
<button class="left-button" (click)="delete()" >
Delete
</button>
<button class="right-button" (click)="save()" >
Save
</button>
</ion-header>
<ion-content id="home" class="background-Image" no-bounce>
<form [formGroup]="signup" novalidate>
<!-- User email -->
<div class="label">Wnat is your email?</div>
<div class="row">
<input class="input" autocorrect="off" type="email" placeholder="" formControlName="email" (input)="onEmailChange()" (blur)="onEmailSubmitted()" (keyup.enter)="hideKeyboard()">
<div class="validation-image">
<img [src]=validationImageEmail [hidden]=!validationImageEmail />
</div>
</div>
<hr class="underline">
</form>
</ion-content>
I think that the case is that your header lacks of a navbar or toolbar. By my experience both have the sabe result, but as the documentation says:
A Toolbar is a generic bar that is positioned above or below content. Unlike a Navbar, a toolbar can be used as a subheader. When toolbars are placed within an ion-header or ion-footer, the toolbars stay fixed in their respective location. When placed within ion-content, toolbars will scroll with the content.
So update your code like this:
<ion-header no-border>
<ion-toolbar>
<button class="left-button" (click)="delete()" >
Delete
</button>
<button class="right-button" (click)="save()" >
Save
</button>
</ion-toolbar>
</ion-header>
Hope this helps.

How to use the same header with ion-side-menus?

I'm creating an app using Ionic 1.3.2, and I have one step when user choose your login type, from facebook or from app, after the user make your login it will redirect to other step when has a <ion-side-menus> and the user can use the app. The problem is I created the first step (choose login) with <ion-nav-bar> and in second step (side-menus) also has <ion-nav-bar> on content of <ion-side-menus> and the header of first step seems override the header of second step bugging the layout, I want to use the same header on both steps.
My question is, how could I use only one header, in that case header created on first step, and the second step use this header too ?
My scene is like below.
index.html (first step)
<body ng-app="starter" ng-controller="MainCtrl" animation="slide-left-right-ios7">
<!-- The nav bar that will be updated as we navigate-->
<ion-nav-bar class="bar bar-header bar-assertive" align-title="center">
</ion-nav-bar>
<!-- where the initial view template will be rendered -->
<ion-nav-view></ion-nav-view>
</body>
main.html (first step, where user choose your login type)
<ion-view view-title="MeuPedido" align-title="center">
<ion-content>
<div class="principal">
<a class="button button-block button-positive" ng-click="fbLogin();">Login com Facebook</a>
<button class="button button-block button-energized" ng-click="goTo('login');">
Entrar
</button>
<button class="button button-block button-energized" ng-click="goTo('addUsuario');">
Cadastrar
</button>
</div>
</ion-content>
</ion-view>
sidemenu.html (second step, after user make his login)
<ion-side-menus ng-controller='CtrlSideMenu' data-ng-init="loadImage();">
<!-- Center content -->
<ion-side-menu-content>
<!--app has header on index.html -->
<ion-nav-bar class="bar-assertive">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left" class="has-header">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="tabsContent"></ion-nav-view>
</ion-side-menu-content>
<!-- Left menu -->
<ion-side-menu side="left">
<ion-header-bar>
<div>
<div class="row">
<div class="col col-90 text-center">
<img ng-src="{{imageURL}}" class="round_image">
</div>
</div>
<div class="row">
<div class="col col-90 text-center customTitle">{{nome}}</div>
</div>
</div>
</ion-header-bar>
<ion-content style="margin-top:200px;">
<ion-list>
<ion-item menu-close href="#/app/search">
Search
</ion-item>
<ion-item menu-close href="#/app/browse">
Browse
</ion-item>
<ion-item menu-close href="#/app/playlists">
Playlists
</ion-item>
</ion-list>
</ion-content>
<ion-footer-bar class="bar bar-footer">
<h6>Desenvolvido por Iguana Sistemas</h6>
</ion-footer-bar>
</ion-side-menu>
</ion-side-menus>
here image of first step, look at in this point has header
here image of second step, note that header of first step is overriding header inside ion-side-menus and bugging the layout.
I don't really get what you want to achieve, but side menu is one thing (it controls the view that appears when you open the side menu)and the the main view is another - is the view that user will see and from here you can open side-menu. you can have different nav bars for this 2 views. but from your code it looks like you have 1 main view that logs in the user and then changes itself to display the feed and a side-menu.
you multiple options: 1. make the title and color of the nav bar variable and change them with angular. 2. create another view for second step and override the nav bar.
You should have a structure something like this: -> main view(login) ->second view(feed) that also has a side menu

Loading GIF in hidden DIV Not Animating in Firefox

I'm showing a hidden DIV that contains an animated GIF when a form is submitted, works fine in Chrome/IE11/Edge but GIF does not animate in Firefox if anyone can tell why that happnes? Code as so:
onSubmit="document.getElementById('overlay').style.display = 'block';document.getElementById('loadergif').src='updating.gif';"
Hidden container like so:
<div id="overlay">
<div id="loader-container"><img src="updating.gif" width="204" height="85" alt="" id="loadergif"/></div>
</div>
Instead of GIF I just used HTML5 Video and that fixes the issue
Show the DIV on submit:
onSubmit="document.getElementById('overlay').style.display='block';"
The DIV:
<div id="overlay">
<div id="loader-container">
<video autoplay loop>
<source src="updating.mp4">
<source src="updating.webm">
<source src="updating.ogv">
</video>
</div>
</div>
Keeps it simple!

jssor slider add external link to the thumbnail

I am using the jssor templete for my slider and I have modified the setting so that I can have a slider image change when the mouse hover on the thumbnail. But I do not know how to add an external link to the thumbnail image so that I can go to the another page associated with that picture
I have try the following method from http://quabr.com/28478806/jssor-external-links-on-thumbnails but it is not worked
<div>
<img u="image" src="../img/photography/002.jpg" />
<div u="thumb">
<img class="i" src="../img/photography/thumb-002.jpg"/>
</div>
<div u="caption" t="L">My Title</div>
</div>
</div>
Thank you for your help!
I guess it worked already.
But there is an extra enclosing '<div>' in following code,
<div>
<img u="image" src="../img/photography/002.jpg" />
<div u="thumb">
<img class="i" src="../img/photography/thumb-002.jpg"/>
</div>
<div u="caption" t="L">My Title</div>
</div>
</div>
Please remove it by replacing
<div u="caption" t="L">My Title</div>
</div>
with
<div u="caption" t="L">My Title</div>
Also, please set 'height: 100%' for 'a' element to make the clickable area bigger.
<a href="http://mylink.com" target="_blank" style="height: 100%;">
And finally, please check out the thumbnail navigator skin html code, because it is fully customizable, and it can be very complicated. Please make sure your link element is not covered by any other element.