| | |
| | | import android.view.ViewGroup |
| | | import androidx.fragment.app.DialogFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.LanguageUtil |
| | | import cn.sinata.xldutils.view.WheelView |
| | | import com.igo.user.R |
| | | import com.igo.user.utils.Const |
| | |
| | | private val wv_2 by lazy { find<WheelView>(R.id.wv_2) } |
| | | private val wv_3 by lazy { find<WheelView>(R.id.wv_3) } |
| | | |
| | | private val language by lazy { SPUtils.instance().getString("language","en") } |
| | | private val language by lazy { LanguageUtil.getLanguage() } |
| | | |
| | | override fun onCreateView( |
| | | inflater: LayoutInflater, |
| | |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | setStyle(STYLE_NO_FRAME, R.style.Dialog) |
| | | setStyle(STYLE_NO_FRAME, cn.sinata.xldutils.R.style.Dialog) |
| | | } |
| | | |
| | | override fun onActivityCreated(savedInstanceState: Bundle?) { |
| | |
| | | val end = if (wv_3.seletedIndex == years.lastIndex) month else 11 |
| | | months.clear() |
| | | months.addAll((0..end)) |
| | | val list = if (language == "en") Const.monthEnglish.subList(0,end+1) else Const.monthFrench.subList(0,end+1) |
| | | val list = if (language == Const.Language.ENGLISH) Const.monthEnglish.subList(0,end+1) else Const.monthFrench.subList(0,end+1) |
| | | wv_2.setItems(list) |
| | | wv_2.setSeletion(if (isFirst) list.lastIndex else 0) |
| | | } |