mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-30 23:03:00 +00:00 
			
		
		
		
	Update Kotlin to 2.0, update dependencies and fix issues
This commit is contained in:
		| @@ -9,6 +9,7 @@ plugins { | ||||
|     id "kotlin-parcelize" | ||||
|     id "checkstyle" | ||||
|     id "org.sonarqube" version "4.0.0.2929" | ||||
|     id "org.jetbrains.kotlin.plugin.compose" version "${kotlin_version}" | ||||
| } | ||||
|  | ||||
| android { | ||||
| @@ -104,10 +105,6 @@ android { | ||||
|                          'META-INF/COPYRIGHT'] | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     composeOptions { | ||||
|         kotlinCompilerExtensionVersion = "1.5.14" | ||||
|     } | ||||
| } | ||||
|  | ||||
| ext { | ||||
| @@ -290,13 +287,13 @@ dependencies { | ||||
|  | ||||
|     // Jetpack Compose | ||||
|     implementation(platform('androidx.compose:compose-bom:2024.06.00')) | ||||
|     implementation 'androidx.compose.material3:material3:1.3.0-beta04' | ||||
|     implementation 'androidx.compose.material3:material3:1.3.0-beta05' | ||||
|     implementation 'androidx.activity:activity-compose' | ||||
|     implementation 'androidx.compose.ui:ui-tooling-preview' | ||||
|     implementation 'androidx.compose.ui:ui-text:1.7.0-beta04' // Needed for parsing HTML to AnnotatedString | ||||
|     implementation 'androidx.compose.ui:ui-text:1.7.0-beta06' // Needed for parsing HTML to AnnotatedString | ||||
|     implementation 'androidx.lifecycle:lifecycle-viewmodel-compose' | ||||
|     implementation 'androidx.paging:paging-compose:3.3.0' | ||||
|     implementation 'com.github.nanihadesuka:LazyColumnScrollbar:2.1.0' | ||||
|     implementation 'androidx.paging:paging-compose:3.3.1' | ||||
|     implementation 'com.github.nanihadesuka:LazyColumnScrollbar:2.2.0' | ||||
|  | ||||
| /** Debugging **/ | ||||
|     // Memory leak detection | ||||
|   | ||||
| @@ -185,10 +185,8 @@ public class ReCaptchaActivity extends AppCompatActivity { | ||||
|             final int abuseEnd = url.indexOf("+path"); | ||||
|  | ||||
|             try { | ||||
|                 String abuseCookie = url.substring(abuseStart + 13, abuseEnd); | ||||
|                 abuseCookie = Utils.decodeUrlUtf8(abuseCookie); | ||||
|                 handleCookies(abuseCookie); | ||||
|             } catch (IllegalArgumentException | StringIndexOutOfBoundsException e) { | ||||
|                 handleCookies(Utils.decodeUrlUtf8(url.substring(abuseStart + 13, abuseEnd))); | ||||
|             } catch (final StringIndexOutOfBoundsException e) { | ||||
|                 if (MainActivity.DEBUG) { | ||||
|                     Log.e(TAG, "handleCookiesFromUrl: invalid google abuse starting at " | ||||
|                             + abuseStart + " and ending at " + abuseEnd + " for url " + url, e); | ||||
|   | ||||
| @@ -202,6 +202,7 @@ class FeedFragment : BaseStateFragment<FeedState>() { | ||||
|     // Menu | ||||
|     // ///////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { | ||||
|         super.onCreateOptionsMenu(menu, inflater) | ||||
|  | ||||
| @@ -212,6 +213,7 @@ class FeedFragment : BaseStateFragment<FeedState>() { | ||||
|         inflater.inflate(R.menu.menu_feed_fragment, menu) | ||||
|     } | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||||
|         if (item.itemId == R.id.menu_item_feed_help) { | ||||
|             val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext()) | ||||
| @@ -253,7 +255,7 @@ class FeedFragment : BaseStateFragment<FeedState>() { | ||||
|             viewModel.getShowFutureItemsFromPreferences() | ||||
|         ) | ||||
|  | ||||
|         AlertDialog.Builder(context!!) | ||||
|         AlertDialog.Builder(requireContext()) | ||||
|             .setTitle(R.string.feed_hide_streams_title) | ||||
|             .setMultiChoiceItems(dialogItems, checkedDialogItems) { _, which, isChecked -> | ||||
|                 checkedDialogItems[which] = isChecked | ||||
| @@ -267,6 +269,7 @@ class FeedFragment : BaseStateFragment<FeedState>() { | ||||
|             .show() | ||||
|     } | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onDestroyOptionsMenu() { | ||||
|         super.onDestroyOptionsMenu() | ||||
|         activity?.supportActionBar?.subtitle = null | ||||
|   | ||||
| @@ -129,6 +129,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() { | ||||
|     // Menu | ||||
|     // //////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { | ||||
|         super.onCreateOptionsMenu(menu, inflater) | ||||
|  | ||||
|   | ||||
| @@ -94,6 +94,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable { | ||||
|  | ||||
|     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||||
|         return object : Dialog(requireActivity(), theme) { | ||||
|             @Deprecated("Deprecated in Java") | ||||
|             override fun onBackPressed() { | ||||
|                 if (!this@FeedGroupDialog.onBackPressed()) { | ||||
|                     super.onBackPressed() | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| package org.schabi.newpipe.settings; | ||||
|  | ||||
| import static org.schabi.newpipe.extractor.utils.Utils.decodeUrlUtf8; | ||||
| import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; | ||||
|  | ||||
| import android.app.Activity; | ||||
| @@ -30,7 +29,6 @@ import org.schabi.newpipe.util.FilePickerActivityHelper; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.net.URI; | ||||
|  | ||||
| public class DownloadSettingsFragment extends BasePreferenceFragment { | ||||
|     public static final boolean IGNORE_RELEASE_ON_OLD_PATH = true; | ||||
| @@ -107,28 +105,15 @@ public class DownloadSettingsFragment extends BasePreferenceFragment { | ||||
|  | ||||
|     private void showPathInSummary(final String prefKey, @StringRes final int defaultString, | ||||
|                                    final Preference target) { | ||||
|         String rawUri = defaultPreferences.getString(prefKey, null); | ||||
|         if (rawUri == null || rawUri.isEmpty()) { | ||||
|         final Uri uri = Uri.parse(defaultPreferences.getString(prefKey, "")); | ||||
|         if (uri.equals(Uri.EMPTY)) { | ||||
|             target.setSummary(getString(defaultString)); | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         if (rawUri.charAt(0) == File.separatorChar) { | ||||
|             target.setSummary(rawUri); | ||||
|             return; | ||||
|         } | ||||
|         if (rawUri.startsWith(ContentResolver.SCHEME_FILE)) { | ||||
|             target.setSummary(new File(URI.create(rawUri)).getPath()); | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         try { | ||||
|             rawUri = decodeUrlUtf8(rawUri); | ||||
|         } catch (final IllegalArgumentException e) { | ||||
|             // nothing to do | ||||
|         } | ||||
|  | ||||
|         target.setSummary(rawUri); | ||||
|         final String summary = ContentResolver.SCHEME_FILE.equals(uri.getScheme()) | ||||
|                 ? uri.getPath() : uri.toString(); | ||||
|         target.setSummary(summary); | ||||
|     } | ||||
|  | ||||
|     private boolean isFileUri(final String path) { | ||||
|   | ||||
| @@ -77,11 +77,13 @@ class NotificationModeConfigFragment : Fragment() { | ||||
|         super.onDestroy() | ||||
|     } | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { | ||||
|         super.onCreateOptionsMenu(menu, inflater) | ||||
|         inflater.inflate(R.menu.menu_notifications_channels, menu) | ||||
|     } | ||||
|  | ||||
|     @Deprecated("Deprecated in Java") | ||||
|     override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||||
|         return when (item.itemId) { | ||||
|             R.id.action_toggle_all -> { | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||||
|  | ||||
| buildscript { | ||||
|     ext.kotlin_version = '1.9.24' | ||||
|     ext.kotlin_version = '2.0.0' | ||||
|     repositories { | ||||
|         google() | ||||
|         mavenCentral() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Isira Seneviratne
					Isira Seneviratne