refactor MocKServer for test and some lint warnings (#102)
This commit is contained in:
parent
1b6753d119
commit
a14310bbfc
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,7 +3,6 @@ package com.h.pixeldroid
|
|||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.h.pixeldroid.R
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
|
|
@ -12,11 +12,11 @@ import android.widget.Button
|
|||
import android.widget.ImageView
|
||||
import com.h.pixeldroid.R
|
||||
|
||||
const val PICK_IMAGE_REQUEST = 1
|
||||
const val TAG = "Camera Fragment"
|
||||
|
||||
class CameraFragment : Fragment() {
|
||||
|
||||
private val PICK_IMAGE_REQUEST = 1
|
||||
private val TAG = "Camera Fragment"
|
||||
|
||||
private var uploadedPictureView: ImageView? = null
|
||||
|
||||
override fun onCreateView(
|
||||
|
|
|
@ -35,7 +35,7 @@ class MyProfileFragment : Fragment() {
|
|||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
preferences = this.activity!!.getSharedPreferences(
|
||||
preferences = this.requireActivity().getSharedPreferences(
|
||||
"${BuildConfig.APPLICATION_ID}.pref", Context.MODE_PRIVATE
|
||||
)
|
||||
val view = inflater.inflate(R.layout.fragment_my_profile, container, false)
|
||||
|
@ -47,7 +47,7 @@ class MyProfileFragment : Fragment() {
|
|||
// Set RecyclerView as a grid with 3 columns
|
||||
recycler = view.findViewById(R.id.myProfilePostsRecyclerView)
|
||||
recycler.layoutManager = GridLayoutManager(context, 3)
|
||||
adapter = ProfilePostsRecyclerViewAdapter(context!!)
|
||||
adapter = ProfilePostsRecyclerViewAdapter(requireContext())
|
||||
recycler.adapter = adapter
|
||||
|
||||
return view
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.bumptech.glide.Glide
|
|||
import com.h.pixeldroid.R
|
||||
import com.h.pixeldroid.objects.Status.Companion.POST_TAG
|
||||
import com.h.pixeldroid.objects.Status
|
||||
import com.h.pixeldroid.utils.ImageConverter
|
||||
import kotlinx.android.synthetic.main.post_fragment.view.*
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class ProfilePostsFragment : Fragment() {
|
|||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
val view = inflater.inflate(R.layout.fragment_profile_posts_list, container, false)
|
||||
preferences = activity!!.getSharedPreferences(
|
||||
preferences = requireActivity().getSharedPreferences(
|
||||
"${BuildConfig.APPLICATION_ID}.pref", Context.MODE_PRIVATE
|
||||
)
|
||||
pixelfedAPI = PixelfedAPI.create("${preferences.getString("domain", "")}")
|
||||
|
@ -49,7 +49,7 @@ class ProfilePostsFragment : Fragment() {
|
|||
columnCount <= 1 -> LinearLayoutManager(context)
|
||||
else -> GridLayoutManager(context, columnCount)
|
||||
}
|
||||
adapter = ProfilePostsRecyclerViewAdapter(context!!)
|
||||
adapter = ProfilePostsRecyclerViewAdapter(requireContext())
|
||||
}
|
||||
}
|
||||
return view
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.h.pixeldroid.BuildConfig
|
|||
import com.h.pixeldroid.R
|
||||
import com.h.pixeldroid.api.PixelfedAPI
|
||||
import com.h.pixeldroid.objects.FeedContent
|
||||
import kotlinx.android.synthetic.main.fragment_feed.*
|
||||
import kotlinx.android.synthetic.main.fragment_feed.view.*
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
|
@ -64,7 +63,7 @@ open class FeedFragment<T: FeedContent, VH: RecyclerView.ViewHolder?>: Fragment(
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
preferences = activity!!.getSharedPreferences(
|
||||
preferences = requireActivity().getSharedPreferences(
|
||||
"${BuildConfig.APPLICATION_ID}.pref", Context.MODE_PRIVATE
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.h.pixeldroid.fragments.feeds
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
|
Loading…
Reference in New Issue