...
This commit is contained in:
@@ -3,35 +3,34 @@ package com.example.accountbook.calendar2.example
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.children
|
||||
import com.example.accountbook.R
|
||||
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.calrendarview.model.CalendarBean
|
||||
import com.example.calrendarview.model.CalendarFactory
|
||||
import com.example.calrendarview.model.DayInfo
|
||||
|
||||
class ActivityCalendarEx: AppCompatActivity() {
|
||||
// member
|
||||
private var bind: CalendarActivityExampleBinding? = null
|
||||
lateinit var bind: CalendarActivityExampleBinding
|
||||
|
||||
|
||||
// AppCompatActivity
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
bind = CalendarActivityExampleBinding.inflate(this.layoutInflater)
|
||||
bind?.let {
|
||||
setContentView(it.root)
|
||||
it.calendarLayoutEx.listener = object: CalendarLayoutListener {
|
||||
override fun onCreatedViewPager() {
|
||||
it.calendarLayoutEx.viewPager?.adapter = CalendarPagerAdapter(this@ActivityCalendarEx).apply {
|
||||
this.layoutId = R.layout.calendar_pager_example
|
||||
}
|
||||
}
|
||||
}
|
||||
it.root.setOnClickListener{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// for (i in 0 until 7) {
|
||||
val infos = CalendarFactory().getBeansOfThisWeek()
|
||||
bind.otherViews.numberOfRow = 7
|
||||
// (bind.otherViews.getChildAt(i) as? DayView)?.dayInfo = infos.get(i)
|
||||
// }
|
||||
setContentView(bind.root)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
||||
@@ -3,62 +3,68 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<TextView
|
||||
android:id="@+id/otherViewEx"
|
||||
android:background="#eeeeee"
|
||||
<com.example.calrendarview.MonthView
|
||||
android:id="@+id/otherViews"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="otherView"
|
||||
android:gravity="center"
|
||||
app:item_layout="@layout/ex_day_view"
|
||||
app:numOfDayId="@id/ex_text_day"
|
||||
/>
|
||||
<com.example.accountbook.calendar2.CalendarLayout
|
||||
android:id="@+id/calendarLayoutEx"
|
||||
android:background="#dddddd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/otherViewEx"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
>
|
||||
<!-- app:calendarId="@id/calendarViewPager"-->
|
||||
|
||||
<!-- <com.example.accountbook.calendar2.CalendarLayout-->
|
||||
<!-- android:id="@+id/calendarLayoutEx"-->
|
||||
<!-- android:background="#dddddd"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/otherViewEx"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- >-->
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/test1"
|
||||
android:background="#9acd32"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/test2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
<TextView
|
||||
android:background="#a8a800"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:text="test"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/subViewEx"-->
|
||||
<!--<!– app:calendarId="@id/calendarViewPager"–>-->
|
||||
<!--<!– >–>-->
|
||||
<!-- <androidx.viewpager2.widget.ViewPager2-->
|
||||
<!-- android:id="@+id/test1"-->
|
||||
<!-- android:background="#9acd32"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:background="@color/material_dynamic_primary50"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:text="subView"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- />-->
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/calendar"-->
|
||||
<!-- android:background="#cccccc"-->
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/test2"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/subViewEx"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- />-->
|
||||
</com.example.accountbook.calendar2.CalendarLayout>
|
||||
<!-- android:layout_height="50dp"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- >-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:background="#a8a800"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:text="test"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
<!--<!– <TextView–>-->
|
||||
<!--<!– android:id="@+id/subViewEx"–>-->
|
||||
<!--<!– android:layout_width="match_parent"–>-->
|
||||
<!--<!– android:background="@color/material_dynamic_primary50"–>-->
|
||||
<!--<!– android:layout_height="30dp"–>-->
|
||||
<!--<!– app:layout_constraintTop_toTopOf="parent"–>-->
|
||||
<!--<!– android:text="subView"–>-->
|
||||
<!--<!– android:gravity="center"–>-->
|
||||
<!--<!– />–>-->
|
||||
<!--<!– <androidx.recyclerview.widget.RecyclerView–>-->
|
||||
<!--<!– android:id="@+id/calendar"–>-->
|
||||
<!--<!– android:background="#cccccc"–>-->
|
||||
<!--<!– android:layout_width="match_parent"–>-->
|
||||
<!--<!– android:layout_height="0dp"–>-->
|
||||
<!--<!– app:layout_constraintTop_toBottomOf="@id/subViewEx"–>-->
|
||||
<!--<!– app:layout_constraintBottom_toBottomOf="parent"–>-->
|
||||
<!--<!– />–>-->
|
||||
<!-- </com.example.accountbook.calendar2.CalendarLayout>-->
|
||||
<!-- <com.example.calrendarview.DayView-->
|
||||
<!-- android:id="@+id/test"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:item_layout="@layout/activity_writer"-->
|
||||
<!-- app:numOfDayId="@id/text_write_title"/>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:paddingVertical="10dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
>
|
||||
<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:text="01일"
|
||||
android:textSize="15dp"
|
||||
/>
|
||||
<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:text="ex_text_day"
|
||||
android:textSize="12dp"
|
||||
android:background="#9acd32"
|
||||
android:layout_marginTop="5dp"
|
||||
/>
|
||||
<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:text="ex_text_day"
|
||||
android:textSize="12dp"
|
||||
android:background="#dda0dd"
|
||||
android:layout_marginTop="5dp"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user