refactor: Move LinkListener to core.ui (#732)

This commit is contained in:
Nik Clayton 2024-06-10 17:40:23 +02:00 committed by GitHub
parent a68e1bf63b
commit 46c7307c0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 20 additions and 19 deletions

View File

@ -24,9 +24,9 @@ import app.pachli.core.activity.loadAvatar
import app.pachli.core.common.extensions.visible
import app.pachli.core.designsystem.R as DR
import app.pachli.core.network.model.TimelineAccount
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemAccountBinding
import app.pachli.interfaces.AccountActionListener
import app.pachli.interfaces.LinkListener
class AccountViewHolder(
private val binding: ItemAccountBinding,

View File

@ -34,9 +34,9 @@ import app.pachli.core.data.model.StatusDisplayOptions
import app.pachli.core.designsystem.R as DR
import app.pachli.core.network.model.TimelineAccount
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemFollowRequestBinding
import app.pachli.interfaces.AccountActionListener
import app.pachli.interfaces.LinkListener
import app.pachli.util.setClickableText
import app.pachli.viewdata.NotificationViewData

View File

@ -80,12 +80,12 @@ import app.pachli.core.network.model.Relationship
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.preferences.AppTheme
import app.pachli.core.preferences.PrefKeys
import app.pachli.core.ui.LinkListener
import app.pachli.core.ui.extensions.reduceSwipeSensitivity
import app.pachli.databinding.ActivityAccountBinding
import app.pachli.db.DraftsAlert
import app.pachli.feature.lists.ListsForAccountFragment
import app.pachli.interfaces.ActionButtonActivity
import app.pachli.interfaces.LinkListener
import app.pachli.interfaces.ReselectableFragment
import app.pachli.util.Error
import app.pachli.util.Loading

View File

@ -25,8 +25,8 @@ import app.pachli.core.network.model.Emoji
import app.pachli.core.network.model.Field
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.ui.BindingHolder
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemAccountFieldBinding
import app.pachli.interfaces.LinkListener
import app.pachli.util.setClickableText
class AccountFieldAdapter(

View File

@ -55,10 +55,10 @@ import app.pachli.core.network.retrofit.MastodonApi
import app.pachli.core.preferences.PrefKeys
import app.pachli.core.preferences.SharedPreferencesRepository
import app.pachli.core.ui.BackgroundMessage
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.FragmentAccountListBinding
import app.pachli.interfaces.AccountActionListener
import app.pachli.interfaces.AppBarLayoutHost
import app.pachli.interfaces.LinkListener
import app.pachli.view.EndlessOnScrollListener
import at.connyduck.calladapter.networkresult.fold
import com.google.android.material.color.MaterialColors

View File

@ -19,9 +19,9 @@ package app.pachli.components.accountlist.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import app.pachli.adapter.FollowRequestViewHolder
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemFollowRequestBinding
import app.pachli.interfaces.AccountActionListener
import app.pachli.interfaces.LinkListener
/** Displays a list of follow requests with accept/reject buttons. */
class FollowRequestsAdapter(

View File

@ -32,8 +32,8 @@ import app.pachli.core.common.util.AbsoluteTimeFormatter
import app.pachli.core.network.model.Announcement
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.ui.BindingHolder
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemAnnouncementBinding
import app.pachli.interfaces.LinkListener
import app.pachli.util.equalByMinute
import app.pachli.util.getRelativeTimeSpanString
import app.pachli.util.setClickableText

View File

@ -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.TimelineAccount
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemFollowBinding
import app.pachli.interfaces.LinkListener
import app.pachli.util.setClickableText
import app.pachli.viewdata.NotificationViewData

View File

@ -42,8 +42,8 @@ import app.pachli.core.data.model.StatusDisplayOptions
import app.pachli.core.designsystem.R as DR
import app.pachli.core.network.model.Emoji
import app.pachli.core.network.model.Notification
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemStatusNotificationBinding
import app.pachli.interfaces.LinkListener
import app.pachli.interfaces.StatusActionListener
import app.pachli.util.SmartLengthInputFilter
import app.pachli.util.getRelativeTimeSpanString

View File

@ -18,7 +18,7 @@ package app.pachli.components.report.adapter
import android.view.View
import app.pachli.core.network.model.Status
import app.pachli.interfaces.LinkListener
import app.pachli.core.ui.LinkListener
interface AdapterHandler : LinkListener {
fun showMedia(v: View?, status: Status?, idx: Int)

View File

@ -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.HashTag
import app.pachli.core.network.model.Status
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemReportStatusBinding
import app.pachli.interfaces.LinkListener
import app.pachli.util.StatusViewHelper
import app.pachli.util.StatusViewHelper.Companion.COLLAPSE_INPUT_FILTER
import app.pachli.util.StatusViewHelper.Companion.NO_INPUT_FILTER

View File

@ -22,8 +22,8 @@ import androidx.paging.PagingDataAdapter
import androidx.recyclerview.widget.DiffUtil
import app.pachli.adapter.AccountViewHolder
import app.pachli.core.network.model.TimelineAccount
import app.pachli.core.ui.LinkListener
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) :
PagingDataAdapter<TimelineAccount, AccountViewHolder>(ACCOUNT_COMPARATOR) {

View File

@ -22,8 +22,8 @@ import androidx.paging.PagingDataAdapter
import androidx.recyclerview.widget.DiffUtil
import app.pachli.core.network.model.HashTag
import app.pachli.core.ui.BindingHolder
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemHashtagBinding
import app.pachli.interfaces.LinkListener
class SearchHashtagsAdapter(private val linkListener: LinkListener) :
PagingDataAdapter<HashTag, BindingHolder<ItemHashtagBinding>>(HASHTAG_COMPARATOR) {

View File

@ -25,8 +25,8 @@ import app.pachli.core.common.extensions.visible
import app.pachli.core.navigation.AccountActivityIntent
import app.pachli.core.navigation.TimelineActivityIntent
import app.pachli.core.network.retrofit.MastodonApi
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.FragmentSearchBinding
import app.pachli.interfaces.LinkListener
import com.google.android.material.color.MaterialColors
import com.google.android.material.snackbar.Snackbar
import com.mikepenz.iconics.IconicsDrawable

View File

@ -31,8 +31,8 @@ import app.pachli.core.designsystem.R as DR
import app.pachli.core.network.model.StatusEdit
import app.pachli.core.network.parseAsMastodonHtml
import app.pachli.core.ui.BindingHolder
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.ItemStatusEditBinding
import app.pachli.interfaces.LinkListener
import app.pachli.util.aspectRatios
import app.pachli.util.setClickableText
import app.pachli.viewdata.PollOptionViewData

View File

@ -44,8 +44,8 @@ import app.pachli.core.navigation.TimelineActivityIntent
import app.pachli.core.preferences.PrefKeys
import app.pachli.core.preferences.SharedPreferencesRepository
import app.pachli.core.ui.BackgroundMessage
import app.pachli.core.ui.LinkListener
import app.pachli.databinding.FragmentViewEditsBinding
import app.pachli.interfaces.LinkListener
import com.google.android.material.color.MaterialColors
import com.google.android.material.divider.MaterialDividerItemDecoration
import com.mikepenz.iconics.IconicsDrawable

View File

@ -20,6 +20,7 @@ package app.pachli.interfaces
import android.view.View
import app.pachli.core.network.model.Poll
import app.pachli.core.network.model.Status
import app.pachli.core.ui.LinkListener
import app.pachli.viewdata.IStatusViewData
interface StatusActionListener<T : IStatusViewData> : LinkListener {

View File

@ -32,9 +32,9 @@ import app.pachli.R
import app.pachli.core.activity.EmojiSpan
import app.pachli.core.network.model.HashTag
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.NoUnderlineURLSpan
import app.pachli.interfaces.LinkListener
import com.mikepenz.iconics.IconicsColor
import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.IconicsSize

View File

@ -10,7 +10,7 @@ import app.pachli.R
import app.pachli.core.activity.BottomSheetActivity.Companion.looksLikeMastodonUrl
import app.pachli.core.network.model.HashTag
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.Test
import org.junit.runner.RunWith

View File

@ -14,7 +14,7 @@
* see <http://www.gnu.org/licenses>.
*/
package app.pachli.interfaces
package app.pachli.core.ui
interface LinkListener {
fun onViewTag(tag: String)