From 442f622b35473aed71f936a83ec556f688887784 Mon Sep 17 00:00:00 2001
From: birdbird <6892457-tzugen@users.noreply.gitlab.com>
Date: Wed, 18 Oct 2023 10:19:10 +0000
Subject: [PATCH] Migrate remaining Java Code and modernize it
---
gradle/libs.versions.toml | 2 +
ultrasonic/detekt-baseline.xml | 16 +-
ultrasonic/src/main/AndroidManifest.xml | 25 +-
.../ultrasonic/fragment/ChatFragment.java | 297 ------------------
.../moire/ultrasonic/util/BackgroundTask.java | 72 -----
.../util/FragmentBackgroundTask.java | 89 ------
.../moire/ultrasonic/util/LoadingTask.java | 66 ----
.../ultrasonic/util/ProgressListener.java | 29 --
.../moire/ultrasonic/util/ShareDetails.java | 16 -
.../ultrasonic/util/TimeSpanPreference.java | 38 ---
.../ultrasonic/fragment/AboutFragment.kt | 3 +-
.../ultrasonic/fragment/AlbumListFragment.kt | 16 +-
.../ultrasonic/fragment/ArtistListFragment.kt | 2 +-
.../ultrasonic/fragment/BookmarksFragment.kt | 11 +-
.../ultrasonic/fragment/EntryListFragment.kt | 4 +-
.../ultrasonic/fragment/EqualizerFragment.kt | 2 +-
.../ultrasonic/fragment/FragmentTitle.kt | 34 +-
.../ultrasonic/fragment/MultiListFragment.kt | 27 +-
.../ultrasonic/fragment/PlayerFragment.kt | 14 +-
.../ultrasonic/fragment/SearchFragment.kt | 35 +--
.../ultrasonic/fragment/SettingsFragment.kt | 2 +-
.../fragment/TrackCollectionFragment.kt | 49 +--
.../fragment/legacy/ChatFragment.kt | 214 +++++++++++++
.../fragment/legacy/LyricsFragment.kt | 55 ++--
.../fragment/legacy/PlaylistsFragment.kt | 180 +++++------
.../fragment/legacy/PodcastFragment.kt | 72 ++---
.../fragment/legacy/SelectGenreFragment.kt | 73 ++---
.../fragment/legacy/SharesFragment.kt | 196 +++++-------
.../ultrasonic/imageloader/ImageLoader.kt | 1 +
.../moire/ultrasonic/model/ChatViewModel.kt | 31 ++
.../moire/ultrasonic/model/SearchListModel.kt | 5 +-
.../provider/AlbumArtContentProvider.kt | 1 +
.../ultrasonic/service/DownloadService.kt | 16 +-
.../moire/ultrasonic/service/DownloadTask.kt | 2 +-
.../ultrasonic/service/MediaPlayerManager.kt | 4 +-
.../subsonic/ImageLoaderProvider.kt | 3 +-
.../moire/ultrasonic/subsonic/ShareHandler.kt | 60 ++--
.../ultrasonic/util/CancellationToken.kt | 4 +-
.../moire/ultrasonic/util/ContextMenuUtil.kt | 3 +-
.../ultrasonic/util/CoroutinePatterns.kt | 36 ++-
.../org/moire/ultrasonic/util/DownloadUtil.kt | 5 +-
.../ultrasonic/util/RefreshableFragment.kt | 14 +
.../org/moire/ultrasonic/util/ShareDetails.kt | 12 +
.../moire/ultrasonic/util/TimeSpanPicker.kt | 6 +-
.../ultrasonic/util/TimeSpanPreference.kt | 27 ++
.../kotlin/org/moire/ultrasonic/util/Util.kt | 36 +--
.../src/main/res/layout/filter_button_bar.xml | 2 +-
.../src/main/res/layout/navigation_header.xml | 1 +
.../src/main/res/layout/share_details.xml | 71 +++--
.../src/main/res/layout/time_span_dialog.xml | 11 +-
.../main/res/navigation/navigation_graph.xml | 2 +-
ultrasonic/src/main/res/values/strings.xml | 1 +
52 files changed, 787 insertions(+), 1206 deletions(-)
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/fragment/ChatFragment.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/BackgroundTask.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/FragmentBackgroundTask.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/LoadingTask.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/ProgressListener.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/ShareDetails.java
delete mode 100644 ultrasonic/src/main/java/org/moire/ultrasonic/util/TimeSpanPreference.java
create mode 100644 ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/legacy/ChatFragment.kt
create mode 100644 ultrasonic/src/main/kotlin/org/moire/ultrasonic/model/ChatViewModel.kt
create mode 100644 ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/RefreshableFragment.kt
create mode 100644 ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/ShareDetails.kt
create mode 100644 ultrasonic/src/main/kotlin/org/moire/ultrasonic/util/TimeSpanPreference.kt
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index fb4af1c9..0cab93bd 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -15,6 +15,7 @@ media3 = "1.1.1"
androidSupport = "1.7.0"
materialDesign = "1.9.0"
constraintLayout = "2.1.4"
+activity = "1.8.0"
multidex = "2.0.1"
room = "2.5.2"
kotlin = "1.9.10"
@@ -66,6 +67,7 @@ navigationFragmentKtx = { module = "androidx.navigation:navigation-fragment-kt
navigationUiKtx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
navigationFeature = { module = "androidx.navigation:navigation-dynamic-features-fragment", version.ref = "navigation" }
navigationSafeArgs = { module = "androidx.navigation:navigation-safe-args-gradle-plugin", version.ref = "navigation"}
+activity = { module = "androidx.activity:activity-ktx", version.ref = "activity" }
preferences = { module = "androidx.preference:preference", version.ref = "preferences" }
media3common = { module = "androidx.media3:media3-common", version.ref = "media3" }
media3exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3" }
diff --git a/ultrasonic/detekt-baseline.xml b/ultrasonic/detekt-baseline.xml
index a8789e05..cae63ce3 100644
--- a/ultrasonic/detekt-baseline.xml
+++ b/ultrasonic/detekt-baseline.xml
@@ -1,9 +1,7 @@
-
- TooManyFunctions:PlaybackService.kt$PlaybackService : MediaLibraryServiceKoinComponentCoroutineScope
- UnusedPrivateMember:UApp.kt$private fun VmPolicy.Builder.detectAllExceptSocket(): VmPolicy.Builder
- ImplicitDefaultLocale:EditServerFragment.kt$EditServerFragment.<no name provided>$String.format( "%s %s", resources.getString(R.string.settings_connection_failure), getErrorMessage(error) )
+
+
ImplicitDefaultLocale:FileLoggerTree.kt$FileLoggerTree$String.format("Failed to write log to %s", file)
ImplicitDefaultLocale:FileLoggerTree.kt$FileLoggerTree$String.format("Log file rotated, logging into file %s", file?.name)
ImplicitDefaultLocale:FileLoggerTree.kt$FileLoggerTree$String.format("Logging into file %s", file?.name)
@@ -11,19 +9,11 @@
LongMethod:EditServerFragment.kt$EditServerFragment$override fun onViewCreated(view: View, savedInstanceState: Bundle?)
LongMethod:NavigationActivity.kt$NavigationActivity$override fun onCreate(savedInstanceState: Bundle?)
LongMethod:PlaylistsFragment.kt$PlaylistsFragment$override fun onContextItemSelected(menuItem: MenuItem): Boolean
- LongMethod:ShareHandler.kt$ShareHandler$private fun showDialog( fragment: Fragment, shareDetails: ShareDetails, swipe: SwipeRefreshLayout?, cancellationToken: CancellationToken, additionalId: String? )
LongMethod:SharesFragment.kt$SharesFragment$override fun onContextItemSelected(menuItem: MenuItem): Boolean
- LongParameterList:ServerRowAdapter.kt$ServerRowAdapter$( private var context: Context, passedData: Array<ServerSetting>, private val model: ServerSettingsModel, private val activeServerProvider: ActiveServerProvider, private val manageMode: Boolean, private val serverDeletedCallback: ((Int) -> Unit), private val serverEditRequestedCallback: ((Int) -> Unit) )
MagicNumber:ActiveServerProvider.kt$ActiveServerProvider$8192
- MagicNumber:JukeboxMediaPlayer.kt$JukeboxMediaPlayer$0.05f
MagicNumber:JukeboxMediaPlayer.kt$JukeboxMediaPlayer$50
MagicNumber:RESTMusicService.kt$RESTMusicService$206
- NestedBlockDepth:DownloadHandler.kt$DownloadHandler$private fun downloadRecursively( fragment: Fragment, id: String, name: String?, isShare: Boolean, isDirectory: Boolean, save: Boolean, append: Boolean, autoPlay: Boolean, shuffle: Boolean, background: Boolean, playNext: Boolean, unpin: Boolean, isArtist: Boolean )
- TooGenericExceptionCaught:FileLoggerTree.kt$FileLoggerTree$x: Throwable
- TooGenericExceptionCaught:JukeboxMediaPlayer.kt$JukeboxMediaPlayer$x: Throwable
TooGenericExceptionCaught:JukeboxMediaPlayer.kt$JukeboxMediaPlayer.TaskQueue$x: Throwable
TooManyFunctions:RESTMusicService.kt$RESTMusicService : MusicService
- UtilityClassWithPublicConstructor:FragmentTitle.kt$FragmentTitle
-
-
+
diff --git a/ultrasonic/src/main/AndroidManifest.xml b/ultrasonic/src/main/AndroidManifest.xml
index d8134933..f8870756 100644
--- a/ultrasonic/src/main/AndroidManifest.xml
+++ b/ultrasonic/src/main/AndroidManifest.xml
@@ -22,20 +22,22 @@
android:xlargeScreens="true"/>
+ android:preserveLegacyExternalStorage="true"
+ android:roundIcon="@mipmap/ic_launcher_round"
+ android:supportsRtl="false"
+ android:theme="@style/Theme.Material3.DynamicColors.Dark"
+ android:usesCleartextTraffic="true"
+ tools:ignore="UnusedAttribute"
+ tools:targetApi="q">
-
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/fragment/ChatFragment.java b/ultrasonic/src/main/java/org/moire/ultrasonic/fragment/ChatFragment.java
deleted file mode 100644
index 6a091f72..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/fragment/ChatFragment.java
+++ /dev/null
@@ -1,297 +0,0 @@
-package org.moire.ultrasonic.fragment;
-
-import android.os.Bundle;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.inputmethod.EditorInfo;
-import android.widget.EditText;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
-
-import org.moire.ultrasonic.R;
-import org.moire.ultrasonic.data.ActiveServerProvider;
-import org.moire.ultrasonic.domain.ChatMessage;
-import org.moire.ultrasonic.service.MusicService;
-import org.moire.ultrasonic.service.MusicServiceFactory;
-import org.moire.ultrasonic.util.BackgroundTask;
-import org.moire.ultrasonic.util.CancellationToken;
-import org.moire.ultrasonic.util.FragmentBackgroundTask;
-import org.moire.ultrasonic.util.Settings;
-import org.moire.ultrasonic.util.Util;
-import org.moire.ultrasonic.view.ChatAdapter;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import kotlin.Lazy;
-
-import static org.koin.java.KoinJavaComponent.inject;
-
-import com.google.android.material.button.MaterialButton;
-
-/**
- * Provides online chat functionality
- */
-public class ChatFragment extends Fragment {
-
- private ListView chatListView;
- private EditText messageEditText;
- private MaterialButton sendButton;
- private Timer timer;
- private volatile static Long lastChatMessageTime = (long) 0;
- private static final ArrayList messageList = new ArrayList<>();
- private CancellationToken cancellationToken;
- private SwipeRefreshLayout swipeRefresh;
-
- private final Lazy activeServerProvider = inject(ActiveServerProvider.class);
-
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- Util.applyTheme(this.getContext());
- super.onCreate(savedInstanceState);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return inflater.inflate(R.layout.chat, container, false);
- }
-
- @Override
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- swipeRefresh = view.findViewById(R.id.chat_refresh);
- swipeRefresh.setEnabled(false);
-
- cancellationToken = new CancellationToken();
- messageEditText = view.findViewById(R.id.chat_edittext);
- sendButton = view.findViewById(R.id.chat_send);
-
- sendButton.setOnClickListener(view1 -> sendMessage());
-
- chatListView = view.findViewById(R.id.chat_entries_list);
- chatListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
- chatListView.setStackFromBottom(true);
-
- String serverName = activeServerProvider.getValue().getActiveServer().getName();
- String userName = activeServerProvider.getValue().getActiveServer().getUserName();
- String title = String.format("%s [%s@%s]", getResources().getString(R.string.button_bar_chat), userName, serverName);
-
- FragmentTitle.Companion.setTitle(this, title);
- setHasOptionsMenu(true);
-
- messageEditText.setImeActionLabel("Send", KeyEvent.KEYCODE_ENTER);
-
- messageEditText.addTextChangedListener(new TextWatcher()
- {
- @Override
- public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
- {
- }
-
- @Override
- public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
- {
- }
-
- @Override
- public void afterTextChanged(Editable editable)
- {
- sendButton.setEnabled(!Util.isNullOrWhiteSpace(editable.toString()));
- }
- });
-
- messageEditText.setOnEditorActionListener((v, actionId, event) -> {
- if (actionId == EditorInfo.IME_ACTION_DONE || (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_DOWN))
- {
- sendMessage();
- return true;
- }
-
- return false;
- });
-
- load();
- timerMethod();
- }
-
- @Override
- public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
- inflater.inflate(R.menu.chat, menu);
- super.onCreateOptionsMenu(menu, inflater);
- }
-
- /*
- * Listen for option item selections so that we receive a notification
- * when the user requests a refresh by selecting the refresh action bar item.
- */
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Check if user triggered a refresh:
- if (item.getItemId() == R.id.menu_refresh) {
- // Start the refresh background task.
- load();
- return true;
- }
- // User didn't trigger a refresh, let the superclass handle this action
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- public void onResume()
- {
- super.onResume();
-
- if (!messageList.isEmpty())
- {
- ListAdapter chatAdapter = new ChatAdapter(getContext(), messageList);
- chatListView.setAdapter(chatAdapter);
- }
-
- if (timer == null)
- {
- timerMethod();
- }
- }
-
- @Override
- public void onPause()
- {
- super.onPause();
-
- if (timer != null)
- {
- timer.cancel();
- timer = null;
- }
- }
-
- @Override
- public void onDestroyView() {
- cancellationToken.cancel();
- super.onDestroyView();
- }
-
- private void timerMethod()
- {
- int refreshInterval = Settings.getChatRefreshInterval();
-
- if (refreshInterval > 0)
- {
- timer = new Timer();
-
- timer.schedule(new TimerTask()
- {
- @Override
- public void run()
- {
- getActivity().runOnUiThread(() -> load());
- }
- }, refreshInterval, refreshInterval);
- }
- }
-
- private void sendMessage()
- {
- if (messageEditText != null)
- {
- final String message;
- Editable text = messageEditText.getText();
-
- if (text == null)
- {
- return;
- }
-
- message = text.toString();
-
- if (!Util.isNullOrWhiteSpace(message))
- {
- messageEditText.setText("");
-
- BackgroundTask task = new FragmentBackgroundTask(getActivity(), false, swipeRefresh, cancellationToken)
- {
- @Override
- protected Void doInBackground() throws Throwable
- {
- MusicService musicService = MusicServiceFactory.getMusicService();
- musicService.addChatMessage(message);
- return null;
- }
-
- @Override
- protected void done(Void result)
- {
- load();
- }
- };
-
- task.execute();
- }
- }
- }
-
- private synchronized void load()
- {
- BackgroundTask> task = new FragmentBackgroundTask>(getActivity(), false, swipeRefresh, cancellationToken)
- {
- @Override
- protected List doInBackground() throws Throwable
- {
- MusicService musicService = MusicServiceFactory.getMusicService();
- return musicService.getChatMessages(lastChatMessageTime);
- }
-
- @Override
- protected void done(List result)
- {
- if (result != null && !result.isEmpty())
- {
- // Reset lastChatMessageTime if we have a newer message
- for (ChatMessage message : result)
- {
- if (message.getTime() > lastChatMessageTime)
- {
- lastChatMessageTime = message.getTime();
- }
- }
-
- // Reverse results to show them on the bottom
- Collections.reverse(result);
- messageList.addAll(result);
-
- ListAdapter chatAdapter = new ChatAdapter(getContext(), messageList);
- chatListView.setAdapter(chatAdapter);
- }
- }
-
- @Override
- protected void error(Throwable error) {
- // Stop the timer in case of an error, otherwise it may repeat the error message forever
- if (timer != null)
- {
- timer.cancel();
- timer = null;
- }
- super.error(error);
- }
- };
-
- task.execute();
- }
-}
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/util/BackgroundTask.java b/ultrasonic/src/main/java/org/moire/ultrasonic/util/BackgroundTask.java
deleted file mode 100644
index bf59e1c8..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/util/BackgroundTask.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see .
-
- Copyright 2009 (C) Sindre Mehus
- */
-package org.moire.ultrasonic.util;
-
-import android.app.Activity;
-import android.os.Handler;
-
-/**
- * @author Sindre Mehus
- */
-public abstract class BackgroundTask implements ProgressListener
-{
- private final Activity activity;
- private final Handler handler;
-
- public BackgroundTask(Activity activity)
- {
- this.activity = activity;
- handler = new Handler();
- }
-
- protected Activity getActivity()
- {
- return activity;
- }
-
- protected Handler getHandler()
- {
- return handler;
- }
-
- public abstract void execute();
-
- protected abstract T doInBackground() throws Throwable;
-
- protected abstract void done(T result);
-
- protected void error(Throwable error)
- {
- CommunicationError.handleError(error, activity);
- }
-
- protected String getErrorMessage(Throwable error)
- {
- return CommunicationError.getErrorMessage(error);
- }
-
- @Override
- public abstract void updateProgress(final String message);
-
- @Override
- public void updateProgress(int messageId)
- {
- updateProgress(activity.getResources().getString(messageId));
- }
-}
\ No newline at end of file
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/util/FragmentBackgroundTask.java b/ultrasonic/src/main/java/org/moire/ultrasonic/util/FragmentBackgroundTask.java
deleted file mode 100644
index 7625a8eb..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/util/FragmentBackgroundTask.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.moire.ultrasonic.util;
-
-import android.app.Activity;
-
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
-
-/**
- * @author Sindre Mehus
- * @version $Id$
- */
-public abstract class FragmentBackgroundTask extends BackgroundTask
-{
- private final boolean changeProgress;
- private final SwipeRefreshLayout swipe;
- private final CancellationToken cancel;
-
- public FragmentBackgroundTask(Activity activity, boolean changeProgress,
- SwipeRefreshLayout swipe, CancellationToken cancel)
- {
- super(activity);
- this.changeProgress = changeProgress;
- this.swipe = swipe;
- this.cancel = cancel;
- }
-
- @Override
- public void execute()
- {
- if (changeProgress)
- {
- if (swipe != null) swipe.setRefreshing(true);
- }
-
- new Thread()
- {
- @Override
- public void run()
- {
- try
- {
- final T result = doInBackground();
- if (cancel.isCancellationRequested())
- {
- return;
- }
-
- getHandler().post(new Runnable()
- {
- @Override
- public void run()
- {
- if (changeProgress)
- {
- if (swipe != null) swipe.setRefreshing(false);
- }
-
- done(result);
- }
- });
- }
- catch (final Throwable t)
- {
- if (cancel.isCancellationRequested())
- {
- return;
- }
- getHandler().post(new Runnable()
- {
- @Override
- public void run()
- {
- if (changeProgress)
- {
- if (swipe != null) swipe.setRefreshing(false);
- }
-
- error(t);
- }
- });
- }
- }
- }.start();
- }
-
- @Override
- public void updateProgress(final String message)
- {
- }
-}
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/util/LoadingTask.java b/ultrasonic/src/main/java/org/moire/ultrasonic/util/LoadingTask.java
deleted file mode 100644
index a2c25fa2..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/util/LoadingTask.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.moire.ultrasonic.util;
-
-import android.app.Activity;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
-
-/**
- * @author Sindre Mehus
- * @version $Id$
- */
-public abstract class LoadingTask extends BackgroundTask
-{
- private final SwipeRefreshLayout swipe;
- private final CancellationToken cancel;
-
- public LoadingTask(Activity activity, SwipeRefreshLayout swipe, CancellationToken cancel)
- {
- super(activity);
- this.swipe = swipe;
- this.cancel = cancel;
- }
-
-
- @Override
- public void execute()
- {
- swipe.setRefreshing(true);
-
- new Thread()
- {
- @Override
- public void run()
- {
- try
- {
- final T result = doInBackground();
- if (cancel.isCancellationRequested())
- {
- return;
- }
-
- getHandler().post(() -> {
- swipe.setRefreshing(false);
- done(result);
- });
- }
- catch (final Throwable t)
- {
- if (cancel.isCancellationRequested())
- {
- return;
- }
-
- getHandler().post(() -> {
- swipe.setRefreshing(false);
- error(t);
- });
- }
- }
- }.start();
- }
-
- @Override
- public void updateProgress(final String message)
- {
- }
-}
\ No newline at end of file
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/util/ProgressListener.java b/ultrasonic/src/main/java/org/moire/ultrasonic/util/ProgressListener.java
deleted file mode 100644
index 3b32a736..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/util/ProgressListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- This file is part of Subsonic.
-
- Subsonic is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Subsonic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Subsonic. If not, see .
-
- Copyright 2009 (C) Sindre Mehus
- */
-package org.moire.ultrasonic.util;
-
-/**
- * @author Sindre Mehus
- */
-public interface ProgressListener
-{
- void updateProgress(String message);
-
- void updateProgress(int messageId);
-}
diff --git a/ultrasonic/src/main/java/org/moire/ultrasonic/util/ShareDetails.java b/ultrasonic/src/main/java/org/moire/ultrasonic/util/ShareDetails.java
deleted file mode 100644
index 005df384..00000000
--- a/ultrasonic/src/main/java/org/moire/ultrasonic/util/ShareDetails.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.moire.ultrasonic.util;
-
-import org.moire.ultrasonic.domain.Track;
-
-import java.util.List;
-
-/**
- * Created by Josh on 12/17/13.
- */
-public class ShareDetails
-{
- public String Description;
- public boolean ShareOnServer;
- public long Expiration;
- public List