Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoongcho committed Oct 7, 2023
1 parent f72f9b1 commit e6308a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -175,6 +177,7 @@ class DailySymbolFragment : Fragment() {
addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
mBinding.month.text = mDailySymbolList[(mBinding.dailyCardRecyclerView.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition()].date
mBinding.dailyCardRecyclerView.minimumHeight = 0
}
})
}
Expand All @@ -188,7 +191,7 @@ class DailySymbolFragment : Fragment() {
val dayOfMonth = SimpleDateFormat("dd", Locale.getDefault())
val dateFormat = SimpleDateFormat(DateUtils.DATE_PATTERN_DASH, Locale.getDefault())
cal.time = Date()
mBinding.month.text = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault()).uppercase()
if (mBinding.month.text.isEmpty()) mBinding.month.text = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.getDefault()).uppercase()

mDailySymbolList.clear()
for (num in 1..365) {
Expand All @@ -208,6 +211,7 @@ class DailySymbolFragment : Fragment() {
@SuppressLint("NotifyDataSetChanged")
fun updateDailySymbol() {
init365Day()
mBinding.dailyCardRecyclerView.minimumHeight = mBinding.dailyCardRecyclerView.height
mDailySymbolAdapter.notifyDataSetChanged()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class StockLineChartFragment : androidx.fragment.app.Fragment() {
***************************************************************************************************/
private lateinit var mSDatePickerDialog: DatePickerDialog
private lateinit var mEDatePickerDialog: DatePickerDialog
private val mStartCalendar = Calendar.getInstance(Locale.getDefault()).apply { add(Calendar.YEAR, -1) }
private val mStartCalendar = Calendar.getInstance(Locale.getDefault()).apply { add(Calendar.MONTH, -6) }
private val mEndCalendar = Calendar.getInstance(Locale.getDefault())
private var mStartMillis = mStartCalendar.timeInMillis
private var mEndMillis = 0L
Expand Down Expand Up @@ -97,7 +97,7 @@ class StockLineChartFragment : androidx.fragment.app.Fragment() {
***************************************************************************************************/
private var mChartMode = R.id.radio_button_option_a
private var mCheckedSyncMarker = true
private var mCheckedDrawCircle = false
private var mCheckedDrawCircle = true
private var mCheckedDrawMarker = true
private var mCheckedEvaluatePrice = true
private var mCheckedPrincipalHighlight = true
Expand Down Expand Up @@ -754,7 +754,8 @@ class StockLineChartFragment : androidx.fragment.app.Fragment() {
private fun setDefaultFillChartColor(lineDataSet: LineDataSet, color: Int) {
lineDataSet.run {
fillColor = color
enableDashedLine(0f, 1f, 0f)
this.color = color
// enableDashedLine(3f, 1f, 0f)
setDrawFilled(true)
setDrawCircleHole(false)
setDrawCircles(false)
Expand Down

0 comments on commit e6308a4

Please sign in to comment.