Skip to content

Commit

Permalink
[FEAT]: Change Report Graph Animation
Browse files Browse the repository at this point in the history
1. 통계뷰2 그래프 그래프 속도 2000 -> 300
2. 통계뷰2 그래프 3M, 5M 클릭시 애니메이션 제외 - 디자인 요청사항
  • Loading branch information
hjh1161514 committed Jan 20, 2022
1 parent 9cc0c72 commit 75a5014
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ReportGraphFragment : Fragment() {
private var COUNT_X_LABEL = 5
private var recordCount = ArrayList<String>()
private var monthCount = ArrayList<String>()
private var isFirst = true

override fun onCreateView(
inflater: LayoutInflater,
Expand Down Expand Up @@ -82,7 +83,11 @@ class ReportGraphFragment : Fragment() {
private fun initBarChart(recordCount: ArrayList<String>) {
val data: BarData = createBarChartData(recordCount)
// set bar width
data.barWidth = 0.1f
if (MAX_X_VALUE < 5) {
data.barWidth = 0.06f
} else {
data.barWidth = 0.1f
}
configureChartAppearance()
prepareChartData(data)
}
Expand All @@ -92,13 +97,15 @@ class ReportGraphFragment : Fragment() {
tvGraph3Month.setOnClickListener {
MAX_X_VALUE = 3
COUNT_X_LABEL = 3
isFirst = false
tvGraph5Month.setTextColor(Color.GRAY)
tvGraph3Month.setTextColor(Color.WHITE)
initNetwork()
}
tvGraph5Month.setOnClickListener {
MAX_X_VALUE = 5
COUNT_X_LABEL = 5
isFirst = false
tvGraph5Month.setTextColor(Color.WHITE)
tvGraph3Month.setTextColor(Color.GRAY)
initNetwork()
Expand Down Expand Up @@ -145,13 +152,14 @@ class ReportGraphFragment : Fragment() {
extraBottomOffset = 20f

// X, Y 바의 애니메이션 효과
animateY(2000)
if (isFirst) animateY(300)
// bar background
setDrawBarShadow(true)
// bar touch
setTouchEnabled(false)

// chart label
getLegend().isEnabled = false
legend.isEnabled = false
}
}

Expand Down

0 comments on commit 75a5014

Please sign in to comment.