diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml
index 0adb3ba..083c688 100644
--- a/.github/workflows/android_ci.yml
+++ b/.github/workflows/android_ci.yml
@@ -16,7 +16,7 @@ jobs:
- name: Set up JDK environment(JDK 11)
uses: actions/setup-java@v1.4.3
with:
- java-version: 11
+ java-version: 17
- name: Generate Release APK
run: ./gradlew assembleRelease
diff --git a/README.md b/README.md
index c57a72c..22dfa2c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-# sense.of.silence & Zigmund Afraid [![Codemagic build status](https://api.codemagic.io/apps/60d07948ab5163f7f1fb5066/release-workflow/status_badge.svg)](https://codemagic.io/apps/60d07948ab5163f7f1fb5066/release-workflow/latest_build)
+# sense.of.silence & Zigmund Afraid
+
+[![Codemagic build status](https://api.codemagic.io/apps/60d07948ab5163f7f1fb5066/release-workflow/status_badge.svg)](https://codemagic.io/apps/60d07948ab5163f7f1fb5066/release-workflow/latest_build)
Online Music Player for particular Music Band "відчуття.тиші" (where I used to play on piano), with
an opportunity to listen to almost all their songs online.
@@ -24,9 +26,7 @@ after every push to the **dev** branch,
[Codemagic](https://codemagic.io/start/) is used to deliver new release app bundle to **Google
Play** after every push to **master** branch;
-• Architectural pattern: [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel)
-and
-[Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html);
+• Architectural pattern: [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel);
• Architecture Components:
[LiveData](https://developer.android.com/topic/libraries/architecture/livedata),
@@ -59,30 +59,29 @@ no unused variables or methods, no commented out code.
• **Screenshots:**
-
-
+
+
## Privacy Policy
-Dmytro Turskyi built the Відчуття.Тиші & Zigmund Afraid app as a Free app. This SERVICE is provided
+Dmytro Turskyi built the Відчуття.Тиші & Zigmund Afraid app as a free app. This service is provided
by Dmytro Turskyi at no cost and is intended for use as is.
-This page is used to inform visitors regarding my policies with the collection, use, and disclosure
-of Personal Information if anyone decided to use my Service.
-
-If you choose to use my Service, then you agree to the collection and use of information in relation
-to this policy. The Personal Information that I collect is used for providing and improving the
-Service. I will not use or share your information with anyone except as described in this Privacy
-Policy.
+This page is used to inform visitors regarding policies with the collection, use, and disclosure
+of personal information if anyone decided to use this service.
-The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which
-are accessible at Відчуття.Тиші & Zigmund Afraid unless otherwise defined in this Privacy Policy.
+If you choose to use this service, then you agree to the collection and use of information in
+relation to this policy. The personal information that app collects is used for providing and
+improving
+the service. App will not use or share your information with anyone except as described in this
+privacy policy.
**Information Collection and Use**
-For a better experience, while using our Service, I may require you to provide us with certain
-personally identifiable information. The information that I request will be retained on your device
-and is not collected by me in any way.
+For a better experience, while using this service, app may require you to provide with certain
+personally identifiable information. The information that app request will be retained on your
+device
+and is not collected by Dmytro Turskyi in any way.
The app does use third-party services that may collect information used to identify you.
@@ -94,11 +93,11 @@ Link to the privacy policy of third-party service providers used by the app
**Log Data**
-I want to inform you that whenever you use my Service, in a case of an error in the app I collect
-data and information (through third-party products) on your phone called Log Data. This Log Data may
-include information such as your device Internet Protocol (“IP”) address, device name, operating
-system version, the configuration of the app when utilizing my Service, the time and date of your
-use of the Service, and other statistics.
+You should be informed that whenever you use this service, in a case of an error in the app your
+data and information will be collected (through third-party products) on your phone called log data.
+This log data may include information such as your device internet protocol (“IP”) address, device
+name, operating system version, the configuration of the app when utilizing this service, the time
+and date of your use of the service, and other statistics.
**Cookies**
@@ -106,55 +105,57 @@ Cookies are files with a small amount of data that are commonly used as anonymou
identifiers. These are sent to your browser from the websites that you visit and are stored on your
device's internal memory.
-This Service does not use these “cookies” explicitly. However, the app may use third-party code and
+This service does not use these “cookies” explicitly. However, the app may use third-party code and
libraries that use “cookies” to collect information and improve their services. You have the option
to either accept or refuse these cookies and know when a cookie is being sent to your device. If you
-choose to refuse our cookies, you may not be able to use some portions of this Service.
+choose to refuse our cookies, you may not be able to use some portions of this service.
**Service Providers**
-I may employ third-party companies and individuals due to the following reasons:
+Dmytro Turskyi may employ third-party companies and individuals due to the following reasons:
-* To facilitate our Service;
-* To provide the Service on our behalf;
-* To perform Service-related services; or
-* To assist us in analyzing how our Service is used.
+* To facilitate this service;
+* To provide the service on behalf of Dmytro Turskyi;
+* To perform service-related services; or
+* To assist us in analyzing how this service is used.
-I want to inform users of this Service that these third parties have access to their Personal
-Information. The reason is to perform the tasks assigned to them on our behalf. However, they are
-obligated not to disclose or use the information for any other purpose.
+Users should be informed of this service that these third parties have access to your personal
+information. The reason is to perform the tasks assigned to them on Dmytro Turskyi behalf. However,
+they are obligated not to disclose or use the information for any other purpose.
**Security**
-I value your trust in providing us your Personal Information, thus we are striving to use
+Dmytro Turskyi values your trust in providing your personal information, thus he is striving to use
commercially acceptable means of protecting it. But remember that no method of transmission over the
-internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its
+internet, or method of electronic storage is 100% secure and reliable, and he cannot guarantee its
absolute security.
**Links to Other Sites**
-This Service may contain links to other sites. If you click on a third-party link, you will be
-directed to that site. Note that these external sites are not operated by me. Therefore, I strongly
-advise you to review the Privacy Policy of these websites. I have no control over and assume no
-responsibility for the content, privacy policies, or practices of any third-party sites or services.
+This service may contain links to other sites. If you click on a third-party link, you will be
+directed to that site. Note that these external sites are not operated by Dmytro Turskyi. Therefore,
+he strongly advises you to review the privacy policy of these websites. Dmytro Turskyi have no
+control over and assume no responsibility for the content, privacy policies, or practices of any
+third-party sites or services.
**Children’s Privacy**
-These Services do not address anyone under the age of 13. I do not knowingly collect personally
-identifiable information from children under 13 years of age. In the case I discover that a child
-under 13 has provided me with personal information, I immediately delete this from our servers. If
-you are a parent or guardian, and you are aware that your child has provided us with personal
-information, please contact me so that I will be able to do the necessary actions.
+These services do not address anyone under the age of 13. Dmytro Turskyi do not knowingly collect
+personally identifiable information from children under 13 years of age. In the case Dmytro Turskyi
+discovers that a child under 13 has provided him with personal information, he immediately will
+delete this from server. If you are a parent or guardian, and you are aware that your child has
+provided Dmytro Turskyi with personal information, please contact Dmytro Turskyi so that he will be
+able to do the necessary actions.
**Changes to This Privacy Policy**
-I may update our Privacy Policy from time to time. Thus, you are advised to review this page
-periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on
-this page.
+Dmytro Turskyi may update this privacy policy from time to time. Thus, you are advised to review
+this page periodically for any changes. Dmytro Turskyi will notify you of any changes by posting the
+new Privacy Policy on this page.
-This policy is effective as of 2021-12-01
+This policy is effective as of 2023-05-22
**Contact Us**
-If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at
-dmitriy.turskiy@gmail.com.
+If you have any questions or suggestions about this privacy policy, do not hesitate to contact
+Dmytro Turskyi at dmytro.turskyi@gmail.com.
diff --git a/build.gradle b/build.gradle
index b0e7cec..9b3d9b7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,14 +5,17 @@
buildscript {
ext {
// sdk versions
- compile_sdk_version = 32
+ compile_sdk_version = 33
build_tools_version = "30.0.3"
min_sdk_version = 21
- target_sdk_version = 32
+ target_sdk_version = 33
/* to check the latest version @see
-[https://play.google.com/console/u/0/developers/6867856033872987263/app/4974045020812963921/releases/overview] */
- version_code = 18
- version_name = "1.0.8"
+[
+https://play.google.com/console/u/0/developers/6867856033872987263/app/4974045020812963921/releases/overview
+]
+*/
+ version_code = 19
+ version_name = "1.0.9"
}
repositories {
// Google's Maven repository
@@ -20,19 +23,19 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.2.2'
+ classpath 'com.android.tools.build:gradle:8.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
// Google Services plugin (required for firebase)
- classpath 'com.google.gms:google-services:4.3.13'
+ classpath 'com.google.gms:google-services:4.3.15'
// firebase
- classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
- classpath 'com.google.firebase:perf-plugin:1.4.1'
- classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.3'
+ classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
+ classpath 'com.google.firebase:perf-plugin:1.4.2'
+ classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.0'
}
}
ext {
@@ -67,16 +70,13 @@ subprojects {
implementation "io.reactivex.rxjava3:rxandroid:$rxAndroidVersion"
implementation "com.github.akarnokd:rxjava3-bridge:$rxAndroidVersion"
implementation "io.reactivex.rxjava3:rxjava:$rxJavaVersion"
-
- // database (Room)
- implementation "androidx.room:room-runtime:$roomVersion"
- annotationProcessor "androidx.room:room-compiler:$roomVersion"
- implementation "androidx.room:room-rxjava2:$roomVersion"
}
}
gradle.projectsEvaluated {
- tasks.withType(JavaCompile) {
- options.compilerArgs << '-Xmaxerrs' << '500'
+ tasks.withType(JavaCompile).tap {
+ configureEach {
+ options.compilerArgs << '-Xmaxerrs' << '500'
+ }
}
}
}
@@ -89,6 +89,6 @@ allprojects {
}
}
-task clean(type: Delete) {
+tasks.register('clean') {
delete rootProject.buildDir
}
diff --git a/data/build.gradle b/data/build.gradle
index afc276b..5129db3 100644
--- a/data/build.gradle
+++ b/data/build.gradle
@@ -14,6 +14,16 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
+
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments += [
+ "room.schemaLocation" : "$projectDir/schemas".toString(),
+ "room.incremental" : "true",
+ "room.expandProjection": "true"
+ ]
+ }
+ }
}
buildTypes {
@@ -24,9 +34,10 @@ android {
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
+ namespace 'io.github.turskyi.data'
}
dependencies {
@@ -35,6 +46,11 @@ dependencies {
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "com.google.android.material:material:$materialVersion"
+ // database (Room)
+ implementation "androidx.room:room-runtime:$roomVersion"
+ annotationProcessor "androidx.room:room-compiler:$roomVersion"
+ implementation "androidx.room:room-rxjava2:$roomVersion"
+
// test
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$extJunitVersion"
diff --git a/data/schemas/io.github.turskyi.data.database.SongsDatabase/1.json b/data/schemas/io.github.turskyi.data.database.SongsDatabase/1.json
new file mode 100644
index 0000000..edfd086
--- /dev/null
+++ b/data/schemas/io.github.turskyi.data.database.SongsDatabase/1.json
@@ -0,0 +1,70 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 1,
+ "identityHash": "f0a497baf07ad23e6355677d0f98818a",
+ "entities": [
+ {
+ "tableName": "table_songs",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `band` TEXT, `album` TEXT, `name` TEXT, `image_resource_id` INTEGER NOT NULL, `image_resource` TEXT, `audio_link` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "bandName",
+ "columnName": "band",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "album",
+ "columnName": "album",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "songName",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "imageResourceId",
+ "columnName": "image_resource_id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "imageResource",
+ "columnName": "image_resource",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "audioLink",
+ "columnName": "audio_link",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "autoGenerate": true,
+ "columnNames": [
+ "id"
+ ]
+ },
+ "indices": [],
+ "foreignKeys": []
+ }
+ ],
+ "views": [],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'f0a497baf07ad23e6355677d0f98818a')"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/data/src/main/AndroidManifest.xml b/data/src/main/AndroidManifest.xml
index b2e2fa7..568741e 100644
--- a/data/src/main/AndroidManifest.xml
+++ b/data/src/main/AndroidManifest.xml
@@ -1,2 +1,2 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/data/src/main/java/io/github/turskyi/data/database/SongsDatabase.java b/data/src/main/java/io/github/turskyi/data/database/SongsDatabase.java
index dd09218..97d2646 100644
--- a/data/src/main/java/io/github/turskyi/data/database/SongsDatabase.java
+++ b/data/src/main/java/io/github/turskyi/data/database/SongsDatabase.java
@@ -1,9 +1,17 @@
package io.github.turskyi.data.database;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_ALBUM;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_AUDIO_LINK;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_BAND;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_ID;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_IMAGE_RES;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_IMAGE_RES_ID;
+import static io.github.turskyi.data.entity.SongEntity.COLUMN_NAME;
import static io.github.turskyi.data.entity.SongEntity.TABLE_SONGS;
import android.content.ContentValues;
import android.content.Context;
+import android.database.sqlite.SQLiteException;
import androidx.annotation.NonNull;
import androidx.room.Database;
@@ -22,8 +30,16 @@
import io.github.turskyi.data.entity.SongEntity;
import io.github.turskyi.domain.entities.enums.Album;
-@Database(entities = {SongEntity.class}, version = 2, exportSchema = false)
+@Database(
+ version = 1,
+ entities = {SongEntity.class}
+)
public abstract class SongsDatabase extends RoomDatabase {
+ private static void recreateTable(SupportSQLiteDatabase db) {
+ db.execSQL("DROP TABLE IF EXISTS " + TABLE_SONGS);
+ db.execSQL("CREATE TABLE " + TABLE_SONGS + "(" + COLUMN_ID + " INTEGER, " + COLUMN_BAND + " TEXT, " + COLUMN_NAME + " TEXT, " + COLUMN_ALBUM + " TEXT, " + COLUMN_IMAGE_RES_ID + " INTEGER, " + COLUMN_IMAGE_RES + " TEXT, " + COLUMN_AUDIO_LINK + " TEXT)");
+ }
+
public abstract SongDao getSongDao();
public static class Callback extends RoomDatabase.Callback {
@@ -41,15 +57,16 @@ public void onOpen(@NonNull SupportSQLiteDatabase db) {
db.query("PRAGMA synchronous = OFF");
}
+ @Override
+ public void onDestructiveMigration(@NonNull SupportSQLiteDatabase db) {
+ super.onDestructiveMigration(db);
+ insertValuesInTable(db);
+ }
+
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db) {
super.onCreate(db);
- db.query("PRAGMA journal_mode = MEMORY");
- fillSenseOfSilenceLpAlbum(db);
- fillZombiAlbum(db);
- fillCrimeAlbum(db);
- fillBonusAlbum(db);
- fillZigmundAfraidAlbum(db);
+ insertValuesInTable(db);
}
private void fillBonusAlbum(@NonNull SupportSQLiteDatabase db) {
@@ -60,26 +77,34 @@ private void fillBonusAlbum(@NonNull SupportSQLiteDatabase db) {
applicationContext.getString(R.string.song_name_hate_number)
);
- List bonusImageResources = Arrays.asList(
+ List bonusImageResourceIds = Arrays.asList(
R.drawable.vt_dnb120,
R.drawable.pic_vt_cover,
R.drawable.pic_whisper_cover,
R.drawable.pic_hate_number_cover
);
+ List bonusImageLinks = Arrays.asList(
+ applicationContext.getString(R.string.image_vt_dnb),
+ applicationContext.getString(R.string.image_vt_cover),
+ applicationContext.getString(R.string.image_whisper_cover),
+ applicationContext.getString(R.string.image_hate_number_cover)
+ );
+
List bonusLinks = Arrays.asList(
applicationContext.getString(R.string.audio_noli_respicere_rmx),
applicationContext.getString(R.string.audio_fly_away),
applicationContext.getString(R.string.audio_whisper),
applicationContext.getString(R.string.audio_hate_number)
- );
+ );
fillAlbum(
db,
applicationContext.getString(R.string.band_sense_of_silence),
Album.BONUS.name,
bonusNames,
- bonusImageResources,
+ bonusImageResourceIds,
+ bonusImageLinks,
bonusLinks
);
}
@@ -101,11 +126,16 @@ private void fillSenseOfSilenceLpAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.song_name_alesia)
);
- List senseOfSilenceImageResources = new ArrayList<>(Collections.nCopies(
+ List senseOfSilenceImageResourceIds = new ArrayList<>(Collections.nCopies(
senseOfSilenceNames.size(),
R.drawable.logo_black
));
+ List senseOfSilenceImageResources = new ArrayList<>(Collections.nCopies(
+ senseOfSilenceNames.size(),
+ applicationContext.getString(R.string.image_logo_black)
+ ));
+
List senseOfSilenceLinks = Arrays.asList(
applicationContext.getString(R.string.audio_winter),
applicationContext.getString(R.string.audio_noli_respicere),
@@ -127,6 +157,7 @@ private void fillSenseOfSilenceLpAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.band_sense_of_silence),
Album.SENSE_OF_SILENCE_LP.name,
senseOfSilenceNames,
+ senseOfSilenceImageResourceIds,
senseOfSilenceImageResources,
senseOfSilenceLinks
);
@@ -140,11 +171,16 @@ private void fillZombiAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.song_name_zombie_instrumental)
);
- List zombiImageResources = new ArrayList<>(Collections.nCopies(
+ List zombiImageResourceIds = new ArrayList<>(Collections.nCopies(
zombiNames.size(),
R.drawable.zombi
));
+ List zombiImageResources = new ArrayList<>(Collections.nCopies(
+ zombiNames.size(),
+ applicationContext.getString(R.string.image_zombi)
+ ));
+
List zombiLinks = Arrays.asList(
applicationContext.getString(R.string.audio_zombi),
applicationContext.getString(R.string.audio_zombi_dubstep),
@@ -157,6 +193,7 @@ private void fillZombiAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.band_sense_of_silence),
Album.ZOMBI.name,
zombiNames,
+ zombiImageResourceIds,
zombiImageResources,
zombiLinks
);
@@ -171,11 +208,16 @@ private void fillCrimeAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.song_name_crime)
);
- List crimeImageResources = new ArrayList<>(Collections.nCopies(
+ List crimeImageResourceIds = new ArrayList<>(Collections.nCopies(
crimeNames.size(),
R.drawable.pic_crime_cover
));
+ List crimeImageResources = new ArrayList<>(Collections.nCopies(
+ crimeNames.size(),
+ applicationContext.getString(R.string.image_crime_cover)
+ ));
+
List crimeLinks = Arrays.asList(
applicationContext.getString(R.string.audio_to_astarta),
applicationContext.getString(R.string.audio_angelscream),
@@ -189,6 +231,7 @@ private void fillCrimeAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.band_sense_of_silence),
Album.CRIME.name,
crimeNames,
+ crimeImageResourceIds,
crimeImageResources,
crimeLinks
);
@@ -201,12 +244,18 @@ private void fillZigmundAfraidAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.song_name_pleasure_was_mine)
);
- List zigmundAfraidImageResources = Arrays.asList(
+ List zigmundAfraidImageResourceIds = Arrays.asList(
R.drawable.ic_za,
R.drawable.vt_dnb120,
R.drawable.pwm
);
+ List zigmundAfraidImageResources = Arrays.asList(
+ applicationContext.getString(R.string.image_za),
+ applicationContext.getString(R.string.image_vt_dnb),
+ applicationContext.getString(R.string.image_pwm)
+ );
+
List zigmundAfraidLinks = Arrays.asList(
applicationContext.getString(R.string.audio_abroad),
applicationContext.getString(R.string.audio_abroad_rmx),
@@ -218,6 +267,7 @@ private void fillZigmundAfraidAlbum(SupportSQLiteDatabase db) {
applicationContext.getString(R.string.band_zigmund_afraid),
Album.ZIGMUND_AFRAID.name,
zigmundAfraidNames,
+ zigmundAfraidImageResourceIds,
zigmundAfraidImageResources,
zigmundAfraidLinks
);
@@ -228,19 +278,33 @@ private void fillAlbum(
String bandName,
String albumName,
List names,
- List imageResources,
+ List imageResourceIds,
+ List imageLinks,
List links
) {
-
for (int i = 0; i < names.size(); i++) {
ContentValues contentValues = new ContentValues();
- contentValues.put(SongEntity.COLUMN_BAND, bandName);
- contentValues.put(SongEntity.COLUMN_ALBUM, albumName);
- contentValues.put(SongEntity.COLUMN_NAME, names.get(i));
- contentValues.put(SongEntity.COLUMN_IMAGE_RES_ID, imageResources.get(i));
- contentValues.put(SongEntity.COLUMN_AUDIO_LINK, links.get(i));
- db.insert(TABLE_SONGS, OnConflictStrategy.REPLACE, contentValues);
+ contentValues.put(COLUMN_BAND, bandName);
+ contentValues.put(COLUMN_ALBUM, albumName);
+ contentValues.put(COLUMN_NAME, names.get(i));
+ contentValues.put(COLUMN_IMAGE_RES_ID, imageResourceIds.get(i));
+ contentValues.put(COLUMN_IMAGE_RES, imageLinks.get(i));
+ contentValues.put(COLUMN_AUDIO_LINK, links.get(i));
+ try {
+ db.insert(TABLE_SONGS, OnConflictStrategy.REPLACE, contentValues);
+ } catch (SQLiteException e) {
+ recreateTable(db);
+ }
}
}
+
+ private void insertValuesInTable(@NonNull SupportSQLiteDatabase db) {
+ db.query("PRAGMA journal_mode = MEMORY");
+ fillSenseOfSilenceLpAlbum(db);
+ fillZombiAlbum(db);
+ fillCrimeAlbum(db);
+ fillBonusAlbum(db);
+ fillZigmundAfraidAlbum(db);
+ }
}
}
diff --git a/data/src/main/java/io/github/turskyi/data/entity/SongEntity.java b/data/src/main/java/io/github/turskyi/data/entity/SongEntity.java
index 1472296..249f3c7 100644
--- a/data/src/main/java/io/github/turskyi/data/entity/SongEntity.java
+++ b/data/src/main/java/io/github/turskyi/data/entity/SongEntity.java
@@ -12,6 +12,14 @@
*/
@Entity(tableName = SongEntity.TABLE_SONGS)
public class SongEntity {
+ public static final String TABLE_SONGS = "table_songs";
+ public static final String COLUMN_ID = "id";
+ public static final String COLUMN_BAND = "band";
+ public static final String COLUMN_ALBUM = "album";
+ public static final String COLUMN_NAME = "name";
+ public static final String COLUMN_IMAGE_RES_ID = "image_resource_id";
+ public static final String COLUMN_IMAGE_RES = "image_resource";
+ public static final String COLUMN_AUDIO_LINK = "audio_link";
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = COLUMN_ID)
private int id = 0;
@@ -20,25 +28,23 @@ public class SongEntity {
*/
@ColumnInfo(name = COLUMN_BAND)
private String bandName;
-
/**
* Name of the album
*/
@ColumnInfo(name = COLUMN_ALBUM)
private String album;
-
/**
* name of the song from the album
*/
@ColumnInfo(name = COLUMN_NAME)
private String songName;
-
/**
* Image resource ID for the song
*/
@ColumnInfo(name = COLUMN_IMAGE_RES_ID)
private int imageResourceId;
-
+ @ColumnInfo(name = COLUMN_IMAGE_RES)
+ private String imageResource;
/**
* Audio resource for the song
*/
@@ -97,6 +103,15 @@ public void setImageResourceId(int imageResourceId) {
this.imageResourceId = imageResourceId;
}
+ @SuppressWarnings("unused")
+ public String getImageResource() {
+ return imageResource;
+ }
+
+ public void setImageResource(String imageResource) {
+ this.imageResource = imageResource;
+ }
+
/**
* Returns the audio link of the song.
*/
@@ -108,20 +123,13 @@ public void setAudioLink(String audioLink) {
this.audioLink = audioLink;
}
- public static final String TABLE_SONGS = "table_songs";
- public static final String COLUMN_ID = "id";
- public static final String COLUMN_BAND = "band";
- public static final String COLUMN_ALBUM = "album";
- public static final String COLUMN_NAME = "name";
- public static final String COLUMN_IMAGE_RES_ID = "image_resource_id";
- public static final String COLUMN_AUDIO_LINK = "audio_link";
-
public Song mapToDomain() {
return new Song(
this.bandName,
this.album,
this.songName,
this.imageResourceId,
+ this.imageResource,
this.audioLink
);
}
diff --git a/data/src/main/res/drawable/ic_pause.png b/data/src/main/res/drawable/ic_pause.png
deleted file mode 100755
index 1818039..0000000
Binary files a/data/src/main/res/drawable/ic_pause.png and /dev/null differ
diff --git a/data/src/main/res/drawable/ic_play_arrow.png b/data/src/main/res/drawable/ic_play_arrow.png
deleted file mode 100755
index 85a242d..0000000
Binary files a/data/src/main/res/drawable/ic_play_arrow.png and /dev/null differ
diff --git a/data/src/main/res/values/strings.xml b/data/src/main/res/values/strings.xml
index 0b8dc5b..a9007c1 100644
--- a/data/src/main/res/values/strings.xml
+++ b/data/src/main/res/values/strings.xml
@@ -162,4 +162,33 @@
https://dl.dropboxusercontent.com/s/5960o0g06ejai9m/zigmund_afraid_pleasure_was_mine.mp3?dl=1
+
+
+
+ https://dl.dropboxusercontent.com/s/luge6ysksfvmj7r/vt_dnb120.webp?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/zimzody148ljo1d/pic_vt_cover.jpg?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/wxjck5v5ilvzest/pic_whisper_cover.jpg?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/v6iqiiuk19p9upj/pic_hate_number_cover.jpg?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/gc2kdydcrt9c9um/logo_black.webp?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/jvny4los44wys3y/zombi.jpg?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/z8teg5p90400o8b/pic_crime_cover.jpg?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/66v5kzgi01gcda0/ic_za.webp?dl=1
+
+
+ https://dl.dropboxusercontent.com/s/2dffvikunch56vs/pwm.webp?dl=1
+
diff --git a/domain/src/main/java/io/github/turskyi/domain/entities/pojo/Song.java b/domain/src/main/java/io/github/turskyi/domain/entities/pojo/Song.java
index 1134214..77f4e19 100644
--- a/domain/src/main/java/io/github/turskyi/domain/entities/pojo/Song.java
+++ b/domain/src/main/java/io/github/turskyi/domain/entities/pojo/Song.java
@@ -1,10 +1,14 @@
package io.github.turskyi.domain.entities.pojo;
+import java.util.Objects;
+
/**
* {@link Song} represents an album song that the user wants to listen.
* It contains a Name of the song from the album and a song from that album.
*/
public class Song {
+ private static final int NO_IMAGE_ID = -1;
+ private static final String NO_IMAGE_LINK_PROVIDED = "";
/**
* Name of the music band
*/
@@ -23,10 +27,8 @@ public class Song {
/**
* Image resource ID for the song
*/
- private final int imageResourceID;
-
- private static final int NO_IMAGE_PROVIDED = -1;
-
+ private final int imageResourceId;
+ private final String imageResource;
/**
* Audio resource for the song
*/
@@ -43,13 +45,15 @@ public Song(String nameOfTheBand,
String album,
String songName,
int imageResourceId,
+ String imageResource,
String audioLink
) {
this.songName = songName;
this.nameOfTheBand = nameOfTheBand;
this.album = album;
this.audioLink = audioLink;
- this.imageResourceID = imageResourceId;
+ this.imageResourceId = imageResourceId;
+ this.imageResource = imageResource;
}
/**
@@ -77,14 +81,19 @@ public String getAlbum() {
* Return the image resource ID of the song.
*/
public int getImageResourceId() {
- return imageResourceID;
+ return imageResourceId;
+ }
+
+ @SuppressWarnings("unused")
+ public String getImageResource() {
+ return imageResource;
}
/**
* Returns whether there is an image for this song.
*/
public boolean hasImage() {
- return imageResourceID != NO_IMAGE_PROVIDED;
+ return imageResourceId != NO_IMAGE_ID && !Objects.equals(imageResource, NO_IMAGE_LINK_PROVIDED);
}
/**
diff --git a/gradle.properties b/gradle.properties
index 2137971..e6cfc18 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -26,18 +26,25 @@ env.SIGNING_KEY_RELEASE_PASSWORD=sv848151
env.SIGNING_KEY_RELEASE_KEY=TurskyiApps
env.SIGNING_KEY_RELEASE_KEY_PASSWORD=13011987dima
# global dependency versions:
-hiltVersion=2.43.2
+appcompatVersion=1.6.1
+androidx_test_version=1.5.2
+androidx_test_core=1.5.0
+extJunitVersion=1.1.5
+espressoVersion=3.5.1
+junitVersion=4.13.2
+hiltVersion=2.46.1
hiltAndroidXVersion=1.0.0
+kotlinVersion=1.8.21
+materialVersion=1.9.0
multidexVersion=2.0.1
rxAndroidVersion=3.0.0
rxJavaVersion=3.0.13
-roomVersion=2.2.6
-junitVersion=4.13.2
-extJunitVersion=1.1.3
-espressoVersion=3.4.0
-appcompatVersion=1.5.0
-materialVersion=1.6.1
-kotlinVersion=1.7.10
-androidx_test_version=1.4.0
+roomVersion=2.5.1
+# android global settings
+android.defaults.buildfeatures.buildconfig=true
+android.nonTransitiveRClass=false
+android.nonFinalResIds=false
+
+
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 945df99..6566853 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
diff --git a/presentation/build.gradle b/presentation/build.gradle
index ff4c577..f7eab10 100644
--- a/presentation/build.gradle
+++ b/presentation/build.gradle
@@ -33,12 +33,13 @@ android {
arguments += [
"room.schemaLocation" : "$projectDir/schemas".toString(),
"room.incremental" : "true",
- "room.expandProjection": "true"]
+ "room.expandProjection": "true"
+ ]
}
}
+ resourceConfigurations += ['en', 'ua']
// Remove unused alternative resources
// (https://developer.android.com/studio/build/shrink-code#unused-alt-resources)
- resConfigs 'en', 'ua'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
@@ -110,32 +111,32 @@ dependencies {
// required app module hilt dependency
implementation "com.google.dagger:hilt-android:$hiltVersion"
- implementation 'org.jetbrains:annotations:23.0.0'
+ implementation 'org.jetbrains:annotations:24.0.1'
/* Firebase Bill of Materials.
* By using the Firebase Android BoM,
* app will always use compatible versions of the Firebase Android libraries. */
- implementation platform('com.google.firebase:firebase-bom:30.3.2')
+ implementation platform('com.google.firebase:firebase-bom:32.0.0')
// Firebase SDK for Google Analytics
- implementation('com.google.firebase:firebase-analytics:21.1.0') {
+ implementation('com.google.firebase:firebase-analytics:21.2.2') {
// remove advertising dependency
exclude module: "play-services-ads-identifier"
exclude module: "play-services-measurement"
exclude module: "play-services-measurement-sdk"
}
- implementation 'com.google.firebase:firebase-crashlytics:18.2.12'
- implementation 'com.google.firebase:firebase-perf:20.1.0'
+ implementation 'com.google.firebase:firebase-crashlytics:18.3.7'
+ implementation 'com.google.firebase:firebase-perf:20.3.2'
// Firebase Cloud Messaging
- implementation 'com.google.firebase:firebase-messaging:23.0.7'
+ implementation 'com.google.firebase:firebase-messaging:23.1.2'
// added to avoid errors with libraries, which using kotlin
//noinspection DifferentStdlibGradleVersion
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
- // added to avoid errors with libraries, which using kotlin
- //noinspection DifferentStdlibGradleVersion
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
+ // database (Room)
+ implementation "androidx.room:room-runtime:$roomVersion"
+ annotationProcessor "androidx.room:room-compiler:$roomVersion"
// test
testImplementation "junit:junit:$junitVersion"
@@ -143,7 +144,7 @@ dependencies {
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test:runner:$androidx_test_version"
- androidTestImplementation "androidx.test:core:$androidx_test_version"
+ androidTestImplementation "androidx.test:core:$androidx_test_core"
}
repositories {
diff --git a/presentation/src/main/AndroidManifest.xml b/presentation/src/main/AndroidManifest.xml
index 05bbd74..3b2c4f9 100644
--- a/presentation/src/main/AndroidManifest.xml
+++ b/presentation/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
+ xmlns:tools="http://schemas.android.com/tools">
-
-
-
+
+
+
\ No newline at end of file
diff --git a/presentation/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/presentation/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index 036d09b..4a4b17f 100644
--- a/presentation/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/presentation/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -1,5 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file