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

[TIMOB-25684] iOS: Adds home-screen like parallax effect to views #9748

Merged
merged 14 commits into from May 15, 2018

Conversation

chmiiller
Copy link
Contributor

@chmiiller chmiiller commented Jan 18, 2018

JIRA: https://jira.appcelerator.org/browse/TIMOB-25684

Adds homescreen like parallax effect to views based on Marcel Pociot's module https://github.com/mpociot/TiMotionEffects

@hansemannn hansemannn changed the title [AC-5533] iOS: Adds homescreen like parallax effect to views [TIMOB-25684] iOS: Adds home-screen like parallax effect to views Jan 18, 2018
@hansemannn
Copy link
Collaborator

hansemannn commented Jan 18, 2018

The unit-tests are missing which will prevent our Danger.js checks from passing. I prepared them for you, please create a file ti.ui.view.addontest.is in tests/:

/*
 * Appcelerator Titanium Mobile
 * Copyright (c) 2015-Present by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */
/* eslint-env mocha */
/* global Ti */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');

describe('Titanium.UI.View', function() {

  it.ios('.horizontalMotionEffect, .verticalMotionEffect', function(finish) {
    var win = Ti.UI.createWindow({
      backgroundColor: 'blue'
    });

    var view = Ti.UI.createView({
      horizontalMotionEffect: {
        min: -50,
        max: 50
      },
      verticalMotionEffect: {
        min: -50,
        max: 50
      }
    });

    win.addEventListener('open', function() {
        // horizontalMotionEffect
        should(view.horizontalMotionEffect).be.an.Object;
        should(view.horizontalMotionEffect.min).be.a.Number;
        should(view.horizontalMotionEffect.max).be.a.Number;

        // verticalMotionEffect
        should(view.verticalMotionEffect).be.an.Object;
        should(view.verticalMotionEffect.min).be.a.Number;
        should(view.verticalMotionEffect.max).be.a.Number;

        finish();
    });

    win.add(view);
    win.open();
  });
});

Also, please adjust the docs in apidoc/Titanium/UI/View.yml to include the properties, with a since version of 7.1.0.

EDIT: @chmiiller I've update the test-case to actually call finish(). Otherwise the test will time-out. Also, the test is brain-written, so you may need to tweak some details to pass.

@hansemannn hansemannn self-requested a review January 18, 2018 16:45
@chmiiller
Copy link
Contributor Author

Thanks @hansemannn ! I've just updated tests and added the properties into View's documentation. Is it missing something else?

@chmiiller
Copy link
Contributor Author

Test suite crashed on iOS simulator. Please see the crash log for more details. I can't access the crash logs =/

@build
Copy link
Contributor

build commented Jan 19, 2018

Messages
📖

🎉 Another contribution from our awesome community member, chmiiller! Thanks again for helping us make Titanium SDK better. 👍

📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@chmiiller
Copy link
Contributor Author

Thanks for all the work @hansemannn ! Looking forward to see it on 7.1.0 release 😬

@hansemannn hansemannn merged commit 6670f52 into tidev:master May 15, 2018
@sgtcoolguy sgtcoolguy modified the milestones: 7.2.0, 7.3.0 May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants