Skip to content

Commit 15eb9d8

Browse files
Bogdan MelnychukBogdan Melnychuk
authored andcommitted
Fixed issues bmelnychuk#1 and bmelnychuk#11
1 parent 926f525 commit 15eb9d8

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
1919

20-
VERSION_NAME=1.2.3
21-
VERSION_CODE=5
20+
VERSION_NAME=1.2.4
21+
VERSION_CODE=6
2222

2323

2424
ANDROID_BUILD_MIN_SDK_VERSION=11

library/src/main/java/com/unnamed/b/atv/view/AndroidTreeView.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public View getView(int style) {
8585
if (containerStyle != 0 && applyForRoot) {
8686
containerContext = new ContextThemeWrapper(mContext, containerStyle);
8787
}
88-
final LinearLayout viewTreeItems = new LinearLayout(containerContext);
88+
final LinearLayout viewTreeItems = new LinearLayout(containerContext, null, containerStyle);
8989

9090
viewTreeItems.setId(R.id.tree_items);
9191
viewTreeItems.setOrientation(LinearLayout.VERTICAL);
@@ -185,7 +185,7 @@ private void collapseNode(TreeNode node, final boolean includeSubnodes) {
185185
node.setExpanded(false);
186186
TreeNode.BaseNodeViewHolder nodeViewHolder = getViewHolderForNode(node);
187187

188-
if(mUseDefaultAnimation) {
188+
if (mUseDefaultAnimation) {
189189
collapse(nodeViewHolder.getNodeItemsView());
190190
} else {
191191
nodeViewHolder.getNodeItemsView().setVisibility(View.GONE);
@@ -214,7 +214,7 @@ private void expandNode(final TreeNode node, boolean includeSubnodes) {
214214
}
215215

216216
}
217-
if(mUseDefaultAnimation) {
217+
if (mUseDefaultAnimation) {
218218
expand(parentViewHolder.getNodeItemsView());
219219
} else {
220220
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
@@ -372,13 +372,12 @@ private static void expand(final View v) {
372372

373373
v.getLayoutParams().height = 0;
374374
v.setVisibility(View.VISIBLE);
375-
Animation a = new Animation()
376-
{
375+
Animation a = new Animation() {
377376
@Override
378377
protected void applyTransformation(float interpolatedTime, Transformation t) {
379378
v.getLayoutParams().height = interpolatedTime == 1
380379
? LinearLayout.LayoutParams.WRAP_CONTENT
381-
: (int)(targetHeight * interpolatedTime);
380+
: (int) (targetHeight * interpolatedTime);
382381
v.requestLayout();
383382
}
384383

@@ -389,21 +388,20 @@ public boolean willChangeBounds() {
389388
};
390389

391390
// 1dp/ms
392-
a.setDuration((int)(targetHeight / v.getContext().getResources().getDisplayMetrics().density));
391+
a.setDuration((int) (targetHeight / v.getContext().getResources().getDisplayMetrics().density));
393392
v.startAnimation(a);
394393
}
395394

396395
private static void collapse(final View v) {
397396
final int initialHeight = v.getMeasuredHeight();
398397

399-
Animation a = new Animation()
400-
{
398+
Animation a = new Animation() {
401399
@Override
402400
protected void applyTransformation(float interpolatedTime, Transformation t) {
403-
if(interpolatedTime == 1){
401+
if (interpolatedTime == 1) {
404402
v.setVisibility(View.GONE);
405-
}else{
406-
v.getLayoutParams().height = initialHeight - (int)(initialHeight * interpolatedTime);
403+
} else {
404+
v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime);
407405
v.requestLayout();
408406
}
409407
}
@@ -415,7 +413,7 @@ public boolean willChangeBounds() {
415413
};
416414

417415
// 1dp/ms
418-
a.setDuration((int)(initialHeight / v.getContext().getResources().getDisplayMetrics().density));
416+
a.setDuration((int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density));
419417
v.startAnimation(a);
420418
}
421419

library/src/main/java/com/unnamed/b/atv/view/TreeNodeWrapperView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private void init() {
3131
nodeContainer.setId(R.id.node_header);
3232

3333
ContextThemeWrapper newContext = new ContextThemeWrapper(getContext(), containerStyle);
34-
nodeItemsContainer = new LinearLayout(newContext);
34+
nodeItemsContainer = new LinearLayout(newContext, null, containerStyle);
3535
nodeItemsContainer.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
3636
nodeItemsContainer.setId(R.id.node_items);
3737
nodeItemsContainer.setOrientation(LinearLayout.VERTICAL);

0 commit comments

Comments
 (0)