cardStackView 구현 오류
2229
37 asked
강의는 cardStackView 구현 부분을 보고 있습니다.
gradle에 cardStack 파일 설치하고,,
강의랑 코드도 동일한데 계속 이런 오류가 생겨요. 왜그럴까요?
오류메세지 : Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'

gradle(module부분)
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.ipari.datingapp"
minSdk 16
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled 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 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.yuyakaido.android:card-stack-view:2.3.4"
}gradle(project부분)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}item_card.xml 파일입니다.
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/profileImageArea"
android:src="@drawable/no"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.cardview.widget.CardView>activity_main.xml파일입니다.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context=".MainActivity">
<com.yuyakaido.android.cardstackview.CardStackView
android:id="@+id/cardStackView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>CardStackAdapter 파일입니다.
package com.ipari.datingapp.slider
import android.content.Context
import android.text.Layout
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.ipari.datingapp.R
class CardStackAdapter(val context : Context, val items : List<String>) : RecyclerView.Adapter<CardStackAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CardStackAdapter.ViewHolder {
val inflater = LayoutInflater.from(parent.context)
val view : View = inflater.inflate(R.layout.item_card, parent, false)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: CardStackAdapter.ViewHolder, position: Int) {
holder.binding(items[position])
}
override fun getItemCount(): Int {
return items.size
}
inner class ViewHolder(itemView : View) : RecyclerView.ViewHolder(itemView) {
fun binding(data : String) {
}
}
}MainActivity 파일입니다.
package com.ipari.datingapp
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.ipari.datingapp.slider.CardStackAdapter
import com.yuyakaido.android.cardstackview.CardStackLayoutManager
import com.yuyakaido.android.cardstackview.CardStackListener
import com.yuyakaido.android.cardstackview.CardStackView
import com.yuyakaido.android.cardstackview.Direction
class MainActivity : AppCompatActivity() {
lateinit var cardStackAdapter: CardStackAdapter
lateinit var manager: CardStackLayoutManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val cardStackView = findViewById<CardStackView>(R.id.cardStackView)
manager = CardStackLayoutManager(baseContext, object : CardStackListener {
override fun onCardDragging(direction: Direction?, ratio: Float) {
}
override fun onCardSwiped(direction: Direction?) {
}
override fun onCardRewound() {
}
override fun onCardCanceled() {
}
override fun onCardAppeared(view: View?, position: Int) {
}
override fun onCardDisappeared(view: View?, position: Int) {
}
})
val testList = mutableListOf<String>()
testList.add("a")
testList.add("b")
testList.add("c")
cardStackAdapter = CardStackAdapter(baseContext, testList)
cardStackView.layoutManager = manager
cardStackView.adapter = cardStackAdapter
}
}
Answer 1
0
검색하니까 나오네용 ㅎㅎ ;;
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'에서 아래 로 바꾸니 됩니다.
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
0
아.. 그런데 item_card를 좀 꾸미니까 또 오류가 떠요 ㅜㅜ
ERROR:/Users/selena/AndroidStudioProjects/DatingApp/app/src/main/res/layout/item_card.xml:45: AAPT: error: attribute android:textStlye not found.
Arctic Fox 버전입니다!
CardStackView 라이브러리 추가에 실패합니다.
0
98
1
CardStackView
0
124
2
CardStackView 오류 정상적으로 구현이 되지 않습니다.
0
198
3
최신화 된 강의 요청합니다
0
158
2
auth.currentUser?.uid.toString() 가 null 이 나와요
0
192
1
혹시.. 지금 최신 환경 상, 강의 내용대로 진행이 안 되는 걸까요?
0
240
1
현시점에서 알려주신 방법대로 서버키를 받는것이 안되는것같습니다
0
260
2
3강 firebase 쓰기가 동작하질않아요
0
183
1
강사님 실시간으로 혹시 문의하는 방법은 없을까요??
0
185
1
해당 강의 들으시는 분들 중에 교육관련해서 서로 얘기 나누실 분 있으신가요??
0
156
1
강사님 FCM 단계 진행하면서 오류들이 너무 많이 발생합니다...
0
206
1
FCM 토큰 문의
0
213
1
강사님 FCM 단계에서 전체적으로 앱 문제가 발생해서 혹시 원격으로 조치 해주실 수 있나요?
0
231
1
토큰 정보 유저정보에 저장하기 강의 4분 12초 코드를 동일하게 입력했는데 적용이 잘 안되는 것 같아요.
0
395
3
토큰 받아와서 메세지 보내기 강의 2분 20초 로그캣 확인 하는 창이 다르고 토큰 값이 안떠요.
0
221
1
FCM 강의, firebaseservice 클래스 내 오류코드 해결방안이 궁금합니다.
0
272
2
FCM 강의 중간부터 코드 오류가 발생했는지 앱에서 회원가입을 해도 파이어베이스 Authentication에는 회원등록이 해도 화면이 넘어가지 않고 데이터도 저장이 안 되네요.
0
293
3
섹션 1 CardStackView의 Implement members 질문있습니다.
0
227
1
수업자료 다운로드 후 알집풀기에서 오류가 발생합니다.
0
461
3
Retrofit 사용해보기 강의 2:20 쯤에 작성된 복사된 코드는 어디서 받나요?
0
234
2
강의 FCM 소개 1:56에 디펜던시 추가하는게 최신버전으로 바뀐 듯합니다.
0
274
1
매칭이 되면 알람 띄우기 강의에서 오류문구 해결방안이 궁금합니다.
0
354
3
소스코드 다운이 불가능합니다..
0
142
1
나와 다른 성별의 유저 불러오기 강의에서 에뮬레이터에서 앱이 켜졌다가 바로 꺼져요.
0
456
11

