-
Notifications
You must be signed in to change notification settings - Fork 155
/
KFFmppegFormatActivity.kt
61 lines (51 loc) · 1.69 KB
/
KFFmppegFormatActivity.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.coder.ffmpegtest.ui
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.coder.ffmpeg.annotation.FormatAttribute
import com.coder.ffmpeg.jni.FFmpegCommand
import com.coder.ffmpegtest.R
/**
*
* @author: AnJoiner
* @datetime: 20-11-14
*/
class KFFmppegFormatActivity : AppCompatActivity() {
private var btnInputFormat: Button?=null
private var btnOutputFormat: Button?=null
private var tvContent: TextView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_ffmpeg_format)
init()
}
private fun init(){
initView()
initListener()
}
private fun initView() {
btnInputFormat = findViewById(R.id.btn_input_format)
btnOutputFormat = findViewById(R.id.btn_output_format)
tvContent = findViewById(R.id.tv_content)
tvContent?.movementMethod = ScrollingMovementMethod.getInstance();
}
private fun initListener(){
btnInputFormat?.setOnClickListener {
tvContent?.text=FFmpegCommand.getSupportFormat(FormatAttribute.INPUT_FORMAT)
}
btnOutputFormat?.setOnClickListener {
tvContent?.text=FFmpegCommand.getSupportFormat(FormatAttribute.OUTPUT_FORMAT)
}
}
companion object{
fun start(context: Context){
val intent = Intent(context,KFFmppegFormatActivity::class.java)
context.startActivity(intent)
}
}
}