Skip to content

Commit

Permalink
android: cleanup unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Dec 4, 2024
1 parent 342d61b commit e731775
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 68 deletions.
5 changes: 1 addition & 4 deletions android/app/src/main/java/su/xash/engine/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -35,4 +32,4 @@ class MainActivity : AppCompatActivity() {
override fun onSupportNavigateUp(): Boolean {
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
}
}
}
2 changes: 0 additions & 2 deletions android/app/src/main/java/su/xash/engine/XashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,4 +28,4 @@ class AppSettingsFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -72,4 +61,4 @@ class GameSettingsFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -38,4 +37,4 @@ class GameSettingsPreferenceFragment(val game: Game) : PreferenceFragmentCompat(
true
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,4 +22,4 @@ class SetupViewModel(application: Application) : AndroidViewModel(application) {
fun setPageNumber(pos: Int) {
_pageNumber.value = pos
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -59,4 +56,4 @@ class LocationPageFragment : Fragment() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -35,4 +32,4 @@ class WelcomePageFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit e731775

Please sign in to comment.