-
Notifications
You must be signed in to change notification settings - Fork 332
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
Support offline mode for Sponsors #529
Support offline mode for Sponsors #529
Conversation
# Conflicts: # app/schemas/io.github.droidkaigi.confsched2018.data.db.AppDatabase/6.json
droidKaigiApi: DroidKaigiApi, | ||
sponsorDatabase: SponsorDatabase, | ||
schedulerProvider: SchedulerProvider | ||
): SponsorPlanRepository = SponsorPlanDataRepository(droidKaigiApi, sponsorDatabase, schedulerProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceeded max line length (100) |
|
||
@Singleton @Provides | ||
fun provideSponsorDao(db: AppDatabase): SponsorDao = db.sponsorDao() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected blank line(s) before “}” |
Sorry, We should prepare release, I will see this pull request tomorrow 🙏 |
Please fix lint errors 🙏 |
(SessionFeedbackEntity::class), | ||
(SponsorPlanEntity::class), | ||
(SponsorGroupEntity::class), | ||
(SponsorEntity::class) | ||
], | ||
version = 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge from master and revert 6.json and upgrade version to 8 and rebuild for creating 8.json 🙇
This is a very hard work implementation, but I would like to change from three tables to one table. 🙇 You do not have to change the model class. I think that it is only necessary to have id, link, base64Img, imgUrl, groupIndex in that table. I think that it is possible to smoothly implement the table conversion by mapper. What do you think? これはとてもhard workな実装になるのですが、3つのテーブルから1テーブルに変更したいです。 モデルクラスは変えなくていいです。私はそのテーブルにはid,link, base64Img, imgUrl,groupIndexがあるだけで良いと思います。 テーブルの変換はmapperで行えば多分スムーズに実装できる気がしています。 どう思いますか? |
@takahirom |
@takahirom |
imgUrl != null -> Sponsor.ImageUri.NetworkImageUri(imgUrl) | ||
else -> throw IllegalStateException("a json file is broken.") | ||
fun List<SponsorGroup>.toSponsorGroupEntities(planId: Int): List<SponsorEntity> = | ||
mapIndexed { index, group -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
} | ||
}.flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒
import android.arch.persistence.room.PrimaryKey | ||
|
||
@Entity(tableName = "sponsor_plan") | ||
data class SponsorPlanEntity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also delete SponsorPlanEntity
using @Embedded
. 🙇
What do you think?
Line 18 in 69d8b42
@Embedded var topic: TopicEntity, |
https://github.com/DroidKaigi/conference-app-2018/blob/69d8b4282558822281a9a128f20902b88af5219d/app/src/main/java/io/github/droidkaigi/confsched2018/data/db/entity/TopicEntity.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I don't know how to delete SponsorPlanEntity using @Embedded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for lack of explanation. I think that it is possible to delete the DB table and not delete the class. 🙇🏻
@@ -2,7 +2,7 @@ | |||
"formatVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert 6.json 🙇
You can copy master 6.json
https://github.com/youta1119/conference-app-2018/blob/master/app/schemas/io.github.droidkaigi.confsched2018.data.db.AppDatabase/6.json
I refactored this. Please cherry-pick 🙏 |
Sorry for taking long time 🙇 |
We don't have the time |
Issue
Overview (Required)
Links