Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggy42 committed Mar 1, 2017
1 parent a72f818 commit 905e6e1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class ScrollAwareFABBehavior(context: Context, attrs: AttributeSet) : FloatingAc
nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(
coordinatorLayout, child, directTargetChild, target, nestedScrollAxes)

override fun onNestedScroll(coordinatorLayout: CoordinatorLayout?, child: FloatingActionButton?, target: View?,
override fun onNestedScroll(coordinatorLayout: CoordinatorLayout?, child: FloatingActionButton, target: View?,
dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed)
if (dyConsumed > 0 && child?.visibility == View.VISIBLE) {
child?.hide(listener)
} else if (dyConsumed < 0 && child?.visibility != View.VISIBLE) {
child?.show()
if (dyConsumed > 0 && child.visibility == View.VISIBLE) {
child.hide(listener)
} else if (dyConsumed < 0 && child.visibility != View.VISIBLE) {
child.show()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ class NotificationsFragment : Fragment(), NotificationsMvpView {
recyclerView.addItemDecoration(SpaceTopItemDecoration(Utils.dpToPx(context, 10)))
recyclerView.adapter = adapter

val refreshLayout = rootView?.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
val refreshLayout = rootView.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
refreshLayout.setColorSchemeColors(Theme.getColorPrimary(context))
refreshLayout.setOnRefreshListener {
NotificationsIntentService.startService(context)
Toast.makeText(context, R.string.checking_notifications, Toast.LENGTH_SHORT).show()
Handler().postDelayed({ refreshLayout.isRefreshing = false }, 2000)
}

emptyView = rootView?.findViewById(R.id.emptyLinearLayout) as ViewGroup
emptyView = rootView.findViewById(R.id.emptyLinearLayout) as ViewGroup

presenter.getNotifications()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class PrivateMessagesListFragment : Fragment(), PrivateMessagesListMvpView {
adapterPrivateMessages = PrivateMessagesConversationsAdapter()
}

override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val rootView = inflater?.inflate(R.layout.fragment_privatemessages, container, false)
val rootView = inflater.inflate(R.layout.fragment_privatemessages, container, false)

val recyclerView = rootView?.findViewById(R.id.tweetsRecyclerView) as RecyclerView
emptyViewGroup = rootView?.findViewById(R.id.emptyLinearLayout) as ViewGroup
emptyViewGroup = rootView.findViewById(R.id.emptyLinearLayout) as ViewGroup

val linearLayoutManager = LinearLayoutManager(activity)
recyclerView.layoutManager = linearLayoutManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class SearchUsersFragment : Fragment(), SearchUsersMvpView {
}
}

override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val rootView = inflater?.inflate(R.layout.fragment_timeline, container, false)
val rootView = inflater.inflate(R.layout.fragment_timeline, container, false)

recyclerView = rootView?.findViewById(R.id.tweetsRecyclerView) as RecyclerView
loadingProgressBar = rootView?.findViewById(R.id.loadingProgressBar) as ProgressBar
swipeRefreshLayout = rootView?.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
badThingsViewGroup = rootView?.findViewById(R.id.badThingsViewGroup) as ViewGroup
retryButton = rootView?.findViewById(R.id.retryButton) as Button
recyclerView = rootView.findViewById(R.id.tweetsRecyclerView) as RecyclerView
loadingProgressBar = rootView.findViewById(R.id.loadingProgressBar) as ProgressBar
swipeRefreshLayout = rootView.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
badThingsViewGroup = rootView.findViewById(R.id.badThingsViewGroup) as ViewGroup
retryButton = rootView.findViewById(R.id.retryButton) as Button

swipeRefreshLayout.isEnabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ open class TimelineFragment : Fragment(), TimelineMvpView, InteractionListener {
}
}

override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val rootView = inflater?.inflate(R.layout.fragment_timeline, container, false)
val rootView = inflater.inflate(R.layout.fragment_timeline, container, false)

recyclerView = rootView?.findViewById(R.id.tweetsRecyclerView) as RecyclerView
swipeRefreshLayout = rootView?.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
loadingProgressBar = rootView?.findViewById(R.id.loadingProgressBar) as ProgressBar
badThingsViewGroup = rootView?.findViewById(R.id.badThingsViewGroup) as ViewGroup
swipeRefreshLayout = rootView.findViewById(R.id.swipeRefreshLayout) as SwipeRefreshLayout
loadingProgressBar = rootView.findViewById(R.id.loadingProgressBar) as ProgressBar
badThingsViewGroup = rootView.findViewById(R.id.badThingsViewGroup) as ViewGroup

val linearLayoutManager = LinearLayoutManager(activity)
recyclerView.layoutManager = linearLayoutManager
Expand All @@ -86,7 +86,7 @@ open class TimelineFragment : Fragment(), TimelineMvpView, InteractionListener {
swipeRefreshLayout.setOnRefreshListener { presenter.onRefresh() }
swipeRefreshLayout.setColorSchemeColors(Theme.getColorPrimary(context))

rootView?.findViewById(R.id.retryButton)?.setOnClickListener {
rootView.findViewById(R.id.retryButton)?.setOnClickListener {
badThingsViewGroup.visible(false)
presenter.getTweets()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ class TweetDetailsFragment : Fragment(), TweetDetailsMvpView, DetailsInteraction
}
}

override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val rootView = inflater?.inflate(R.layout.fragment_tweet_details, container, false)
val rootView = inflater.inflate(R.layout.fragment_tweet_details, container, false)

recyclerView = rootView?.findViewById(R.id.tweetsRecyclerView) as RecyclerView
badThingsViewGroup = rootView?.findViewById(R.id.badThingsViewGroup) as ViewGroup
loadingProgressBar = rootView?.findViewById(R.id.loadingProgressBar) as ProgressBar
recyclerView = rootView.findViewById(R.id.tweetsRecyclerView) as RecyclerView
badThingsViewGroup = rootView.findViewById(R.id.badThingsViewGroup) as ViewGroup
loadingProgressBar = rootView.findViewById(R.id.loadingProgressBar) as ProgressBar

recyclerView.layoutManager = LinearLayoutManager(activity)
recyclerView.setHasFixedSize(true)
recyclerView.addItemDecoration(SpaceTopItemDecoration(Utils.dpToPx(activity, 10)))
recyclerView.adapter = adapter

rootView?.findViewById(R.id.retryButton)?.setOnClickListener {
rootView.findViewById(R.id.retryButton)?.setOnClickListener {
badThingsViewGroup.visible(false)
presenter.getConversation(statusId)
}
Expand Down

0 comments on commit 905e6e1

Please sign in to comment.