android10 / android10/Android-CleanArchitecture

Questions about what the view must do

Đang mở
#126 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
discussion question
Ngôn ngữ chính
Java
Star
15.5k
Fork
3.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have been studying this project for a while now and I have a few questions
that are not so clear to me.

1 - In this project the verification for internet connection is made in the
data layer, but this seems not to be the best thing to do because
you need to have android framework code in this layer. To me, the only
layer that must have framework specific code is the view layer, or I'm missing something? Put
the connection verification in this layer is a problem?

2 - If the view has some buttons but these buttons only do simple things,
like start another activity or fire a share intent, I need to pass these events
to presenter and then bring back to the view? Or the view itself could react to them?

3 - Suppose the fragment/activity needs to take a screenshot of some view in the screen (e.g. an item in the recyclerview) and save this screenshot in gallery. For me, the right way to do that is to do this in background. Because that way we don't block the UI. But, following this project principles
I will need a use case to that and so, I will need to pass the view (the view that I need to take the screenshot), down in the layers. This use case will have
a lot of framework specific code (e.g. generate bitmap from view. Save in gallery) and this does not seem right. My solution for this specific case is to
create a simple Observable in the fragment/activity and do that job right there,
but this way the view layer now has some kind of "logic", is this a problem?
What is the best way to do that?

Thanks!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.