-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
month view getting invisible on expanding #64
Comments
Change 301 line in CollapsibleCalendar.kt from
to
|
@Zeeshan-The-Dev not working out still facing same issue while expanding. |
I was trying fixing this issue, but i reintegrate the library, and it works, try again. |
I'm also facing the same issue. May I know how you come up with a solution or workaround on this? Thanks! |
@MihirLakhia @Zeeshan-The-Dev @forceporquillo @tobiasschuerg I debug the whole working of it and came up with the solution. Solution:- just write ( reload() method ) inside this condition in expand method if (interpolatedTime == 1f) {
} Expand Method :- fun expand(duration: Int) {
} |
Try this solution: Change Full reload() method override fun reload() {
mAdapter?.let { mAdapter ->
mAdapter.refresh()
val calendar = Calendar.getInstance()
val tempDatePattern: String
if (calendar.get(Calendar.YEAR) != mAdapter.calendar.get(Calendar.YEAR)) {
tempDatePattern = "MMMM yyyy"
} else {
tempDatePattern = datePattern
}
// reset UI
val dateFormat = SimpleDateFormat(tempDatePattern, getCurrentLocale(context))
dateFormat.timeZone = mAdapter.calendar.timeZone
mTxtTitle.text = dateFormat.format(mAdapter.calendar.time)
mTableHead.removeAllViews()
mTableBody.removeAllViews()
var rowCurrent: TableRow
rowCurrent = TableRow(context)
rowCurrent.layoutParams = TableLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT)
for (i in 0..6) {
val view = mInflater.inflate(R.layout.layout_day_of_week, null)
val txtDayOfWeek = view.findViewById<View>(R.id.txt_day_of_week) as TextView
txtDayOfWeek.setText(DateFormatSymbols().getShortWeekdays()[(i + firstDayOfWeek) % 7 + 1])
view.layoutParams = TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT,1f)
rowCurrent.addView(view)
}
mTableHead.addView(rowCurrent)
// set day view
for (i in 0 until mAdapter.count) {
if (i % 7 == 0) {
rowCurrent = TableRow(context)
rowCurrent.layoutParams = TableLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT, 1f)
mTableBody.addView(rowCurrent)
}
val view = mAdapter.getView(i)
view.layoutParams = TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT, 1f)
params.let { params ->
if (params != null && (mAdapter.getItem(i).diff < params.prevDays || mAdapter.getItem(i).diff > params.nextDaysBlocked)) {
view.isClickable = false
view.alpha = 0.3f
} else {
view.setOnClickListener { v -> onItemClicked(v, mAdapter.getItem(i)) }
}
}
rowCurrent.addView(view)
}
redraw()
mIsWaitingForUpdate = true
}
} |
on expanding Calendar month view getting disable.
please comment, if anyone have solution.
thanks
The text was updated successfully, but these errors were encountered: