Last active
October 8, 2021 00:14
-
-
Save akexorcist/33c20f85bb23d9884b380f7b02d32e7f to your computer and use it in GitHub Desktop.
Revisions
-
akexorcist revised this gist
Oct 8, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class GroupFocusableEditText : AppCompatEditText { override fun getGlobalVisibleRect(r: Rect?, globalOffset: Point?): Boolean { val result = super.getGlobalVisibleRect(r, globalOffset) getFocusableGroupLayout()?.let { view -> view.getGlobalVisibleRect(parentRect, globalOffset) r?.bottom = parentRect.bottom } return result -
akexorcist revised this gist
Oct 7, 2021 . No changes.There are no files selected for viewing
-
akexorcist revised this gist
Oct 7, 2021 . 1 changed file with 16 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import android.view.View import androidx.appcompat.widget.AppCompatEditText class GroupFocusableEditText : AppCompatEditText { private var parentRect = Rect() constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( @@ -17,7 +19,6 @@ class GroupFocusableEditText : AppCompatEditText { override fun getFocusedRect(r: Rect?) { super.getFocusedRect(r) getFocusableGroupLayout()?.let { view -> view.getFocusedRect(parentRect) r?.bottom = parentRect.bottom } @@ -26,13 +27,26 @@ class GroupFocusableEditText : AppCompatEditText { override fun getGlobalVisibleRect(r: Rect?, globalOffset: Point?): Boolean { val result = super.getGlobalVisibleRect(r, globalOffset) getFocusableGroupLayout()?.let { view -> view.getGlobalVisibleRect(parentRect) r?.bottom = parentRect.bottom } return result } override fun requestRectangleOnScreen(rectangle: Rect?): Boolean { val result = super.requestRectangleOnScreen(rectangle) getFocusableGroupLayout()?.let { view -> parentRect.set( 0, 0, view.width, view.height ) view.requestRectangleOnScreen(parentRect, true) } return result } private fun getFocusableGroupLayout(): GroupFocusableLayout? { var viewParent = parent while (viewParent is View) { -
akexorcist revised this gist
Oct 6, 2021 . No changes.There are no files selected for viewing
-
akexorcist revised this gist
Oct 6, 2021 . No changes.There are no files selected for viewing
-
akexorcist revised this gist
Oct 6, 2021 . No changes.There are no files selected for viewing
-
akexorcist revised this gist
Oct 6, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,11 +14,10 @@ class GroupFocusableEditText : AppCompatEditText { defStyleAttr ) override fun getFocusedRect(r: Rect?) { super.getFocusedRect(r) getFocusableGroupLayout()?.let { view -> val parentRect = Rect() view.getFocusedRect(parentRect) r?.bottom = parentRect.bottom } @@ -27,6 +26,7 @@ class GroupFocusableEditText : AppCompatEditText { override fun getGlobalVisibleRect(r: Rect?, globalOffset: Point?): Boolean { val result = super.getGlobalVisibleRect(r, globalOffset) getFocusableGroupLayout()?.let { view -> val parentRect = Rect() view.getGlobalVisibleRect(parentRect) r?.bottom = parentRect.bottom } -
akexorcist created this gist
Oct 5, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ import android.content.Context import android.graphics.Point import android.graphics.Rect import android.util.AttributeSet import android.view.View import androidx.appcompat.widget.AppCompatEditText class GroupFocusableEditText : AppCompatEditText { 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 val parentRect: Rect = Rect() override fun getFocusedRect(r: Rect?) { super.getFocusedRect(r) getFocusableGroupLayout()?.let { view -> view.getFocusedRect(parentRect) r?.bottom = parentRect.bottom } } override fun getGlobalVisibleRect(r: Rect?, globalOffset: Point?): Boolean { val result = super.getGlobalVisibleRect(r, globalOffset) getFocusableGroupLayout()?.let { view -> view.getGlobalVisibleRect(parentRect) r?.bottom = parentRect.bottom } return result } private fun getFocusableGroupLayout(): GroupFocusableLayout? { var viewParent = parent while (viewParent is View) { if (viewParent is GroupFocusableLayout) { return viewParent } viewParent = (viewParent as View).parent } return null } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import android.content.Context import android.util.AttributeSet import android.widget.FrameLayout class GroupFocusableLayout : 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 ) }