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

BuildView refactoring #28

Merged

Conversation

DreierF
Copy link
Contributor

@DreierF DreierF commented Feb 11, 2017

Hi,
As proposed in the last pull request I have now refactored the BuildView, to be less coupled with Build and Branch. Therefore I introduced an interface IBuildState, that is implemented by Build and Branch.
The methods setBuildData and setPullRequestData have been inlined at call site to reduce the number of parameters.
Further all attributes that are shown in the BuildView have now a default visibility set to GONE and are set to VISIBLE when the attribute is actually set. This enables to also use the BuildView for the repository list.
Last but not least BuildItemViewHolder is now used for all lists, because they have identical behaviours.

@dkhmelenko
Copy link
Owner

@DreierF Build is failing. Could you please fix it first?

@DreierF
Copy link
Contributor Author

DreierF commented Feb 12, 2017

Oh. Sorry didn't see it.

holder.mBuildView.setCommit(relatedCommit);
holder.mBuildView.setState(relatedBuild);
holder.mBuildView.setTitle(
holder.mBuildView.getContext().getString(R.string.pull_request_number, request.getPullRequestNumber()));
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DreierF shouldn't this class have BuildViewHolder as ViewHolder? then we can remove BranchViewHolder and item_pull_request.xml

Copy link
Owner

@dkhmelenko dkhmelenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides that looks good 👍 Looking forward to get merged it.

@DreierF
Copy link
Contributor Author

DreierF commented Feb 16, 2017

Fixed! Not sure how I could miss that one 😅

@dkhmelenko
Copy link
Owner

dkhmelenko commented Feb 16, 2017

@DreierF It's failing now again. Could you fix it?
I restarted the job on Travis, now it's working :)

@dkhmelenko
Copy link
Owner

dkhmelenko commented Feb 16, 2017

it's crashing on openning any repo details.
Device S7 edge. Stacktrace:

			Process: com.khmelenko.lab.travisclient, PID: 16013
			java.lang.RuntimeException: Unable to bind views for com.khmelenko.lab.travisclient.adapter.viewholder.BuildViewHolder
				at butterknife.ButterKnife.bind(ButterKnife.java:322)
				at butterknife.ButterKnife.bind(ButterKnife.java:279)
				at com.khmelenko.lab.travisclient.adapter.viewholder.BuildViewHolder.<init>(BuildViewHolder.java:29)
				at com.khmelenko.lab.travisclient.adapter.PullRequestsListAdapter.onCreateViewHolder(PullRequestsListAdapter.java:48)
				at com.khmelenko.lab.travisclient.adapter.PullRequestsListAdapter.onCreateViewHolder(PullRequestsListAdapter.java:23)
				at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6319)
				at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5507)
				at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5392)
				at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5388)
				at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2149)
				at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1533)
				at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1496)
				at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:593)
				at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3535)
				at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3264)
				at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3796)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:636)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
				at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1795)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
				at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
				at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1375)
				at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:870)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
				at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
				at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
				at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
				at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
				at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
				at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
				at android.view.View.layout(View.java:17938)
				at android.view.ViewGroup.layout(ViewGroup.java:5812)
				at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
				at android.widget.FrameLayout.onLayout(FrameLayout.java:281)

@dkhmelenko dkhmelenko merged commit f4265c5 into dkhmelenko:develop Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants