-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathGlobalizationActivity.kt
36 lines (28 loc) · 1.13 KB
/
GlobalizationActivity.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
package com.loper7.datepicker
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.loper7.date_time_picker.DateTimeConfig
import com.loper7.date_time_picker.number_picker.NumberPicker
import kotlinx.android.synthetic.main.activity_globalization.*
/**
*
* @CreateDate: 2021/1/12 11:10
* @Description:
* @Author: LOPER7
* @Email: [email protected]
*/
class GlobalizationActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_globalization)
picker.setGlobal(DateTimeConfig.GLOBAL_US)
picker1.setGlobal(DateTimeConfig.GLOBAL_CHINA)
picker2.setGlobal(DateTimeConfig.GLOBAL_LOCAL)
picker2.setDisplayType(intArrayOf(DateTimeConfig.YEAR,DateTimeConfig.MONTH,DateTimeConfig.DAY))
picker1.setOnDateTimeChangedListener {
Log.e("loper7","${StringUtils.conversionTime(picker1.getMillisecond(),"yyyy-MM-dd HH:mm:ss")}")
}
var numberPicker:NumberPicker? = picker.getPicker(DateTimeConfig.YEAR)
}
}