Skip to content

Develop to Main. Implementation of all the basic functionality of the application. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5763aa2
Develop: Add adapter/main adapter/common
LebedevSergeyVach Apr 4, 2025
1177f88
Develop: Add data/GenreData.kt
LebedevSergeyVach Apr 4, 2025
9e5cf6b
Develop: Add ui/mapper ui/offset
LebedevSergeyVach Apr 4, 2025
e546729
Develop: Update res/mipmap/
LebedevSergeyVach Apr 4, 2025
6d42a3a
Develop: Update fragments/films/FilmsFragment.kt
LebedevSergeyVach Apr 4, 2025
f53c6e1
Develop: Update viewmodel/FilmsViewModel.kt
LebedevSergeyVach Apr 4, 2025
c801ce2
Develop: Add data/genre/
LebedevSergeyVach Apr 5, 2025
d9890db
Develop: Update res/anim/
LebedevSergeyVach Apr 5, 2025
4340b58
Develop: Add utils/extensions/DpToPxExtensions.kt
LebedevSergeyVach Apr 5, 2025
727cdc8
Develop: Update versions gradle & app/proguard-rules.pro
LebedevSergeyVach Apr 5, 2025
f84b755
Develop: Update res/layout/fragment_films.xml /res/layout/fragment_ro…
LebedevSergeyVach Apr 5, 2025
049b575
Develop: Update api/FilmsApi.kt & data/film/
LebedevSergeyVach Apr 5, 2025
a9de2e1
Develop: Update ui/mapper/MainScreenMapper.kt & ui/mapper/MainScreenM…
LebedevSergeyVach Apr 5, 2025
3b3499e
Develop: Update adapter/common/ & adapter/main/
LebedevSergeyVach Apr 5, 2025
38d77f9
Develop: Update viewmodel/FilmsState.kt & viewmodel/FilmsViewModel.kt
LebedevSergeyVach Apr 5, 2025
8429c52
Develop: Update repository/FilmsRepository.kt & repository/FilmsRepos…
LebedevSergeyVach Apr 5, 2025
85b3560
Develop: Update fragments/root/RootContainerFragment.kt & fragments/f…
LebedevSergeyVach Apr 5, 2025
d47054a
Develop: Add utils/extensions/ContextMaterialSnackbarExtensions.kt
LebedevSergeyVach Apr 6, 2025
de37b58
Develop: Update fragments/films/FilmsFragment.kt
LebedevSergeyVach Apr 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
defaultConfig {
applicationId = "com.sequenia"
minSdk = 26
compileSdk = 36
targetSdk = 36
versionCode = 1
versionName = "v1.0"

Expand Down Expand Up @@ -92,39 +92,27 @@ dependencies {
*
* https://developer.android.com/jetpack/androidx/releases/constraintlayout
* https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout
*
* implementation("androidx.constraintlayout:constraintlayout:2.2.1")
*/
implementation(libs.androidx.constraintlayout)

/**
* Serialization
*
* https://github.com/Kotlin/kotlinx.serialization
* https://kotlinlang.org/docs/serialization.html
*
* implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
*/
implementation(libs.kotlinx.serialization.json)

/**
* SplashScreen
*
* https://developer.android.com/reference/android/window/SplashScreen
* https://developer.android.com/reference/androidx/core/splashscreen/SplashScreen
* https://developer.android.com/develop/ui/views/launch/splash-screen
*
* https://github.com/patildnyaneshwar/SplashScreen
*
* implementation("androidx.core:core-splashscreen:1.0.1")
*/
implementation(libs.androidx.core.splashscreen)

/**
* Android Jetpack's Navigation component
*
* https://developer.android.com/guide/navigation
*
*/
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui)
Expand All @@ -148,7 +136,6 @@ dependencies {
* BlurTransformation glide-transformations
*
* https://github.com/bumptech/glide
* https://github.com/wasabeef/glide-transformations
*/
implementation(libs.glide)

Expand Down Expand Up @@ -179,11 +166,4 @@ dependencies {
implementation(libs.koin.android)
implementation(libs.koin.annotations)
ksp(libs.koin.ksp.compiler)

/**
* SwipeRefreshLayout
*
* https://developer.android.com/develop/ui/views/touch-and-input/swipe/add-swipe-interface
*/
implementation(libs.androidx.swiperefreshlayout)
}
128 changes: 127 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,130 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Основные правила для Android
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose

# Сохраняем аннотации (например, для Retrofit, Dagger и других библиотек)
-keepattributes *Annotation*
-keepattributes Signature
-keepattributes InnerClasses

# Сохраняем исходные имена файлов и номера строк для stack traces
-keepattributes SourceFile,LineNumberTable

# Сохраняем классы, которые используются в манифесте
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference

# Сохраняем View и их методы, чтобы они не были обфусцированы
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}

# Сохраняем классы, которые используются в ресурсах (например, в XML-макетах)
-keep class **.R$* {
public static final int *;
}

# Сохраняем классы, которые используются в нативных методах (JNI)
-keepclasseswithmembernames class * {
native <methods>;
}

# Сохраняем классы, которые используются в сериализации (например, Parcelable)
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Сохраняем классы, которые используются в Gson
-keep class com.google.gson.** { *; }
-keep class com.google.gson.stream.** { *; }
#-keep class * implements com.google.gson.TypeAdapterFactory
#-keep class * implements com.google.gson.JsonSerializer
#-keep class * implements com.google.gson.JsonDeserializer

# Сохраняем классы, которые используются в Retrofit
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep class okio.** { *; }

# Сохраняем классы, которые используются в Dagger
-keep class dagger.** { *; }
-keep class javax.inject.** { *; }
#-keep class * extends dagger.internal.Binding
#-keep class * extends dagger.internal.ModuleAdapter
#-keep class * extends dagger.internal.StaticInjection

# Сохраняем классы, которые используются в Coroutines
-keep class kotlinx.coroutines.** { *; }

# Сохраняем классы, которые используются в ViewModel
-keep class * extends androidx.lifecycle.ViewModel {
public <init>(...);
}

# Сохраняем классы, которые используются в LiveData
-keep class * extends androidx.lifecycle.LiveData {
public <init>(...);
}

# Сохраняем классы, которые используются в Navigation Component
-keep class * extends androidx.navigation.NavController {
public <init>(...);
}

# Сохраняем классы, которые используются в WorkManager
-keep class androidx.work.** { *; }

# Сохраняем классы, которые используются в Firebase
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }

# Сохраняем классы, которые используются в Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}

# Сохраняем классы, которые используются в Moshi
-keep class com.squareup.moshi.** { *; }
#-keep class * implements com.squareup.moshi.JsonAdapter$Factory

# Сохраняем классы, которые используются в Kotlin
-keep class kotlin.** { *; }
-keep class kotlinx.** { *; }

# Сохраняем классы, которые используются в вашем приложении
# (Замените com.eltex.androidschool на ваш пакет)
-keep class com.eltex.androidschool.** { *; }
-keep class com.eltex.androidschool.model.** { *; }
-keep class com.eltex.androidschool.viewmodel.** { *; }
-keep class com.eltex.androidschool.repository.** { *; }

# Сохраняем классы, которые используются в ресурсах (например, ButterKnife, DataBinding)
-keep class butterknife.** { *; }
-keep class **$$ViewBinder { *; }
-keep class **$$DataBinder { *; }

# Сохраняем классы, которые используются в ресурсах (например, для анимаций)
-keep class **.R$* {
public static final int *;
}
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 0 additions & 35 deletions app/src/main/java/com/sequenia/adapter/FilmAdapter.kt

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/java/com/sequenia/adapter/FilmItemCallback.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.sequenia.adapter
package com.sequenia.adapter.common.film

import android.graphics.drawable.Drawable
import androidx.recyclerview.widget.RecyclerView.ViewHolder

import androidx.recyclerview.widget.RecyclerView

import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource
Expand All @@ -12,14 +13,17 @@ import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target

import com.sequenia.R
import com.sequenia.data.FilmData
import com.sequenia.data.film.FilmData
import com.sequenia.databinding.CardFilmBinding

class FilmViewHolder(
private val binding: CardFilmBinding,
) : ViewHolder(binding.root) {
fun bindFilms(film: FilmData) {
) : RecyclerView.ViewHolder(binding.root) {
fun bind(film: FilmData) {
binding.textNameFilm.text = film.localizedName
binding.textNameFilm.minHeight = binding.textNameFilm.paint.fontMetricsInt.let { paint ->
paint.descent - paint.ascent + paint.leading
} * 2

renderingImageAttachmentPoster(film = film)
}
Expand Down Expand Up @@ -65,4 +69,4 @@ class FilmViewHolder(
})
.into(binding.imageFilmAttachment)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.sequenia.adapter.common.genre

import android.graphics.Color
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.sequenia.R
import com.sequenia.databinding.CardGenreBinding

class GenreViewHolder(
private val binding: CardGenreBinding,
) : RecyclerView.ViewHolder(binding.root) {

fun bind(textGenre: String, isSelected: Boolean) {
binding.itemHeaderSeparator.text = textGenre
binding.root.setBackgroundColor(
if (isSelected) {
ContextCompat.getColor(binding.root.context, R.color.background_card_genre)
} else {
Color.TRANSPARENT
}
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sequenia.adapter.common.header

import androidx.recyclerview.widget.RecyclerView
import com.sequenia.databinding.ItemHeaderSeparatorBinding

class HeaderViewHolder(
private val binding: ItemHeaderSeparatorBinding,
) : RecyclerView.ViewHolder(binding.root) {

fun bind(textHeader: String) {
binding.itemHeaderSeparator.text = textHeader
}
}
Loading