Skip to content

Commit

Permalink
Scroll the transfer fragment when option selected
Browse files Browse the repository at this point in the history
  • Loading branch information
autoreleasefool committed Mar 17, 2016
1 parent 31aac7e commit f407e24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
});
}
}
};
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_transfer.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<ScrollView
android:id="@+id/scrollview_transfer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down

0 comments on commit f407e24

Please sign in to comment.