Remove imports and make CameraActivity inherit from BaseActivity

This commit is contained in:
Matthieu 2020-12-16 21:50:27 +01:00
parent 1d4af5bffe
commit 9980d651d2
12 changed files with 2 additions and 29 deletions

View File

@ -2,7 +2,6 @@ package com.h.pixeldroid
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_about.*
class AboutActivity : BaseActivity() {

View File

@ -4,7 +4,6 @@ import android.content.Context
import android.content.res.Configuration
import android.content.res.Resources
import android.os.Build
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceManager
import java.util.*
@ -34,7 +33,7 @@ open class BaseActivity : AppCompatActivity() {
.apply { setLocale(locale) }
)
@SuppressWarnings("deprecation")
@Suppress("DEPRECATION")
private fun updateResourcesLocaleLegacy(context: Context, locale: Locale): Context {
val resources: Resources = context.resources
val configuration: Configuration = resources.configuration

View File

@ -1,10 +1,9 @@
package com.h.pixeldroid
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.h.pixeldroid.fragments.CameraFragment
class CameraActivity : AppCompatActivity() {
class CameraActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_camera)

View File

@ -1,7 +1,6 @@
package com.h.pixeldroid
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.h.pixeldroid.db.AppDatabase
import com.h.pixeldroid.fragments.feeds.uncachedFeeds.accountLists.AccountListFragment
import com.h.pixeldroid.objects.Account

View File

@ -1,7 +1,6 @@
package com.h.pixeldroid
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_licenses.*

View File

@ -10,7 +10,6 @@ import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity
import androidx.browser.customtabs.CustomTabsIntent
import com.h.pixeldroid.api.PixelfedAPI
import com.h.pixeldroid.db.AppDatabase

View File

@ -21,7 +21,6 @@ import android.view.MenuItem
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.net.toFile

View File

@ -3,8 +3,6 @@ package com.h.pixeldroid
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.h.pixeldroid.api.PixelfedAPI
import com.h.pixeldroid.db.AppDatabase
import com.h.pixeldroid.di.PixelfedAPIHolder
import com.h.pixeldroid.fragments.PostFragment
@ -13,7 +11,6 @@ import com.h.pixeldroid.objects.Status
import com.h.pixeldroid.objects.Status.Companion.DISCOVER_TAG
import com.h.pixeldroid.objects.Status.Companion.DOMAIN_TAG
import com.h.pixeldroid.objects.Status.Companion.POST_TAG
import com.h.pixeldroid.utils.DBUtils
import kotlinx.android.synthetic.main.activity_post.*
import retrofit2.Call
import retrofit2.Callback

View File

@ -11,7 +11,6 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.net.toFile
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView

View File

@ -8,7 +8,6 @@ import android.util.Log
import android.view.View
import android.widget.*
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager

View File

@ -1,6 +1,5 @@
package com.h.pixeldroid
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.View

View File

@ -4,7 +4,6 @@ import android.app.SearchManager
import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
@ -99,18 +98,5 @@ class SearchActivity : BaseActivity() {
}
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
if (intent.action == Intent.ACTION_SEARCH) {
intent.getStringExtra(SearchManager.QUERY)?.also { query ->
search(query)
}
}
}
private fun search(query: String){
Log.e("search", "")
}
}