refactor: Move LinkListener to core.ui (#732)
This commit is contained in:
parent
a68e1bf63b
commit
46c7307c0d
|
@ -24,9 +24,9 @@ import app.pachli.core.activity.loadAvatar
|
||||||
import app.pachli.core.common.extensions.visible
|
import app.pachli.core.common.extensions.visible
|
||||||
import app.pachli.core.designsystem.R as DR
|
import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.TimelineAccount
|
import app.pachli.core.network.model.TimelineAccount
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemAccountBinding
|
import app.pachli.databinding.ItemAccountBinding
|
||||||
import app.pachli.interfaces.AccountActionListener
|
import app.pachli.interfaces.AccountActionListener
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
|
|
||||||
class AccountViewHolder(
|
class AccountViewHolder(
|
||||||
private val binding: ItemAccountBinding,
|
private val binding: ItemAccountBinding,
|
||||||
|
|
|
@ -34,9 +34,9 @@ import app.pachli.core.data.model.StatusDisplayOptions
|
||||||
import app.pachli.core.designsystem.R as DR
|
import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.TimelineAccount
|
import app.pachli.core.network.model.TimelineAccount
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemFollowRequestBinding
|
import app.pachli.databinding.ItemFollowRequestBinding
|
||||||
import app.pachli.interfaces.AccountActionListener
|
import app.pachli.interfaces.AccountActionListener
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.setClickableText
|
import app.pachli.util.setClickableText
|
||||||
import app.pachli.viewdata.NotificationViewData
|
import app.pachli.viewdata.NotificationViewData
|
||||||
|
|
||||||
|
|
|
@ -80,12 +80,12 @@ import app.pachli.core.network.model.Relationship
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
import app.pachli.core.preferences.AppTheme
|
import app.pachli.core.preferences.AppTheme
|
||||||
import app.pachli.core.preferences.PrefKeys
|
import app.pachli.core.preferences.PrefKeys
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.core.ui.extensions.reduceSwipeSensitivity
|
import app.pachli.core.ui.extensions.reduceSwipeSensitivity
|
||||||
import app.pachli.databinding.ActivityAccountBinding
|
import app.pachli.databinding.ActivityAccountBinding
|
||||||
import app.pachli.db.DraftsAlert
|
import app.pachli.db.DraftsAlert
|
||||||
import app.pachli.feature.lists.ListsForAccountFragment
|
import app.pachli.feature.lists.ListsForAccountFragment
|
||||||
import app.pachli.interfaces.ActionButtonActivity
|
import app.pachli.interfaces.ActionButtonActivity
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.interfaces.ReselectableFragment
|
import app.pachli.interfaces.ReselectableFragment
|
||||||
import app.pachli.util.Error
|
import app.pachli.util.Error
|
||||||
import app.pachli.util.Loading
|
import app.pachli.util.Loading
|
||||||
|
|
|
@ -25,8 +25,8 @@ import app.pachli.core.network.model.Emoji
|
||||||
import app.pachli.core.network.model.Field
|
import app.pachli.core.network.model.Field
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
import app.pachli.core.ui.BindingHolder
|
import app.pachli.core.ui.BindingHolder
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemAccountFieldBinding
|
import app.pachli.databinding.ItemAccountFieldBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.setClickableText
|
import app.pachli.util.setClickableText
|
||||||
|
|
||||||
class AccountFieldAdapter(
|
class AccountFieldAdapter(
|
||||||
|
|
|
@ -55,10 +55,10 @@ import app.pachli.core.network.retrofit.MastodonApi
|
||||||
import app.pachli.core.preferences.PrefKeys
|
import app.pachli.core.preferences.PrefKeys
|
||||||
import app.pachli.core.preferences.SharedPreferencesRepository
|
import app.pachli.core.preferences.SharedPreferencesRepository
|
||||||
import app.pachli.core.ui.BackgroundMessage
|
import app.pachli.core.ui.BackgroundMessage
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.FragmentAccountListBinding
|
import app.pachli.databinding.FragmentAccountListBinding
|
||||||
import app.pachli.interfaces.AccountActionListener
|
import app.pachli.interfaces.AccountActionListener
|
||||||
import app.pachli.interfaces.AppBarLayoutHost
|
import app.pachli.interfaces.AppBarLayoutHost
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.view.EndlessOnScrollListener
|
import app.pachli.view.EndlessOnScrollListener
|
||||||
import at.connyduck.calladapter.networkresult.fold
|
import at.connyduck.calladapter.networkresult.fold
|
||||||
import com.google.android.material.color.MaterialColors
|
import com.google.android.material.color.MaterialColors
|
||||||
|
|
|
@ -19,9 +19,9 @@ package app.pachli.components.accountlist.adapter
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import app.pachli.adapter.FollowRequestViewHolder
|
import app.pachli.adapter.FollowRequestViewHolder
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemFollowRequestBinding
|
import app.pachli.databinding.ItemFollowRequestBinding
|
||||||
import app.pachli.interfaces.AccountActionListener
|
import app.pachli.interfaces.AccountActionListener
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
|
|
||||||
/** Displays a list of follow requests with accept/reject buttons. */
|
/** Displays a list of follow requests with accept/reject buttons. */
|
||||||
class FollowRequestsAdapter(
|
class FollowRequestsAdapter(
|
||||||
|
|
|
@ -32,8 +32,8 @@ import app.pachli.core.common.util.AbsoluteTimeFormatter
|
||||||
import app.pachli.core.network.model.Announcement
|
import app.pachli.core.network.model.Announcement
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
import app.pachli.core.ui.BindingHolder
|
import app.pachli.core.ui.BindingHolder
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemAnnouncementBinding
|
import app.pachli.databinding.ItemAnnouncementBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.equalByMinute
|
import app.pachli.util.equalByMinute
|
||||||
import app.pachli.util.getRelativeTimeSpanString
|
import app.pachli.util.getRelativeTimeSpanString
|
||||||
import app.pachli.util.setClickableText
|
import app.pachli.util.setClickableText
|
||||||
|
|
|
@ -27,8 +27,8 @@ import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.Notification
|
import app.pachli.core.network.model.Notification
|
||||||
import app.pachli.core.network.model.TimelineAccount
|
import app.pachli.core.network.model.TimelineAccount
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemFollowBinding
|
import app.pachli.databinding.ItemFollowBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.setClickableText
|
import app.pachli.util.setClickableText
|
||||||
import app.pachli.viewdata.NotificationViewData
|
import app.pachli.viewdata.NotificationViewData
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,8 @@ import app.pachli.core.data.model.StatusDisplayOptions
|
||||||
import app.pachli.core.designsystem.R as DR
|
import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.Emoji
|
import app.pachli.core.network.model.Emoji
|
||||||
import app.pachli.core.network.model.Notification
|
import app.pachli.core.network.model.Notification
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemStatusNotificationBinding
|
import app.pachli.databinding.ItemStatusNotificationBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.interfaces.StatusActionListener
|
import app.pachli.interfaces.StatusActionListener
|
||||||
import app.pachli.util.SmartLengthInputFilter
|
import app.pachli.util.SmartLengthInputFilter
|
||||||
import app.pachli.util.getRelativeTimeSpanString
|
import app.pachli.util.getRelativeTimeSpanString
|
||||||
|
|
|
@ -18,7 +18,7 @@ package app.pachli.components.report.adapter
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import app.pachli.core.network.model.Status
|
import app.pachli.core.network.model.Status
|
||||||
import app.pachli.interfaces.LinkListener
|
import app.pachli.core.ui.LinkListener
|
||||||
|
|
||||||
interface AdapterHandler : LinkListener {
|
interface AdapterHandler : LinkListener {
|
||||||
fun showMedia(v: View?, status: Status?, idx: Int)
|
fun showMedia(v: View?, status: Status?, idx: Int)
|
||||||
|
|
|
@ -31,8 +31,8 @@ import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.Emoji
|
import app.pachli.core.network.model.Emoji
|
||||||
import app.pachli.core.network.model.HashTag
|
import app.pachli.core.network.model.HashTag
|
||||||
import app.pachli.core.network.model.Status
|
import app.pachli.core.network.model.Status
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemReportStatusBinding
|
import app.pachli.databinding.ItemReportStatusBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.StatusViewHelper
|
import app.pachli.util.StatusViewHelper
|
||||||
import app.pachli.util.StatusViewHelper.Companion.COLLAPSE_INPUT_FILTER
|
import app.pachli.util.StatusViewHelper.Companion.COLLAPSE_INPUT_FILTER
|
||||||
import app.pachli.util.StatusViewHelper.Companion.NO_INPUT_FILTER
|
import app.pachli.util.StatusViewHelper.Companion.NO_INPUT_FILTER
|
||||||
|
|
|
@ -22,8 +22,8 @@ import androidx.paging.PagingDataAdapter
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import app.pachli.adapter.AccountViewHolder
|
import app.pachli.adapter.AccountViewHolder
|
||||||
import app.pachli.core.network.model.TimelineAccount
|
import app.pachli.core.network.model.TimelineAccount
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemAccountBinding
|
import app.pachli.databinding.ItemAccountBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
|
|
||||||
class SearchAccountsAdapter(private val linkListener: LinkListener, private val animateAvatars: Boolean, private val animateEmojis: Boolean, private val showBotOverlay: Boolean) :
|
class SearchAccountsAdapter(private val linkListener: LinkListener, private val animateAvatars: Boolean, private val animateEmojis: Boolean, private val showBotOverlay: Boolean) :
|
||||||
PagingDataAdapter<TimelineAccount, AccountViewHolder>(ACCOUNT_COMPARATOR) {
|
PagingDataAdapter<TimelineAccount, AccountViewHolder>(ACCOUNT_COMPARATOR) {
|
||||||
|
|
|
@ -22,8 +22,8 @@ import androidx.paging.PagingDataAdapter
|
||||||
import androidx.recyclerview.widget.DiffUtil
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
import app.pachli.core.network.model.HashTag
|
import app.pachli.core.network.model.HashTag
|
||||||
import app.pachli.core.ui.BindingHolder
|
import app.pachli.core.ui.BindingHolder
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemHashtagBinding
|
import app.pachli.databinding.ItemHashtagBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
|
|
||||||
class SearchHashtagsAdapter(private val linkListener: LinkListener) :
|
class SearchHashtagsAdapter(private val linkListener: LinkListener) :
|
||||||
PagingDataAdapter<HashTag, BindingHolder<ItemHashtagBinding>>(HASHTAG_COMPARATOR) {
|
PagingDataAdapter<HashTag, BindingHolder<ItemHashtagBinding>>(HASHTAG_COMPARATOR) {
|
||||||
|
|
|
@ -25,8 +25,8 @@ import app.pachli.core.common.extensions.visible
|
||||||
import app.pachli.core.navigation.AccountActivityIntent
|
import app.pachli.core.navigation.AccountActivityIntent
|
||||||
import app.pachli.core.navigation.TimelineActivityIntent
|
import app.pachli.core.navigation.TimelineActivityIntent
|
||||||
import app.pachli.core.network.retrofit.MastodonApi
|
import app.pachli.core.network.retrofit.MastodonApi
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.FragmentSearchBinding
|
import app.pachli.databinding.FragmentSearchBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import com.google.android.material.color.MaterialColors
|
import com.google.android.material.color.MaterialColors
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
|
|
|
@ -31,8 +31,8 @@ import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.core.network.model.StatusEdit
|
import app.pachli.core.network.model.StatusEdit
|
||||||
import app.pachli.core.network.parseAsMastodonHtml
|
import app.pachli.core.network.parseAsMastodonHtml
|
||||||
import app.pachli.core.ui.BindingHolder
|
import app.pachli.core.ui.BindingHolder
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.ItemStatusEditBinding
|
import app.pachli.databinding.ItemStatusEditBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import app.pachli.util.aspectRatios
|
import app.pachli.util.aspectRatios
|
||||||
import app.pachli.util.setClickableText
|
import app.pachli.util.setClickableText
|
||||||
import app.pachli.viewdata.PollOptionViewData
|
import app.pachli.viewdata.PollOptionViewData
|
||||||
|
|
|
@ -44,8 +44,8 @@ import app.pachli.core.navigation.TimelineActivityIntent
|
||||||
import app.pachli.core.preferences.PrefKeys
|
import app.pachli.core.preferences.PrefKeys
|
||||||
import app.pachli.core.preferences.SharedPreferencesRepository
|
import app.pachli.core.preferences.SharedPreferencesRepository
|
||||||
import app.pachli.core.ui.BackgroundMessage
|
import app.pachli.core.ui.BackgroundMessage
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.databinding.FragmentViewEditsBinding
|
import app.pachli.databinding.FragmentViewEditsBinding
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import com.google.android.material.color.MaterialColors
|
import com.google.android.material.color.MaterialColors
|
||||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
|
|
|
@ -20,6 +20,7 @@ package app.pachli.interfaces
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import app.pachli.core.network.model.Poll
|
import app.pachli.core.network.model.Poll
|
||||||
import app.pachli.core.network.model.Status
|
import app.pachli.core.network.model.Status
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.viewdata.IStatusViewData
|
import app.pachli.viewdata.IStatusViewData
|
||||||
|
|
||||||
interface StatusActionListener<T : IStatusViewData> : LinkListener {
|
interface StatusActionListener<T : IStatusViewData> : LinkListener {
|
||||||
|
|
|
@ -32,9 +32,9 @@ import app.pachli.R
|
||||||
import app.pachli.core.activity.EmojiSpan
|
import app.pachli.core.activity.EmojiSpan
|
||||||
import app.pachli.core.network.model.HashTag
|
import app.pachli.core.network.model.HashTag
|
||||||
import app.pachli.core.network.model.Status.Mention
|
import app.pachli.core.network.model.Status.Mention
|
||||||
|
import app.pachli.core.ui.LinkListener
|
||||||
import app.pachli.core.ui.MentionSpan
|
import app.pachli.core.ui.MentionSpan
|
||||||
import app.pachli.core.ui.NoUnderlineURLSpan
|
import app.pachli.core.ui.NoUnderlineURLSpan
|
||||||
import app.pachli.interfaces.LinkListener
|
|
||||||
import com.mikepenz.iconics.IconicsColor
|
import com.mikepenz.iconics.IconicsColor
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.IconicsSize
|
import com.mikepenz.iconics.IconicsSize
|
||||||
|
|
|
@ -10,7 +10,7 @@ import app.pachli.R
|
||||||
import app.pachli.core.activity.BottomSheetActivity.Companion.looksLikeMastodonUrl
|
import app.pachli.core.activity.BottomSheetActivity.Companion.looksLikeMastodonUrl
|
||||||
import app.pachli.core.network.model.HashTag
|
import app.pachli.core.network.model.HashTag
|
||||||
import app.pachli.core.network.model.Status
|
import app.pachli.core.network.model.Status
|
||||||
import app.pachli.interfaces.LinkListener
|
import app.pachli.core.ui.LinkListener
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* see <http://www.gnu.org/licenses>.
|
* see <http://www.gnu.org/licenses>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package app.pachli.interfaces
|
package app.pachli.core.ui
|
||||||
|
|
||||||
interface LinkListener {
|
interface LinkListener {
|
||||||
fun onViewTag(tag: String)
|
fun onViewTag(tag: String)
|
Loading…
Reference in New Issue