Skip to content

Instantly share code, notes, and snippets.

View ZZANZU's full-sized avatar
:octocat:
냅다 박는 중

Chanjoo Lee ZZANZU

:octocat:
냅다 박는 중
View GitHub Profile
<Transition
app:constraintSetStart="@+id/start"
app:constraintSetEnd="@id/end"
motion:duration="3000">
<OnClick <!--🔥 클릭을 통해 애니메이션 실행-->
motion:targetId="@+id/example_btn"
motion:clickAction="toggle"
/>
<KeyFrameSet>
<KeyAttribute
<androidx.constraintlayout.motion.widget.MotionLayout
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"
app:layoutDescription="@xml/MotionScene을 정의한 xml파일"
tools:context=".MainActivity">
<ImageView
buildTypes {
debug { // debug 빌드 설정
...
}
release { // release 빌드 설정
minifyEnabled true // 미사용 코드 삭제
shrinkResources true // 미사용 리소스 삭제
...
}
}
-keepattributes LineNumberTable,SourceFile
-renamesourcefileattribute SourceFile
androidx.appcompat.app.ActionBarDrawerToggle$DelegateProvider -> a.a.a.b:
androidx.appcompat.app.AlertController -> androidx.appcompat.app.AlertController:
android.content.Context mContext -> a
int mListItemLayout -> O
int mViewSpacingRight -> l
android.widget.Button mButtonNeutral -> w
int mMultiChoiceItemLayout -> M
boolean mShowTitle -> P
int mViewSpacingLeft -> j
int mButtonPanelSideLayout -> K
#...
-keep class {패키지명}.data.model.** { *; } # 이 부분!
-keepclassmembers class {패키지명}.data.model.** { *; } # 이 부분!
#...
override suspend fun getRegionList(): ArrayList<Region> {
// ...
val result = regionRef.get().await()
val documents = result.documents
for (document in documents) { // document에는 정상적으로 데이터가 담겨있는 것을 확인함.
val region = document.toObject<Region>() // 🔥 toObject()가 정상작동하지 않아서 region에 빈 데이터가 들어감.
if (region != null) regionInfo.add(region)
buildTypes {
debug {
...
}
release {
...
debuggable true
}
}
mViewpager.registerOnPageChangeCallback(object: OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
// height를 wrap_content가 되도록 설정
val view = (getChildAt(0) as RecyclerView).layoutManager?.findViewByPosition(position) // 표시된 아이템의 뷰 객체
view?.post { // UI 스레드에서 해당 뷰 height를 다시 설정해서 그려줌
val wMeasureSpec =
View.MeasureSpec.makeMeasureSpec(view.width, View.MeasureSpec.EXACTLY)
val hMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
view.measure(wMeasureSpec, hMeasureSpec)
@ZZANZU
ZZANZU / ViewPager2.kt
Created May 6, 2023 07:00
ViewPager2
/**
* A lot of places in code rely on an assumption that the page fills the whole ViewPager2.
*
* TODO(b/70666617) Allow page width different than width/height 100%/100%
*/
private RecyclerView.OnChildAttachStateChangeListener enforceChildFillListener() {
return new RecyclerView.OnChildAttachStateChangeListener() {
@Override
public void onChildViewAttachedToWindow(@NonNull View view) {
RecyclerView.LayoutParams layoutParams =