SHARE
TWEET

Untitled

a guest Feb 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   @Override
  2.     void onProgressRefresh(float scale, boolean fromUser, int progress) {
  3.         super.onProgressRefresh(scale, fromUser, progress);
  4.  
  5.         if (mOnSeekBarChangeListener != null) {
  6.             mOnSeekBarChangeListener.onProgressChanged(this, progress, fromUser);
  7.         }
  8.     }
  9.  
  10.  
  11.  
  12.     @SuppressLint("SetTextI18n")
  13.     override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
  14.         if(fromUser){
  15.             val p = exp(progress)
  16.             progressView!!.setText("${(p)}")
  17.         }
  18.     }
  19.  
  20.    val power: Double = 1.005129105
  21.     val k: Int = 30
  22.  
  23.    private fun exp(t:Int) : Int{
  24.         if(t==0)
  25.             return 0
  26.         if(t > 0 && t < 12)
  27.             return 10
  28.         if(t >= 12 && t < 23)
  29.             return 15
  30.         if(t >= 23 && t < 34)
  31.             return 20
  32.         if(t >= 34 && t < 60)
  33.             return 30
  34.  
  35.         if(t == 1000)
  36.             return 5000
  37.         val v = (k* (power.pow(t))).toInt()
  38.  
  39.         return v - v.rem(10)
  40.     }
  41.  
  42.  private fun expXf(t:Int) : Int{
  43.         if(t==0)
  44.             return 0
  45.  
  46.         if(t in 1..11)
  47.             return 11
  48.         if(t in 12..22)
  49.             return 22
  50.         if(t in 23..33)
  51.             return 33
  52.         if(t in 34..59)
  53.             return 59
  54.  
  55.         if(t  >= 5000)
  56.             return 1000
  57.  
  58.         val v = log((t.toDouble()/k.toDouble()), power)
  59.         return v.toInt()
  60.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top