From 94c5abecc31d4802239586583074f9f39dc6398f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 2 Jul 2022 18:23:24 +0200 Subject: [PATCH] cleanup --- app/src/main/AndroidManifest.xml | 2 +- .../libretube/activities/MainActivity.kt | 2 +- .../libretube/{util => activities}/Player.kt | 2 +- .../libretube/adapters/PlaylistAdapter.kt | 2 +- .../libretube/adapters/PlaylistsAdapter.kt | 2 +- .../adapters/SearchHistoryAdapter.kt | 5 +- .../adapters/SearchSuggestionsAdapter.kt | 3 +- .../libretube/adapters/SubscriptionAdapter.kt | 3 +- .../adapters/SubscriptionChannelAdapter.kt | 5 +- .../libretube/adapters/WatchHistoryAdapter.kt | 3 +- .../libretube/dialogs/AddtoPlaylistDialog.kt | 2 +- .../libretube/dialogs/CreatePlaylistDialog.kt | 2 +- .../libretube/dialogs/CustomInstanceDialog.kt | 2 +- .../libretube/dialogs/DeleteAccountDialog.kt | 2 +- .../github/libretube/dialogs/LoginDialog.kt | 2 +- .../github/libretube/dialogs/LogoutDialog.kt | 2 +- .../dialogs/PlaylistOptionsDialog.kt | 2 +- .../github/libretube/dialogs/ShareDialog.kt | 2 +- .../libretube/dialogs/VideoOptionsDialog.kt | 2 +- .../libretube/fragments/ChannelFragment.kt | 2 +- .../libretube/fragments/HomeFragment.kt | 2 +- .../libretube/fragments/LibraryFragment.kt | 2 +- .../libretube/fragments/PlayerFragment.kt | 2 +- .../libretube/fragments/PlaylistFragment.kt | 2 +- .../libretube/fragments/SearchFragment.kt | 2 +- .../fragments/SubscriptionsFragment.kt | 2 +- .../fragments/WatchHistoryFragment.kt | 2 +- .../libretube/preferences/AdvancedSettings.kt | 1 - .../libretube/preferences/InstanceSettings.kt | 1 - .../{util => preferences}/PreferenceHelper.kt | 2 +- .../libretube/services/DownloadService.kt | 2 +- .../github/libretube/util/BackgroundMode.kt | 1 + .../com/github/libretube/util/LocaleHelper.kt | 1 + .../github/libretube/util/ResettableLazy.kt | 6 +-- .../github/libretube/util/RetrofitInstance.kt | 2 - .../com/github/libretube/util/ThemeHelper.kt | 1 + .../{util => views}/CustomExoPlayerView.kt | 2 +- .../{util => views}/CustomSwipeToRefresh.kt | 2 +- .../SingleViewTouchableMotionLayout.kt | 2 +- app/src/main/res/layout/activity_player.xml | 4 +- app/src/main/res/layout/fragment_channel.xml | 4 +- app/src/main/res/layout/fragment_library.xml | 4 +- app/src/main/res/layout/fragment_player.xml | 6 +-- .../res/layout/fragment_subscriptions.xml | 4 +- .../res/layout/fragment_watch_history.xml | 52 +++++++++---------- 45 files changed, 82 insertions(+), 78 deletions(-) rename app/src/main/java/com/github/libretube/{util => activities}/Player.kt (90%) rename app/src/main/java/com/github/libretube/{util => preferences}/PreferenceHelper.kt (99%) rename app/src/main/java/com/github/libretube/{util => views}/CustomExoPlayerView.kt (96%) rename app/src/main/java/com/github/libretube/{util => views}/CustomSwipeToRefresh.kt (96%) rename app/src/main/java/com/github/libretube/{util => views}/SingleViewTouchableMotionLayout.kt (99%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a548dad46..dbc40491c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,7 +22,7 @@ android:supportsRtl="true" android:theme="@style/Theme.Purple"> () + private val managedDelegates = LinkedList() fun register(managed: Resettable) { synchronized(managedDelegates) { @@ -38,7 +38,7 @@ class ResettableLazy(val manager: ResettableLazyManager, val init: () lazyHolder = makeInitBlock() } - fun makeInitBlock(): Lazy { + private fun makeInitBlock(): Lazy { return lazy { manager.register(this) init() diff --git a/app/src/main/java/com/github/libretube/util/RetrofitInstance.kt b/app/src/main/java/com/github/libretube/util/RetrofitInstance.kt index ebc6b9f7c..713d1671c 100644 --- a/app/src/main/java/com/github/libretube/util/RetrofitInstance.kt +++ b/app/src/main/java/com/github/libretube/util/RetrofitInstance.kt @@ -1,7 +1,5 @@ package com.github.libretube.util -import com.github.libretube.resettableLazy -import com.github.libretube.resettableManager import retrofit2.Retrofit import retrofit2.converter.jackson.JacksonConverterFactory diff --git a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt b/app/src/main/java/com/github/libretube/util/ThemeHelper.kt index 3fb5cd385..af3fd368b 100644 --- a/app/src/main/java/com/github/libretube/util/ThemeHelper.kt +++ b/app/src/main/java/com/github/libretube/util/ThemeHelper.kt @@ -8,6 +8,7 @@ import android.content.pm.PackageManager import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import com.github.libretube.R +import com.github.libretube.preferences.PreferenceHelper object ThemeHelper { diff --git a/app/src/main/java/com/github/libretube/util/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt similarity index 96% rename from app/src/main/java/com/github/libretube/util/CustomExoPlayerView.kt rename to app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt index acb87ce11..a3886f8ce 100644 --- a/app/src/main/java/com/github/libretube/util/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/views/CustomExoPlayerView.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.views import android.annotation.SuppressLint import android.content.Context diff --git a/app/src/main/java/com/github/libretube/util/CustomSwipeToRefresh.kt b/app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt similarity index 96% rename from app/src/main/java/com/github/libretube/util/CustomSwipeToRefresh.kt rename to app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt index b71f587e3..87ee39d51 100644 --- a/app/src/main/java/com/github/libretube/util/CustomSwipeToRefresh.kt +++ b/app/src/main/java/com/github/libretube/views/CustomSwipeToRefresh.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.views import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/github/libretube/util/SingleViewTouchableMotionLayout.kt b/app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt similarity index 99% rename from app/src/main/java/com/github/libretube/util/SingleViewTouchableMotionLayout.kt rename to app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt index 8ec436fd0..9eb3060bb 100644 --- a/app/src/main/java/com/github/libretube/util/SingleViewTouchableMotionLayout.kt +++ b/app/src/main/java/com/github/libretube/views/SingleViewTouchableMotionLayout.kt @@ -1,4 +1,4 @@ -package com.github.libretube.util +package com.github.libretube.views import android.content.Context import android.graphics.Rect diff --git a/app/src/main/res/layout/activity_player.xml b/app/src/main/res/layout/activity_player.xml index c9851ab3f..8075249cf 100644 --- a/app/src/main/res/layout/activity_player.xml +++ b/app/src/main/res/layout/activity_player.xml @@ -4,9 +4,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" - tools:context=".util.Player"> + tools:context=".activities.Player"> - - - + diff --git a/app/src/main/res/layout/fragment_library.xml b/app/src/main/res/layout/fragment_library.xml index f79dff1e7..fe0f24e73 100644 --- a/app/src/main/res/layout/fragment_library.xml +++ b/app/src/main/res/layout/fragment_library.xml @@ -33,7 +33,7 @@ android:textStyle="bold" /> - @@ -88,7 +88,7 @@ - + - - - + diff --git a/app/src/main/res/layout/fragment_subscriptions.xml b/app/src/main/res/layout/fragment_subscriptions.xml index fc0ba8155..0082a2a97 100644 --- a/app/src/main/res/layout/fragment_subscriptions.xml +++ b/app/src/main/res/layout/fragment_subscriptions.xml @@ -39,7 +39,7 @@ android:textStyle="bold" /> - @@ -101,5 +101,5 @@ - + diff --git a/app/src/main/res/layout/fragment_watch_history.xml b/app/src/main/res/layout/fragment_watch_history.xml index daefe3a64..3e522b29d 100644 --- a/app/src/main/res/layout/fragment_watch_history.xml +++ b/app/src/main/res/layout/fragment_watch_history.xml @@ -6,37 +6,37 @@ + android:orientation="vertical"> - - - + android:layout_marginBottom="8dp" + android:paddingHorizontal="8dp"> - + - + - + + +