...
This commit is contained in:
parent
6900d0ffb1
commit
c0f0cd4cb3
@ -49,4 +49,6 @@ dependencies {
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
// 추가
|
||||
implementation("androidx.viewpager2:viewpager2:1.1.0")
|
||||
}
|
||||
@ -18,26 +18,34 @@
|
||||
android:theme="@style/Theme.AccountBook">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.ActivityCalendar"
|
||||
<activity android:name=".calendar2.example.ActivityCalendarEx"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.AccountBook">
|
||||
android:theme="@style/Base.Theme.AccountBook">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.ActivityWriter"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.AccountBook">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
<!-- <activity-->
|
||||
<!-- android:name=".activity.ActivityCalendar"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:theme="@style/Theme.AccountBook">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.VIEW" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity>-->
|
||||
<!-- <activity-->
|
||||
<!-- android:name=".activity.ActivityWriter"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:theme="@style/Theme.AccountBook">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.VIEW" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </activity>-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
28
app/src/main/java/com/example/accountbook/BaseFragLayout.kt
Normal file
28
app/src/main/java/com/example/accountbook/BaseFragLayout.kt
Normal file
@ -0,0 +1,28 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
class BaseFragLayout : ConstraintLayout {
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes){
|
||||
findViewById<View>(R.id.child)?.let{
|
||||
it.visibility= View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.accountbook.calendar.CalendarDateView
|
||||
import com.example.accountbook.calendar.CalendarView
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
class BehaviorCalendar(context: Context?, attrs: AttributeSet?) : CoordinatorLayout.Behavior<CalendarDateView>(context, attrs) {
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: CalendarDateView,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
// parent: CoordinatorLayout
|
||||
// child: 이벤트를 받아 변경될 뷰
|
||||
// dependency: 의존하고 있는 다른 뷰?
|
||||
child.y = 0f
|
||||
Log.d("", "$child")
|
||||
Log.d("BehaviorCalendar", "$dependency")
|
||||
child.bottom = dependency.top - 50
|
||||
return false
|
||||
}
|
||||
|
||||
override fun layoutDependsOn(
|
||||
parent: CoordinatorLayout,
|
||||
child: CalendarDateView,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
Log.d("BehaviorCalendar", "layoutDependsOn $dependency")
|
||||
return dependency.id == R.id.list_table
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.accountbook.calendar.CalendarDateView
|
||||
import com.example.accountbook.calendar.CalendarView
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
class BehaviorCalendar2(context: Context?, attrs: AttributeSet?) : CoordinatorLayout.Behavior<View>(context, attrs) {
|
||||
override fun layoutDependsOn(
|
||||
parent: CoordinatorLayout,
|
||||
child: View,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
if ((child.tag as? View) != null && (child.tag as View).id == R.id.test2) {
|
||||
|
||||
} else {
|
||||
if(child.id == R.id.test) child.tag = child.findViewById<View>(R.id.test2)
|
||||
}
|
||||
return if (child.tag != null) {
|
||||
Log.d("BehaviorCalendar777", "layoutDependsOn $child")
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: View,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
// parent: CoordinatorLayout
|
||||
// child: 이벤트를 받아 변경될 뷰
|
||||
// dependency: 의존하고 있는 다른 뷰?
|
||||
Log.d("BehaviorCalendar333", "child: $child")
|
||||
Log.d("BehaviorCalendar333", "depend: $dependency")
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDependentViewRemoved(
|
||||
parent: CoordinatorLayout,
|
||||
child: View,
|
||||
dependency: View
|
||||
) {
|
||||
super.onDependentViewRemoved(parent, child, dependency)
|
||||
Log.d("BehaviorCalendar444", "$child")
|
||||
Log.d("BehaviorCalendar444", "$dependency")
|
||||
}
|
||||
|
||||
override fun onStartNestedScroll(
|
||||
coordinatorLayout: CoordinatorLayout,
|
||||
child: View,
|
||||
directTargetChild: View,
|
||||
target: View,
|
||||
axes: Int,
|
||||
type: Int
|
||||
): Boolean {
|
||||
Log.d("BehaviorCalendar555", "SCROLL_AXIS_VERTICAL")
|
||||
return axes == ViewCompat.SCROLL_AXIS_VERTICAL
|
||||
}
|
||||
|
||||
var dyDirectionSum = 0
|
||||
override fun onNestedPreScroll(
|
||||
coordinatorLayout: CoordinatorLayout,
|
||||
child: View,
|
||||
target: View,
|
||||
dx: Int,
|
||||
dy: Int,
|
||||
consumed: IntArray,
|
||||
type: Int
|
||||
) {
|
||||
(child.tag as? View)?.let {
|
||||
it.y += 2
|
||||
Log.d("BehaviorCalendar999", "onNestedPreScroll")
|
||||
}
|
||||
// if ((dy > 0 && dyDirectionSum < 0) || (dy < 0 && dyDirectionSum > 0)) {
|
||||
// }
|
||||
// if (dy > 10) {
|
||||
// child.y = 90f
|
||||
// } else {
|
||||
// child.y = 0f
|
||||
// }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.TableLayout
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.accountbook.calendar.CalendarDateView
|
||||
import com.example.accountbook.calendar.CalendarView
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
class BehaviorCalendarTop(context: Context?, attrs: AttributeSet?) : CoordinatorLayout.Behavior<TableLayout>(context, attrs) {
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: TableLayout,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
// parent: CoordinatorLayout
|
||||
// child: 이벤트를 받아 변경될 뷰
|
||||
// dependency: 의존하고 있는 다른 뷰?
|
||||
val height = 30 * (parent.resources.displayMetrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT)
|
||||
Log.d("", "$child")
|
||||
Log.d("BehaviorCalendarTop", "onDependentViewChanged $dependency")
|
||||
child.top = dependency.top - height
|
||||
child.bottom = dependency.top
|
||||
return false
|
||||
}
|
||||
|
||||
override fun layoutDependsOn(
|
||||
parent: CoordinatorLayout,
|
||||
child: TableLayout,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
Log.d("BehaviorCalendar", "layoutDependsOn $dependency")
|
||||
return dependency.id == R.id.list_table
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.annotation.NonNull
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import com.example.accountbook.calendar.CalendarDateView
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
class BehaviorCalendart(context: Context?, attrs: AttributeSet?) : CoordinatorLayout.Behavior<FloatingActionButton>(context, attrs) {
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: FloatingActionButton,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
// parent: CoordinatorLayout
|
||||
// child: 이벤트를 받아 변경될 뷰
|
||||
// dependency: 의존하고 있는 다른 뷰?
|
||||
child.y = 0f
|
||||
|
||||
Log.d("", "$child")
|
||||
Log.d("BehaviorCalendar", "$dependency")
|
||||
return false
|
||||
}
|
||||
|
||||
override fun layoutDependsOn(
|
||||
parent: CoordinatorLayout,
|
||||
child: FloatingActionButton,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
Log.d("BehaviorCalendar", "layoutDependsOn $dependency")
|
||||
return dependency is AppBarLayout
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,29 +1,35 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.example.accountbook.calendar.CalendarAdapter2
|
||||
import com.example.accountbook.calendar.CalendarBean
|
||||
import com.example.accountbook.calendar.CalendarFactory
|
||||
import com.example.accountbook.calendar.CalendarUtil
|
||||
import com.example.accountbook.databinding.FragmentFirstBinding
|
||||
import java.util.Date
|
||||
|
||||
/**
|
||||
* A simple [Fragment] subclass as the default destination in the navigation.
|
||||
*/
|
||||
class FirstFragment : Fragment() {
|
||||
class FirstFragment(layoutId: Int): Fragment(layoutId) {
|
||||
|
||||
private var _binding: FragmentFirstBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
|
||||
_binding = FragmentFirstBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
|
||||
@ -31,7 +37,6 @@ class FirstFragment : Fragment() {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// binding.buttonFirst.setOnClickListener {
|
||||
// findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment)
|
||||
// }
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.example.accountbook
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.navigation.findNavController
|
||||
@ -10,35 +13,110 @@ import androidx.navigation.ui.navigateUp
|
||||
import androidx.navigation.ui.setupActionBarWithNavController
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.accountbook.activity.ActivityCalendar
|
||||
import com.example.accountbook.activity.ActivityWriter
|
||||
import com.example.accountbook.adapter.AdapterTable
|
||||
import com.example.accountbook.adapter.SampleAdapter
|
||||
import com.example.accountbook.calendar.CalendarAdapter
|
||||
import com.example.accountbook.calendar.CalendarBean
|
||||
import com.example.accountbook.calendar.CalendarViewFragmentAdapter
|
||||
import com.example.accountbook.calendar.CalendarViewPagerAdapter
|
||||
import com.example.accountbook.calendar2.example.ActivityCalendarEx
|
||||
import com.example.accountbook.databinding.ActivityMainBinding
|
||||
import com.example.accountbook.databinding.FragmentCalendarBinding
|
||||
import com.example.accountbook.databinding.ItemCalendarBinding
|
||||
import com.example.accountbook.databinding.TempActivityMainBinding
|
||||
import com.example.accountbook.fragment.FragCalI1
|
||||
import com.example.accountbook.fragment.FragmentCalendar
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
class MainActivity: AppCompatActivity() {
|
||||
|
||||
private lateinit var appBarConfiguration: AppBarConfiguration
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private var adapterCalendar: CalendarAdapter? = null
|
||||
lateinit var bindItem: ItemCalendarBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater) // 뷰 init
|
||||
setContentView(binding.root) // activity에 뷰 연결하기
|
||||
// setSupportActionBar(binding.toolbar) // activity actionbar 연결하기
|
||||
|
||||
setSupportActionBar(binding.toolbar)
|
||||
// binding2 = TempActivityMainBinding.inflate(layoutInflater) // 뷰 init
|
||||
// setContentView(binding2.root) // activity에 뷰 연결하기
|
||||
// setSupportActionBar(binding2.toolbar) // activity actionbar 연결하기
|
||||
|
||||
val navController = findNavController(R.id.nav_host_fragment_content_main)
|
||||
appBarConfiguration = AppBarConfiguration(navController.graph)
|
||||
setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
// // NavHostFragment로 NavController 가져오기
|
||||
// val navController = findNavController(R.id.nav_host_fragment_content_main)
|
||||
// // 최상위 뷰에 뒤로가기 버튼 숨기기
|
||||
// appBarConfiguration = AppBarConfiguration(navController.graph)
|
||||
// // NavController와 ActionBar를 통합
|
||||
// // 뒤로가기 버튼이 생기고 제목이 업데이트 된다.
|
||||
// setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
//
|
||||
//
|
||||
// binding.fab.setOnClickListener { view ->
|
||||
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
// .setAction("Action", null)
|
||||
// .setAnchorView(R.id.fab).show()
|
||||
// }
|
||||
|
||||
binding.fab.setOnClickListener { view ->
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null)
|
||||
.setAnchorView(R.id.fab).show()
|
||||
}
|
||||
|
||||
startActivity(Intent(applicationContext, ActivityCalendar::class.java))
|
||||
// binding.listTable.adapter = SampleAdapter().apply { notifySample() }
|
||||
// binding.listTable.addOnScrollListener(
|
||||
// object : RecyclerView.OnScrollListener() {
|
||||
// override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
// super.onScrolled(recyclerView, dx, dy)
|
||||
// val layoutManager = recyclerView.layoutManager as LinearLayoutManager
|
||||
// val layoutParms = binding.calendar.layoutParams
|
||||
// if (layoutManager.findFirstVisibleItemPosition() == 0) {
|
||||
// Log.d("listTable", "it' on the 1st position.")
|
||||
// // 뷰 높이
|
||||
// layoutParms?.height = 300
|
||||
// // 달력의 열
|
||||
// // binding.calendarDateView.changeRow(1)
|
||||
// } else {
|
||||
// // 뷰 높이
|
||||
// layoutParms?.height = 800
|
||||
// // 달력의 열
|
||||
// // binding.calendarDateView.changeRow(6)
|
||||
// }
|
||||
// binding.calendar.layoutParams = layoutParms
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
|
||||
// view pager의 레이아웃에 calendarview를 담을 recyclerview가 필요한지 알기 어렵다
|
||||
// view pager의 레이아웃도 binding이 필요하다. viewHolder가 두번 있어야한다.
|
||||
// 따라서 view pager 레이아웃에 쓸 데이터도 필요할 수 도 있다.
|
||||
// val fcb = FragmentCalendarBinding.inflate(layoutInflater, binding.root, false)
|
||||
// val icb = ItemCalendarBinding.inflate(layoutInflater)
|
||||
//
|
||||
// bindItem = ItemCalendarBinding.inflate(layoutInflater, binding.root, false)
|
||||
// binding.pager.adapter = object : CalendarViewFragmentAdapter(this){
|
||||
// override fun getFragment(): FragmentCalendar {
|
||||
// return FragCalI1(R.layout.fragment_calendar, bindItem.root)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
startActivity(Intent(this, ActivityCalendarEx::class.java))
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
menuInflater.inflate(R.menu.menu_main, menu)
|
||||
@ -60,4 +138,41 @@ class MainActivity : AppCompatActivity() {
|
||||
return navController.navigateUp(appBarConfiguration)
|
||||
|| super.onSupportNavigateUp()
|
||||
}
|
||||
|
||||
// private fun initCalendar() {
|
||||
// Log.i("FragmentCalendar","initView")
|
||||
// adapterCalendar = object: CalendarAdapter {
|
||||
// override fun getView(
|
||||
// convertView: View?,
|
||||
// parentView: ViewGroup?,
|
||||
// bean: CalendarBean?
|
||||
// ): View {
|
||||
// Log.i("FragmentCalendar","getView")
|
||||
//
|
||||
// var bindItem : ItemCalendarBinding? = null
|
||||
// if (convertView == null) {
|
||||
// bindItem = ItemCalendarBinding.inflate(LayoutInflater.from(parentView?.context))
|
||||
// } else {
|
||||
// bindItem = ItemCalendarBinding.bind(convertView)
|
||||
// }
|
||||
// bindItem.day.apply {
|
||||
// this.text = bean?.day.toString()
|
||||
// if (bean?.monthFlag != 0) {
|
||||
// this.setTextColor(Color.WHITE)
|
||||
// } else {
|
||||
// this.setTextColor(Color.BLACK)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// bindItem.root.setOnLongClickListener{ it ->
|
||||
//// startActivity(Intent(context, ActivityWriter::class.java))
|
||||
//// return@setOnLongClickListener true
|
||||
//// }
|
||||
// return convertView ?: bindItem.root
|
||||
// }
|
||||
//
|
||||
//// override fun hasChildView() = binding.calendarDateView.views.size > 0
|
||||
// }
|
||||
// binding.calendarDateView.setAdapter(adapterCalendar)
|
||||
// }
|
||||
}
|
||||
@ -21,7 +21,7 @@ import com.example.accountbook.fragment.FragmentTable
|
||||
|
||||
class ActivityCalendar: AppCompatActivity(){
|
||||
private lateinit var bind: ActivityCalendarBinding
|
||||
val fragmentCalendar: FragmentCalendar by lazy { FragmentCalendar() }
|
||||
// val fragmentCalendar: FragmentCalendar<Any?> by lazy { FragmentCalendar() }
|
||||
val fragmentTable: FragmentTable by lazy { FragmentTable() }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -30,20 +30,15 @@ class ActivityCalendar: AppCompatActivity(){
|
||||
bind = ActivityCalendarBinding.inflate(this.layoutInflater)
|
||||
// setting content view
|
||||
setContentView(bind.root)
|
||||
bind.chkShift.setOnClickListener() { _ ->
|
||||
// 화면 전환
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.fragment_box,
|
||||
if (bind.chkShift.isChecked) fragmentTable else fragmentCalendar
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(
|
||||
R.id.fragment_box, fragmentCalendar
|
||||
)
|
||||
.commit()
|
||||
// bind.chkShift.setOnClickListener() { _ -> // 화면 전환
|
||||
// supportFragmentManager.beginTransaction().apply {
|
||||
// if (bind.chkShift.isChecked) {
|
||||
// show(fragmentTable)
|
||||
// } else {
|
||||
// hide(fragmentTable)
|
||||
// }
|
||||
// }.commit();
|
||||
// }
|
||||
// supportFragmentManager.beginTransaction().replace(R.id.fragment_box, fragmentCalendar).add(R.id.fragment_box, fragmentTable).hide(fragmentTable).commit()
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@ import android.widget.ArrayAdapter
|
||||
import com.example.accountbook.R
|
||||
import com.example.accountbook.databinding.ItemTableBinding
|
||||
|
||||
class AdapterTable(context: Context, private val data: Array<String>):
|
||||
class AdapterTable(context: Context, private val data: List<String>):
|
||||
ArrayAdapter<String>(context, R.layout.item_table, data) {
|
||||
private lateinit var bind:ItemTableBinding
|
||||
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.example.accountbook.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.accountbook.R
|
||||
|
||||
|
||||
class SampleAdapter : RecyclerView.Adapter<SampleAdapter.SampleViewHolder>() {
|
||||
|
||||
private val items = mutableListOf<Int>()
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = SampleViewHolder(parent)
|
||||
|
||||
override fun onBindViewHolder(holder: SampleViewHolder, position: Int) {
|
||||
Log.d("SampleAdapter", "position: $position")
|
||||
}
|
||||
|
||||
override fun getItemCount() = items.size.also {
|
||||
Log.d("SampleAdapter", "items.size: ${items.size}")
|
||||
}
|
||||
|
||||
fun notifySample() {
|
||||
items.clear()
|
||||
(1..60).forEach {
|
||||
items.add(it)
|
||||
}
|
||||
Log.d("SampleAdapter", "items.size: ${items.size}")
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
class SampleViewHolder(parent: ViewGroup) : RecyclerView.ViewHolder(
|
||||
LayoutInflater.from(parent.context).inflate(R.layout.item_table, parent, false)
|
||||
)
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.example.accountbook.calendar
|
||||
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
|
||||
|
||||
abstract class CalendarAdapter2(private val layout: View, private val listBeans: List<CalendarBean>): RecyclerView.Adapter<CalendarAdapter2.ViewHolderCalendar2>() {
|
||||
// input
|
||||
abstract fun bindViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, bean: CalendarBean)
|
||||
override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView)
|
||||
Log.d("CalendarAdapter2", "onAttachedToRecyclerView recyclerview: $recyclerView")
|
||||
}
|
||||
|
||||
// view holder
|
||||
class ViewHolderCalendar2(view: View) : RecyclerView.ViewHolder(view)
|
||||
|
||||
|
||||
// extension RecyclerView
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CalendarAdapter2.ViewHolderCalendar2 {
|
||||
Log.d("CalendarAdapter2", "onCreateViewHolder")
|
||||
return ViewHolderCalendar2(this.layout)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
Log.d("CalendarAdapter2", "getItemCount size: ${listBeans.size}")
|
||||
return listBeans.size
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, position: Int) {
|
||||
Log.d("CalendarAdapter2", "onBindViewHolder")
|
||||
bindViewHolder(holder, listBeans[position])
|
||||
}
|
||||
}
|
||||
@ -19,9 +19,9 @@ class CalendarDateView(context: Context, attrs: AttributeSet?):
|
||||
private var mCaledarLayoutChangeListener: CalendarTopViewChangeListener? = null
|
||||
private var onItemClickListener: CalendarView.OnItemClickListener? = null
|
||||
private val cache: LinkedList<CalendarView?> = LinkedList<CalendarView?>()
|
||||
private val MAXCOUNT = 6
|
||||
private var row = 6
|
||||
private var mAdapter: CalendarAdapter? = null
|
||||
private var mAdapterPager: PagerAdapter? =null
|
||||
override var itemHeight = 0
|
||||
private set
|
||||
|
||||
@ -40,7 +40,6 @@ class CalendarDateView(context: Context, attrs: AttributeSet?):
|
||||
val a = context.obtainStyledAttributes(attrs, R.styleable.CalendarDateView)
|
||||
row = a.getInteger(R.styleable.CalendarDateView_cbd_calendar_row, 6)
|
||||
a.recycle()
|
||||
|
||||
}
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
@ -60,7 +59,7 @@ class CalendarDateView(context: Context, attrs: AttributeSet?):
|
||||
|
||||
private fun initialize() {
|
||||
val dateArr: IntArray = CalendarUtil.getYMD(Date())
|
||||
setAdapter(object : PagerAdapter() {
|
||||
mAdapterPager = object: PagerAdapter() {
|
||||
override fun getCount(): Int {
|
||||
// Log.i(this@CalendarDateView::class.java.simpleName, "container >>> setAdapter getCount")
|
||||
return Int.MAX_VALUE
|
||||
@ -99,7 +98,8 @@ class CalendarDateView(context: Context, attrs: AttributeSet?):
|
||||
cache.addLast(`object` as CalendarView)
|
||||
views.remove(position)
|
||||
}
|
||||
})
|
||||
}
|
||||
setAdapter(mAdapterPager)
|
||||
addOnPageChangeListener(object: SimpleOnPageChangeListener() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
@ -135,4 +135,8 @@ class CalendarDateView(context: Context, attrs: AttributeSet?):
|
||||
override fun setCalendarTopViewChangeListener(listener: CalendarTopViewChangeListener?) {
|
||||
mCaledarLayoutChangeListener = listener
|
||||
}
|
||||
|
||||
fun changeRow(row: Int) {
|
||||
this.row = row
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,13 @@ object CalendarFactory {
|
||||
list.add(bean)
|
||||
}
|
||||
Log.e("TIME CHECK" , "fun getMonthOfDayList END")
|
||||
|
||||
// val resultList: MutableList<CalendarBean> = ArrayList()
|
||||
// for (i in 0 until 7) {
|
||||
// resultList.add(list[i])
|
||||
// }
|
||||
return list
|
||||
// return resultList
|
||||
}
|
||||
|
||||
fun getCalendarBean(year: Int, month: Int, day: Int): CalendarBean {
|
||||
|
||||
@ -43,7 +43,14 @@ class CalendarView : ViewGroup {
|
||||
}
|
||||
|
||||
fun setData(data: List<CalendarBean>?, isToday: Boolean) {
|
||||
this.data = data
|
||||
var li: MutableList<CalendarBean> = ArrayList()
|
||||
for (i in 0 until 7) {
|
||||
if (data != null) {
|
||||
li.add(data[i])
|
||||
}
|
||||
}
|
||||
this.data = li
|
||||
// this.data = data
|
||||
this.isToday = isToday
|
||||
setItem()
|
||||
requestLayout()
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
package com.example.accountbook.calendar
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.example.accountbook.MainActivity
|
||||
import com.example.accountbook.R
|
||||
import com.example.accountbook.fragment.FragCalI1
|
||||
import com.example.accountbook.fragment.FragmentCalendar
|
||||
import java.util.Date
|
||||
|
||||
//abstract
|
||||
abstract class CalendarViewFragmentAdapter(activity: AppCompatActivity): FragmentStateAdapter(activity) {
|
||||
private lateinit var calendarData: List<CalendarBean>
|
||||
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return getFragment().setCalendarData(this.getCalendarData(position))
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int
|
||||
= Int.MAX_VALUE
|
||||
|
||||
|
||||
protected fun getCalendarData(position: Int): List<CalendarBean>
|
||||
= CalendarUtil.getYMD(Date()).run {
|
||||
return CalendarFactory.getMonthOfDayList(
|
||||
this[0],
|
||||
this[1] + position - Int.MAX_VALUE / 2
|
||||
)
|
||||
}
|
||||
|
||||
abstract fun getFragment(): FragmentCalendar
|
||||
}
|
||||
|
||||
abstract class CalendarViewPagerAdapter (val pageView: View, val calendarView: RecyclerView, val dateItemView: View, val context: Context): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
// member
|
||||
private val row = 7
|
||||
// input
|
||||
abstract fun bindDateViewHolder(holder: RecyclerView.ViewHolder, bean: CalendarBean)
|
||||
abstract fun bindCalendarViewHolder(holder: RecyclerView.ViewHolder, listBeans: List<CalendarBean>)
|
||||
|
||||
|
||||
// view Holder
|
||||
class PageViewHolder(view: View): RecyclerView.ViewHolder(view)
|
||||
|
||||
|
||||
// extension RecyclerView Adapter
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder
|
||||
= PageViewHolder(pageView)
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
// calendar date
|
||||
val dateArr: IntArray = CalendarUtil.getYMD(Date())
|
||||
val data = CalendarFactory.getMonthOfDayList(
|
||||
dateArr[0],
|
||||
dateArr[1] + position - Int.MAX_VALUE / 2
|
||||
)
|
||||
|
||||
// etc
|
||||
bindCalendarViewHolder(holder, data)
|
||||
// val isToday: Boolean = position == Int.MAX_VALUE / 2
|
||||
|
||||
calendarView.adapter = object : CalendarAdapter2(dateItemView, data) {
|
||||
override fun bindViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, bean: CalendarBean) {
|
||||
// 날짜 뷰
|
||||
bindDateViewHolder(holder, bean)
|
||||
}
|
||||
}
|
||||
calendarView.layoutManager = GridLayoutManager(context, row)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.example.accountbook.calendar2
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
|
||||
|
||||
// life cycle, calendar data binding
|
||||
abstract class CalendarFragment: Fragment() {
|
||||
// member
|
||||
|
||||
|
||||
|
||||
// Fragment
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package com.example.accountbook.calendar2
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.view.children
|
||||
import androidx.core.view.forEach
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import androidx.viewpager2.widget.ViewPager2.Orientation
|
||||
import com.example.accountbook.R
|
||||
|
||||
interface CalendarLayoutListener {
|
||||
fun onCreatedViewPager()
|
||||
}
|
||||
|
||||
class CalendarLayout: ConstraintLayout {
|
||||
constructor(context: Context) : super(context) {
|
||||
setAttr(null)
|
||||
}
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
|
||||
setAttr(attrs)}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
setAttr(attrs)}
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
setAttr(attrs)
|
||||
}
|
||||
|
||||
|
||||
// member
|
||||
private var attrs: AttributeSet? = null
|
||||
private var pagerLayoutId = -1
|
||||
var viewPager: ViewPager2? = null
|
||||
var listener: CalendarLayoutListener? = null
|
||||
|
||||
|
||||
// ViewGroup
|
||||
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
||||
Log.d("CalendarLayout", "onLayout >>>")
|
||||
super.onLayout(changed, left, top, right, bottom)
|
||||
this.id = ConstraintLayout.generateViewId()
|
||||
Log.d("CalendarLayout", "CalendarLayout.id: $this.id")
|
||||
|
||||
if (!isInEditMode) {
|
||||
// child로 viewPager 이외에는 모두 숨김처리
|
||||
Log.d("CalendarLayout", "childCount: $childCount")
|
||||
this.children.forEach { child ->
|
||||
Log.d("CalendarLayout", "child: $child")
|
||||
if (child.id == viewPager?.id) {
|
||||
return@forEach
|
||||
}
|
||||
this.removeView(child)
|
||||
}
|
||||
|
||||
if (viewPager == null) {
|
||||
addCalendarPager()
|
||||
listener?.onCreatedViewPager()
|
||||
} else {
|
||||
Log.e("CalendarLayout", "viewPager already exist.")
|
||||
}
|
||||
}
|
||||
|
||||
Log.d("CalendarLayout", "onLayout <<<")
|
||||
}
|
||||
|
||||
|
||||
// fun
|
||||
private fun setAttr(attrs: AttributeSet?) {
|
||||
this.attrs = attrs
|
||||
// context.obtainStyledAttributes(attrs, R.styleable.CalendarLayout).run {
|
||||
// pagerLayoutId = this.getResourceId(R.styleable.CalendarLayout_pager_layout, -1)
|
||||
// this.recycle()
|
||||
// }
|
||||
}
|
||||
|
||||
private fun addCalendarPager() {
|
||||
// viewPager to add
|
||||
viewPager = ViewPager2(this.context).apply {
|
||||
this.id = ViewPager2.generateViewId()
|
||||
this.setBackgroundColor(Color.parseColor("#cd5c5c"))
|
||||
this.orientation = ViewPager2.ORIENTATION_HORIZONTAL
|
||||
}
|
||||
// do
|
||||
this.addView(
|
||||
viewPager,
|
||||
ConstraintLayout.LayoutParams(
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
)
|
||||
)
|
||||
// constraint of viewPager
|
||||
ConstraintSet().run {
|
||||
this.clone(this@CalendarLayout)
|
||||
this.connect(
|
||||
viewPager!!.id,
|
||||
ConstraintSet.TOP,
|
||||
this@CalendarLayout.id,
|
||||
ConstraintSet.TOP,
|
||||
0
|
||||
)
|
||||
this.applyTo(this@CalendarLayout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.example.accountbook.calendar2
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import com.example.accountbook.R
|
||||
|
||||
class CalendarManager {
|
||||
constructor(fragmentActivity: FragmentActivity) {
|
||||
this.fragmentActivity = fragmentActivity
|
||||
}
|
||||
constructor(fragment: Fragment) {
|
||||
this.fragment = fragment
|
||||
}
|
||||
constructor(fragmentManager: FragmentManager, lifecycle: Lifecycle) {
|
||||
this.fragmentManager = fragmentManager
|
||||
this.lifecycle = lifecycle
|
||||
}
|
||||
|
||||
|
||||
// member
|
||||
lateinit var fragmentActivity: FragmentActivity
|
||||
lateinit var fragment: Fragment
|
||||
lateinit var fragmentManager: FragmentManager
|
||||
lateinit var lifecycle: Lifecycle
|
||||
|
||||
|
||||
// fun
|
||||
fun getCalendarAdapter(fragmentActivity: FragmentActivity) {
|
||||
CalendarPagerAdapter(fragmentActivity)
|
||||
}
|
||||
fun getCalendarAdapter(fragment: Fragment) {
|
||||
CalendarPagerAdapter(fragment)
|
||||
}
|
||||
fun getCalendarAdapter(fragmentManager: FragmentManager, lifecycle: Lifecycle) {
|
||||
CalendarPagerAdapter(fragmentManager, lifecycle)
|
||||
}
|
||||
|
||||
|
||||
// viewPager?.adapter = CalendarPagerAdapter(this).apply {
|
||||
// this.layoutId = R.layout.calendar_pager_example
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.example.accountbook.calendar2
|
||||
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import androidx.viewpager2.adapter.FragmentViewHolder
|
||||
|
||||
class CalendarPagerAdapter : FragmentStateAdapter {
|
||||
constructor(fragmentActivity: FragmentActivity) : super(fragmentActivity)
|
||||
constructor(fragment: Fragment) : super(fragment)
|
||||
constructor(fragmentManager: FragmentManager, lifecycle: Lifecycle) : super(
|
||||
fragmentManager,
|
||||
lifecycle
|
||||
)
|
||||
|
||||
|
||||
// member
|
||||
var layoutId: Int? = null
|
||||
|
||||
override fun onBindViewHolder(
|
||||
holder: FragmentViewHolder,
|
||||
position: Int,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
super.onBindViewHolder(holder, position, payloads)
|
||||
}
|
||||
// FragmentStateAdapter
|
||||
override fun getItemCount(): Int = Int.MAX_VALUE
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
Log.d("CalendarPagerAdapter", "createFragment layoutId: ${layoutId}")
|
||||
return if (layoutId != null) Fragment(layoutId!!) else Fragment()
|
||||
}
|
||||
|
||||
fun getTopView(position: Int, inflater: LayoutInflater) : View? = null
|
||||
fun getBottomView(position: Int, inflater: LayoutInflater) : View? = null
|
||||
fun drawCalendar(position: Int) = true
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.example.accountbook.calendar2.example
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
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
|
||||
|
||||
class ActivityCalendarEx: AppCompatActivity() {
|
||||
// member
|
||||
private var bind: CalendarActivityExampleBinding? = null
|
||||
|
||||
|
||||
// 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{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,113 +1,132 @@
|
||||
package com.example.accountbook.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.example.accountbook.activity.ActivityWriter
|
||||
import com.example.accountbook.calendar.CalendarAdapter
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.example.accountbook.R
|
||||
import com.example.accountbook.calendar.CalendarAdapter2
|
||||
import com.example.accountbook.calendar.CalendarBean
|
||||
import com.example.accountbook.databinding.FragmentCalendarBinding
|
||||
import com.example.accountbook.databinding.ItemCalendarBinding
|
||||
|
||||
class FragmentCalendar: Fragment() {
|
||||
private lateinit var bind: FragmentCalendarBinding
|
||||
|
||||
abstract class FragmentCalendar(val layoutId: Int, val dateView: View) : Fragment() {
|
||||
// member
|
||||
private val row = 7
|
||||
// var layoutId: Int
|
||||
// private val root: View
|
||||
// get() = getRoot()
|
||||
// private var pageData: List<T>? = getPageData()
|
||||
private val recyclerView: RecyclerView
|
||||
get() = getCalendarView()
|
||||
// private val dateView: View
|
||||
// get() = getDateView()
|
||||
|
||||
private lateinit var calendarData: List<CalendarBean>
|
||||
|
||||
// page view draw
|
||||
// abstract fun getLayoutId(): Int
|
||||
// abstract fun getRoot(): View
|
||||
|
||||
// page view data, nullable
|
||||
// fun <T> getPageData(): List<T>? {
|
||||
// return null
|
||||
// }
|
||||
|
||||
abstract fun bindPageView(): View
|
||||
|
||||
// calendarView draw
|
||||
abstract fun getCalendarView(): RecyclerView
|
||||
|
||||
// calendarView ItemView draw
|
||||
// abstract fun getDateView(): View
|
||||
|
||||
// calendarView ItemView data
|
||||
fun setCalendarData(data :List<CalendarBean>): FragmentCalendar {
|
||||
this.calendarData = data
|
||||
return this
|
||||
}
|
||||
|
||||
// calendarView ItemView binding
|
||||
abstract fun bindDateViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, bean: CalendarBean)
|
||||
|
||||
|
||||
// fragment
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
bind = FragmentCalendarBinding.inflate(inflater)
|
||||
return bind.root
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
// init view
|
||||
if (bind.calendarDateView.adapter == null) {
|
||||
initView()
|
||||
}
|
||||
// init list
|
||||
// initList()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
Log.i("FragmentCalendar","initView")
|
||||
|
||||
bind.calendarDateView.setAdapter(object: CalendarAdapter {
|
||||
override fun getView(
|
||||
convertView: View?,
|
||||
parentView: ViewGroup?,
|
||||
bean: CalendarBean?
|
||||
): View {
|
||||
Log.i("FragmentCalendar","getView")
|
||||
|
||||
var bindItem : ItemCalendarBinding? = null
|
||||
if (convertView == null) {
|
||||
bindItem = ItemCalendarBinding.inflate(LayoutInflater.from(parentView?.context))
|
||||
} else {
|
||||
bindItem = ItemCalendarBinding.bind(convertView)
|
||||
}
|
||||
bindItem.day.apply {
|
||||
this.text = bean?.day.toString()
|
||||
if (bean?.monthFlag != 0) {
|
||||
this.setTextColor(Color.WHITE)
|
||||
} else {
|
||||
this.setTextColor(Color.BLACK)
|
||||
}
|
||||
}
|
||||
|
||||
bindItem.root.setOnLongClickListener{ it ->
|
||||
startActivity(Intent(context, ActivityWriter::class.java))
|
||||
return@setOnLongClickListener true
|
||||
}
|
||||
return convertView ?: bindItem.root
|
||||
}
|
||||
|
||||
override fun hasChildView() = bind.calendarDateView.views.size > 0
|
||||
})
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
Log.d("FragmentCalendar","NOT Working on f1")
|
||||
return inflater.inflate(layoutId, container, false)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
bindPageView()
|
||||
recyclerView.layoutManager = GridLayoutManager(context, row)
|
||||
val ma = object: CalendarAdapter2(dateView, calendarData) {
|
||||
override fun bindViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, bean: CalendarBean) {
|
||||
bindDateViewHolder(holder, bean)
|
||||
}
|
||||
}
|
||||
recyclerView.adapter = ma
|
||||
Log.d("FragmentCalendar", "onResume recyclerview: ${recyclerView}")
|
||||
}
|
||||
}
|
||||
|
||||
class FragCalI1(layoutId: Int, dateView: View) : FragmentCalendar(layoutId, dateView) {
|
||||
private lateinit var bind: FragmentCalendarBinding
|
||||
private lateinit var bindItem: ItemCalendarBinding
|
||||
|
||||
// override fun getLayoutId(): Int {
|
||||
// return R.layout.fragment_calendar
|
||||
// }
|
||||
|
||||
// override fun getRoot(): View {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
|
||||
override fun bindPageView(): View {
|
||||
Log.d("FragCalI1", "bindPageView")
|
||||
return bind.root
|
||||
}
|
||||
|
||||
// private fun initList() {
|
||||
// bind.list.setAdapter(object : BaseAdapter() {
|
||||
// override fun getCount(): Int {
|
||||
// Log.i("bindList" , "getCount ")
|
||||
// return 100
|
||||
// }
|
||||
//
|
||||
// override fun getItem(position: Int) = null
|
||||
//
|
||||
// override fun getItemId(position: Int): Long = 0
|
||||
//
|
||||
// override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
|
||||
// Log.i("bindList" , "getView ${position}")
|
||||
// var mConvertView: View? = convertView
|
||||
// if (mConvertView == null) {
|
||||
// mConvertView = LayoutInflater.from(this@ActivityCalendar).inflate(android.R.layout.simple_list_item_1, null)
|
||||
// }
|
||||
//
|
||||
// (mConvertView as TextView).apply {
|
||||
// this.text = "item" + position
|
||||
// this.setBackgroundColor(Color.RED)
|
||||
// }
|
||||
//
|
||||
// return mConvertView
|
||||
// }
|
||||
//
|
||||
// })
|
||||
override fun getCalendarView(): RecyclerView {
|
||||
Log.d("FragCalI1", "getCalendarView recyclerview: ${bind.calendarDateView}")
|
||||
return bind.calendarDateView
|
||||
}
|
||||
|
||||
// override fun getDateView(): View {
|
||||
// return bindItem.root
|
||||
// }
|
||||
|
||||
override fun bindDateViewHolder(holder: CalendarAdapter2.ViewHolderCalendar2, bean: CalendarBean) {
|
||||
Log.d("FragCalI1", "bindDateViewHolder, bean: ${bean}")
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
Log.d("onAttach" , "onAttach")
|
||||
}
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
bind = FragmentCalendarBinding.inflate(inflater,container, false)
|
||||
bindItem = ItemCalendarBinding.inflate(inflater, container, false)
|
||||
return super.onCreateView(inflater,container,savedInstanceState)
|
||||
}
|
||||
}
|
||||
@ -4,26 +4,28 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ArrayAdapter
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.example.accountbook.R
|
||||
import com.example.accountbook.adapter.AdapterTable
|
||||
import com.example.accountbook.databinding.FragmentTableBinding
|
||||
|
||||
class FragmentTable: Fragment() {
|
||||
private lateinit var bind: FragmentTableBinding
|
||||
private var li: Array<String> = arrayOf("0", "1")
|
||||
private var li: ArrayList<String> = arrayListOf()
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
for (i in 0..<50) {
|
||||
li.add(i.toString())
|
||||
}
|
||||
// view
|
||||
bind = FragmentTableBinding.inflate(inflater)
|
||||
// data
|
||||
setData()
|
||||
bind.listTable.adapter = AdapterTable(inflater.context, li)
|
||||
bind.listTable.adapter = AdapterTable(inflater.context, li.toList())
|
||||
return bind.root
|
||||
}
|
||||
|
||||
|
||||
@ -8,94 +8,63 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:background="#bbbbbb"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:gravity="center"
|
||||
android:text="월표시"
|
||||
android:textColor="@color/black"
|
||||
/>
|
||||
<CheckBox
|
||||
android:id="@+id/chk_shift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Shift"
|
||||
/>
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/btn_shift"-->
|
||||
<!-- android:layout_width="30dp"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:text="전환"-->
|
||||
<!-- android:layout_gravity="start|center_vertical"/>-->
|
||||
<Button
|
||||
android:id="@+id/btn_menu"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:text="메뉴"
|
||||
android:layout_gravity="end|center_vertical"/>
|
||||
</FrameLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="#cccccc"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="소득"
|
||||
android:textColor="@color/black"/>
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textColor="#ff0000"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="소득액"
|
||||
android:textColor="#ff0000"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:background="#cccccc"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="지출"
|
||||
android:textColor="@color/black"/>
|
||||
<TextView
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="-"
|
||||
android:textColor="#0000ff"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="지출액"
|
||||
android:textColor="#0000ff"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:background="#bbbbbb"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:layout_weight="0">-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:background="#cccccc"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="60dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="소득"-->
|
||||
<!-- android:textColor="@color/black"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="+"-->
|
||||
<!-- android:textColor="#ff0000"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="소득액"-->
|
||||
<!-- android:textColor="#ff0000"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:background="#cccccc"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="60dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="지출"-->
|
||||
<!-- android:textColor="@color/black"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="-"-->
|
||||
<!-- android:textColor="#0000ff"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="지출액"-->
|
||||
<!-- android:textColor="#0000ff"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_box"
|
||||
|
||||
@ -1,33 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".MainActivity">
|
||||
tools:context=".MainActivity"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp">
|
||||
<!-- <com.example.accountbook.calendar2.CalendarLayout-->
|
||||
<!-- android:background="#00ff00"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:calendarId="@id/calendarEx">-->
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/calendarEx"-->
|
||||
<!-- android:background="#ff00ff"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="300dp"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:foregroundTint="#000000"-->
|
||||
<!-- android:background="#ffffff"-->
|
||||
<!-- android:text="hjgjhgjhgjhgjgh"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="120dp"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/calendarEx"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"/>-->
|
||||
<!-- </com.example.accountbook.calendar2.CalendarLayout>-->
|
||||
<!-- <androidx.appcompat.widget.Toolbar-->
|
||||
<!-- android:id="@+id/toolbar"-->
|
||||
<!-- android:background="@color/material_dynamic_primary100"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:title="(10월)"/>-->
|
||||
<!-- Calendar -->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/calendar"-->
|
||||
<!-- android:background="@color/material_dynamic_neutral99"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="450dp"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/toolbar"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/dayOfTheWeek"-->
|
||||
<!-- android:background="@color/material_dynamic_neutral95"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="일요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="월요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="화요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="수요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="목요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="금요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="토요일"-->
|
||||
<!-- />-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- <androidx.viewpager2.widget.ViewPager2-->
|
||||
<!-- android:id="@+id/pager"-->
|
||||
<!-- android:background="#ddd000"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/dayOfTheWeek"-->
|
||||
<!-- android:orientation="horizontal" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- Table -->
|
||||
<!-- <TableLayout-->
|
||||
<!-- android:id="@+id/table"-->
|
||||
<!-- android:background="@color/material_dynamic_neutral90"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/calendar"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
|
||||
<!-- <TableRow-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.1"-->
|
||||
<!-- android:text="날짜"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#eeeeee"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.3"-->
|
||||
<!-- android:text="금액"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#dddddd"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.5"-->
|
||||
<!-- android:text="메모"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#eeeeee"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.2"-->
|
||||
<!-- android:text="카테고리"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#dddddd"/>-->
|
||||
<!-- </TableRow>-->
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/list_table"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- tools:listitem="@layout/item_table"-->
|
||||
<!-- app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"-->
|
||||
<!-- />-->
|
||||
<!-- </TableLayout>-->
|
||||
<!-- <com.google.android.material.floatingactionbutton.FloatingActionButton-->
|
||||
<!-- android:id="@+id/fab"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_marginEnd="@dimen/fab_margin"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- app:srcCompat="@android:drawable/ic_dialog_email"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- android:contentDescription="상단으로" />-->
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_main" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:srcCompat="@android:drawable/ic_dialog_email" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
64
app/src/main/res/layout/calendar_activity_example.xml
Normal file
64
app/src/main/res/layout/calendar_activity_example.xml
Normal file
@ -0,0 +1,64 @@
|
||||
<?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">
|
||||
<TextView
|
||||
android:id="@+id/otherViewEx"
|
||||
android:background="#eeeeee"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="otherView"
|
||||
android:gravity="center"
|
||||
/>
|
||||
<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"-->
|
||||
<!-- >-->
|
||||
<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"-->
|
||||
<!-- 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>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
34
app/src/main/res/layout/calendar_pager_example.xml
Normal file
34
app/src/main/res/layout/calendar_pager_example.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?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:background="#faf0e6">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/top_layer"
|
||||
android:background="#d2b48c"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:background="#ffdead"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_layer"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottom_layer"
|
||||
android:orientation="horizontal"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/bottom_layer"
|
||||
android:background="#d2b48c"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
10
app/src/main/res/layout/frag1.xml
Normal file
10
app/src/main/res/layout/frag1.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.example.accountbook.BaseFragLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<VideoView
|
||||
android:id="@+id/child"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</com.example.accountbook.BaseFragLayout>
|
||||
21
app/src/main/res/layout/fragment_base.xml
Normal file
21
app/src/main/res/layout/fragment_base.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</FrameLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:backgroundTint="@color/material_dynamic_primary80"
|
||||
android:id="@+id/calendarDateView"
|
||||
android:background="#ddd000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
@ -1,65 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:background="@color/material_dynamic_primary70"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="#dddddd"
|
||||
android:layout_weight="0">
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="일요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="월요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="화요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="수요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="목요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="금요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="토요일"
|
||||
/>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:text="테스트"
|
||||
/>
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="28dp"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:background="#dddddd"-->
|
||||
<!-- android:layout_weight="0">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="일요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="월요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="화요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="수요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="목요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="금요일"-->
|
||||
<!-- />-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:text="토요일"-->
|
||||
<!-- />-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <com.example.accountbook.calendar.CalendarLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
@ -67,16 +73,19 @@
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="#eeeeee"-->
|
||||
<!-- >-->
|
||||
<com.example.accountbook.calendar.CalendarDateView
|
||||
android:id="@+id/calendarDateView"
|
||||
android:background="#ddd000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:backgroundTint="@color/material_dynamic_primary80"
|
||||
android:id="@+id/calendarDateView"
|
||||
android:background="#ddd000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
<!-- <ListView-->
|
||||
<!-- android:id="@+id/list"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:background="#ffffff"-->
|
||||
<!-- />-->
|
||||
<!-- </com.example.accountbook.calendar.CalendarLayout>-->
|
||||
</LinearLayout>
|
||||
@ -1,54 +1,55 @@
|
||||
<?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"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:background="@color/material_dynamic_primary60"
|
||||
android:id="@+id/day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="날짜"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_plus"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textColor="#ff0000"
|
||||
app:layout_constraintTop_toBottomOf="@id/day"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="당일소득"
|
||||
android:textColor="#ff0000"
|
||||
app:layout_constraintTop_toTopOf="@id/text_plus"
|
||||
app:layout_constraintStart_toEndOf="@id/text_plus"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text_plus"/>
|
||||
<TextView
|
||||
android:id="@+id/text_minus"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="-"
|
||||
android:textColor="#0000ff"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_plus"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="당일지출"
|
||||
android:textColor="#0000ff"
|
||||
app:layout_constraintTop_toTopOf="@id/text_minus"
|
||||
app:layout_constraintStart_toEndOf="@id/text_minus"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text_minus"/>
|
||||
<TextView
|
||||
android:id="@+id/text_plus"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="+"
|
||||
android:textColor="#ff0000"
|
||||
app:layout_constraintTop_toBottomOf="@id/day"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="당일소득"
|
||||
android:textColor="#ff0000"
|
||||
app:layout_constraintTop_toTopOf="@id/text_plus"
|
||||
app:layout_constraintStart_toEndOf="@id/text_plus"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text_plus"/>
|
||||
<TextView
|
||||
android:id="@+id/text_minus"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="-"
|
||||
android:textColor="#0000ff"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_plus"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="당일지출"
|
||||
android:textColor="#0000ff"
|
||||
app:layout_constraintTop_toTopOf="@id/text_minus"
|
||||
app:layout_constraintStart_toEndOf="@id/text_minus"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text_minus"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/text_date"
|
||||
android:layout_width="0dp"
|
||||
|
||||
156
app/src/main/res/layout/temp_activity_main.xml
Normal file
156
app/src/main/res/layout/temp_activity_main.xml
Normal file
@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- <com.google.android.material.appbar.AppBarLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_insetEdge="top">-->
|
||||
<!-- <com.google.android.material.appbar.MaterialToolbar-->
|
||||
<!-- android:id="@+id/toolbar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
<!-- </com.google.android.material.appbar.AppBarLayout>-->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="월표시"
|
||||
android:textColor="@color/white"
|
||||
android:background="@color/design_default_color_primary_variant"
|
||||
app:layout_dodgeInsetEdges="top"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/test"
|
||||
app:layout_behavior=".BehaviorCalendar2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:elevation="99dp"
|
||||
android:clipToPadding="false">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/test2"
|
||||
|
||||
android:background="#dddddd"
|
||||
android:layout_weight="0">
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="일요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="월요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="화요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="수요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="목요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="금요일"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="토요일"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<com.example.accountbook.calendar.CalendarDateView
|
||||
android:id="@+id/calendarDateView"
|
||||
android:background="#ddd000"
|
||||
app:cbd_calendar_row="6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="450dp"
|
||||
app:layout_behavior=".BehaviorCalendar2"
|
||||
android:elevation="2dp"/>
|
||||
<!-- <TableLayout-->
|
||||
<!-- android:elevation="1dp"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="#33ee33"-->
|
||||
<!-- app:layout_dodgeInsetEdges="top">-->
|
||||
<!-- <TableRow-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="30dp">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.1"-->
|
||||
<!-- android:text="날짜"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#eeeeee"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.3"-->
|
||||
<!-- android:text="금액"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#dddddd"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.5"-->
|
||||
<!-- android:text="메모"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#eeeeee"/>-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_weight="0.2"-->
|
||||
<!-- android:text="카테고리"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="#dddddd"/>-->
|
||||
<!-- </TableRow>-->
|
||||
<!-- </TableLayout>-->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:elevation="1dp"
|
||||
android:id="@+id/list_table2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_table" />
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:srcCompat="@android:drawable/ic_dialog_email" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@ -6,4 +6,8 @@
|
||||
<attr name="cbd_calendar_row"/>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="CalendarLayout">
|
||||
<attr name="pager_layout" format="reference"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
Loading…
x
Reference in New Issue
Block a user