Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Game Client Android
Game Client Android
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Akamu
  • Game Client AndroidGame Client Android
  • Wiki
    • 2.development
  • 2.3loading animations

Last edited by Niklas Fix May 04, 2020
Page history

2.3loading animations

When implementing screens for the Akamu App, it may occur that you want to use a loading animation while the app is communicating with the server. A blueprint layout for this already exists. You can find it under res/layout/layout_dotloader.xml and res/layout/layout_load_failed.xml.

DotLoader Layout

This layout file uses this library by Bhargav Mogra to display some fancy hopping dots while loading data. Include this layout file to the layout file you're working on with the following code:

...
<include layout="@layout/layout_dotloader"
	 android:id="@+id/layout_dotloader_my_layout"
	 android:visibility="gone"/>
...

The visibility is set to "gone" because otherwise we would see this layout always in the layout editor. Change the visibility of this included layout in your activity whenever you want to show a loading animation. You should set the visibility to "gone" again after the loading is done.

Loading Failed Layout

This layout file shows an image of the akamu elephant after loading has failed. Furthermore you can let it show the reason why the loading task has failed. Include this layout file to the layout file you're working on with the following code:

...
<include layout="@layout/layout_load_failed"
	 android:id="@+id/layout_load_failed_my_layout"
	 android:visibility="gone"/>
...

The visibility is set to "gone" because otherwise we would see this layout always in the layout editor. Change the visibility of this included layout in your activity whenever you want to indicate that a loading task has failed.

Clone repository
  • 1. Getting started
  • 2.Development
    • 2.1Development Using MVP Pattern
    • 2.2AkamuAPI
    • 2.3loading animations
    • 2.4Packaging
  • Home