Migrate to ConstraintLayout (WIP)

This commit is contained in:
topjohnwu
2019-01-22 03:52:29 -05:00
parent abf19aad74
commit a44dc8df37
4 changed files with 203 additions and 167 deletions
@@ -129,9 +129,6 @@ public class PolicyAdapter extends RecyclerView.Adapter<PolicyAdapter.ViewHolder
.setNegativeButton(R.string.no_thanks, null)
.setCancelable(true)
.show());
// Hide for now
holder.moreInfo.setVisibility(View.GONE);
}
@Override
@@ -19,6 +19,7 @@ public interface ExpandableView {
default void setupExpandable() {
Container container = getContainer();
setExpanded(false);
container.expandLayout.getViewTreeObserver().addOnPreDrawListener(
new ViewTreeObserver.OnPreDrawListener() {
@@ -32,7 +33,6 @@ public interface ExpandableView {
}
container.expandLayout.getViewTreeObserver().removeOnPreDrawListener(this);
container.expandLayout.setVisibility(View.GONE);
container.expandAnimator = slideAnimator(0, container.expandHeight);
container.collapseAnimator = slideAnimator(container.expandHeight, 0);
return true;
@@ -51,7 +51,6 @@ public interface ExpandableView {
ViewGroup.LayoutParams layoutParams = container.expandLayout.getLayoutParams();
layoutParams.height = expanded ? container.expandHeight : 0;
container.expandLayout.setLayoutParams(layoutParams);
container.expandLayout.setVisibility(expanded ? View.VISIBLE : View.GONE);
}
default void expand() {