当前位置:网站首页>How to achieve the turning effect of wechat video recording?

How to achieve the turning effect of wechat video recording?

2022-06-23 23:41:00 Android Guide

Good morning , I am Lao Bei , official account 「GitHub Point north 」 Will recommend GitHub Useful projects on , Tap the value of open source , Welcome to your attention .

My quotation

WeChat chat , Send a recorded video , Long press the button , There is a looping effect during recording , How can this effect be achieved ? If you write it yourself, it probably involves knowledge points Android Customize View Medium drawArc Draw an arc , But we can go first GitHub Find out if there are any similar libraries , The principle is “ Most of the time, you don't need to know much about the principle at all , Just stand on the ding ding of the giant ”, The so-called predecessors plant trees, and later generations enjoy the cool .

very good ,GitHub There are really , be known as CameraVideoButton, Imitation Instagram Animation buttons for taking photos or recording videos , Recommended to you , Language is
Kotlin, Words GitHub What a treasure .

Results the preview

 Insert picture description here

Use

The project and app build.gradle:

allprojects {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.iammert:CameraVideoButton:0.2'
}

xml quote :

<com.iammert.library.cameravideobuttonlib.CameraVideoButton android:id="@+id/button" android:layout_width="120dp" android:layout_height="120dp" app:cvb_recording_color="#D438A2"/>

Code callback :

videoRecordButton.actionListener = object : CameraVideoButton.ActionListener{
    
    override fun onStartRecord() {
    
        Log.v("TEST", "Start recording video")
    }

    override fun onEndRecord() {
    
        Log.v("TEST", "Stop recording video")
    }

    override fun onDurationTooShortError() {
    
        Log.v("TEST", "Toast or notify user")
    }

    override fun onSingleTap() {
    
        Log.v("TEST", "Take photo here")
    }
}

GitHub Address

https://github.com/iammert/CameraVideoButton

above , Today's sharing , Think the content is good , Please order some more 「 Fabulous 」 Under the support , Thank you very much .

原网站

版权声明
本文为[Android Guide]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206232043467163.html