Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.64 KB | None | 0 0
  1. import k2m.koli.model.ArrivalOrderItem
  2.  
  3. open class BaseFieldsHelper {
  4.  
  5.     fun compareArrivalTime(timeAfterArrival: Long, item: ArrivalOrderItem?, vararg views: View) {
  6.         if (item != null) {
  7.             if (item.allowEditMinutes != null && (item.allowEditMinutes == 0 || timeAfterArrival > item.allowEditMinutes!! * 60000)) {
  8.                 setViewsEnabling(false, *views)
  9.             } else {
  10.                 setViewsEnabling(true, *views)
  11.             }
  12.         }
  13.     }
  14.  
  15.     private fun setViewsEnabling(isEnabled: Boolean, vararg views: View) {
  16.         for (view in views) {
  17.             view.isEnabled = isEnabled
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement