Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the compile error. #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# built application files
*.apk
*.ap_

# lint folder
lint

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/
classes/
gen-external-apklibs/

# maven output folder
target

# OSX files
.DS_Store

# Windows files
Thumbs.db

# vi swap files
*.swp

# backup files
*.bak

# Android Studio
*.iml
*.ipr
*.iws
.idea/

# dummy
*.classpath
*.settings/
*local.properties

.gradle
/build
/captures
*/build

32 changes: 0 additions & 32 deletions .idea/assetWizardSettings.xml

This file was deleted.

113 changes: 0 additions & 113 deletions .idea/codeStyles/Project.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/dictionaries/metecanduyal.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/gradle.xml

This file was deleted.

52 changes: 0 additions & 52 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

30 changes: 16 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
namespace "app.layout.motion.motionlayoutexample"
compileSdkVersion 32
defaultConfig {
applicationId "app.layout.motion.motionlayoutexample"
minSdkVersion 18
targetSdkVersion 29
minSdkVersion 21
targetSdkVersion 32
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
Expand All @@ -24,16 +25,17 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
implementation 'androidx.constraintlayout:constraintlayout-solver:2.0.0-beta3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-rc01'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'androidx.fragment:fragment:1.2.0-rc02'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.constraintlayout:constraintlayout-solver:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'androidx.fragment:fragment:1.4.1'
implementation 'com.google.android.material:material:1.9.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
6 changes: 4 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.layout.motion.motionlayoutexample">
>

<application
android:allowBackup="true"
Expand All @@ -10,7 +10,9 @@
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package app.layout.motion.motionlayoutexample;

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
import android.view.View
import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.coordinatorlayout.widget.CoordinatorLayout
import com.google.android.material.bottomsheet.BottomSheetBehavior

public class CustomBottomSheetBehavior<V : View>(context: Context, attrs: AttributeSet) : BottomSheetBehavior<V>(context, attrs) {
private val TAG = "CustomBottomSheetBehavior"

@SuppressLint("LongLogTag")
override fun onInterceptTouchEvent(parent: CoordinatorLayout, child: V, event: MotionEvent): Boolean {
Log.i(TAG, "onInterceptTouchEvent, child: " + child + " MotionEvent:" + event)

if (state == BottomSheetBehavior.STATE_EXPANDED) {
return false
}

if (child is MotionLayout) {
val shouldIntercept = child.progress < 1
isDraggable = shouldIntercept
return if (shouldIntercept) {
super.onInterceptTouchEvent(parent, child, event)
} else {
false
}
}

return super.onInterceptTouchEvent(parent, child, event)
}


}
Loading