|
|
@ -22,11 +22,9 @@ import android.view.MenuItem |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.widget.PopupWindow |
|
|
|
import android.widget.PopupWindow |
|
|
|
import androidx.activity.viewModels |
|
|
|
import androidx.activity.viewModels |
|
|
|
import androidx.lifecycle.Observer |
|
|
|
|
|
|
|
import androidx.recyclerview.widget.DividerItemDecoration |
|
|
|
import androidx.recyclerview.widget.DividerItemDecoration |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import com.keylesspalace.tusky.BaseActivity |
|
|
|
import com.keylesspalace.tusky.* |
|
|
|
import com.keylesspalace.tusky.R |
|
|
|
|
|
|
|
import com.keylesspalace.tusky.adapter.EmojiAdapter |
|
|
|
import com.keylesspalace.tusky.adapter.EmojiAdapter |
|
|
|
import com.keylesspalace.tusky.adapter.OnEmojiSelectedListener |
|
|
|
import com.keylesspalace.tusky.adapter.OnEmojiSelectedListener |
|
|
|
import com.keylesspalace.tusky.di.Injectable |
|
|
|
import com.keylesspalace.tusky.di.Injectable |
|
|
@ -37,7 +35,7 @@ import kotlinx.android.synthetic.main.activity_announcements.* |
|
|
|
import kotlinx.android.synthetic.main.toolbar_basic.* |
|
|
|
import kotlinx.android.synthetic.main.toolbar_basic.* |
|
|
|
import javax.inject.Inject |
|
|
|
import javax.inject.Inject |
|
|
|
|
|
|
|
|
|
|
|
class AnnouncementsActivity : BaseActivity(), AnnouncementActionListener, OnEmojiSelectedListener, Injectable { |
|
|
|
class AnnouncementsActivity : BottomSheetActivity(), AnnouncementActionListener, OnEmojiSelectedListener, Injectable { |
|
|
|
|
|
|
|
|
|
|
|
@Inject |
|
|
|
@Inject |
|
|
|
lateinit var viewModelFactory: ViewModelFactory |
|
|
|
lateinit var viewModelFactory: ViewModelFactory |
|
|
@ -147,6 +145,24 @@ class AnnouncementsActivity : BaseActivity(), AnnouncementActionListener, OnEmoj |
|
|
|
viewModel.removeReaction(announcementId, name) |
|
|
|
viewModel.removeReaction(announcementId, name) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onViewTag(tag: String?) { |
|
|
|
|
|
|
|
val intent = Intent(this, ViewTagActivity::class.java) |
|
|
|
|
|
|
|
intent.putExtra("hashtag", tag) |
|
|
|
|
|
|
|
startActivityWithSlideInAnimation(intent) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onViewAccount(id: String?) { |
|
|
|
|
|
|
|
if (id != null) { |
|
|
|
|
|
|
|
viewAccount(id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onViewUrl(url: String?) { |
|
|
|
|
|
|
|
if (url != null) { |
|
|
|
|
|
|
|
viewUrl(url) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
fun newIntent(context: Context) = Intent(context, AnnouncementsActivity::class.java) |
|
|
|
fun newIntent(context: Context) = Intent(context, AnnouncementsActivity::class.java) |
|
|
|
} |
|
|
|
} |
|
|
|