Skip to content

Commit

Permalink
修复统计行字体显示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyanbin committed Nov 15, 2017
1 parent 590a6ae commit 6d5f44c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHo
float scalex = 1-TanTanLayoutManager.SCALE*(level-Math.abs(proportion));
Log.e("huang","scaleX"+scalex);
child.setScaleX(scalex);
child.setTranslationY(TanTanLayoutManager.MAX_TRANY*(level-Math.abs(proportion)));
child.setTranslationY(TanTanLayoutManager.MAX_TRANSLATION_Y *(level-Math.abs(proportion)));
}/*else{
float scalex = 1-TanTanLayoutManager.SCALE*(level-1-Math.abs(proportion)-Math.abs(proportion));
Log.e("huang","level--------"+level+"proportion"+proportion);
child.setScaleX(scalex);
child.setTranslationY(TanTanLayoutManager.MAX_TRANY*(level-1-Math.abs(proportion)-Math.abs(proportion)));
child.setTranslationY(TanTanLayoutManager.MAX_TRANSLATION_Y*(level-1-Math.abs(proportion)-Math.abs(proportion)));
}*/
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TanTanLayoutManager extends LayoutManager {

public static final int MAX_SHOW_COUNT = 4;
public static final float SCALE = 0.05f;
public static final int MAX_TRANY = 20;
public static final int MAX_TRANSLATION_Y = 20;
@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {

Expand Down Expand Up @@ -43,10 +43,10 @@ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State
child.setTranslationY(0);
}else if(level < MAX_SHOW_COUNT-1){
child.setScaleX(1-SCALE*level);
child.setTranslationY(MAX_TRANY*level);
child.setTranslationY(MAX_TRANSLATION_Y *level);
}else{
child.setScaleX(1-SCALE*(level-1));
child.setTranslationY(MAX_TRANY*(level-1));
child.setTranslationY(MAX_TRANSLATION_Y *(level-1));
}

}
Expand Down

0 comments on commit 6d5f44c

Please sign in to comment.