From 9980d651d2e477afe29ffb9af005a701d11e825d Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Wed, 16 Dec 2020 21:50:27 +0100 Subject: [PATCH] Remove imports and make CameraActivity inherit from BaseActivity --- .../main/java/com/h/pixeldroid/AboutActivity.kt | 1 - app/src/main/java/com/h/pixeldroid/BaseActivity.kt | 3 +-- .../main/java/com/h/pixeldroid/CameraActivity.kt | 3 +-- .../main/java/com/h/pixeldroid/FollowsActivity.kt | 1 - .../main/java/com/h/pixeldroid/LicenseActivity.kt | 1 - .../main/java/com/h/pixeldroid/LoginActivity.kt | 1 - .../java/com/h/pixeldroid/PhotoEditActivity.kt | 1 - app/src/main/java/com/h/pixeldroid/PostActivity.kt | 3 --- .../java/com/h/pixeldroid/PostCreationActivity.kt | 1 - .../main/java/com/h/pixeldroid/ProfileActivity.kt | 1 - .../main/java/com/h/pixeldroid/ReportActivity.kt | 1 - .../main/java/com/h/pixeldroid/SearchActivity.kt | 14 -------------- 12 files changed, 2 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/h/pixeldroid/AboutActivity.kt b/app/src/main/java/com/h/pixeldroid/AboutActivity.kt index 6892d463..3ad0cd1e 100644 --- a/app/src/main/java/com/h/pixeldroid/AboutActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/AboutActivity.kt @@ -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() { diff --git a/app/src/main/java/com/h/pixeldroid/BaseActivity.kt b/app/src/main/java/com/h/pixeldroid/BaseActivity.kt index 7d03c2d6..3c6367d2 100644 --- a/app/src/main/java/com/h/pixeldroid/BaseActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/BaseActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/CameraActivity.kt b/app/src/main/java/com/h/pixeldroid/CameraActivity.kt index 027aae4c..fd12ece6 100644 --- a/app/src/main/java/com/h/pixeldroid/CameraActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/CameraActivity.kt @@ -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) diff --git a/app/src/main/java/com/h/pixeldroid/FollowsActivity.kt b/app/src/main/java/com/h/pixeldroid/FollowsActivity.kt index b12a5fc4..83246673 100644 --- a/app/src/main/java/com/h/pixeldroid/FollowsActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/FollowsActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/LicenseActivity.kt b/app/src/main/java/com/h/pixeldroid/LicenseActivity.kt index ead11b16..58c9d967 100644 --- a/app/src/main/java/com/h/pixeldroid/LicenseActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/LicenseActivity.kt @@ -1,7 +1,6 @@ package com.h.pixeldroid import android.os.Bundle -import androidx.appcompat.app.AppCompatActivity import kotlinx.android.synthetic.main.activity_licenses.* diff --git a/app/src/main/java/com/h/pixeldroid/LoginActivity.kt b/app/src/main/java/com/h/pixeldroid/LoginActivity.kt index f5d17ac2..defc0b42 100644 --- a/app/src/main/java/com/h/pixeldroid/LoginActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/LoginActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/PhotoEditActivity.kt b/app/src/main/java/com/h/pixeldroid/PhotoEditActivity.kt index 2d1d4834..c325f6ea 100644 --- a/app/src/main/java/com/h/pixeldroid/PhotoEditActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/PhotoEditActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/PostActivity.kt b/app/src/main/java/com/h/pixeldroid/PostActivity.kt index 8a209c93..c29eee49 100644 --- a/app/src/main/java/com/h/pixeldroid/PostActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/PostActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/PostCreationActivity.kt b/app/src/main/java/com/h/pixeldroid/PostCreationActivity.kt index c2a2d216..379fd5f3 100644 --- a/app/src/main/java/com/h/pixeldroid/PostCreationActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/PostCreationActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/ProfileActivity.kt b/app/src/main/java/com/h/pixeldroid/ProfileActivity.kt index ec8d4922..7d361cc2 100644 --- a/app/src/main/java/com/h/pixeldroid/ProfileActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/ProfileActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/ReportActivity.kt b/app/src/main/java/com/h/pixeldroid/ReportActivity.kt index ae66bcb7..04132a92 100644 --- a/app/src/main/java/com/h/pixeldroid/ReportActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/ReportActivity.kt @@ -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 diff --git a/app/src/main/java/com/h/pixeldroid/SearchActivity.kt b/app/src/main/java/com/h/pixeldroid/SearchActivity.kt index 99bb7e11..db66c9c9 100644 --- a/app/src/main/java/com/h/pixeldroid/SearchActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/SearchActivity.kt @@ -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", "") - } }