Skip to content

KacperL98/New_Marvel_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marvel-studios-1420x670

MarvelApp

Hello👋

The project was created using Marvel API.

🔨 In the application I used:

✅Retrofit

✅Picasso

✅ViewBinding

✅Kotlin Coroutines

✅Hilt

✅Architecture Components (LiveData, ViewModel)

API size images ⚠️

APi returns images of different sizes, so in the end I decided to manually set the height and width of the images on the first screen. I also checked the views on different emulators and it looked ok. I know this is not entirely correct. It didn't look good with match_parent and wrap_content. ✋

First of all, I focused on the quality of the code. I divided the code into smaller parts and tried to keep the clean code rules.

I wanted to take care of details such as:

  • The function to hide the keyboard when the user is scrolling the list
    fun Fragment.hideKeyboard() {
    val inputMethodManager =
        requireContext().getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
    var view = requireActivity().currentFocus
    if (view == null) {
        view = View(requireContext())
    }

    inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
    }
    private fun closeKeyboardAfterScroll() {
        binding.listOfHeroesRV.addOnScrollListener(object : RecyclerView.OnScrollListener() {
            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
                if (dy > 20) {
                    hideKeyboard()
                }
                super.onScrolled(recyclerView, dx, dy)
            }
        })
    }
  • After clicking on the text field, the bottom navigation bar does not appear above the keyboard. I added this line to the Android Manifest
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
  • The description of comic books was often very long, so I limited its display on the home screen to 5 lines, and the creators to 1 line. In the comic details, I added a ScrollView and an extendable screen. Above the button, the starting text is transparent. bottom sheet behavior:
    private fun extendableView() {
        BottomSheetBehavior.from(binding.sheetShape).apply {
            peekHeight = 600
            this.state = BottomSheetBehavior.STATE_COLLAPSED
        }
    }

GIF's 💡

ezgif com-gif-maker (5)

ezgif com-gif-maker (6)

ezgif com-gif-maker (7)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages