Sebbi
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Project 4 - Documentation In Project 4 we rewrite our frontend from [Project 3](https://gitlab.stud.idi.ntnu.no/it2810-h22/Team-24/project_3) to React Native. ## How to start the project After cloning the project 1. Navigate into the _native_ folder 2. Run the following commands: ``` npm install npx expo start ``` 3. Download the expo go app on your mobile device 4. Scan the qr code that showed up in your terminal after running _npx expo start_ 5. Now the app should be loading on your phone! ## React native The app is written in Typescript and uses the React Native framework to support the app on iOS and Android. The framework allows us to develop using similar code to our previous React-based project, but render it natively as a mobile application. ### NativeBase We have used the component library NativeBase to get prebuilt components and stylings. It makes the app more responsive and gives it a holistic presentation. It is similar to the Chakra library we have used previously, and helped us in the development of the app. We used it for scrollview, buttons, as well as styling components like flex, box, center, etc. ## Features ### Listview The listview is mostly the same as our React-app. There we used Chakra-UIs built in accordion element. But nativebase did not have a built in accordion so we opted to use their box elemets to make a custom accordion. Other than the implementation, the feature itself is the same: The listview features an accordion where the titles are the titles of the movies. On expand our application fetches the object data for each movie. This results in some loadingtime, however we dont fetch data before we need it, which results in faster inital loading time. We decided on the use of a accordian, because it renders data vertically and the user can show/hide data as needed. We also included a component which will be displayed if the search results in none movies. ### Searchbar We decided to have the same design on our native app as in our webapp, this was due to time limitations. However we decided to remove the search button, and query a new search whenever a user changes the value in the searchfield. The design ended up looking much cleaner, and was more mobile friendly. We also changed the advanced search view from a drawer to a modal, as this also was more mobile friendly. One other change we had to implement was that our component library did not include a slider with two thumbs, so we changed the way a user filters on ratings from a slider to two number inputs. ### Pagination In project 3 we used pages to handle a big dataset, however we saw it more fitting to use an infinite scollview in a app, due to screen size limitations. It was hard to fit a page selector into such a small screen. To achieve a scollview we decided to use a _load more_ button at the end of our list. This way we didnt have to check if a user was a the end of the list. When a user gets to the end of the list, he/she can click the button to load more movies. However when we implemented this the app refetched the whole query and the user ended up at the top of the list again. To prevent this we decided to segment the scollview into sections, so that a section is responsible for fetching an displaying its data. The section takes in a offset as a prop, and when the user clicks _load more_ a new section gets added to the list. This way a user only needs to fetch the new data, istead of new data and all the previous data. ### AddMovie AddMovie is implemented by using [React Hook Form](https://docs.nativebase.io/3.1.x/react-hooks-forms) just as in Project 3. But using Nativebase components instead of Chakra UI components and a different DatePicker. For the DatePicker component we use [React Native DateTimePicker](https://github.com/react-native-datetimepicker/datetimepicker#react-native-datetimepicker) which is rendered by the Controller-component and updates the release date state in React Hook Form on change. This component functions differently on Android and iOS. On Android the DateTimePicker is opened automatically when component is mounted, and it does not on iOS. We handled this by rendering a Pressable on Android which opens DateTimePicker. Making changes in this updates the state and thus the text displayed in the Pressable. On iOS it is rendered normally without a Pressable for opening. We check whether the device is Android or not using `Platform.OS === "ios"` . ### Vote The vote feature is implemented a bit differently from Project 3. Instead of toggling between displaying and not displaying the stars, we chose to open the stars as a modal. This makes more sense on a mobile device as the component is easier to interact with when it is bigger. The star rating component used is [React Native Ratings](https://github.com/Monte9/react-native-ratings#readme). The user can then rate the movies on a scale from 0-5 stars where 1 star is 2 points on a scale from 0-10. Interacting with the stars will update the rating state. When the user presses `Submit rating` the voteMovie mutation is sent to the backend and updates the rating for the movie. The data is then refetched to display the newly computed rating. The VoteMovie component receives the setShowModal function as a prop from VoteMovieModal so that when `Submit rating` is pressed, the modal closes. ### Darkmode Darkmode on the app is made possible through the use of the useColorMode() hook from NativeBase. Some of the NativeBase components have dark mode themes already implemented, but others have custom coloring attributes based on the state of colorMode. The dark mode button itself is located in the top right corner of the app to make it easily accessible.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully