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

[ScrollView] aabb not working on lumin #288

Open
grzegorzdec opened this issue Apr 7, 2020 · 0 comments
Open

[ScrollView] aabb not working on lumin #288

grzegorzdec opened this issue Apr 7, 2020 · 0 comments
Labels
bug Something isn't working Lumin Related to Lumin platform.

Comments

@grzegorzdec
Copy link
Contributor

ScrollView parameter aabb is not working on the ZI simulator. I expected to limit the size of the scrollview.

Screenshot and code:

Screenshot 2020-04-07 at 10 22 17

import React from "react";
import {
  View,
  ScrollView,
  ScrollBar,
  Text,
  LinearLayout
} from "magic-script-components";

export class ExampleScrollView extends React.Component {
  render() {
    const alphabet = [
      "Alfa",
      "Bravo",
      "Charlie",
      "Delta",
      "Echo",
      "Foxtrot",
      "Golf",
      "Hotel",
      "India",
      "Juliett",
      "Kilo",
      "Lima",
      "Mike",
      "November",
      "Oscar",
      "Papa",
      "Quebec",
      "Romeo",
      "Sierra",
      "Tango",
      "Uniform",
      "Victor",
      "Whiskey",
      "X-ray",
      "Yankee",
      "Zulu"
    ];

    const aabb = {
      min: [-0.25, -0.45, -0.1],
      max: [0.25, 0.35, 0.1]
    };

    const calculateValue = (number, multiplier) =>
      ((number + 1 * multiplier) % 10) * 0.1;

    return (
      <View name="main-view">
        <Text
          alignment="center-center"
          text="Phonetic Alphabet"
          textAlignment="center"
          textSize={0.07}
          localPosition={[0, 0.4, 0]}
        />
        <ScrollView scrollBarVisibility="always" scrollBounds={aabb}>
          <ScrollBar length={0.6} thumbSize={0.03} orientation="vertical" />
          <LinearLayout
            defaultItemAlignment="center-left"
            defaultItemPadding={[0.01, 0.01, 0.01, 0.01]}
            orientation="vertical"
          >
            {alphabet.map((word, index) => (
              <Text
                textSize={0.05}
                key={index}
                text={`${word[0]} - ${word}`}
                textColor={[
                  calculateValue(index, 1),
                  calculateValue(index, 2),
                  calculateValue(index, 3),
                  0.8
                ]}
              />
            ))}
          </LinearLayout>
        </ScrollView>
      </View>
    );
  }
}
@grzegorzdec grzegorzdec added bug Something isn't working Lumin Related to Lumin platform. labels Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Lumin Related to Lumin platform.
Projects
None yet
Development

No branches or pull requests

1 participant