/tripkit/TripKitAndroidUI/com.skedgo.tripkit.ui.utils

Package-level declarations

Types

Name Summary
AccessibilityDefaultViewManager open class AccessibilityDefaultViewManager(context: Context?, observeAccessibility: Boolean = true)
AutoUpdatableAdapter interface AutoUpdatableAdapter
BindingConversions object BindingConversions
BottomSheetViewPager class BottomSheetViewPager(context: Context, attrs: AttributeSet?) : ViewPager
DeviceInfo object DeviceInfo
DistanceFormatter object DistanceFormatter
Formats a distance in meters according to the following rules:
DrawableUtils class DrawableUtils
DynamicAppColor object DynamicAppColor
for dynamic color scheme https://redmine.buzzhives.com/issues/23356
LocationUtil object LocationUtil
MapUtils object MapUtils
OnSwipeTouchListener class OnSwipeTouchListener(context: Context, listener: OnSwipeTouchListener.SwipeGestureListener) : View.OnTouchListener
Optional data class Optional<M>(val value: M?)
ProviderUtils object ProviderUtils
ServiceLineOverlayTask class ServiceLineOverlayTask : Function<List<ServiceLineOverlayTask.ServiceLineInfo>, List<PolylineOptions>>
Snackbars class Snackbars
SqlUtils object SqlUtils
StopMarkerUtils object StopMarkerUtils
SystemColors data class SystemColors(val barBackground: Int, val barForeground: Int, val tintColor: Int)
TapAction class TapAction<TSender>
TapStateFlow class TapStateFlow<TSender>
TimeSpanUtils object TimeSpanUtils
TKUIBottomSheetScrollView class TKUIBottomSheetScrollView(context: Context, attrs: AttributeSet?) : FrameLayout, NestedScrollingParent2
Provides a NestedScrollView-like functionality but specifically for the case when a BottomSheetBehavior contains a ViewPager2 that hosts multiple RecyclerView because in that case, some bug causes the RecyclerView to have the same heights and scroll state.
TKUINestedScrollableHost class TKUINestedScrollableHost : FrameLayout
Layout to wrap a scrollable component inside a ViewPager2. Provided as a solution to the problem where pages of ViewPager2 have nested scrollable elements that scroll in the same direction as ViewPager2. The scrollable element needs to be the immediate and only child of this host layout.
TransportModeDefaults object TransportModeDefaults
TransportModeSharedPreference class TransportModeSharedPreference@Injectconstructor(context: Context)
TripSearchUtils object TripSearchUtils
TripSegmentActionProcessor class TripSegmentActionProcessor@Injectconstructor
UnScrollableLinearLayoutManager class UnScrollableLinearLayoutManager(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0) : LinearLayoutManager
ViewPagerAdapter open class ViewPagerAdapter(manager: FragmentManager, fragmentBundle: Bundle? = null) : FragmentStatePagerAdapter
ViewUtils object ViewUtils

Properties

Name Summary
APP_PREF_CLEAR_CAR_PODS_ONCE const val APP_PREF_CLEAR_CAR_PODS_ONCE: String
APP_PREF_DEACTIVATED const val APP_PREF_DEACTIVATED: String
ITEM_DEFAULT const val ITEM_DEFAULT: Int = 0
ITEM_DIRECTIONS const val ITEM_DIRECTIONS: Int = 1
ITEM_EXTERNAL_BOOKING const val ITEM_EXTERNAL_BOOKING: Int = 6
ITEM_MODE_LOCATION const val ITEM_MODE_LOCATION: Int = 3
ITEM_NEARBY const val ITEM_NEARBY: Int = 2
ITEM_QUICK_BOOKING const val ITEM_QUICK_BOOKING: Int = 5
ITEM_SERVICE const val ITEM_SERVICE: Int = 4
ITEM_TIMETABLE const val ITEM_TIMETABLE: Int = 7
ITEM_TIMETABLE_PAYMENT const val ITEM_TIMETABLE_PAYMENT: Int = 8
KEY_APP_PREF const val KEY_APP_PREF: String
PREF_KEY_TRANSPORT_MODE const val PREF_KEY_TRANSPORT_MODE: String

Functions

Name Summary
checkDateForStringLabel fun Date.checkDateForStringLabel(context: Context): String?
checkUrl fun String.checkUrl(): String?
clearTag fun clearTag(view: View, clear: Boolean)
convertLocationToAlpha fun convertLocationToAlpha(location: Location?): Int
correctItemType fun TripSegment.correctItemType(): Int
createSummaryIcon fun TripSegment.createSummaryIcon(context: Context, transportIcon: Drawable): Drawable
deFocusAndHideKeyboard fun Context.deFocusAndHideKeyboard(focus: View?)
defocusAndHideKeyboard fun defocusAndHideKeyboard(context: Context, focus: View?)
focusViewForAccessibility fun focusViewForAccessibility(view: View, focus: Boolean)
formatString fun TimeTag.formatString(context: Context, timezone: String?): String
fromJson inline fun <T> Gson.fromJson(json: String): T
generateTripPreviewHeader fun TripSegment.generateTripPreviewHeader(icon: Drawable): TripSegmentSummary
fun TripSegment.generateTripPreviewHeader(context: Context, icon: Drawable, printTime: PrintTime): TripSegmentSummary
getAccessibilityManager fun Context.getAccessibilityManager(): AccessibilityManager
getDisplayDateFormatter fun getDisplayDateFormatter(tz: DateTimeZone? = null): DateTimeFormatter
getDisplayDateTimeFormatter fun getDisplayDateTimeFormatter(tz: DateTimeZone? = null): DateTimeFormatter
getDisplayTimeFormatter fun getDisplayTimeFormatter(tz: DateTimeZone? = null): DateTimeFormatter
getISO2DateFormatter fun getISO2DateFormatter(tz: DateTimeZone? = null): DateTimeFormatter
getISODateFormatter fun getISODateFormatter(tz: DateTimeZone? = null): DateTimeFormatter
getPackageNameFromStoreUrl fun String.getPackageNameFromStoreUrl(): String?
getRgbFromColorResource fun Int.getRgbFromColorResource(): AppColor
getSegmentIconObservable fun TripSegment.getSegmentIconObservable(context: Context, getTransportIconTintStrategy: GetTransportIconTintStrategy): Observable<Drawable?>
getVersionCode fun Context.getVersionCode(): Long?
getVersionName fun Context.getVersionName(): String?
groupConsecutiveBy fun <T> Iterable<T>.groupConsecutiveBy(groupIdentifier: (T, T) -> Boolean): List<MutableList<T>>
hideKeyboard fun hideKeyboard(context: Context, focus: View?)
Hide the soft keyboard.
highlightTexts fun TextView.highlightTexts(textsToHighLight: List<Pair<String, ClickableSpan>>)
fun TextView.highlightTexts(matcher: List<String>?, matchByWord: Boolean = true)
ignoreNetworkErrors fun <T> Observable<T>.ignoreNetworkErrors(): Observable<T>
isAppInstalled fun String.isAppInstalled(packageManager: PackageManager): Boolean
isAppInstalledById fun String.isAppInstalledById(packageManager: PackageManager): Boolean
isFragmentInBackStack fun FragmentManager.isFragmentInBackStack(fragmentTag: String): Boolean
isInternetAvailable @RequiresApi(value = 23)
fun Context.isInternetAvailable(): Boolean
isNetworkConnected fun Context.isNetworkConnected(): Boolean
isPermissionGranted fun Context.isPermissionGranted(permission: String): Boolean
isTalkBackOn fun Context.isTalkBackOn(): Boolean
logError fun Throwable.logError()
merge fun <T> Flow<T>.merge(vararg flows: Flow<T>): Flow<T>
observe fun <T : Any, L : LiveData<T>> LifecycleOwner.observe(liveData: L, body: (T?) -> Unit)
openAppInPlayStore fun Context.openAppInPlayStore()
openAppNotificationSettings fun Context.openAppNotificationSettings()
ordinalSuffix fun Int.ordinalSuffix(): String
popSpecificWithTag fun Fragment.popSpecificWithTag(tag: String)
removeQueryParamFromUrl fun String.removeQueryParamFromUrl(paramToRemove: String): String
replaceFragment fun Fragment.replaceFragment(fragment: Fragment, tag: String, containerViewId: Int, checkBackStack: Boolean = true)
fun Fragment.replaceFragment(fragment: Fragment, tag: String, containerViewId: Int, checkBackStack: Boolean = true, addToBackStack: Boolean = true)
requestPermissionGently fun Context.requestPermissionGently(permissions: List<String>, callback: (PermissionStatus?) -> Unit, title: String, description: String, openSettingsTitle: String, openSettingsExplanation: String, versionChecker: Int? = null)
rgbToHex fun rgbToHex(red: Int, green: Int, blue: Int): String
safeCall suspend fun <T> FlowCollector<Resource<T>>.safeCall(errorHandlingCall: suspend (Exception) -> Unit? = null, call: suspend () -> Unit): FlowCollector<Resource<T>>
setAddRtlSupport fun setAddRtlSupport(view: View, addRtlSupport: Boolean)
setAlertIcon fun setAlertIcon(view: ImageView, severity: String)
setBackground fun setBackground(view: View, drawable: StateListDrawable?)
setBackgroundDrawable fun setBackgroundDrawable(view: View, drawable: Drawable?)
setBackgroundTint fun setBackgroundTint(view: View, color: Int?)
setButtonAppTint fun setButtonAppTint(button: Button, @ColorIntdefault: Int)
=================== Dynamic color binding using colors from DynamicAppColor ===================
setButtonStateBackground fun setButtonStateBackground(button: Button, @ColorIntdefault: Int?)
setButtonTextAppTint fun setButtonTextAppTint(button: Button, @ColorIntdefault: Int?)
setCalendarViewSelectedTint fun setCalendarViewSelectedTint(calendarView: CalendarView, @ColorIntdefault: Int?)
setCardBackgroundColor fun setCardBackgroundColor(view: CardView, color: Int?)
setDebounceClickListener fun setDebounceClickListener(view: View, onClickListener: View.OnClickListener)
setDrawableTint fun TextView.setDrawableTint(color: Int)
setDynamicHeight fun setDynamicHeight(view: View, heightInDp: Int)
setIcon fun setIcon(view: ImageView, iconResource: Drawable?)
fun setIcon(view: ImageView, iconResource: Int?)
setIconDrawable fun setIconDrawable(view: ImageView, drawable: Drawable?)
setImageFromUrl fun setImageFromUrl(imageView: ImageView, source: String?)
setImageFromUrlWithPlaceholder fun setImageFromUrlWithPlaceholder(imageView: ImageView, source: String?, placeholder: Int, tripGoKey: String, tripGoClientId: String?, userToken: String?)
setImageTint fun ImageView.setImageTint(@ColorIntcolor: Int)
setImageViewAppForegroundTint fun setImageViewAppForegroundTint(imageView: ImageView, @ColorIntdefault: Int?)
setImageViewAppTint fun setImageViewAppTint(imageView: ImageView, @ColorIntdefault: Int?)
setImageViewSize fun setImageViewSize(view: ImageView, size: Float)
setLayoutAppBackgroundTint fun setLayoutAppBackgroundTint(view: View, @ColorIntdefault: Int?)
setLayoutAppTint fun setLayoutAppTint(view: View, @ColorIntdefault: Int?)
setLayoutHeight fun setLayoutHeight(view: View, show: Boolean)
setListValuesToText fun setListValuesToText(textView: TextView, values: List<String>?)
setMirrorImage fun setMirrorImage(imageView: ImageView, isMirrored: Boolean)
setProgressBarTint fun setProgressBarTint(progressBar: ProgressBar, @ColorIntdefault: Int?)
setRadioButtonCheckedTint fun setRadioButtonCheckedTint(radioButton: RadioButton, @ColorIntdefault: Int?)
setSwitchCheckedTint fun setSwitchCheckedTint(switch: SwitchCompat, @ColorIntdefault: Int?)
setTextViewAppForegroundTint fun setTextViewAppForegroundTint(textView: TextView, @ColorIntdefault: Int?)
setTextViewAppTint fun setTextViewAppTint(textView: TextView, @ColorIntdefault: Int?)
setTextViewBackgroundTint fun setTextViewBackgroundTint(textView: TextView, @ColorIntdefault: Int?)
setTextViewBackgroundTintAlpha fun setTextViewBackgroundTintAlpha(textView: TextView, @ColorIntdefault: Int?)
setTextViewTextColor fun setTextViewTextColor(view: TextView, color: Int?)
setViewIsDisabled fun setViewIsDisabled(view: View, disabled: Boolean, originalColor: Int?)
setVisibilityInv fun setVisibilityInv(view: View, visible: Boolean?)
showConfirmationPopUpDialog fun Context.showConfirmationPopUpDialog(title: String? = null, message: String? = null, positiveLabel: String, positiveCallback: () -> Unit? = null, negativeLabel: String? = null, negativeCallback: () -> Unit? = null, cancellable: Boolean = true)
showKeyboard fun showKeyboard(activity: Activity?)
Show the soft keyboard.
showProminentDisclosure fun Context.showProminentDisclosure(onActionClicked: (Boolean) -> Unit)
showSingleSelectionPopUpDialog fun Context.showSingleSelectionPopUpDialog(items: List<String>, onItemSelected: (String) -> Unit)
talkBackSpeak fun Context.talkBackSpeak(message: String)
tint fun Drawable.tint(color: Int): Drawable
toDp fun Int.toDp(context: Context): Int
toFlow fun <T> Single<T>.toFlow(): Flow<T>
toIntSafe fun String.toIntSafe(): Int
updateClickActionAccessibilityLabel fun View.updateClickActionAccessibilityLabel(clickActionLabel: String)
updateFields fun <T> MutableLiveData<T>.updateFields(actions: (MutableLiveData<T>) -> Unit)
viewAppDetailsSettingsIntent fun Context.viewAppDetailsSettingsIntent(): Intent