VideoLoadingView

项目地址: VideoLoadingView
简介:一个简单的加载界面

中文版

It's a loading view which can customize its color, change its speed or control it by yourselves(register a listener).

Maybe it's suitable for those video playing layouts.

Preview

VideoLoadingView-screenshot

Integration

Android Studio
  allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
  }

  dependencies {
        compile 'com.github.XuDeveloper:VideoLoadingView:v1.0'
  }
Eclipse

Maybe you can copy my code to your project!

Usage

Declare a VideoLoadingView inside your XML layout file:


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.xu.library.VideoLoadingView
        android:id="@+id/videoloadingview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:ArcColor="@color/green"
        app:TriangleColor="@color/green"
        />

</RelativeLayout>

Or use Java code dynamically.


    view = (VideoLoadingView) findViewById(R.id.videoLoadingView);
    view.setArcColor(Color.GREEN);
    view.setTriangleColor(Color.GREEN);
    view.setSpeed(VideoLoadingViewSpeed.SPEED_FAST);  //Default: VideoLoadingViewSpeed.SPEED_MEDIUM
    // view.setSpeed(VideoLoadingViewSpeed.SPEED_SLOW); 
    view.start();  //Default: stop()
    // view.pause();
    // view.stop();

You can register a listener:

    view.registerVideoViewListener(new VideoLoadingView.VideoViewListener() {
         @Override
         public void onStart() {
             Log.i(TAG, "video_loading_view onStart");
         }

         @Override
         public void onPause(double progress) {
             Log.i(TAG, "video_loading_view onPause, progress:" + progress);
         }

         @Override
         public void onStop() {
             Log.i(TAG, "video_loading_view onStop");
         }
     });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值