Skip to content

Commit

Permalink
Non transitive R classes weow
Browse files Browse the repository at this point in the history
  • Loading branch information
ForceTower committed Aug 13, 2024
1 parent b00fd1a commit d694ee4
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class AboutMeFragment : UFragment() {

Glide.with(this)
.load("https://avatars.githubusercontent.com/ForceTower")
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
.fallback(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.placeholder(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.transition(DrawableTransitionOptions.withCrossFade())
.circleCrop()
.into(binding.imageCreatorPicture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ContributorsFragment : UFragment() {
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams
.Builder()
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), R.attr.colorPrimary))
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary))
.build()
)
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fun formatSemesterGradeChart(chart: LineChart, list: List<SemesterMean>?) {
set.setDrawFilled(true)
set.fillDrawable = ContextCompat.getDrawable(context, R.drawable.gradient_chart_evaluation)
set.mode = LineDataSet.Mode.CUBIC_BEZIER
set.color = ViewUtils.attributeColorUtils(context, R.attr.colorAccent)
set.color = ViewUtils.attributeColorUtils(context, androidx.appcompat.R.attr.colorAccent)
set.setDrawCircles(false)
set.setDrawValues(false)

Expand All @@ -76,7 +76,7 @@ fun formatSemesterGradeChart(chart: LineChart, list: List<SemesterMean>?) {

val typedValue = TypedValue()
val theme = context.theme
theme.resolveAttribute(R.attr.colorOnSurface, typedValue, true)
theme.resolveAttribute(com.google.android.material.R.attr.colorOnSurface, typedValue, true)
val colorOnSurface = typedValue.data

chart.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun disciplineFlowchartTextColor(tv: TextView, completed: Boolean?, participatin
val participate = participating ?: false
val ctx = tv.context
val color = when {
complete -> ViewUtils.attributeColorUtils(ctx, R.attr.colorPrimary)
complete -> ViewUtils.attributeColorUtils(ctx, androidx.appcompat.R.attr.colorPrimary)
participate -> ContextCompat.getColor(ctx, R.color.yellow)
else -> ContextCompat.getColor(ctx, R.color.red)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ class HomeBottomFragment : UFragment() {
viewModel.setSelectedImage(uri)
Glide.with(requireContext())
.load(uri)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
.fallback(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.placeholder(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.circleCrop()
.transition(DrawableTransitionOptions.withCrossFade())
.into(binding.imageUserPicture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class SigningInFragment : UFragment() {

val typedValue = TypedValue()
val theme = requireContext().theme
theme.resolveAttribute(R.attr.colorOnSurface, typedValue, true)
theme.resolveAttribute(com.google.android.material.R.attr.colorOnSurface, typedValue, true)
val colorOnSurface = typedValue.data
textView.setTextColor(colorOnSurface)
textView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fun profileImage(iv: ImageView, url: String?) {

Glide.with(iv.context)
.load(url)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
.fallback(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.placeholder(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.circleCrop()
.transition(DrawableTransitionOptions.withCrossFade())
.into(iv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CreateReminderDialog : RoundedDialog() {
if (viewModel.currentDeadline != null)
calendar.timeInMillis = viewModel.currentDeadline!!

val color = ViewUtils.attributeColorUtils(requireContext(), R.attr.colorPrimary)
val color = ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary)

val picker = DatePickerDialog.newInstance(
{ _, y, m, d ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AdvancedSettingsFragment : PreferenceFragmentCompat() {
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams
.Builder()
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), R.attr.colorPrimary))
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary))
.build()
)
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class IntroductionFragment : UFragment() {
viewModel.setSelectedImage(uri)
Glide.with(requireContext())
.load(uri)
.fallback(R.mipmap.ic_unes_large_image_512)
.placeholder(R.mipmap.ic_unes_large_image_512)
.fallback(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.placeholder(com.forcetower.core.R.mipmap.ic_unes_large_image_512)
.circleCrop()
.transition(DrawableTransitionOptions.withCrossFade())
.into(binding.imageUserImage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class SyncSpecialFragment : UFragment() {
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams
.Builder()
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), R.attr.colorPrimary))
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary))
.build()
)
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun Snackbar.config(pxElevation: Int = 6) {

try {
val at = view.findViewById<TextView>(com.google.android.material.R.id.snackbar_action)
at.setTextColor(ViewUtils.attributeColorUtils(context, R.attr.colorPrimary))
at.setTextColor(ViewUtils.attributeColorUtils(context, androidx.appcompat.R.attr.colorPrimary))
at.isAllCaps = false
at.typeface = font
} catch (ignored: Exception) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ class ThemeSwitcherResourceProvider {
@JvmStatic
@StyleableRes
private val PRIMARY_THEME_OVERLAY_ATTRS = intArrayOf(
R.attr.colorPrimary,
R.attr.colorPrimaryDark,
androidx.appcompat.R.attr.colorPrimary,
androidx.appcompat.R.attr.colorPrimaryDark,
R.attr.colorPrimaryLight,
R.attr.colorPrimaryAlpha
)

@JvmStatic
@StyleableRes
private val SECONDARY_THEME_OVERLAY_ATTRS = intArrayOf(
R.attr.colorAccent,
R.attr.colorSecondary
androidx.appcompat.R.attr.colorAccent,
com.google.android.material.R.attr.colorSecondary
)

@JvmStatic
@StyleableRes
private val BACKGROUND_THEME_OVERLAY_ATTRS = intArrayOf(
R.attr.background,
androidx.appcompat.R.attr.background,
R.attr.colorStatusBar,
R.attr.colorSurface,
com.google.android.material.R.attr.colorSurface,
android.R.attr.windowBackground
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,21 +258,21 @@ class BottomSheetBehavior<V : View> : Behavior<V> {
@SuppressLint("PrivateResource")
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
// Re-use BottomSheetBehavior's attrs
val a = context.obtainStyledAttributes(attrs, R.styleable.BottomSheetBehavior_Layout)
val value = a.peekValue(R.styleable.BottomSheetBehavior_Layout_behavior_peekHeight)
val a = context.obtainStyledAttributes(attrs, com.google.android.material.R.styleable.BottomSheetBehavior_Layout)
val value = a.peekValue(com.google.android.material.R.styleable.BottomSheetBehavior_Layout_behavior_peekHeight)
peekHeight = if (value != null && value.data == PEEK_HEIGHT_AUTO) {
value.data
} else {
a.getDimensionPixelSize(
R.styleable.BottomSheetBehavior_Layout_behavior_peekHeight,
com.google.android.material.R.styleable.BottomSheetBehavior_Layout_behavior_peekHeight,
PEEK_HEIGHT_AUTO
)
}
isHideable = a.getBoolean(R.styleable.BottomSheetBehavior_Layout_behavior_hideable, false)
isHideable = a.getBoolean(com.google.android.material.R.styleable.BottomSheetBehavior_Layout_behavior_hideable, false)
isFitToContents =
a.getBoolean(R.styleable.BottomSheetBehavior_Layout_behavior_fitToContents, true)
a.getBoolean(com.google.android.material.R.styleable.BottomSheetBehavior_Layout_behavior_fitToContents, true)
skipCollapsed =
a.getBoolean(R.styleable.BottomSheetBehavior_Layout_behavior_skipCollapsed, false)
a.getBoolean(com.google.android.material.R.styleable.BottomSheetBehavior_Layout_behavior_skipCollapsed, false)
a.recycle()
val configuration = ViewConfiguration.get(context)
minimumVelocity = configuration.scaledMinimumFlingVelocity
Expand Down Expand Up @@ -349,7 +349,7 @@ class BottomSheetBehavior<V : View> : Behavior<V> {
// init peekHeightMin
@SuppressLint("PrivateResource")
peekHeightMin = parent.resources.getDimensionPixelSize(
R.dimen.design_bottom_sheet_peek_height_min
com.google.android.material.R.dimen.design_bottom_sheet_peek_height_min
)
}
lastPeekHeight = max(peekHeightMin, parentHeight - parent.width * 9 / 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ public CustomEditText(Context context, AttributeSet attrs) {
super(context, attrs);
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();
theme.resolveAttribute(R.attr.colorOnSurface, typedValue, true);
theme.resolveAttribute(com.google.android.material.R.attr.colorOnSurface, typedValue, true);
setTextColor(typedValue.data);

float textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 7, context.getResources().getDisplayMetrics());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AERINewsFragment : UFragment() {
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams
.Builder()
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), R.attr.colorPrimary))
.setToolbarColor(ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary))
.build()
)
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class CreateEventFragment : UFragment() {
val selection = (if (start) viewModel.start else viewModel.end)
calendar.timeInMillis = selection

val color = ViewUtils.attributeColorUtils(requireContext(), com.forcetower.uefs.R.attr.colorPrimary)
val color = ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary)

val picker = DatePickerDialog.newInstance(
{ _, y, m, d ->
Expand Down Expand Up @@ -220,7 +220,7 @@ class CreateEventFragment : UFragment() {

picker.version = TimePickerDialog.Version.VERSION_2

val color = ViewUtils.attributeColorUtils(requireContext(), com.forcetower.uefs.R.attr.colorPrimary)
val color = ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary)
picker.accentColor = color
picker.setOkColor(color)

Expand Down Expand Up @@ -422,8 +422,8 @@ class CreateEventFragment : UFragment() {

private fun onContentSelected(uri: Uri?) {
uri ?: return
val bg = ColorUtils.modifyAlpha(ViewUtils.attributeColorUtils(requireContext(), com.forcetower.uefs.R.attr.colorPrimary), 120)
val ac = ViewUtils.attributeColorUtils(requireContext(), com.forcetower.uefs.R.attr.colorAccent)
val bg = ColorUtils.modifyAlpha(ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorPrimary), 120)
val ac = ViewUtils.attributeColorUtils(requireContext(), androidx.appcompat.R.attr.colorAccent)

val options = CropImageContractOptions(
uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class EventDetailsActivity : UActivity() {
.setDefaultColorSchemeParams(
CustomTabColorSchemeParams
.Builder()
.setToolbarColor(ViewUtils.attributeColorUtils(this, com.forcetower.uefs.R.attr.colorPrimary))
.setToolbarColor(ViewUtils.attributeColorUtils(this, androidx.appcompat.R.attr.colorPrimary))
.build()
)
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ kapt.incremental.apt=true

org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
android.nonTransitiveRClass=false
android.nonTransitiveRClass=true
android.nonFinalResIds=false

0 comments on commit d694ee4

Please sign in to comment.