Skip to content

Commit

Permalink
As suggested changes
Browse files Browse the repository at this point in the history
Moved utils function from Chat > Core module and using CopyToClipboard function from there.
  • Loading branch information
AbhishekSingh committed Apr 23, 2021
1 parent bb74cb3 commit 81ab220
Show file tree
Hide file tree
Showing 43 changed files with 49 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.navgurukul.chat.core.error.ChatErrorFormatter
import org.navgurukul.chat.core.pushers.PushersManager
import org.navgurukul.chat.core.repo.*
import org.navgurukul.chat.core.resources.*
import org.navgurukul.chat.core.utils.DimensionConverter
import org.merakilearn.core.utils.DimensionConverter
import org.navgurukul.chat.features.crypto.KeyRequestHandler
import org.navgurukul.chat.features.grouplist.SelectedGroupDataSource
import org.navgurukul.chat.features.home.AvatarRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.annotation.StringRes
import androidx.core.view.isVisible
import com.google.android.material.snackbar.Snackbar
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.copyToClipboard
import org.merakilearn.core.utils.copyToClipboard
import org.navgurukul.commonui.themes.ThemeUtils

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.navgurukul.chat.core.intent
import android.content.Context
import android.net.Uri
import android.webkit.MimeTypeMap
import org.navgurukul.chat.core.utils.getFileExtension
import org.merakilearn.core.utils.getFileExtension
import timber.log.Timber

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package org.navgurukul.chat.core.repo

import arrow.core.Option
import org.matrix.android.sdk.api.session.Session
import org.navgurukul.chat.core.utils.BehaviorDataSource
import org.merakilearn.core.utils.BehaviorDataSource

class ActiveSessionDataSource : BehaviorDataSource<Option<Session>>()
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.navgurukul.chat.R
import org.navgurukul.chat.core.extensions.configureAndStart
import org.navgurukul.chat.core.utils.deleteAllFiles
import org.merakilearn.core.utils.deleteAllFiles
import org.navgurukul.chat.features.settings.ChatPreferences
import org.navgurukul.commonui.resources.StringProvider
import kotlin.coroutines.resume
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package org.navgurukul.chat.features.grouplist

import arrow.core.Option
import org.matrix.android.sdk.api.session.group.model.GroupSummary
import org.navgurukul.chat.core.utils.BehaviorDataSource
import org.merakilearn.core.utils.BehaviorDataSource

class SelectedGroupDataSource : BehaviorDataSource<Option<GroupSummary>>(Option.empty())
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import org.navgurukul.chat.core.glide.GlideApp
import org.navgurukul.chat.core.glide.GlideRequest
import org.navgurukul.chat.core.glide.GlideRequests
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.utils.getColorFromRoomId
import org.navgurukul.chat.core.utils.getColorFromUserId
import org.merakilearn.core.utils.getColorFromRoomId
import org.merakilearn.core.utils.getColorFromUserId

/**
* This helper centralise ways to retrieve avatar into ImageView or even generic Target<Drawable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.navgurukul.chat.features.home

import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.navgurukul.chat.core.utils.BehaviorDataSource
import org.merakilearn.core.utils.BehaviorDataSource

class HomeRoomListDataSource : BehaviorDataSource<List<RoomSummary>>()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.navgurukul.chat.features.home.room.detail
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import org.navgurukul.chat.core.utils.Debouncer
import org.merakilearn.core.utils.Debouncer

/**
* Show or hide the jumpToBottomView, depending on the scrolling and if the timeline is displaying the more recent event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ import kotlinx.android.synthetic.main.merge_composer_layout.view.*
import org.commonmark.parser.Parser
import org.koin.android.ext.android.inject
import org.koin.androidx.scope.fragmentScope
import org.koin.androidx.scope.lifecycleScope
import org.koin.androidx.scope.scope
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.parameter.parametersOf
import org.koin.core.scope.KoinScopeComponent
Expand All @@ -59,8 +57,8 @@ import org.navgurukul.chat.core.dialogs.withColoredButton
import org.navgurukul.chat.core.extensions.*
import org.navgurukul.chat.core.glide.GlideApp
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.utils.*
import org.navgurukul.chat.core.utils.createUIHandler
import org.merakilearn.core.utils.*
import org.merakilearn.core.utils.createUIHandler
import org.navgurukul.chat.core.views.NotificationAreaView
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.detail.composer.TextComposerView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import org.matrix.android.sdk.api.session.room.timeline.*
import org.navgurukul.chat.R
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.resources.UserPreferencesProvider
import org.navgurukul.chat.core.utils.isValidUrl
import org.navgurukul.chat.core.utils.subscribeLogError
import org.merakilearn.core.utils.isValidUrl
import org.merakilearn.core.utils.subscribeLogError
import org.navgurukul.chat.features.command.CommandParser
import org.navgurukul.chat.features.command.ParsedCommand
import org.navgurukul.chat.features.home.room.TypingHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.annotation.ColorInt
import org.matrix.android.sdk.api.session.room.send.SendState
import org.navgurukul.chat.R
import org.navgurukul.chat.core.resources.ColorProvider
import org.navgurukul.chat.core.utils.getColorFromUserId
import org.merakilearn.core.utils.getColorFromUserId

class MessageColorProvider(
private val colorProvider: ColorProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.parcel.Parcelize
import kotlinx.android.synthetic.main.bottom_sheet_generic_list.*
import org.koin.android.ext.android.inject
import org.koin.androidx.scope.lifecycleScope
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.parameter.parametersOf
import org.koin.core.scope.KoinScopeComponent
Expand All @@ -23,7 +22,7 @@ import org.navgurukul.chat.core.extensions.KEY_ARG
import org.navgurukul.chat.core.extensions.args
import org.navgurukul.chat.core.extensions.cleanup
import org.navgurukul.chat.core.extensions.configureWith
import org.navgurukul.chat.core.utils.DimensionConverter
import org.merakilearn.core.utils.DimensionConverter
import org.navgurukul.chat.features.home.room.detail.timeline.item.MessageInformationData

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import org.navgurukul.chat.R
import org.navgurukul.chat.core.epoxy.MerakiEpoxyModel
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.resources.ColorProvider
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.navgurukul.chat.core.utils.DimensionConverter
import org.navgurukul.chat.core.utils.containsOnlyEmojis
import org.navgurukul.chat.core.utils.isLocalFile
import org.merakilearn.core.utils.DebouncedClickListener
import org.merakilearn.core.utils.DimensionConverter
import org.merakilearn.core.utils.containsOnlyEmojis
import org.merakilearn.core.utils.isLocalFile
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController
import org.navgurukul.chat.features.home.room.detail.timeline.helper.*
import org.navgurukul.chat.features.home.room.detail.timeline.item.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.navgurukul.chat.features.home.room.detail.timeline.helper

import org.navgurukul.chat.core.utils.DimensionConverter
import org.merakilearn.core.utils.DimensionConverter

class AvatarSizeProvider(private val dimensionConverter: DimensionConverter) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker
import org.matrix.android.sdk.api.session.room.send.SendState
import org.navgurukul.chat.R
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.utils.TextUtils.formatFileSize
import org.merakilearn.core.utils.TextUtils.formatFileSize
import org.navgurukul.chat.features.home.room.detail.timeline.MessageColorProvider
import org.navgurukul.commonui.error.ErrorFormatter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.navgurukul.chat.features.home.room.detail.timeline.helper

import android.view.View
import org.navgurukul.chat.EmojiCompatFontProvider
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.merakilearn.core.utils.DebouncedClickListener
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.detail.timeline.MessageColorProvider
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import android.widget.TextView
import androidx.annotation.IdRes
import com.airbnb.epoxy.EpoxyAttribute
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.merakilearn.core.utils.DebouncedClickListener
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.detail.timeline.MessageColorProvider
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ package org.navgurukul.chat.features.home.room.detail.timeline.item

import android.view.View
import android.view.ViewStub
import android.widget.RelativeLayout
import androidx.annotation.CallSuper
import androidx.annotation.IdRes
import androidx.core.view.updateLayoutParams
import com.airbnb.epoxy.EpoxyAttribute
import org.navgurukul.chat.R
import org.navgurukul.chat.core.epoxy.MerakiEpoxyHolder
import org.navgurukul.chat.core.epoxy.MerakiEpoxyModel
import org.navgurukul.chat.core.utils.DimensionConverter
import org.navgurukul.commonui.platform.CheckableView
import org.merakilearn.core.utils.DimensionConverter

/**
* Children must override getViewType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import android.widget.TextView
import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController

@EpoxyModelClass
abstract class DefaultItem : BaseEventItem<DefaultItem.Holder>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ package org.navgurukul.chat.features.home.room.detail.timeline.item
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.core.view.isVisible
import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import org.navgurukul.chat.R
import org.navgurukul.chat.core.epoxy.ClickListener
import org.navgurukul.chat.core.epoxy.onClick
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController

@EpoxyModelClass
abstract class NoticeItem : BaseEventItem<NoticeItem.Holder>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.navgurukul.chat.core.linkify.SaralLinkify
import org.navgurukul.chat.core.utils.EvenBetterLinkMovementMethod
import org.navgurukul.chat.core.utils.isValidUrl
import org.merakilearn.core.utils.EvenBetterLinkMovementMethod
import org.merakilearn.core.utils.isValidUrl
import org.navgurukul.chat.features.home.room.detail.timeline.TimelineEventController
import org.navgurukul.chat.features.html.PillImageSpan

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.matrix.android.sdk.api.util.toMatrixItem
import org.navgurukul.chat.core.date.SaralDateFormatter
import org.navgurukul.chat.core.extensions.localDateTime
import org.navgurukul.chat.core.resources.DateProvider
import org.navgurukul.chat.core.utils.DebouncedClickListener
import org.merakilearn.core.utils.DebouncedClickListener
import org.navgurukul.chat.features.home.AvatarRenderer
import org.navgurukul.chat.features.home.room.TypingHelper
import org.navgurukul.chat.features.home.room.format.DisplayableEventFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import org.navgurukul.chat.R
import org.navgurukul.chat.core.glide.GlideApp
import org.navgurukul.chat.core.glide.GlideRequest
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.utils.DimensionConverter
import org.navgurukul.chat.core.utils.isLocalFile
import org.merakilearn.core.utils.DimensionConverter
import org.merakilearn.core.utils.isLocalFile
import kotlin.math.min


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.koin.android.ext.android.inject
import org.navgurukul.chat.R
import org.navgurukul.chat.core.intent.getMimeTypeFromUri
import org.navgurukul.chat.core.repo.ActiveSessionHolder
import org.navgurukul.chat.core.utils.shareMedia
import org.merakilearn.core.utils.shareMedia
import org.navgurukul.chat.features.attachmentviewer.AttachmentCommands
import org.navgurukul.chat.features.attachmentviewer.AttachmentViewerActivity
import timber.log.Timber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import org.merakilearn.core.navigator.MerakiNavigator
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.startNotificationChannelSettingsIntent
import org.merakilearn.core.utils.startNotificationChannelSettingsIntent
import org.navgurukul.chat.features.settings.ChatPreferences
import org.navgurukul.commonui.resources.StringProvider
import timber.log.Timber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import androidx.core.content.withStyledAttributes
import org.koin.java.KoinJavaComponent.inject
import org.navgurukul.chat.EmojiCompatWrapper
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.TextUtils
import org.merakilearn.core.utils.TextUtils

/**
* An animated reaction button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.core.view.isVisible
import org.matrix.android.sdk.api.session.sync.SyncState
import kotlinx.android.synthetic.main.view_sync_state.view.*
import org.navgurukul.chat.R
import org.navgurukul.chat.core.utils.isAirplaneModeOn
import org.merakilearn.core.utils.isAirplaneModeOn

class SyncStateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
: FrameLayout(context, attrs, defStyle) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.view.View
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.os.Handler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import io.reactivex.Completable
import io.reactivex.Single
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.content.res.Resources
import android.util.TypedValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import java.util.regex.Pattern

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.text.Spanned
import android.text.style.ClickableSpan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.content.ActivityNotFoundException
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import timber.log.Timber
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.os.Handler
import android.os.HandlerThread
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.annotation.TargetApi
import android.app.Activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import android.content.Context
import android.os.Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import java.net.URL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.navgurukul.chat.core.utils
package org.merakilearn.core.utils

import androidx.annotation.ColorRes
import org.navgurukul.chat.R
Expand Down
Loading

0 comments on commit 81ab220

Please sign in to comment.