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

638 - Documentation - Add API details and improve documentation #658

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
949c1bf
[#638] Update top app bars documentation
paulinea Oct 5, 2023
d1dfc57
[#638] Update banners documentation
paulinea Oct 5, 2023
64a1897
[#638] Add implementation word for concistency
paulinea Oct 5, 2023
364dec6
[#638] Update bottom bars documentation
paulinea Oct 5, 2023
19f9967
[#638] Update buttons documentation
paulinea Oct 5, 2023
60c495e
[#638] Add space before h4 titles
paulinea Oct 5, 2023
97ff533
[#638] Update cards documentation
paulinea Oct 5, 2023
d2aec28
[#638] Update checkboxes documentation
paulinea Oct 6, 2023
c07005a
[#638] Update chips documentation
paulinea Oct 9, 2023
6c4c9dd
[#638] Update dialogs documentation
paulinea Oct 9, 2023
b536fd2
[#638] Update floating action buttons documentation
paulinea Oct 9, 2023
863e3d3
[#638] Update image tile documentation
paulinea Oct 9, 2023
bd0d952
[#638] Update menus documentation
paulinea Oct 9, 2023
0be59e4
[#638] Update bottom navigation documentation
paulinea Oct 9, 2023
7ad2953
[#638] Update progress indicators documentation
paulinea Oct 9, 2023
3a3e049
[#638] Update radio buttons documentation
paulinea Oct 9, 2023
1b5ee1f
[#638] Homogenize documentations
paulinea Oct 9, 2023
17bba32
[#638] Update sliders documentation
paulinea Oct 9, 2023
b7de95b
[#638] Add accessibility information in documentation
paulinea Oct 10, 2023
72bdcfc
[#638] Update switches documentation
paulinea Oct 10, 2023
4382170
[#638] Review and improve documentation presentation
paulinea Oct 10, 2023
83e5bee
[#638] Update changelog
paulinea Oct 10, 2023
24f5dc6
[#638] Review: Add dots at the end of params description in KDoc
florentmaitre Oct 12, 2023
bbe363a
[#638] Review: Remove line break to fix IDE preview
paulinea Oct 13, 2023
8824b59
[#638] Review: Use "soon available" wording
paulinea Oct 13, 2023
331e25b
[#638] Review: Remove not working tags
paulinea Oct 13, 2023
4701b26
[#638] Review: Fix scrollBehavior parameter type
paulinea Oct 13, 2023
1d98931
[#638] Review: Use new API in code example
paulinea Oct 13, 2023
c69032c
[#638] Review: Use brackets in kdoc
paulinea Oct 13, 2023
79dea39
[#638] Review: Replace "principal button" by "primary button"
paulinea Oct 13, 2023
a5cc0f5
[#638] Review: Remove line break
paulinea Oct 13, 2023
8ffd5c4
[#638] Review: Use OdsSlider and OdsSliderLockups new APIs in examples
paulinea Oct 13, 2023
2aced85
[#638] Review: Add missing titles in summaries and remove empty sections
paulinea Oct 13, 2023
040a147
[#638] Review: Remove API used in summaries
paulinea Oct 13, 2023
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
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/Orange-OpenSource/ods-android/compare/0.16.0...develop)

### Changed

- \[Lib\] Review and update technical documentation ([#638](https://github.com/Orange-OpenSource/ods-android/issues/638))

### Fixed

- \[App\] Change illustrations alignment for slider and text field components ([#618](https://github.com/Orange-OpenSource/ods-android/issues/618))
Expand Down
8 changes: 8 additions & 0 deletions docs/_layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
max-height: 100%;
}

h2, h3 {
margin-top: 3rem;
}

h4, h5 {
margin-top: 2rem;
}

#outer {
width:100%;
height:100%;
Expand Down
140 changes: 2 additions & 138 deletions docs/components/AppBarsBottom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@ title: "App bars: bottom"
description: A bottom app bar displays navigation and key actions at the bottom of mobile screens.
---

---

**Page Summary**
<br>**On this page**

* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
* [Component specific tokens](#component-specific-tokens)

---

## Specifications references

- [Design System Manager - App bars](https://system.design.orange.com/0c1af118d/p/23e0e6-app-bars/b/620966)
- [Material Design - App bars: bottom](https://material.io/components/app-bars-bottom)
- *Technical documentation soon available*

## Accessibility

Expand All @@ -33,135 +28,4 @@ action performs. While optional, their use is strongly encouraged.

When using icons for navigation icons, action items and other elements of bottom
app bars, you should set a content description on them so that screen readers
like TalkBack are able to announce their purpose or action, if any.

For an overall content description of the bottom app bar, set an
`android:contentDescription` or use the `setContentDescription` method on the
`BottomAppBar`.

For the navigation icon, this can be achieved via the
`app:navigationContentDescription` attribute or
`setNavigationContentDescription` method.

For action items and items within the overflow menu, the content description
needs to be set in the menu:

```xml
<menu>
<item
android:contentDescription="@string/content_description_one" />
<item
android:contentDescription="@string/content_description_two" />
</menu>
```

## Implementation

Bottom app bars provide access to a bottom navigation drawer and up to four
actions, including the floating action button.

> **Jetpack Compose implementation**

*Not available yet*

> **XML implementation**

API and source code:

* `CoordinatorLayout`: [Class definition](https://developer.android.com/reference/androidx/coordinatorlayout/widget/CoordinatorLayout)
* `BottomAppBar`: [Class definition](https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomappbar/BottomAppBar.java)
* `FloatingActionButton`: [Class definition](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)

In the layout:

```xml
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Note: A RecyclerView can also be used -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="100dp"
android:clipToPadding="false">

<!-- Scrollable content -->

</androidx.core.widget.NestedScrollView>

<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:navigationIcon="@drawable/ic_menu_24dp"
app:menu="@menu/bottom_app_bar"
/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_add_24dp"
app:layout_anchor="@id/bottomAppBar"
/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
```

In `menu/bottom_app_bar.xml`:

```xml
<menu>

<item
android:id="@+id/search"
android:icon="@drawable/ic_search_24dp"
android:title="@string/search"
android:contentDescription="@string/content_description_search"
app:showAsAction="ifRoom"
/>

<item
android:id="@+id/more"
android:title="@string/more"
android:contentDescription="@string/content_description_more"
app:showAsAction="never"
/>

</menu>
```

In menu/navigation icon drawables:

```xml
<vector
android:tint="?attr/colorControlNormal">
</vector>
```

In code:

```kotlin
bottomAppBar.setNavigationOnClickListener {
// Handle navigation icon press
}

bottomAppBar.setOnMenuItemClickListener { menuItem ->
when (menuItem.itemId) {
R.id.search -> {
// Handle search icon press
true
}
R.id.more -> {
// Handle more item (inside overflow menu) press
true
}
else -> false
}
}
```

## Component specific tokens

_Soon available_
like TalkBack are able to announce their purpose or action, if any.
Loading