This commit is contained in:
KJG
2024-12-20 16:18:45 +09:00
parent a1162f2f4c
commit 41824758a7
18 changed files with 847 additions and 294 deletions
@@ -172,7 +172,7 @@ class CalendarLayout : FrameLayout {
view!!.getHitRect(rect)
val isClick = rect.contains(ev.x.toInt(), ev.y.toInt())
Log.d(
TAG,
"tag",
"isClickView() called with: isClick = [$isClick]"
)
return isClick
@@ -302,7 +302,7 @@ class CalendarLayout : FrameLayout {
}
companion object {
private const val TAG = "CalendarLayout"
private const val tag = "CalendarLayout"
const val TYPE_OPEN = 0
@@ -158,7 +158,7 @@ class CalendarView : ViewGroup {
}
}
Log.i(
TAG,
"tag",
"onMeasure() called with: itemHeight = [$itemHeight], itemWidth = [$itemWidth]"
)
lastwidthMeasureSpec = widthMeasureSpec
@@ -199,6 +199,6 @@ class CalendarView : ViewGroup {
}
companion object {
private const val TAG = "CalendarView"
private const val tag = "CalendarView"
}
}
@@ -9,8 +9,8 @@ import com.example.accountbook.calendar2.CalendarLayoutListener
import com.example.accountbook.calendar2.CalendarManager
import com.example.accountbook.calendar2.CalendarPagerAdapter
import com.example.accountbook.databinding.CalendarActivityExampleBinding
import com.example.accountbook.databinding.ExDayViewBinding
import com.example.calrendarview.DayView
//import com.example.accountbook.databinding.ExDayLayoutBinding
import com.example.calrendarview.DayLayout
import com.example.calrendarview.model.CalendarBean
import com.example.calrendarview.model.CalendarFactory
import com.example.calrendarview.model.DayInfo
@@ -26,9 +26,9 @@ class ActivityCalendarEx: AppCompatActivity() {
bind = CalendarActivityExampleBinding.inflate(this.layoutInflater)
// for (i in 0 until 7) {
val infos = CalendarFactory().getBeansOfThisWeek()
// val infos = CalendarFactory().getBeansOfThisWeek()
// bind.otherViews.numberOfRow = 7
// (bind.otherViews.getChildAt(i) as? DayView)?.dayInfo = infos.get(i)
// (bind.otherViews.getChildAt(i) as? DayLayout)?.infoDay = infos.get(i)
// }
setContentView(bind.root)
}
@@ -3,15 +3,20 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.example.calrendarview.MonthView
android:id="@+id/otherViews"
<!-- <com.example.calrendarview.WeekLayout-->
<!-- android:id="@+id/otherViews"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:item_layout="@layout/ex_day_view"-->
<!-- app:numOfDayId="@id/ex_text_day"-->
<!-- />-->
<com.example.calrendarview.CalendarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
app:item_layout="@layout/ex_day_view"
app:numOfDayId="@id/ex_text_day"
/>
app:numOfDayId="@id/ex_text_day" />
<!-- <com.example.accountbook.calendar2.CalendarLayout-->
<!-- android:id="@+id/calendarLayoutEx"-->
<!-- android:background="#dddddd"-->
@@ -61,7 +66,7 @@
<!--&lt;!&ndash; app:layout_constraintBottom_toBottomOf="parent"&ndash;&gt;-->
<!--&lt;!&ndash; />&ndash;&gt;-->
<!-- </com.example.accountbook.calendar2.CalendarLayout>-->
<!-- <com.example.calrendarview.DayView-->
<!-- <com.example.calrendarview.DayLayout-->
<!-- android:id="@+id/test"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
+10 -12
View File
@@ -2,40 +2,38 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingVertical="10dp"
android:paddingHorizontal="5dp"
android:paddingHorizontal="1dp"
>
<TextView
android:id="@+id/ex_text_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:gravity="end|center_vertical"
android:gravity="center"
android:text="01일"
android:textSize="15dp"
android:textSize="12dp"
/>
<TextView
android:id="@+id/ex_text_day_view_01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/ex_text_day"
android:gravity="end|center_vertical"
android:gravity="start|center_vertical"
android:text="ex_text_day"
android:textSize="12dp"
android:background="#9acd32"
android:layout_marginTop="5dp"
android:textSize="8dp"
android:layout_marginTop="8dp"
/>
<TextView
android:id="@+id/ex_text_day_view_02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/ex_text_day_view_01"
android:gravity="end|center_vertical"
android:gravity="start|center_vertical"
android:text="ex_text_day"
android:textSize="12dp"
android:background="#dda0dd"
android:layout_marginTop="5dp"
android:textSize="8dp"
android:layout_marginTop="3dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>