Open hoangnguyen92dn opened 3 years ago
1) This is my mistake, I copy it from another project
2) Yes, it better when we can move those methods to base class
3) Already think about using mapper method with kolin extension but it will have a problem. If we use toEntity
as a extension method, when you are using Entity
class, IDE will suggest a method toEntity
(but in most of the time, I don't want that methods). Also, I think Entity class with extension method will bigger than normal Entity
class (I have not test it yet)
4), Yes, we should use a clear name
5) This is my mistake. Actually, I disable auto optimize import because my current laptop performance is not so good. For another issue, I should use Analyze Tools
to find and clean the code
https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/app/src/main/java/com/linh/androidnbsurveyapp/di/UseCaseModule.kt#L1
initEvents()
andobserveViewModel()
in Base classes, because it's duplicated in the inherited classes.https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/app/src/main/java/com/linh/androidnbsurveyapp/ui/feature/home/HomeActivity.kt#L36-L37
https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/app/src/main/java/com/linh/androidnbsurveyapp/ui/feature/login/LoginActivity.kt#L30-L31
Response.toEntity()
), what do you think?https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/data/src/main/java/com/linh/data/source/mapper/SurveyDataMapper.kt#L8-L47
afterTextChanged
from EditText's extension, so I think we could get rid of thishttps://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/app/src/main/java/com/linh/androidnbsurveyapp/common/ViewExtension.kt#L7-L17
f
character from Mapper classes?https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/data/src/main/java/com/linh/data/source/mapper/AccessTokenDataMapper.kt#L7-L28
https://github.com/PhanVanLinh/NBSurveyApp/blob/9fe9ff4c822698dd42e52d7eef138296ff6b0244/app/src/main/java/com/linh/androidnbsurveyapp/ui/model/mapper/SurveyModelMapper.kt#L7-L17
private
access modifier, unused imported... It's still fine to leave them there but it would be better to clean unused things for cleaner code