-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #940 from StepicOrg/release/1.207
Release/1.207
- Loading branch information
Showing
55 changed files
with
747 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/stepic/droid/model/CertificateListItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.stepic.droid.model | ||
|
||
import android.os.Parcelable | ||
import kotlinx.android.parcel.Parcelize | ||
import org.stepik.android.model.Certificate | ||
|
||
sealed class CertificateListItem : Parcelable { | ||
@Parcelize | ||
data class Data( | ||
val certificate: Certificate, | ||
val title: String?, | ||
val coverFullPath: String? | ||
) : CertificateListItem() | ||
|
||
@Parcelize | ||
object Placeholder : CertificateListItem() | ||
} |
35 changes: 0 additions & 35 deletions
35
app/src/main/java/org/stepic/droid/model/CertificateViewItem.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/src/main/java/org/stepic/droid/storage/migration/MigrationFrom78To79.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.stepic.droid.storage.migration | ||
|
||
import androidx.room.migration.Migration | ||
import androidx.sqlite.db.SupportSQLiteDatabase | ||
import org.stepic.droid.storage.structure.DbStructureCourse | ||
import org.stepik.android.cache.certificates.structure.DbStructureCertificate | ||
|
||
object MigrationFrom78To79 : Migration(78, 79) { | ||
override fun migrate(db: SupportSQLiteDatabase) { | ||
db.execSQL("ALTER TABLE ${DbStructureCertificate.TABLE_NAME} ADD COLUMN ${DbStructureCertificate.Columns.IS_WITH_SCORE} INTEGER DEFAULT 1") | ||
db.execSQL("ALTER TABLE ${DbStructureCourse.TABLE_NAME} ADD COLUMN ${DbStructureCourse.Columns.ANNOUNCEMENTS} TEXT") | ||
db.execSQL("CREATE TABLE IF NOT EXISTS `Announcement` (`id` INTEGER NOT NULL, `course` INTEGER NOT NULL, `user` INTEGER, `subject` TEXT NOT NULL, `text` TEXT NOT NULL, `createDate` INTEGER, `nextDate` INTEGER, `sentDate` INTEGER, `status` TEXT NOT NULL, `isRestrictedByScore` INTEGER NOT NULL, `scorePercentMin` INTEGER NOT NULL, `scorePercentMax` INTEGER NOT NULL, `emailTemplate` TEXT, `isScheduled` INTEGER NOT NULL, `startDate` INTEGER, `mailPeriodDays` INTEGER NOT NULL, `mailQuantity` INTEGER NOT NULL, `isInfinite` INTEGER NOT NULL, `onEnroll` INTEGER NOT NULL, `publishCount` INTEGER, `queueCount` INTEGER, `sentCount` INTEGER, `openCount` INTEGER, `clickCount` INTEGER, `estimatedStartDate` INTEGER, `estimatedFinishDate` INTEGER, `noticeDates` TEXT NOT NULL, PRIMARY KEY(`id`))") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/src/main/java/org/stepik/android/cache/announcement/AnnouncementCacheDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.stepik.android.cache.announcement | ||
|
||
import io.reactivex.Completable | ||
import io.reactivex.Single | ||
import org.stepik.android.cache.announcement.dao.AnnouncementDao | ||
import org.stepik.android.data.announcement.source.AnnouncementCacheDataSource | ||
import org.stepik.android.domain.announcement.model.Announcement | ||
import javax.inject.Inject | ||
|
||
class AnnouncementCacheDataSourceImpl | ||
@Inject | ||
constructor( | ||
private val announcementDao: AnnouncementDao | ||
) : AnnouncementCacheDataSource { | ||
override fun getAnnouncements(announcementIds: List<Long>): Single<List<Announcement>> = | ||
announcementDao.getAnnouncement(announcementIds) | ||
|
||
override fun saveAnnouncements(announcements: List<Announcement>): Completable = | ||
announcementDao.saveAnnouncements(announcements) | ||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/org/stepik/android/cache/announcement/dao/AnnouncementDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.stepik.android.cache.announcement.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Insert | ||
import androidx.room.OnConflictStrategy | ||
import androidx.room.Query | ||
import io.reactivex.Completable | ||
import io.reactivex.Single | ||
import org.stepik.android.domain.announcement.model.Announcement | ||
|
||
@Dao | ||
interface AnnouncementDao { | ||
@Query("SELECT * FROM Announcement WHERE id IN (:announcementIds)") | ||
fun getAnnouncement(announcementIds: List<Long>): Single<List<Announcement>> | ||
|
||
@Insert(onConflict = OnConflictStrategy.REPLACE) | ||
fun saveAnnouncements(announcements: List<Announcement>): Completable | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.