SW scroll to the top on activity create
This commit is contained in:
parent
d642418e02
commit
35c07d1e60
|
@ -8,6 +8,7 @@ import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
@ -36,6 +37,8 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
//logging
|
//logging
|
||||||
private static Logger log = LoggerFactory.getLogger(SetupWizardActivity.class);
|
private static Logger log = LoggerFactory.getLogger(SetupWizardActivity.class);
|
||||||
|
|
||||||
|
ScrollView scrollView;
|
||||||
|
|
||||||
private SWDefinition swDefinition = new SWDefinition();
|
private SWDefinition swDefinition = new SWDefinition();
|
||||||
private List<SWScreen> screens = swDefinition.getScreens();
|
private List<SWScreen> screens = swDefinition.getScreens();
|
||||||
private int currentWizardPage = 0;
|
private int currentWizardPage = 0;
|
||||||
|
@ -47,6 +50,8 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
LocaleHelper.onCreate(this, "en");
|
LocaleHelper.onCreate(this, "en");
|
||||||
setContentView(R.layout.activity_setupwizard);
|
setContentView(R.layout.activity_setupwizard);
|
||||||
|
|
||||||
|
scrollView = (ScrollView) findViewById(R.id.sw_scrollview);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
currentWizardPage = intent.getIntExtra(SetupWizardActivity.INTENT_MESSAGE, 0);
|
currentWizardPage = intent.getIntExtra(SetupWizardActivity.INTENT_MESSAGE, 0);
|
||||||
if (screens.size() > 0 && currentWizardPage < screens.size()) {
|
if (screens.size() > 0 && currentWizardPage < screens.size()) {
|
||||||
|
@ -126,6 +131,7 @@ public class SetupWizardActivity extends AppCompatActivity {
|
||||||
SWItem currentItem = currentScreen.items.get(i);
|
SWItem currentItem = currentScreen.items.get(i);
|
||||||
currentItem.generateDialog(this.findViewById(R.id.sw_content_fields), layout);
|
currentItem.generateDialog(this.findViewById(R.id.sw_content_fields), layout);
|
||||||
}
|
}
|
||||||
|
scrollView.smoothScrollTo(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateButtons() {
|
private void updateButtons() {
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
tools:text="Title" />
|
tools:text="Title" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
android:id="@+id/sw_scrollview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
Loading…
Reference in a new issue