-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1632 from novasamatech/rc/8.5.0
Rc/8.5.0
- Loading branch information
Showing
26 changed files
with
246 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...in/java/io/novafoundation/nova/common/utils/formatting/spannable/SpannableFormatterExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,39 @@ | ||
package io.novafoundation.nova.common.utils.formatting.spannable | ||
|
||
import android.content.Context | ||
import android.text.SpannedString | ||
import androidx.annotation.StringRes | ||
import io.novafoundation.nova.common.R | ||
import io.novafoundation.nova.common.resources.ResourceManager | ||
import io.novafoundation.nova.common.utils.colorSpan | ||
import io.novafoundation.nova.common.utils.toSpannable | ||
|
||
fun CharSequence.spannableFormatting(vararg args: Any): CharSequence { | ||
return SpannableFormatter.format(this, *args) | ||
} | ||
|
||
fun SpannableFormatter.format(resourceManager: ResourceManager, @StringRes resId: Int, vararg args: Any): SpannedString { | ||
val format = resourceManager.getString(resId) | ||
return format(format, *args) | ||
} | ||
|
||
fun SpannableFormatter.format(context: Context, @StringRes resId: Int, vararg args: Any): SpannedString { | ||
val format = context.getString(resId) | ||
return format(format, *args) | ||
} | ||
|
||
fun Context.highlightedText(mainRes: Int, vararg highlightedRes: Int): SpannedString { | ||
val highlighted = highlightedRes.map { | ||
getString(it).toSpannable(colorSpan(getColor(R.color.text_primary))) | ||
}.toTypedArray() | ||
|
||
return SpannableFormatter.format(this, mainRes, *highlighted) | ||
} | ||
|
||
fun ResourceManager.highlightedText(mainRes: Int, vararg highlightedRes: Int): SpannedString { | ||
val highlighted = highlightedRes.map { | ||
getString(it).toSpannable(colorSpan(getColor(R.color.text_primary))) | ||
}.toTypedArray() | ||
|
||
return SpannableFormatter.format(this, mainRes, *highlighted) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ing/src/main/java/io/novafoundation/nova/feature_deep_linking/di/DeepLinkingFeatureApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.