Skip to content

Commit

Permalink
StackWidget: Remove unused remoteViews; fix invalid check
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Sep 9, 2022
1 parent 961fb76 commit ec1f0c5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ internal class StackRemoteViewsFactory(private val context: Context, intent: Int
)
private val habitIds: LongArray
private val widgetType: StackWidgetType
private var remoteViews = ArrayList<RemoteViews>()
override fun onCreate() {}
override fun onDestroy() {}
override fun getCount(): Int {
Expand Down Expand Up @@ -89,7 +88,7 @@ internal class StackRemoteViewsFactory(private val context: Context, intent: Int

override fun getViewAt(position: Int): RemoteViews? {
Log.i("StackRemoteViewsFactory", "getViewAt $position started")
if (position < 0 || position >= remoteViews.size) return null
if (position < 0 || position >= habitIds.size) return null
val app = context.applicationContext as HabitsApplication
val prefs = app.component.preferences
val habitList = app.component.habitList
Expand Down

0 comments on commit ec1f0c5

Please sign in to comment.