Merge pull request #1039 from TebbeUbben/startupwizard

Some styling for SW
This commit is contained in:
Milos Kozak 2018-05-13 18:33:07 +02:00 committed by GitHub
commit 30a0b49666
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 61 additions and 34 deletions

View file

@ -170,6 +170,7 @@
<activity <activity
android:name=".startupwizard.SetupWizardActivity" android:name=".startupwizard.SetupWizardActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/AppTheme.SetupWizard"
android:label="@string/title_activity_setup_wizard"></activity> android:label="@string/title_activity_setup_wizard"></activity>
</application> </application>

View file

@ -76,12 +76,6 @@ public class SWDefinition {
.add(new SWInfotext() .add(new SWInfotext()
.label(R.string.backupismissing) .label(R.string.backupismissing)
.visibility(() -> !ImportExportPrefs.file.exists())) .visibility(() -> !ImportExportPrefs.file.exists()))
.add(new SWButton()
.text(R.string.exitwizard)
.action(() -> {
SP.putBoolean(R.string.key_setupwizard_processed, true);
getActivity().finish();
}))
) )
.add(new SWScreen(R.string.language) .add(new SWScreen(R.string.language)
.skippable(false) .skippable(false)

View file

@ -60,6 +60,11 @@ public class SetupWizardActivity extends AppCompatActivity {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (currentWizardPage == 0) OKDialog.showConfirmation(this, MainApp.gs(R.string.exitwizard), this::finish);
else showPreviousPage(null);
}
public void exitPressed(View view) {
OKDialog.showConfirmation(this, MainApp.gs(R.string.exitwizard), this::finish); OKDialog.showConfirmation(this, MainApp.gs(R.string.exitwizard), this::finish);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,29 +1,44 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".startupwizard.SetupWizardActivity"> tools:context=".startupwizard.SetupWizardActivity">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:background="@android:color/transparent"
android:onClick="exitPressed"
app:srcCompat="@drawable/ic_exit_to_app" />
<TextView <TextView
android:id="@+id/sw_content" android:id="@+id/sw_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:keepScreenOn="true" android:keepScreenOn="true"
android:textColor="#33b5e5" android:textAlignment="center"
android:textSize="20dp" android:textColor="#FFFFFF"
android:textStyle="bold" /> android:textSize="32sp"
tools:text="Title" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout <LinearLayout
android:id="@+id/sw_content_fields" android:id="@+id/sw_content_fields"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:orientation="vertical"> android:orientation="vertical"
android:padding="16dp" />
</LinearLayout> </ScrollView>
<LinearLayout <LinearLayout
android:id="@+id/sw_content_controls" android:id="@+id/sw_content_controls"
@ -31,42 +46,41 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal" android:layout_gravity="bottom|center_horizontal"
android:background="@color/black_overlay" android:background="@color/black_overlay"
android:orientation="horizontal"> android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<Button <Button
android:id="@+id/previous_button" android:id="@+id/previous_button"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:background="@android:color/transparent"
android:onClick="showPreviousPage" android:onClick="showPreviousPage"
android:text="@string/setupwizard_previous" /> android:text="@string/setupwizard_previous"
android:textColor="#FFFFFF" />
<Button <View
android:id="@+id/skip_button"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1" />
android:onClick="showNextPage"
android:text="@string/setupwizard_skip"
android:visibility="invisible" />
<Button <Button
android:id="@+id/next_button" android:id="@+id/next_button"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:background="@android:color/transparent"
android:onClick="showNextPage" android:onClick="showNextPage"
android:text="@string/setupwizard_next" android:text="@string/setupwizard_next"
android:visibility="gone" /> android:textColor="#FFFFFF" />
<Button <Button
android:id="@+id/finish_button" android:id="@+id/finish_button"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:background="@android:color/transparent"
android:onClick="finishSetupWizard" android:onClick="finishSetupWizard"
android:text="@string/setupwizard_finish" android:text="@string/setupwizard_finish"
android:visibility="gone" /> android:textColor="#FFFFFF" />
</LinearLayout> </LinearLayout>

View file

@ -72,4 +72,10 @@
<color name="deviationred">#72FF0000</color> <color name="deviationred">#72FF0000</color>
<color name="deviationblack">#72000000</color> <color name="deviationblack">#72000000</color>
<color name="swColorPrimary">#303030</color>
<color name="swColorPrimaryDark">#303030</color>
<color name="swColorAccent">#FFEB3B</color>
<color name="swColorBackground">#303030</color>
</resources> </resources>

View file

@ -24,5 +24,12 @@
<item name="android:textSize">10sp</item> <item name="android:textSize">10sp</item>
</style> </style>
<style name="AppTheme.SetupWizard" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/swColorPrimary</item>
<item name="colorPrimaryDark">@color/swColorPrimaryDark</item>
<item name="colorAccent">@color/swColorAccent</item>
<item name="android:windowBackground">@color/swColorBackground</item>
</style>
<!-- Preferences --> <!-- Preferences -->
</resources> </resources>