# snake
**Repository Path**: HarmonyOS-tpc/snake
## Basic Information
- **Project Name**: snake
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-09-17
- **Last Updated**: 2024-12-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# snake
Snake: Snake View is a simple and animated linear chart for openharmony.
## snake includes:
*this library solution can help developers display animation in snake chart.
## Usage Instructions
1. A sample project which provides runnable code examples that demonstrate uses of the classes in this project is available in the sample/ folder.
2. The following core classes are the essential interface to snake:
SnakeView : this class basically we are creating the custom xml layout for snake animation.
3. The steps to initialize the snake and the core classes:
a. xml file
b.Java file
private void generateValue() {
LogUtil.debug("genrate", "value");
if (position < (values.length - 1)) {
position++;
} else {
position = 0;
}
float value = values[position];
snakeView.addValue(value);
text.setText(Integer.toString((int) value));
handler.postTask(new Runnable() {
@Override
public void run() {
if (!stop) {
generateValue();
}
}
}, 500);
}
## Installation instruction
1.For using module in sample app,include the below library dependency to generate hap/snake.har:
Add the dependencies in entry/build.gradle as below :
dependencies {
implementation project(path: ':snakeview')
}
2. Using the snake har, make sure to add snake.har file in the entry/libs folder and add the below dependency
in build.gradle.
Modify the dependencies in the entry/build.gradle file.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
}
## License
Copyright Txus Ballesteros 2015 (@txusballesteros)
This file is part of some open source application.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the License.
Contact: Txus Ballesteros txus.ballesteros@gmail.com