Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alighters/CubeGrid
Cube grid animation about the android.
https://github.com/alighters/CubeGrid
Last synced: 2 months ago
JSON representation
Cube grid animation about the android.
- Host: GitHub
- URL: https://github.com/alighters/CubeGrid
- Owner: alighters
- Created: 2016-02-05T10:24:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-22T02:32:56.000Z (over 8 years ago)
- Last Synced: 2023-11-07T15:23:43.146Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 143 KB
- Stars: 216
- Watchers: 6
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-ui - https://github.com/david-wei/CubeGrid
- awesome-android-ui - https://github.com/david-wei/CubeGrid
README
# CubeGrid
Cube grid animation about the android.The android implementation about the [9-cube-grid](https://github.com/tobiasahlin/SpinKit/blob/master/examples/9-cube-grid.html)
## Demo
![test](http://7xpyth.com1.z0.glb.clouddn.com/cube1.gif)## Usage
### Add dependency
allprojects {
repositories {
...
mavenCentral()
}
}
dependencies {
compile 'com.lighters.cubegrid:cubegridlibray:1.2.4'
}
### Step 1
```
```
### Step 2
```
public class MainActivity extends AppCompatActivity {public final static String TAG = MainActivity.class.getName();
private CubeGridImageView mCubeGridImageView;
private CubeGridFrameLayout mCubeGridFrameLayout;@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}private void init() {
mCubeGridImageView = (CubeGridImageView) findViewById(R.id.iv_cube_grid);
mCubeGridFrameLayout = (CubeGridFrameLayout) findViewById(R.id.fl_cube_grid);
mCubeGridImageView.start(mImageAnimCallback);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mCubeGridFrameLayout.start(mFrameLayoutAnimCallback);
}
}, 100);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mCubeGridImageView.stop();
}
}, 5000);
}private ICubeGridAnimCallback mImageAnimCallback = new ICubeGridAnimCallback() {
@Override
public void onAnimStart() {}
@Override
public void onAnimExecute(int curLoopCount) {
Log.d(TAG, "image loop:" + curLoopCount);
}@Override
public void onAnimEnd() {
Toast.makeText(MainActivity.this, "ImageAnimEnd", Toast.LENGTH_SHORT).show();
}
};private ICubeGridAnimCallback mFrameLayoutAnimCallback = new ICubeGridAnimCallback() {
@Override
public void onAnimStart() {}
@Override
public void onAnimExecute(int curLoopCount) {
Log.d(TAG, "frame layout loop:" + curLoopCount);
}@Override
public void onAnimEnd() {
Toast.makeText(MainActivity.this, "FrameAnimEnd", Toast.LENGTH_SHORT).show();
}
};@Override
protected void onDestroy() {
super.onDestroy();
mCubeGridImageView.destory();
mCubeGridFrameLayout.destroy();
}
}
```## LICENSE
```
Copyright (C) 2016 david.wei (lighters)
Licensed 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.