Skip to content

Commit 6d428f4

Browse files
committed
chore: change configuration
1 parent 9344975 commit 6d428f4

4 files changed

Lines changed: 22 additions & 15 deletions

File tree

pangutext-android/src/main/java/com/highcapable/pangutext/android/extension/Replacement.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ package com.highcapable.pangutext.android.extension
2626
import android.text.SpannableStringBuilder
2727
import android.util.Log
2828
import com.highcapable.kavaref.KavaRef.Companion.resolve
29-
import com.highcapable.pangutext.android.generated.PangutextAndroidProperties
29+
import com.highcapable.pangutext.android.generated.PanguTextProperties
3030
import java.util.regex.Matcher
3131

3232
/**
@@ -120,7 +120,7 @@ internal fun CharSequence.replaceAndPreserveSpans(regex: Regex, replacement: Str
120120

121121
builder
122122
}.onFailure {
123-
Log.w(PangutextAndroidProperties.PROJECT_NAME, "Failed to replace span text content.", it)
123+
Log.w(PanguTextProperties.PROJECT_NAME, "Failed to replace span text content.", it)
124124
}.getOrNull() ?: this
125125

126126
/**

pangutext-android/src/main/java/com/highcapable/pangutext/android/factory/PanguTextFactory2.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import android.view.LayoutInflater
3030
import android.view.View
3131
import com.highcapable.betterandroid.ui.extension.view.layoutInflater
3232
import com.highcapable.kavaref.KavaRef.Companion.asResolver
33-
import com.highcapable.pangutext.android.generated.PangutextAndroidProperties
33+
import com.highcapable.pangutext.android.generated.PanguTextProperties
3434

3535
/**
3636
* Pangu text factory 2 for [LayoutInflater.Factory2].
@@ -105,15 +105,15 @@ class PanguTextFactory2 private constructor(private val base: LayoutInflater.Fac
105105
fun inject(inflater: LayoutInflater) {
106106
val original = inflater.factory2
107107
if (original is PanguTextFactory2) return run {
108-
Log.w(PangutextAndroidProperties.PROJECT_NAME, "PanguTextFactory2 was already injected.")
108+
Log.w(PanguTextProperties.PROJECT_NAME, "PanguTextFactory2 was already injected.")
109109
}
110110

111111
val replacement = PanguTextFactory2(original)
112112
if (original != null)
113113
inflater.asResolver().optional(silent = true).firstFieldOrNull {
114114
name = "mFactory2"
115115
superclass()
116-
}?.setQuietly(replacement) ?: Log.e(PangutextAndroidProperties.PROJECT_NAME, "LayoutInflater.mFactory2 not found.")
116+
}?.setQuietly(replacement) ?: Log.e(PanguTextProperties.PROJECT_NAME, "LayoutInflater.mFactory2 not found.")
117117
else inflater.factory2 = replacement
118118
}
119119
}

pangutext-android/src/main/java/com/highcapable/pangutext/android/factory/PanguWidget.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import com.highcapable.pangutext.android.R
4242
import com.highcapable.pangutext.android.core.PanguTextView
4343
import com.highcapable.pangutext.android.extension.injectPanguText
4444
import com.highcapable.pangutext.android.extension.injectRealTimePanguText
45-
import com.highcapable.pangutext.android.generated.PangutextAndroidProperties
45+
import com.highcapable.pangutext.android.generated.PanguTextProperties
4646

4747
/**
4848
* A widgets processor that automatically applies [PanguText] to the text content.
@@ -77,11 +77,11 @@ internal object PanguWidget {
7777

7878
// Catching when the attrs value initialization failed.
7979
runCatching { twoParams?.create(context, attrs) }.onFailure {
80-
Log.w(PangutextAndroidProperties.PROJECT_NAME, "Failed to create instance of $viewClass using (Context, AttributeSet).", it)
80+
Log.w(PanguTextProperties.PROJECT_NAME, "Failed to create instance of $viewClass using (Context, AttributeSet).", it)
8181
}.getOrNull()
8282
// Try to initialize with the default constructor again, otherwise return null.
8383
?: runCatching { onceParam?.create(context) }.onFailure {
84-
Log.w(PangutextAndroidProperties.PROJECT_NAME, "Failed to create instance of $viewClass, this process will be ignored.", it)
84+
Log.w(PanguTextProperties.PROJECT_NAME, "Failed to create instance of $viewClass, this process will be ignored.", it)
8585
}.getOrNull()
8686
}
8787

@@ -121,7 +121,7 @@ internal object PanguWidget {
121121
val excludePatterns = getStringOrNull(R.styleable.PanguTextHelper_panguText_excludePatterns)
122122
?.split(TEXT_REGEX_SPLIT_SYMBOL)?.mapNotNull { regex ->
123123
runCatching { regex.toRegex() }.onFailure { th ->
124-
Log.e(PangutextAndroidProperties.PROJECT_NAME, "Invalid exclude pattern of $instance: $regex", th)
124+
Log.e(PanguTextProperties.PROJECT_NAME, "Invalid exclude pattern of $instance: $regex", th)
125125
}.getOrNull()
126126
}?.toTypedArray() ?: emptyArray()
127127

settings.gradle.kts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ plugins {
2222
}
2323

2424
gropify {
25+
global {
26+
android {
27+
includeKeys("^project\\..*$".toRegex())
28+
className = rootProject.name
29+
isRestrictedAccessEnabled = true
30+
}
31+
jvm {
32+
includeKeys("^project\\..*$".toRegex())
33+
className = rootProject.name
34+
isRestrictedAccessEnabled = true
35+
}
36+
}
37+
2538
rootProject {
2639
common {
2740
isEnabled = false
@@ -33,12 +46,6 @@ gropify {
3346
isEnabled = false
3447
}
3548
}
36-
37-
projects(":pangutext-android") {
38-
android {
39-
isRestrictedAccessEnabled = true
40-
}
41-
}
4249
}
4350

4451
rootProject.name = "PanguText"

0 commit comments

Comments
 (0)