-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #412 from lucasnlm/update-17-1-0
Improve wear control / Fix crash
- Loading branch information
Showing
10 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
wear/src/main/java/dev/lucasnlm/antimine/wear/game/view/CustomDismissibleFrameLayout.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package dev.lucasnlm.antimine.wear.game.view | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.MotionEvent | ||
import android.widget.FrameLayout | ||
import androidx.fragment.app.Fragment | ||
import java.lang.ref.WeakReference | ||
|
||
class CustomDismissibleFrameLayout : FrameLayout { | ||
constructor(context: Context) : super(context) | ||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) | ||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) | ||
|
||
private var childFragment: WeakReference<Fragment>? = null | ||
|
||
fun setChildFragment(fragment: Fragment) { | ||
childFragment = WeakReference(fragment) | ||
} | ||
|
||
override fun onInterceptTouchEvent(event: MotionEvent?): Boolean { | ||
val child = childFragment?.get() | ||
return child?.view?.onTouchEvent(event) ?: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters