...
This commit is contained in:
parent
c0f0cd4cb3
commit
17ecb69646
1
CalrendarView/.gitignore
vendored
Normal file
1
CalrendarView/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
43
CalrendarView/build.gradle.kts
Normal file
43
CalrendarView/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
plugins {
|
||||||
|
alias(libs.plugins.androidLibrary)
|
||||||
|
alias(libs.plugins.jetbrainsKotlinAndroid)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "com.example.calrendarview"
|
||||||
|
compileSdk = 34
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk = 24
|
||||||
|
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
consumerProguardFiles("consumer-rules.pro")
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
implementation(libs.androidx.core.ktx)
|
||||||
|
implementation(libs.androidx.appcompat)
|
||||||
|
implementation(libs.material)
|
||||||
|
testImplementation(libs.junit)
|
||||||
|
androidTestImplementation(libs.androidx.junit)
|
||||||
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
|
}
|
||||||
0
CalrendarView/consumer-rules.pro
Normal file
0
CalrendarView/consumer-rules.pro
Normal file
21
CalrendarView/proguard-rules.pro
vendored
Normal file
21
CalrendarView/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.example.calrendarview
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
|
|
||||||
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
import org.junit.Assert.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* See [testing documentation](http://d.android.com/tools/testing).
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4::class)
|
||||||
|
class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
fun useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||||
|
assertEquals("com.example.calrendarview.test", appContext.packageName)
|
||||||
|
}
|
||||||
|
}
|
||||||
4
CalrendarView/src/main/AndroidManifest.xml
Normal file
4
CalrendarView/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.calrendarview
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
|
||||||
|
class BaseCustomViews : View {
|
||||||
|
constructor(context: Context?) : super(context){appyAttrs(null)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs){appyAttrs(attrs)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||||
|
context,
|
||||||
|
attrs,
|
||||||
|
defStyleAttr
|
||||||
|
){appyAttrs(attrs)}
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
context: Context?,
|
||||||
|
attrs: AttributeSet?,
|
||||||
|
defStyleAttr: Int,
|
||||||
|
defStyleRes: Int
|
||||||
|
) : super(context, attrs, defStyleAttr, defStyleRes) {appyAttrs(attrs)}
|
||||||
|
|
||||||
|
|
||||||
|
fun appyAttrs(attrs: AttributeSet?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.calrendarview
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
|
||||||
|
class DayView : View {
|
||||||
|
constructor(context: Context?) : super(context){appyAttrs(null)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs){appyAttrs(attrs)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||||
|
context,
|
||||||
|
attrs,
|
||||||
|
defStyleAttr
|
||||||
|
){appyAttrs(attrs)}
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
context: Context?,
|
||||||
|
attrs: AttributeSet?,
|
||||||
|
defStyleAttr: Int,
|
||||||
|
defStyleRes: Int
|
||||||
|
) : super(context, attrs, defStyleAttr, defStyleRes) {appyAttrs(attrs)}
|
||||||
|
|
||||||
|
|
||||||
|
fun appyAttrs(attrs: AttributeSet?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun displayDayNumber() {
|
||||||
|
//todo 오늘 의 날짜를 표시
|
||||||
|
}
|
||||||
|
|
||||||
|
fun displayDayOfWeek() {
|
||||||
|
//todo 오늘의 요일을 표시?
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isToday() : Boolean {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.example.calrendarview
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
import com.example.calrendarview.model.DayInfo
|
||||||
|
|
||||||
|
|
||||||
|
class MonthView : View {
|
||||||
|
constructor(context: Context?) : super(context){appyAttrs(null)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs){appyAttrs(attrs)}
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||||
|
context,
|
||||||
|
attrs,
|
||||||
|
defStyleAttr
|
||||||
|
){appyAttrs(attrs)}
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
context: Context?,
|
||||||
|
attrs: AttributeSet?,
|
||||||
|
defStyleAttr: Int,
|
||||||
|
defStyleRes: Int
|
||||||
|
) : super(context, attrs, defStyleAttr, defStyleRes) {appyAttrs(attrs)}
|
||||||
|
|
||||||
|
|
||||||
|
fun appyAttrs(attrs: AttributeSet?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var numberOfRow : Int = 7
|
||||||
|
set(value) {
|
||||||
|
field = value
|
||||||
|
initChildViews()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun initChildViews() {
|
||||||
|
//todo : 7 * numberOfRow 의 차일드 뷰를 만든다.
|
||||||
|
}
|
||||||
|
|
||||||
|
fun displyMonthOfNumber() {
|
||||||
|
//todo :월 표시
|
||||||
|
}
|
||||||
|
|
||||||
|
fun displayWeekHeader() {
|
||||||
|
//todo 주간 요일 표시
|
||||||
|
}
|
||||||
|
|
||||||
|
fun displayYear(){
|
||||||
|
//todo 년도 표시
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setData(days : Collection<DayInfo>) {
|
||||||
|
//todo 최대 7*6의 데이터를 받는다.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package com.example.calrendarview.model
|
||||||
|
|
||||||
|
|
||||||
|
interface DayInfo {
|
||||||
|
fun getDayOfNum()
|
||||||
|
fun getDayOfWeek()
|
||||||
|
fun isToday()
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.calrendarview
|
||||||
|
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
import org.junit.Assert.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* See [testing documentation](http://d.android.com/tools/testing).
|
||||||
|
*/
|
||||||
|
class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
fun addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -46,6 +46,8 @@ dependencies {
|
|||||||
implementation(libs.androidx.constraintlayout)
|
implementation(libs.androidx.constraintlayout)
|
||||||
implementation(libs.androidx.navigation.fragment.ktx)
|
implementation(libs.androidx.navigation.fragment.ktx)
|
||||||
implementation(libs.androidx.navigation.ui.ktx)
|
implementation(libs.androidx.navigation.ui.ktx)
|
||||||
|
implementation(project(":CalrendarView"))
|
||||||
|
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
androidTestImplementation(libs.androidx.junit)
|
androidTestImplementation(libs.androidx.junit)
|
||||||
androidTestImplementation(libs.androidx.espresso.core)
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.androidApplication) apply false
|
alias(libs.plugins.androidApplication) apply false
|
||||||
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
|
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
|
||||||
|
alias(libs.plugins.androidLibrary) apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@ -25,4 +25,5 @@ androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation
|
|||||||
[plugins]
|
[plugins]
|
||||||
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
||||||
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||||
|
androidLibrary = { id = "com.android.library", version.ref = "agp" }
|
||||||
|
|
||||||
|
|||||||
@ -21,4 +21,4 @@ dependencyResolutionManagement {
|
|||||||
|
|
||||||
rootProject.name = "AccountBook"
|
rootProject.name = "AccountBook"
|
||||||
include(":app")
|
include(":app")
|
||||||
|
include(":CalrendarView")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user