Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
finishing
Browse files Browse the repository at this point in the history
  • Loading branch information
spookynova committed Aug 8, 2023
1 parent cacb706 commit ad9b302
Show file tree
Hide file tree
Showing 28 changed files with 839 additions and 188 deletions.
11 changes: 10 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ android {

buildTypes {
release {
minifyEnabled true
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
multiDexEnabled true
}
}
compileOptions {
Expand Down Expand Up @@ -52,7 +59,9 @@ dependencies {
implementation 'com.scwang.wave:MultiWaveHeader:1.0.0'
implementation 'com.github.todou:nestrefresh:0.0.8'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

implementation 'com.jcodecraeer:xrecyclerview:1.6.0'
implementation 'nl.bryanderidder:themed-toggle-button-group:1.4.1'
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'me.relex:circleindicator:2.1.6'
implementation 'org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.1.0'
Expand Down
60 changes: 39 additions & 21 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# General configuration
-dontwarn com.squareup.okhttp.**
-dontwarn okhttp3.**
-dontwarn okio.**

# Optimization options
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose

# Obfuscation options
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keepattributes Signature
-keepattributes *Annotation*
-keepparameternames
-keep class **.R
-keepclassmembers class **.R$* {
public static <fields>;
}


# Keep Android specific classes and methods
-keep class android.support.** { *; }
-keep interface android.support.** { *; }
-keep class androidx.annotation.** { *; }
-keep class androidx.appcompat.widget.** { *; }
-keep class androidx.lifecycle.** { *; }

# Keep specific libraries (adjust as needed)
-keep class com.google.gson.** { *; }
-keep class org.json.** { *; }


# Keep your model classes and fields (adjust as needed)
-keep class id.blossom.data.model.** { *; }

4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Expand All @@ -20,6 +19,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.Blossom"
tools:targetApi="31">
<activity
android:name=".ui.activity.showall.ShowAllAnimeActivity"
android:exported="false" />
<activity
android:name=".ui.activity.stream.StreamAnimeActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import id.blossom.di.ActivityScope
import id.blossom.di.module.ActivityModule
import id.blossom.ui.activity.detail.DetailAnimeActivity
import id.blossom.ui.activity.genres.GenresResultActivity
import id.blossom.ui.activity.showall.ShowAllAnimeActivity
import id.blossom.ui.activity.stream.StreamAnimeActivity
import id.blossom.ui.fragment.favorite.FavoriteFragment
import id.blossom.ui.fragment.home.HomeFragment
Expand All @@ -20,6 +21,7 @@ interface ActivityComponent {
fun inject(activity: DetailAnimeActivity)
fun inject(activity: GenresResultActivity)
fun inject(activity: StreamAnimeActivity)
fun inject(activity: ShowAllAnimeActivity)

// Add the inject function for each fragment
fun inject(fragment: HomeFragment)
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/id/blossom/di/module/ActivityModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import id.blossom.ui.activity.detail.DetailAnimeViewModel
import id.blossom.ui.activity.detail.adapter.EpisodeAnimeListAdapter
import id.blossom.ui.activity.genres.GenresResultViewModel
import id.blossom.ui.activity.genres.adapter.GenresResultAdapter
import id.blossom.ui.activity.showall.ShowAllAnimeViewModel
import id.blossom.ui.activity.showall.adapter.ShowAllOngoingAnimeAdapter
import id.blossom.ui.activity.showall.adapter.ShowAllRecentAnimeAdapter
import id.blossom.ui.activity.stream.StreamAnimeViewModel
import id.blossom.ui.base.ViewModelProviderFactory
import id.blossom.ui.fragment.favorite.FavoriteViewModel
Expand Down Expand Up @@ -100,6 +103,13 @@ class ActivityModule(private val activity: AppCompatActivity) {
})[SettingsViewModel::class.java]
}

@Provides
fun provideShowAllAnimeViewModel(animeRepository: AnimeRepository): ShowAllAnimeViewModel {
return ViewModelProvider(activity,
ViewModelProviderFactory(ShowAllAnimeViewModel::class) {
ShowAllAnimeViewModel(animeRepository)
})[ShowAllAnimeViewModel::class.java]
}
@Provides
fun provideRecentAnimeAdapter() = RecentAnimeAdapter(ArrayList())

Expand All @@ -124,4 +134,10 @@ class ActivityModule(private val activity: AppCompatActivity) {
@Provides
fun provideFavoriteAnimeAdapter() = FavoriteAnimeAdapter(ArrayList())

@Provides
fun provideShowAllRecentAnimeAdapter() = ShowAllRecentAnimeAdapter(ArrayList())

@Provides
fun provideShowAllOnGoingAnimeAdapter() = ShowAllOngoingAnimeAdapter(ArrayList())

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.jcodecraeer.xrecyclerview.XRecyclerView
import id.blossom.BlossomApp
import id.blossom.data.model.anime.genres.result.PropertyGenresAnimeDataItem
import id.blossom.databinding.ActivityGenresResultBinding
Expand All @@ -32,6 +33,8 @@ class GenresResultActivity : AppCompatActivity() {
@Inject
lateinit var genresResultAdapter: GenresResultAdapter

private var page = 1

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityGenresResultBinding.inflate(layoutInflater)
Expand All @@ -56,10 +59,21 @@ class GenresResultActivity : AppCompatActivity() {
Toast.makeText(this, "Genre Id is null", Toast.LENGTH_LONG).show()
}

binding.animeSearchRv.adapter = genresResultAdapter
binding.animeSearchRv.layoutManager =
binding.animeResultGenreRv.adapter = genresResultAdapter
binding.animeResultGenreRv.layoutManager =
StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
binding.animeResultGenreRv.setLoadingListener(object : XRecyclerView.LoadingListener {
override fun onRefresh() {
page = 1
//genresResultViewModel.fetchGenresResultAnime(genreId.toString())
}

override fun onLoadMore() {
page++
//scheduleViewModel.fetchScheduleAnime(page, queryDays.toString())
}

})
}

private fun setupObserver() {
Expand Down
Loading

0 comments on commit ad9b302

Please # to comment.