Skip to content

Commit

Permalink
fixed indents in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLordPouya committed Jul 11, 2019
1 parent edd9652 commit 2857ddb
Show file tree
Hide file tree
Showing 34 changed files with 326 additions and 202 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

ext{
ext {
//Important library versions :
rxjava_Version = "2.2.9"
lifecycle_version = "2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package ir.heydarii.musicmanager.base

import androidx.appcompat.app.AppCompatActivity

open class BaseActivity : AppCompatActivity() {
}
open class BaseActivity : AppCompatActivity()
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package ir.heydarii.musicmanager.base

import androidx.fragment.app.Fragment

open class BaseFragment : Fragment() {
}
open class BaseFragment : Fragment()
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import retrofit2.Retrofit
import javax.inject.Singleton

@Singleton
@Component(modules = [RetrofitModule::class,RoomModule::class])
@Component(modules = [RetrofitModule::class, RoomModule::class])
interface RetrofitComponent {

fun getRetrofit(): Retrofit
Expand All @@ -17,6 +17,6 @@ interface RetrofitComponent {

fun getAppDataBase(): AppDatabase

fun getAlbumsDAO () : AlbumsDAO
fun getAlbumsDAO(): AlbumsDAO

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class RetrofitModule {
@Singleton
@Provides
fun provideRetrofit(
converter: GsonConverterFactory,
httpClient: OkHttpClient.Builder,
@Named("baseURL") baseURL: String
converter: GsonConverterFactory,
httpClient: OkHttpClient.Builder,
@Named("baseURL") baseURL: String
): Retrofit {
val retrofitClass = RetrofitServiceGenerator(converter, httpClient, baseURL)
return retrofitClass.getClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import kotlinx.android.synthetic.main.album_details_main_layout.*

class AlbumDetailsActivity : BaseActivity() {

lateinit var viewModel: AlbumDetailsViewModel
private lateinit var viewModel: AlbumDetailsViewModel

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class AlbumDetailsViewModel : BaseViewModel() {
private var isAlbumSaved = false



/**
* Gets the album data
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class SavedAlbumsFragment : BaseFragment() {
private fun setUpRecycler() {
adapter = SavedAlbumsAdapter(emptyList()) { artistName: String, albumName: String ->
savedAlbumsClickListener(
artistName,
albumName
artistName,
albumName
)
}
recycler.adapter = adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class SavedAlbumsViewModel : BaseViewModel() {
fun getAllAlbums() {
composite.add(
dataRepository.getAllSavedAlbums()
.subscribe({
albumsList.value = it
}, {
Logger.d(it)
//TODO : Handle the error
})
.subscribe({
albumsList.value = it
}, {
Logger.d(it)
//TODO : Handle the error
})
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ir.heydarii.musicmanager.base.BaseViewModel
import ir.heydarii.musicmanager.base.di.DaggerDataRepositoryComponent
import ir.heydarii.musicmanager.pojos.ArtistResponseModel
import ir.heydarii.musicmanager.repository.DataRepository
import ir.heydarii.musicmanager.utils.Consts
import ir.heydarii.musicmanager.utils.ViewNotifierEnums

class SearchArtistViewModel : BaseViewModel() {
Expand All @@ -30,15 +29,15 @@ class SearchArtistViewModel : BaseViewModel() {
composite.clear()

composite.add(dataRepository.getArtistName(artistName, page, apiKey)
.subscribe({
artistResponse.value = it
viewNotifier.value = ViewNotifierEnums.HIDE_LOADING
}, {

viewNotifier.value = ViewNotifierEnums.HIDE_LOADING
Logger.d(it.message)
//TODO : Add error handling
})
.subscribe({
artistResponse.value = it
viewNotifier.value = ViewNotifierEnums.HIDE_LOADING
}, {

viewNotifier.value = ViewNotifierEnums.HIDE_LOADING
Logger.d(it.message)
//TODO : Add error handling
})
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import ir.heydarii.musicmanager.features.albumdetails.AlbumDetailsActivity
import ir.heydarii.musicmanager.pojos.ArtistTopAlbumsResponseModel
import ir.heydarii.musicmanager.utils.Consts
import ir.heydarii.musicmanager.utils.Consts.Companion.ALBUM_NAME
import ir.heydarii.musicmanager.utils.Consts.Companion.ARTIST_ID
import ir.heydarii.musicmanager.utils.Consts.Companion.ARTIST_NAME
import ir.heydarii.musicmanager.utils.ViewNotifierEnums
import kotlinx.android.synthetic.main.activity_top_albums.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@ package ir.heydarii.musicmanager.pojos
import com.google.gson.annotations.SerializedName

data class ArtistResponseModel(
val results: Results
val results: Results
)

data class Results(
val artistmatches: Artistmatches,
@SerializedName("opensearch:Query")
val Query: OpensearchQuery,
@SerializedName("opensearch:itemsPerPage")
val itemsPerPage: String,
@SerializedName("opensearch:startIndex")
val startIndex: String,
@SerializedName("opensearch:totalResults")
val totalResults: String
val artistmatches: Artistmatches,
@SerializedName("opensearch:Query")
val Query: OpensearchQuery,
@SerializedName("opensearch:itemsPerPage")
val itemsPerPage: String,
@SerializedName("opensearch:startIndex")
val startIndex: String,
@SerializedName("opensearch:totalResults")
val totalResults: String
)


data class OpensearchQuery(
@SerializedName("#text")
val text: String,
val role: String,
val searchTerms: String,
val startPage: String
@SerializedName("#text")
val text: String,
val role: String,
val searchTerms: String,
val startPage: String
)

data class Artistmatches(
val artist: List<Artist>
val artist: List<Artist>
)

data class Artist(
val image: List<Image>,
val listeners: String,
val mbid: String,
val name: String,
val streamable: String,
val url: String
val image: List<Image>,
val listeners: String,
val mbid: String,
val name: String,
val streamable: String,
val url: String
)

data class Image(
@SerializedName("#text")
val text: String,
val size: String
@SerializedName("#text")
val text: String,
val size: String
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ir.heydarii.musicmanager.repository

import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
Expand All @@ -20,20 +19,18 @@ import javax.inject.Inject
*/
class DataRepository @Inject constructor() {

lateinit var network: NetworkInteractor
lateinit var database: AlbumsDAO
private var network: NetworkInteractor
private var database: AlbumsDAO


init {
val component = DaggerDataProviderComponent.builder().retrofitComponent(BaseApplication.getRetrofitComponent()).build()
val component = DaggerDataProviderComponent.builder().retrofitComponent(BaseApplication.getRetrofitComponent()).build()

network = component.getNetworkInteractor()
database = component.getDbInteractor()
}




fun getArtistName(artistName: String, page: Int, apiKey: String): Single<ArtistResponseModel> {
return network.getArtistsName(artistName, page, apiKey)
.subscribeOn(Schedulers.io())
Expand Down Expand Up @@ -62,7 +59,7 @@ class DataRepository @Inject constructor() {
}

val image = it.album.image.last().text ?: ""
AlbumDatabaseEntity( null,it.album.name, it.album.artist, image, tracks)
AlbumDatabaseEntity(null, it.album.name, it.album.artist, image, tracks)
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
Expand All @@ -89,7 +86,7 @@ class DataRepository @Inject constructor() {

}

fun removeAlbum(artistName: String,albumName: String): Completable {
fun removeAlbum(artistName: String, albumName: String): Completable {
return database.removeAlbum(artistName, albumName)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package ir.heydarii.musicmanager.repository.dbinteractor

import androidx.room.*
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single
import ir.heydarii.musicmanager.pojos.AlbumDatabaseEntity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ir.heydarii.musicmanager.repository.di
import dagger.Component
import ir.heydarii.musicmanager.CustomScope
import ir.heydarii.musicmanager.base.di.RetrofitComponent
import ir.heydarii.musicmanager.repository.DataRepository
import ir.heydarii.musicmanager.repository.dbinteractor.AlbumsDAO
import ir.heydarii.musicmanager.repository.networkinteractor.NetworkInteractor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ir.heydarii.musicmanager.repository.networkinteractor

import io.reactivex.Observable
import io.reactivex.Single
import ir.heydarii.musicmanager.pojos.AlbumDetailsResponseModel
import ir.heydarii.musicmanager.pojos.ArtistResponseModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ir.heydarii.musicmanager.retrofit

import io.reactivex.Observable
import io.reactivex.Single
import ir.heydarii.musicmanager.pojos.AlbumDetailsResponseModel
import ir.heydarii.musicmanager.pojos.ArtistResponseModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ir.heydarii.musicmanager.pojos.AlbumDatabaseEntity
import ir.heydarii.musicmanager.repository.dbinteractor.AlbumsDAO


@Database(entities = [AlbumDatabaseEntity::class], version = 1,exportSchema = false)
@Database(entities = [AlbumDatabaseEntity::class], version = 1, exportSchema = false)
@TypeConverters(StringListDataConverter::class)
abstract class AppDatabase : RoomDatabase() {

Expand Down
46 changes: 23 additions & 23 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<vector xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:aapt="http:https://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
xmlns:aapt="http:https://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0"/>
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
21 changes: 15 additions & 6 deletions app/src/main/res/drawable/ic_about.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<vector android:autoMirrored="true" android:height="24dp"
android:viewportHeight="30" android:viewportWidth="30"
android:width="24dp" xmlns:android="http:https://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M3.158,26.134C6.066,23.557 5,21 5,21l7,2c0,0 -3.663,3.721 -8.417,3.99L3.158,26.134z"/>
<path android:fillColor="#FF000000" android:pathData="M3.5,26.5m-0.5,0a0.5,0.5 0,1 1,1 0a0.5,0.5 0,1 1,-1 0"/>
<path android:fillColor="#FF000000" android:pathData="M15,3C7.82,3 2,7.925 2,14s5.82,11 13,11s13,-4.925 13,-11S22.18,3 15,3zM16,20h-2v-7h2V20zM15,10.5c-0.828,0 -1.5,-0.672 -1.5,-1.5s0.672,-1.5 1.5,-1.5s1.5,0.672 1.5,1.5S15.828,10.5 15,10.5z"/>
<vector xmlns:android="http:https://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:fillColor="#FF000000"
android:pathData="M3.158,26.134C6.066,23.557 5,21 5,21l7,2c0,0 -3.663,3.721 -8.417,3.99L3.158,26.134z" />
<path
android:fillColor="#FF000000"
android:pathData="M3.5,26.5m-0.5,0a0.5,0.5 0,1 1,1 0a0.5,0.5 0,1 1,-1 0" />
<path
android:fillColor="#FF000000"
android:pathData="M15,3C7.82,3 2,7.925 2,14s5.82,11 13,11s13,-4.925 13,-11S22.18,3 15,3zM16,20h-2v-7h2V20zM15,10.5c-0.828,0 -1.5,-0.672 -1.5,-1.5s0.672,-1.5 1.5,-1.5s1.5,0.672 1.5,1.5S15.828,10.5 15,10.5z" />
</vector>

0 comments on commit 2857ddb

Please sign in to comment.