From f407e24ea7d22af47f44ec8ddb82f0a69e541124 Mon Sep 17 00:00:00 2001 From: Joseph Roque Date: Thu, 17 Mar 2016 01:19:44 -0700 Subject: [PATCH] Scroll the transfer fragment when option selected --- .../bowlingcompanion/fragment/TransferFragment.java | 10 +++++++++- app/src/main/res/layout/fragment_transfer.xml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ca/josephroque/bowlingcompanion/fragment/TransferFragment.java b/app/src/main/java/ca/josephroque/bowlingcompanion/fragment/TransferFragment.java index 017d4e825..620f6d72f 100644 --- a/app/src/main/java/ca/josephroque/bowlingcompanion/fragment/TransferFragment.java +++ b/app/src/main/java/ca/josephroque/bowlingcompanion/fragment/TransferFragment.java @@ -19,6 +19,7 @@ import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.ScrollView; import android.widget.TextView; import java.io.BufferedReader; @@ -93,7 +94,7 @@ public final class TransferFragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_transfer, container, false); + final ScrollView rootView = (ScrollView) inflater.inflate(R.layout.fragment_transfer, container, false); View.OnClickListener cardClickListener = new View.OnClickListener() { @Override @@ -105,6 +106,13 @@ else if (v.getId() == R.id.btn_export) showCardView(VIEW_EXPORT); else if (v.getId() == R.id.btn_restore_delete) showCardView(VIEW_RESTORE_DELETE); + + rootView.post(new Runnable() { + @Override + public void run() { + rootView.fullScroll(View.FOCUS_DOWN); + } + }); } } }; diff --git a/app/src/main/res/layout/fragment_transfer.xml b/app/src/main/res/layout/fragment_transfer.xml index 3a69f98d5..c55221970 100644 --- a/app/src/main/res/layout/fragment_transfer.xml +++ b/app/src/main/res/layout/fragment_transfer.xml @@ -1,4 +1,5 @@