UICollectionViewLayout for Google Chrome (iOS App) Tab Switcher-like UI - ios

My project needs a UI like Google Chrome's Tab Switcher. There was such a question in the past but the responses are mostly irrelevant, as it was written 5 years ago and the responses had to do with a static and overlapping Evernote UI (here). I've been trying for days, but the best I could get was something really sluggish. Also interestingly, when coded, at some areas it worked, then it didn't. I didn't choose any code because honestly my code probably is more wrong than right and I should start fresh from the beginning.
What is it that makes it so confusing? Bottom down must be initially 100% visible, next up 50%, next 25% (relative to their height) and also obviously it's scrollable. The scroll direction like chrome is first (latest) at bottom and last at the top. However, I would also like the distance between the first and second to increase, should you scroll down to see less recent views, the second would have to be able to be 100% visible, as the bottom app disappears off screen.
Yes, it's a jailbreak project but that's irrelevant as I've coded a replica in the iOS simulator for this part. It's just a layout problem for a UICollectionView. All of the rest of the project, has been coded

I think that you can you the following library to achieve the desired result.
StickyCollectionView-Swift

Related

How to debug Ionic iOS swipe gesture issues

I am dealing with a weird bug on Ionic's iOS native build where I sometimes cannot swipe back or switch tabs once I transition to a new page using router.navigateByURL(...), and trying to debug this issue has been troublesome since I can't "see" how the gestures are handled. Does anyone know where I should be looking in the code for handling transition gestures?
Here's a video demo of the problem: https://streamable.com/hk9c0
In the video, you can see me:
Swiping down to refresh using the ion-refresher element and you can see the page beneath (already entered a bug report for that part: https://github.com/ionic-team/ionic/issues/18284 )
Trying to tap the back arrow in the left corner
Attempting to swipe left to right to go back a page (hard to show that one)
Tapping the bottom tabs to transition to new tab, at one point, I tap on a tab that has an ion-fab element which appears in the bottom right because its z-index is higher than the "stuck" page.
Currently the best I've been able to do is by looking at the css classes that are added to the pages, but it's not much use....
Where app-release is the page you can see in the video and app-home is the page underneath the stack. It's my understanding that Ionic uses hammer.jsfor gestures, so I added it as a tag, please correct me if I am wrong. I cannot, for the life of me, recreate this bug consistently, but will often trigger 1 out of 50 tries.
I've been digging through the utils in Ionic Core to see where elements are being added and removed, with no luck.
I created a bug request for this here as well: https://github.com/ionic-team/ionic/issues/18305
Are you using #angular/animations to make the transitions between the pages? I had some issues like yours, as you can see in my question.
Router navigate on Ionic with animation blinking on ios using angular animations
If I am right about the use of #angualar/animations I suggest to use a custom animation of the Ionic itself, and not te angular's. You can see an working example here of its use here:
https://github.com/mhartington/ionic4-custom-animation
Since I have less tem 50 rep I cant comment so I had to post this anwser not knowing if it was really your case. Hope it helps.

WKInterfaceTable rendering issues. Both the scroll bar and last row are cut off

I'm developing a WatchKit app for the Apple Watch. I "finished" the app originally when the first beta was out back in Nov/Dec.
I recently upgraded the the final release and somethings in WatchKit changed (as to be expected). I had to fix couple lines of code here and there since they changed how the app views start up.
Anyway, after fixing the issues I noticed that my WKInterfaceTable displays and scrolls almost correctly. The last row in the table gets cut off (as indicated in the screenshot below). Also, the scrollbar is very short - shorter than it should be (also in the screenshot). Anyone else experiencing this?
In the screenshot, the app has about 10 rows, I just scrolled way to the bottom with a bit of an extra pull just to show the cut-off from the last row... Notice the bottom of the row and the scrollbar at the top right.
I've included extra screenshots that may be helpful. I researched some tutorials on WKInterfaceTable and they're not really doing anything different than I am in the Interface Builder. I'm lost here.
I'm not making ANY UI modifications in code. I'm just letting WatchKit handle the UI as much as possible without any intervention from me.
Thanks!
Other Screenshots:
The scrollbar is short by design, this isn't a bug. That's how it's meant to be.
Regarding the cutting off of the last row, add the table into a WKInterfaceGroup, then set the group's height to 'Size to Fit Content'. That should fix it.

jQM + WL on Android - High CPU in landscape

The current version of my app, running on Android 4.0.4 on an ancient Galaxy Tab has an odd issue when it's running in landscape orientation. I have the CPU usage developer option turned on, and I can see that a single core is being fully utilised when the app is sitting idle, even at it's login screen.
I'm using jQM 1.4.4, WL 6.2.0.01-20141027-1531.
When it's clear that CPU usage idling high for my app, I change to portrait and the CPU usage completely goes away, and the app is responsive again.
Step (CPU usage after a few seconds)
Login Screen (high)
Tap in text field, keyboard appears (none)
Hide keyboard (none)
Switch to portrait (none)
Switch to landscape (high)
On top of that, when I switch from Portrait to Landscape, the view doesn't redraw under the new aspect. The view is constrained to an area (square-ish) as wide as the screen is tall (or wide in portrait). The fixed header disappears but the view is interactive. To fix this, you can tap into a text field which brings up a keyboard. The view updates to fill the screen, and CPU usage is down again.
Other thing to note is that this issue did not exist in the previous version of the app. I've reviewed all changes between the versions and nothing stands out to me that should cause an issue like this.
Suspects:
the page or pagecontainer, popup or fixed header is doing a lot of work that usually should only occur on window resize (no direct changes to the logic here);
the CSS, in particular some responsive queries (there's a breakpoint between landscape and portrait) (no responsive CSS changes)
Other info:
Not a single problem was reported with Samsung Tab 3 running 4.2.2 or a Nexus 7 on 4.4.4 with this version
Tried using weinre to profile this issue except it loses connection soon after opening the app (again, previous version it was fine)
Minor differences between two identical target devices (Samsung Galaxy Tab 10.1): one tablet always performs fares better
I'm about to roll back to the older codebase and iteratively add code back in to see where the issue comes in.
Thanks for reading. Any pointers or suggestions are obviously greatly appreciated.
Update 1
I profiled from within Eclipse (turns out the Timeline inspector tab is pretty useless in weinre).
https://www.dropbox.com/s/ke0a9c2z9krhucu/highThreadUsage.PNG
Doesn't mean much to me. I suspect all that profile really says is 'the webview is doing all the work'.
I've created a new Hybrid app in the same project, and copied everything into it. I'm going to start stripping out chunks of code/functionality to see resolves the issues first.
This is a preliminary answer. I'm still doing the legwork and trying to see what exactly is happening in this situation.
The culprit appears to be a specific panel. A panel I haven't even touched in weeks. The only thing that I can even think of is that I changed the padding-top on .ui-tabs-panel from 1em to 0.5em...
There are two panels that are immediately init'd on app load. The one that slides from the right is the culprit: if I remove the init call and the HTML for it, the app is fine. Putting it all back, and prematurely opening the panel via weinre resolves the issue. Next step, is changing that padding-top back to 1em.
Problem doesn't show up. I repeat this several times over: make a build with 0.5em padding, and another with 1em. Repeat. The 0.5em build always has the issue, the other does not.
I'm going to chalk this up to the most coincidental (read: unlucky) bug, ever.
I'm planning on hardcoding the panel contents to display:none and showing them when the panel is opened. See if that works.

flexslider stops sliding on touch and dives images in two ios phone gap

If youre working with small slide you will notice they often stall halfways thru the slide. im using slide and not fade. Ive tested this on the basic flexslider example there is. It doenst matter if its a big og small slide if you slide the picture to 50% and you leave your finger from the slide, going straight down, then the image is stuck with 50% of to images.. Is this a bug or is there a solution? tested on ios 6 phone gap
edit it doenst have to be 50% you its everywhere u start sliding images and move the finger out of the slider then the sliding animation is stopped and youre stuck with something of two images.
Solution: Its currently a bug according to github A minor bug with no one to fix it anytime soon.. However i experienced severals flicker bugs when creating a slider on a transformed moved div...
therefor the solution for me was use iosslider instead. Its perfect! ive tried all sliders out there this one does it all with no bugs!!!.. Its free for personal use however not free for commercial :/ anyways its the best and there really isnt an alternative to what i need a slider for.
Say thank you with +1 if you went ahead and downloaded iosslider :) You will be satisfied i promise!

Intermittent refresh issues when scrolling up and down on 9810 + Blackberry

I am facing a strange issue with screen scrolling on 9810 device and simulator.
I have a complete order screen, which is shown when the order of the user is confirmed.
At the top there is Vertical Field Manager which contains another VerticalFieldManager ( containing Label Fields and buttonFields ) and a FlowFieldManager (containing images).
Now the problem that i am facing is that whenever i scroll the screen up and down , there are many gray lines appearing on the screen. It seems as if there is some screen refresh issue with the device. I tested on previous OS (4.5, 4.5 4.7 5.0) version, everything is working just fine on them. The problem is arising on OS version above 6.0 .
While the correct screen must be like
As you can see these gray lines appear whenevr i scroll screen up and down. Any ideas how to rectify this issue ?
In the first image, it looks like you are trying to add a shadow effect at the top of the screen. The vertical field manager uses some graphics optimization to improve scroll performance. Instead of repainting everything, it picks up the pixels on screen in the layout area, and shifts them. This works so long as all the painting code is relative to the virtual extent.
Certain UI effect, like a shadow effect, are relative to the screen, rather than the virtual extent, so this optimization picks up those effects and copies them elsewhere, which looks bad. It also tends to look just like your first image.
There are two ways to fix this:
Turn off the optimization. Override isScrollCopyable to return false. Your visual problems should go away, but scrolling performance will suffer.
Don't add UI effects on top of a scrollable area.
I am very sorry for the late reply. However i fixed the issue by myself. I just overrided the paintBackground method in my class and inside that i wrote graphics.clear(). This seems to fix this scrolling issue. I will try Michael method too though.

Resources