aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/net/lacolaco/smileessence/view/adapter
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-10-09 17:45:51 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-10-09 18:09:01 +0900
commitc86532ef6d337d2b16f8bc29b70205677d571683 (patch)
treebcb23137c2eaa000e2aced154f21b1b6461caf3e /app/src/main/java/net/lacolaco/smileessence/view/adapter
parentbe40171c1a4ac855122768f2ea892f695d4cb787 (diff)
downloadSmileEssence-c86532ef6d337d2b16f8bc29b70205677d571683.tar.gz
reinit
Diffstat (limited to 'app/src/main/java/net/lacolaco/smileessence/view/adapter')
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/CustomListAdapter.kt6
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/EventListAdapter.kt24
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/MessageListAdapter.kt24
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/PageListAdapter.kt28
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/TimelineAdapter.kt2
-rw-r--r--app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt4
6 files changed, 7 insertions, 81 deletions
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/CustomListAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/CustomListAdapter.kt
index e68e3746..612c14e5 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/CustomListAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/CustomListAdapter.kt
@@ -2,9 +2,7 @@ package net.lacolaco.smileessence.view.adapter
import android.widget.BaseAdapter
import net.lacolaco.smileessence.util.UIHandler
-
-import java.util.ArrayList
-import java.util.Collections
+import java.util.*
abstract class CustomListAdapter<out T> : BaseAdapter() {
private var isNotifiable = true
@@ -42,4 +40,4 @@ abstract class CustomListAdapter<out T> : BaseAdapter() {
fun updateForce() {
UIHandler().post { this.notifyDataSetChanged() }
}
-} \ No newline at end of file
+}
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/EventListAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/EventListAdapter.kt
index 86e80e2b..b38bf25e 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/EventListAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/EventListAdapter.kt
@@ -1,27 +1,3 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
package net.lacolaco.smileessence.view.adapter
import android.app.Activity
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/MessageListAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/MessageListAdapter.kt
index 90a17c90..6d80486f 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/MessageListAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/MessageListAdapter.kt
@@ -1,27 +1,3 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
package net.lacolaco.smileessence.view.adapter
import android.app.Activity
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/PageListAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/PageListAdapter.kt
index d400ac4f..2e739faa 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/PageListAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/PageListAdapter.kt
@@ -1,27 +1,3 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2014 lacolaco.net
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
package net.lacolaco.smileessence.view.adapter
import android.os.Bundle
@@ -29,10 +5,8 @@ import android.support.v13.app.FragmentPagerAdapter
import net.lacolaco.smileessence.activity.MainActivity
import net.lacolaco.smileessence.logging.Logger
import net.lacolaco.smileessence.view.page.PageFragment
-
import java.lang.ref.WeakReference
-import java.util.ArrayList
-import java.util.HashMap
+import java.util.*
class PageListAdapter(_activity: MainActivity) : FragmentPagerAdapter(_activity.fragmentManager) {
private val pages = ArrayList<PageInfo>()
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/TimelineAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/TimelineAdapter.kt
index 511db35e..362e183b 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/TimelineAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/TimelineAdapter.kt
@@ -3,9 +3,9 @@ package net.lacolaco.smileessence.view.adapter
import android.app.Activity
import android.view.View
import android.view.ViewGroup
+import net.lacolaco.smileessence.World
import net.lacolaco.smileessence.entity.Tweet
import net.lacolaco.smileessence.view.Partials
-import net.lacolaco.smileessence.World
class TimelineAdapter(private val activity: Activity, private val world: World) : OrderedCustomListAdapter<Tweet>() {
val lastID: Long
diff --git a/app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt b/app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt
index f32fa7f3..46b40681 100644
--- a/app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt
+++ b/app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt
@@ -3,7 +3,9 @@ package net.lacolaco.smileessence.view.adapter
import java.util.*
abstract class UnorderedCustomListAdapter<T> constructor(override val list: ArrayList<T> = ArrayList()) : CustomListAdapter<T>() {
- init { update() }
+ init {
+ update()
+ }
@Synchronized
fun add(item: T) = list.add(item)