-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Telefonica/apps/new-controls
Control specifications
- Loading branch information
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
catalog/src/main/java/com/telefonica/mistica/catalog/ui/fragment/ControlsCatalogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.telefonica.mistica.catalog.ui.fragment | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.telefonica.mistica.button.ProgressButton | ||
import com.telefonica.mistica.catalog.R | ||
|
||
class ControlsCatalogFragment : Fragment() { | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
super.onCreateView(inflater, container, savedInstanceState) | ||
return layoutInflater.inflate(R.layout.screen_controls_catalog, container, false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:orientation="vertical" | ||
android:padding="16dp"> | ||
|
||
<com.telefonica.mistica.section.SectionTitleView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="start" | ||
android:text="Controls" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="8dp" | ||
android:background="?colorBackground" | ||
android:gravity="center_horizontal" | ||
android:orientation="vertical"> | ||
|
||
<androidx.appcompat.widget.SwitchCompat | ||
android:id="@+id/switch1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Switch" /> | ||
|
||
<androidx.appcompat.widget.AppCompatCheckBox | ||
android:id="@+id/checkBox" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="CheckBox" /> | ||
|
||
<androidx.appcompat.widget.AppCompatRadioButton | ||
android:id="@+id/radiobutton" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Radio button" /> | ||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
|
||
</ScrollView> |
23 changes: 23 additions & 0 deletions
23
library/src/main/java/com/telefonica/mistica/control/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Controls | ||
|
||
Switches, Checkboxes and Radiobuttons are implemented using Material components and using our theme to tint them. To use them, just add the Material components: | ||
|
||
```xml | ||
<androidx.appcompat.widget.SwitchCompat | ||
android:id="@+id/switch1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Switch" /> | ||
|
||
<androidx.appcompat.widget.AppCompatCheckBox | ||
android:id="@+id/checkBox" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="CheckBox" /> | ||
|
||
<androidx.appcompat.widget.AppCompatRadioButton | ||
android:id="@+id/radiobutton" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Radio button" /> | ||
``` |