remove some local variables

This commit is contained in:
tibbi 2017-10-21 19:17:34 +02:00
parent 879ba83574
commit 5e8a41d4c7
6 changed files with 6 additions and 18 deletions

View File

@ -22,7 +22,7 @@ class MyDayPagerAdapter(fm: FragmentManager, private val mCodes: List<String>, p
val fragment = DayFragment()
fragment.arguments = bundle
fragment.setListener(mListener)
fragment.mListener = mListener
mFragments.put(position, fragment)
return fragment

View File

@ -20,7 +20,7 @@ class MyWeekPagerAdapter(fm: FragmentManager, val mWeekTimestamps: List<Int>, va
val fragment = WeekFragment()
fragment.arguments = bundle
fragment.setListener(mListener)
fragment.mListener = mListener
mFragments.put(position, fragment)
return fragment

View File

@ -21,7 +21,7 @@ class MyYearPagerAdapter(fm: FragmentManager, val mYears: List<Int>, val mListen
val fragment = YearFragment()
fragment.arguments = bundle
fragment.setListener(mListener)
fragment.mListener = mListener
mFragments.put(position, fragment)
return fragment

View File

@ -33,9 +33,9 @@ import org.joda.time.DateTime
import java.util.*
class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListener {
var mListener: NavigationListener? = null
private var mTextColor = 0
private var mDayCode = ""
private var mListener: NavigationListener? = null
private var lastHash = 0
lateinit var mRes: Resources
@ -82,10 +82,6 @@ class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListen
}
}
fun setListener(listener: NavigationListener) {
mListener = listener
}
private fun pickDay() {
activity.setTheme(context.getAppropriateTheme())
val view = getLayoutInflater(arguments).inflate(R.layout.date_picker, null)

View File

@ -33,7 +33,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
private val CLICK_DURATION_THRESHOLD = 150
private val PLUS_FADEOUT_DELAY = 5000L
private var mListener: WeekScrollListener? = null
var mListener: WeekScrollListener? = null
private var mWeekTimestamp = 0
private var mRowHeight = 0
private var minScrollY = -1
@ -424,10 +424,6 @@ class WeekFragment : Fragment(), WeeklyCalendar {
private fun getColumnWithId(id: Int) = mView.findViewById(mRes.getIdentifier("week_column_$id", "id", context.packageName)) as ViewGroup
fun setListener(listener: WeekScrollListener) {
mListener = listener
}
fun updateScrollY(y: Int) {
if (wasFragmentInit)
mView.week_events_scrollview.scrollY = y

View File

@ -22,7 +22,7 @@ import org.joda.time.DateTime
import java.util.*
class YearFragment : Fragment(), YearlyCalendar {
private var mListener: NavigationListener? = null
var mListener: NavigationListener? = null
private var mYear = 0
private var mSundayFirst = false
private var lastHash = 0
@ -87,10 +87,6 @@ class YearFragment : Fragment(), YearlyCalendar {
}
}
fun setListener(listener: NavigationListener) {
mListener = listener
}
override fun updateYearlyCalendar(events: SparseArray<ArrayList<DayYearly>>, hashCode: Int) {
if (!isAdded)
return