From 02bfb3466547e8a931b44b401c1d789efd893ce0 Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 29 Feb 2024 10:04:15 +0300 Subject: [PATCH] Android Gradle Plugin can't JUST WORK, can it?! --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- mastodon/build.gradle | 2 ++ .../joinmastodon/android/fragments/HomeFragment.java | 10 +++++----- .../android/fragments/ProfileAboutFragment.java | 2 +- .../android/fragments/ProfileFragment.java | 2 +- .../android/fragments/discover/DiscoverFragment.java | 4 ++-- .../fragments/discover/SearchQueryFragment.java | 2 +- .../android/ui/photoviewer/PhotoViewerInfoSheet.java | 2 +- .../ui/viewcontrollers/DropdownSubmenuController.java | 2 +- .../android/ui/views/ReorderableLinearLayout.java | 2 +- 11 files changed, 17 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index c4715843..1f5a65bd 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:7.4.2" + classpath "com.android.tools.build:gradle:8.2.2" classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e9cd6f21..adb8ebf8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Jun 03 23:40:27 MSK 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/mastodon/build.gradle b/mastodon/build.gradle index 4939669e..755a67d9 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -66,6 +66,7 @@ android { } buildFeatures{ aidl true + buildConfig true } dependenciesInfo{ // Disables dependency metadata when building APKs. @@ -73,6 +74,7 @@ android { // Disables dependency metadata when building Android App Bundles. includeInBundle false } + namespace 'org.joinmastodon.android' } dependencies { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java index ed01e888..f40283f0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java @@ -112,7 +112,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene content.setOrientation(LinearLayout.VERTICAL); FrameLayout fragmentContainer=new FrameLayout(getActivity()); - fragmentContainer.setId(R.id.fragment_wrap); + fragmentContainer.setId(me.grishka.appkit.R.id.fragment_wrap); content.addView(fragmentContainer, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1f)); inflater.inflate(R.layout.tab_bar, content); @@ -131,10 +131,10 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene if(savedInstanceState==null){ getChildFragmentManager().beginTransaction() - .add(R.id.fragment_wrap, homeTimelineFragment) - .add(R.id.fragment_wrap, searchFragment).hide(searchFragment) - .add(R.id.fragment_wrap, notificationsFragment).hide(notificationsFragment) - .add(R.id.fragment_wrap, profileFragment).hide(profileFragment) + .add(me.grishka.appkit.R.id.fragment_wrap, homeTimelineFragment) + .add(me.grishka.appkit.R.id.fragment_wrap, searchFragment).hide(searchFragment) + .add(me.grishka.appkit.R.id.fragment_wrap, notificationsFragment).hide(notificationsFragment) + .add(me.grishka.appkit.R.id.fragment_wrap, profileFragment).hide(profileFragment) .commit(); String defaultTab=getArguments().getString("tab"); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java index 061e981c..a5678804 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileAboutFragment.java @@ -310,7 +310,7 @@ public class ProfileAboutFragment extends Fragment implements WindowInsetsAwareF public void onSelectedChanged(@Nullable RecyclerView.ViewHolder viewHolder, int actionState){ super.onSelectedChanged(viewHolder, actionState); if(actionState==ItemTouchHelper.ACTION_STATE_DRAG){ - viewHolder.itemView.setTag(R.id.item_touch_helper_previous_elevation, viewHolder.itemView.getElevation()); // prevents the default behavior of changing elevation in onDraw() + viewHolder.itemView.setTag(me.grishka.appkit.R.id.item_touch_helper_previous_elevation, viewHolder.itemView.getElevation()); // prevents the default behavior of changing elevation in onDraw() viewHolder.itemView.animate().translationZ(V.dp(1)).setDuration(200).setInterpolator(CubicBezierInterpolator.DEFAULT).start(); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 3d68461d..700548b3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -930,7 +930,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList Toolbar toolbar=getToolbar(); if(canGoBack()){ - Drawable back=getToolbarContext().getDrawable(R.drawable.ic_arrow_back).mutate(); + Drawable back=getToolbarContext().getDrawable(me.grishka.appkit.R.drawable.ic_arrow_back).mutate(); back.setTint(UiUtils.getThemeColor(getToolbarContext(), R.attr.colorM3OnSurfaceVariant)); toolbar.setNavigationIcon(back); toolbar.setNavigationContentDescription(0); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverFragment.java index cb53a04e..a1934c14 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverFragment.java @@ -180,7 +180,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop, searchBack.setImportantForAccessibility(searchActive ? View.IMPORTANT_FOR_ACCESSIBILITY_YES : View.IMPORTANT_FOR_ACCESSIBILITY_NO); searchBack.setOnClickListener(v->exitSearch()); if(searchActive){ - searchBack.setImageResource(R.drawable.ic_arrow_back); + searchBack.setImageResource(me.grishka.appkit.R.drawable.ic_arrow_back); pager.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE); searchView.setVisibility(View.VISIBLE); @@ -228,7 +228,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop, pager.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE); searchView.setVisibility(View.VISIBLE); - searchBack.setImageResource(R.drawable.ic_arrow_back); + searchBack.setImageResource(me.grishka.appkit.R.drawable.ic_arrow_back); searchBack.setEnabled(true); searchBack.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); tabsDivider.setVisibility(View.GONE); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java index 2712ee97..3ff7fc79 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/SearchQueryFragment.java @@ -166,7 +166,7 @@ public class SearchQueryFragment extends MastodonRecyclerFragmentdropdownController.popSubmenuController()); backItem.setAccessibilityDelegate(new View.AccessibilityDelegate(){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/views/ReorderableLinearLayout.java b/mastodon/src/main/java/org/joinmastodon/android/ui/views/ReorderableLinearLayout.java index 4c071f60..46c33d66 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/views/ReorderableLinearLayout.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/views/ReorderableLinearLayout.java @@ -284,7 +284,7 @@ public class ReorderableLinearLayout extends LinearLayout implements CustomViewH private int getMaxDragScroll(){ if(cachedMaxScrollSpeed==-1){ - cachedMaxScrollSpeed=getResources().getDimensionPixelSize(R.dimen.item_touch_helper_max_drag_scroll_per_frame); + cachedMaxScrollSpeed=getResources().getDimensionPixelSize(me.grishka.appkit.R.dimen.item_touch_helper_max_drag_scroll_per_frame); } return cachedMaxScrollSpeed; }