Skip to content
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

Add staff list screen #144

Closed
takahirom opened this issue Jan 5, 2019 · 23 comments · Fixed by #557
Closed

Add staff list screen #144

takahirom opened this issue Jan 5, 2019 · 23 comments · Fixed by #557

Comments

@takahirom
Copy link
Member

takahirom commented Jan 5, 2019

Overview (Required)

https://gallery.io/projects/MCHbtQVoQ2HCZd9Pbpex4PVP/files/MCHtA7U1iMGr6_wk8XZwCNuDb4sy76tbjpM (Please send request)
image

@mkano9
Copy link
Contributor

mkano9 commented Jan 8, 2019

I would love to work on this one 🙋‍♂️

@takahirom
Copy link
Member Author

Thank you every year! I am longing for your PR 😄

@mkano9
Copy link
Contributor

mkano9 commented Jan 16, 2019

Just a quick update, I should be able to publish a PR this weekend.

@mkano9
Copy link
Contributor

mkano9 commented Jan 16, 2019

What's supposed to happen when user clicks on a row? Launch the profileUrl in webview?

@takahirom
Copy link
Member Author

Thank you. I think that nothing should happen. If necessary we can also add later.

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

@takahirom Can you think of anything that might be causing this error? I can't compile due to an error that says "Duplicate class found in the file .... item_staff.xml". I get the same error for fragment_staff_search.xml. (These are new files I am adding) FYI this is the first time I use the databinding and the navigation component libraries.

screen shot 2019-01-19 at 9 26 29 am

@takahirom
Copy link
Member Author

@miga9
Thank you for challenging for this issue!
This error on the IDE is a common problem and seems to be normal. Can you copy the compile error message?

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

Thanks for responding!

Let me give you more info. I have added Staff class to /model/src/commonMain/kotlin/Staff.kt, API response classes to /data/api/src/commonMain/kotlin/io/github/droidkaigi/confsched2019/data/api/response/, and Room entity classes to /data/db/src/commonMain/kotlin/io/github/droidkaigi/confsched2019/data/db/entity/.

screen shot 2019-01-19 at 10 33 09 am

In the same order as the 5 errors in the screenshot:

/{path}/kaigi2019/feature/staff/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/io/github/droidkaigi/confsched2019/staff/databinding/ItemStaffBinding.java:26: error: cannot find symbol protected ItemStaffBinding(DataBindingComponent _bindingComponent, View _root, ^ symbol: class DataBindingComponent location: class ItemStaffBinding

/{path}/kaigi2019/feature/staff/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/io/github/droidkaigi/confsched2019/staff/databinding/ItemStaffBinding.java:59: error: cannot find symbol @Nullable DataBindingComponent component) { ^ symbol: class DataBindingComponent location: class ItemStaffBinding

/{path}/kaigi2019/feature/staff/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/io/github/droidkaigi/confsched2019/staff/databinding/FragmentStaffSearchBinding.java:17: error: cannot find symbol protected FragmentStaffSearchBinding(DataBindingComponent _bindingComponent, View _root, ^ symbol: class DataBindingComponent location: class FragmentStaffSearchBinding

/{path}kaigi2019/feature/staff/build/generated/data_binding_base_class_source_out/debug/dataBindingGenBaseClassesDebug/out/io/github/droidkaigi/confsched2019/staff/databinding/FragmentStaffSearchBinding.java:42: error: cannot find symbol @Nullable DataBindingComponent component) { ^ symbol: class DataBindingComponent location: class FragmentStaffSearchBinding

/{path}/kaigi2019/feature/staff/build/tmp/kapt3/stubs/debug/io/github/droidkaigi/confsched2019/staff/ui/item/StaffItem.java:26: error: Assisted injection requires at least one non-@Assisted parameter. public StaffItem(@org.jetbrains.annotations.NotNull() ^

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

It's still a mess, but I pushed my branch to my repo, if that helps.
mkano9@10e3ad5

@takahirom
Copy link
Member Author

Thank you 👍
I have not checked it yet. But I am concerned about this error. If you don't have @Inject parameter, you can create Item by using a normal way.
Databinding will also display an error if the other part is bad. 😭

/{path}/kaigi2019/feature/staff/build/tmp/kapt3/stubs/debug/io/github/droidkaigi/confsched2019/staff/ui/item/StaffItem.java:26: error: Assisted injection requires at least one non-@Assisted parameter. public StaffItem(@org.jetbrains.annotations.NotNull() ^
class StaffItem(
    val staff: Staff
) : BindableItem<ItemStaffBinding>(staff.id.hashCode().toLong()) {
            items += result.staffs.map {
                StaffItem(it)
            }

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

It reduced the 5 errors down to 1. "Clean Project" and building again didn't work. ItemStaffBinding class seems to not recognize the Staff class import. And DataBinderMapperImpl doesn't see ItemStaffBindingImpl.

kaigi2019/feature/staff/build/generated/source/kapt/debug/io/github/droidkaigi/confsched2019/staff/DataBinderMapperImpl.java:10: error: cannot find symbol import io.github.droidkaigi.confsched2019.staff.databinding.ItemStaffBindingImpl; ^ symbol: class ItemStaffBindingImpl location: package io.github.droidkaigi.confsched2019.staff.databinding

@takahirom
Copy link
Member Author

👀

@tomoya0x00
Copy link
Contributor

Is the following error message displayed?

  シンボル:   クラス ItemStaffBindingImpl
  場所: パッケージ io.github.droidkaigi.confsched2019.staff.databinding
e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
****/ data binding error ****msg:Could not find accessor io.github.droidkaigi.confsched2019.model.Staff.imageUrl
file:D:\development\ghq\github.com\miga9\conference-app-2019\feature\staff\src\main\res\layout\item_staff.xml
loc:31:28 - 31:41

@takahirom
Copy link
Member Author

Sometimes databinding will display important errors later. 😭

@takahirom
Copy link
Member Author

Probably I can use iconUrl 👍

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

Ah yes! Printing the stacktrace by ./gradlew :frontend:android:assembleDebug --stacktrace gave me that detail. It still has similar errors, but I think I can figure it out now.

Thank you for your time and the help! @takahirom @tomoya0x00

@takahirom
Copy link
Member Author

Please feel free to ask us if you have any questions. 👍

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

I have been fighting a compile error below from mkano9@3035e2b#diff-0dc44fa82dcee2a3d4d7bb9f2f9fda8bR70. Android Studio recognizes nothing from the model module.

e: kaigi2019/feature/staff/src/main/java/io/github/droidkaigi/confsched2019/staff/ui/StaffSearchFragment.kt: (70, 34): Unresolved reference: changed

Can you think of any possibilities? Have you guys been through something similar in this project?

This livedata is from mkano9@3035e2b#diff-0f996f98f14222fd162ff583467fa8ae

screen shot 2019-01-19 at 2 22 07 pm

@mkano9
Copy link
Contributor

mkano9 commented Jan 19, 2019

I was able to get it to compile. I had to manually add the import statements for io.github.droidkaigi.confsched2019.ext.android.changed although my IDE still shows in red as it doesn't recognize.

@takahirom
Copy link
Member Author

It is a common problem with this project. Close the project and return to the "Welcome to Android Studio" screen. So when you mouse over the project, press the close button that appears. And it should be displayed again by reopening the project.

@takahirom
Copy link
Member Author

I opened that issue.
#548

@mkano9
Copy link
Contributor

mkano9 commented Jan 20, 2019

@takahirom Thank you!

One more question, does the staff list have to be sorted alphabetically or just display it in the order from API response? If we are displaying in the order from API response, then I think showing the initial letter on the left may not make sense as it will repeat and is in no order.

@takahirom
Copy link
Member Author

I am sorry to have changed, but I do not want to display the initial letter and I would like to use the order returned from the API. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants