Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filled progressbar #264

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions material-stepper/src/main/res/layout/ms_stepper_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,17 @@
android:layout_width="match_parent"
tools:style="@style/MSBottomNavigation">

<Button
android:id="@+id/ms_stepPrevButton"
style="?attr/ms_backNavigationButtonStyle"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:drawableLeft="@drawable/ms_ic_chevron_start"
android:drawableStart="@drawable/ms_ic_chevron_start"
tools:drawableTint="@color/ms_material_grey_400"
tools:style="@style/MSNavBarButton.Back"
tools:text="@string/ms_back"
tools:textColor="@color/ms_bottomNavigationButtonTextColor" />

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true">

<com.stepstone.stepper.internal.widget.DottedProgressBar
android:id="@+id/ms_stepDottedProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:visibility="gone" />

<com.stepstone.stepper.internal.widget.ColorableProgressBar
Expand All @@ -77,11 +65,25 @@
android:indeterminate="false"
android:visibility="gone"
tools:progress="33"
android:layout_gravity="center"
tools:style="@style/MSColorableProgressBar"
tools:visibility="visible" />

</FrameLayout>

<Button
android:id="@+id/ms_stepPrevButton"
style="?attr/ms_backNavigationButtonStyle"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:drawableLeft="@drawable/ms_ic_chevron_start"
android:drawableStart="@drawable/ms_ic_chevron_start"
tools:drawableTint="@color/ms_material_grey_400"
tools:style="@style/MSNavBarButton.Back"
tools:text="@string/ms_back"
tools:textColor="@color/ms_bottomNavigationButtonTextColor" />

<com.stepstone.stepper.internal.widget.RightNavigationButton
android:id="@+id/ms_stepNextButton"
style="?attr/ms_nextNavigationButtonStyle"
Expand Down
1 change: 1 addition & 0 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
android:name=".CustomStepperLayoutThemeActivity"
android:theme="@style/AppThemeDark" />
<activity android:name=".SetButtonColorProgrammaticallyActivity" />
<activity android:name=".FilledProgressBarActivity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2016 StepStone Services

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.stepstone.stepper.sample

class FilledProgressBarActivity : AbstractStepperActivity() {

override val layoutResId: Int
get() = R.layout.activity_filled_progress_bar

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class MainActivity : AppCompatActivity() {
SampleItem(getString(R.string.themed_dots), getString(R.string.themed_dots_description), ThemedDotsActivity::class.java),
SampleItem(getString(R.string.default_progress_bar), getString(R.string.default_progress_bar_description), DefaultProgressBarActivity::class.java),
SampleItem(getString(R.string.styled_progress_bar), getString(R.string.styled_progress_bar_description), StyledProgressBarActivity::class.java),
SampleItem(getString(R.string.filled_progress_bar), getString(R.string.filled_progress_bar_description), FilledProgressBarActivity::class.java),
SampleItem(getString(R.string.default_tabs), getString(R.string.default_tabs_description), DefaultTabsActivity::class.java),
SampleItem(getString(R.string.styled_tabs), getString(R.string.styled_tabs_description), StyledTabsActivity::class.java),
SampleItem(getString(R.string.default_none), getString(R.string.default_none_description), DefaultNoneActivity::class.java),
Expand Down
17 changes: 17 additions & 0 deletions sample/src/main/res/layout/activity_filled_progress_bar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.stepstone.stepper.StepperLayout 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"
android:id="@+id/stepperLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ms_stepperType="progress_bar"
app:ms_activeStepColor="#66bb67"
app:ms_inactiveStepColor="#006867"
app:ms_backButtonColor="#FFFFFF"
app:ms_nextButtonColor="#FFFFFF"
app:ms_completeButtonColor="#FFFFFF"
app:ms_bottomNavigationBackground="?attr/colorAccent"
app:ms_completeButtonBackground="@drawable/ms_button_background"
app:ms_stepperLayoutTheme="@style/FilledProgressStepperLayoutTheme"
tools:theme="@style/AppTheme" />
2 changes: 2 additions & 0 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<string name="themed_dots">Themed dots</string>
<string name="default_progress_bar">Default progress bar</string>
<string name="styled_progress_bar">Styled progress bar</string>
<string name="filled_progress_bar">Filled progress bar</string>
<string name="default_none">Default \'none\'</string>
<string name="default_tabs">Default tabs</string>
<string name="styled_tabs">Styled tabs</string>
Expand All @@ -32,6 +33,7 @@
<string name="themed_dots_description">Dotted stepper styled through view attributes set in Activity theme</string>
<string name="default_progress_bar_description">The default implementation of a stepper with a horizontal progress bar</string>
<string name="styled_progress_bar_description">Horizontal progress bar stepper styled through view attributes in the layout file</string>
<string name="filled_progress_bar_description">Horizontal progress bar that fills the navigation bar</string>
<string name="default_tabs_description">The default implementation of a tabbed stepper</string>
<string name="styled_tabs_description">Tabbed stepper styled through view attributes in the layout file</string>
<string name="default_none_description">The default implementation of a stepper without any particular current step indication</string>
Expand Down
9 changes: 9 additions & 0 deletions sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<item name="ms_completeNavigationButtonStyle">@style/CenteredCompleteButtonStyle</item>
</style>

<style name="FilledProgressStepperLayoutTheme" parent="MSDefaultStepperLayoutTheme">
<item name="ms_colorableProgressBarStyle">@style/FilledProgressStepperLayoutStyle</item>
</style>

<style name="CustomBottomNavigationStyle" parent="MSBottomNavigation">
<item name="android:layout_height">40dp</item>
</style>
Expand Down Expand Up @@ -93,6 +97,11 @@
<item name="fontPath">fonts/Oswald-Stencbab.ttf</item>
</style>

<style name="FilledProgressStepperLayoutStyle" parent="MSColorableProgressBar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
</style>

<style name="MainCoordinatorLayoutStyle" />

<style name="MainAppBarLayoutStyle">
Expand Down