android: cleanup unused imports

This commit is contained in:
Alibek Omarov 2024-12-04 16:27:53 +03:00
parent 342d61b283
commit e731775f70
12 changed files with 9 additions and 68 deletions

View file

@ -1,15 +1,12 @@
package su.xash.engine
import android.os.Bundle
import android.os.PersistableBundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import su.xash.engine.databinding.ActivityMainBinding
class MainActivity : AppCompatActivity() {
@ -35,4 +32,4 @@ class MainActivity : AppCompatActivity() {
override fun onSupportNavigateUp(): Boolean {
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
}
}
}

View file

@ -3,13 +3,11 @@ package su.xash.engine;
import android.annotation.SuppressLint;
import android.content.pm.ActivityInfo;
import android.content.res.AssetManager;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings.Secure;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import org.libsdl.app.SDLActivity;

View file

@ -12,7 +12,6 @@ import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsProvider;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

View file

@ -5,13 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.navigation.fragment.findNavController
import su.xash.engine.R
import su.xash.engine.adapters.GameAdapter
import su.xash.engine.databinding.FragmentAppSettingsBinding
import su.xash.engine.databinding.FragmentGameSettingsBinding
import su.xash.engine.databinding.FragmentLibraryBinding
class AppSettingsFragment : Fragment() {
private var _binding: FragmentAppSettingsBinding? = null
@ -34,4 +28,4 @@ class AppSettingsFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}

View file

@ -1,16 +1,12 @@
package su.xash.engine.ui.settings
import android.os.Bundle
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import su.xash.engine.BuildConfig
import su.xash.engine.R
import su.xash.engine.model.Game
class AppSettingsPreferenceFragment() : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
preferenceManager.sharedPreferencesName = "app_preferences";
setPreferencesFromResource(R.xml.app_preferences, rootKey);
}
}
}

View file

@ -1,23 +1,12 @@
package su.xash.engine.ui.settings
import android.content.Intent
import android.os.Bundle
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 androidx.core.view.MenuProvider
import androidx.core.view.get
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.viewModelScope
import androidx.navigation.fragment.findNavController
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import su.xash.engine.R
import su.xash.engine.databinding.FragmentGameSettingsBinding
import su.xash.engine.ui.library.LibraryViewModel
@ -72,4 +61,4 @@ class GameSettingsFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}

View file

@ -4,7 +4,6 @@ import android.os.Bundle
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import su.xash.engine.BuildConfig
import su.xash.engine.R
import su.xash.engine.model.Game
@ -38,4 +37,4 @@ class GameSettingsPreferenceFragment(val game: Game) : PreferenceFragmentCompat(
true
}
}
}
}

View file

@ -1,31 +1,15 @@
package su.xash.engine.ui.setup
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.activity.result.contract.ActivityResultContracts
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import androidx.viewbinding.ViewBinding
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import androidx.work.Data
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import su.xash.engine.R
import su.xash.engine.databinding.FragmentLibraryBinding
import su.xash.engine.databinding.FragmentSetupBinding
import su.xash.engine.databinding.PageLocationBinding
import su.xash.engine.databinding.PageWelcomeBinding
import su.xash.engine.ui.library.LibraryViewModel
import su.xash.engine.ui.setup.pages.LocationPageFragment
import su.xash.engine.ui.setup.pages.WelcomePageFragment
import su.xash.engine.workers.FileCopyWorker
class SetupFragment : Fragment() {
private var _binding: FragmentSetupBinding? = null
@ -61,4 +45,4 @@ class SetupPageAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
val pages = listOf(WelcomePageFragment(), LocationPageFragment())
override fun getItemCount(): Int = 2
override fun createFragment(position: Int): Fragment = pages[position]
}
}

View file

@ -6,12 +6,8 @@ import androidx.documentfile.provider.DocumentFile
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.work.Data
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import su.xash.engine.MainApplication
import su.xash.engine.model.Game
import su.xash.engine.workers.FileCopyWorker
class SetupViewModel(application: Application) : AndroidViewModel(application) {
val pageNumber: LiveData<Int> get() = _pageNumber
@ -26,4 +22,4 @@ class SetupViewModel(application: Application) : AndroidViewModel(application) {
fun setPageNumber(pos: Int) {
_pageNumber.value = pos
}
}
}

View file

@ -9,13 +9,10 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import androidx.viewbinding.ViewBinding
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import su.xash.engine.R
import su.xash.engine.databinding.PageLocationBinding
import su.xash.engine.databinding.PageWelcomeBinding
import su.xash.engine.ui.library.LibraryViewModel
import su.xash.engine.ui.setup.SetupFragment
import su.xash.engine.ui.setup.SetupViewModel
class LocationPageFragment : Fragment() {
@ -59,4 +56,4 @@ class LocationPageFragment : Fragment() {
}
}
}
}
}

View file

@ -6,10 +6,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.viewbinding.ViewBinding
import su.xash.engine.databinding.PageLocationBinding
import su.xash.engine.databinding.PageWelcomeBinding
import su.xash.engine.ui.setup.SetupFragment
import su.xash.engine.ui.setup.SetupViewModel
class WelcomePageFragment : Fragment() {
@ -35,4 +32,4 @@ class WelcomePageFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}

View file

@ -2,17 +2,12 @@ package su.xash.engine.workers
import android.content.Context
import android.net.Uri
import android.provider.DocumentsContract
import android.util.Log
import androidx.documentfile.provider.DocumentFile
import androidx.work.CoroutineWorker
import androidx.work.Worker
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import su.xash.engine.model.Game
import java.io.FileInputStream
const val KEY_FILE_URI = "KEY_FILE_URI"