new channel view now works at least as well as the old channel view

This commit is contained in:
geeksville 2020-04-08 10:55:28 -07:00
parent 012139cb01
commit db0656f7b9
5 changed files with 121 additions and 31 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/ic_twotone_lock_24"
android:state_checked="false"
/>
<item
android:drawable="@drawable/ic_twotone_lock_open_24"
android:state_checked="true"
/>
<item android:drawable="@drawable/ic_twotone_lock_24" />
</selector>

View file

@ -38,17 +38,47 @@
app:layout_constraintTop_toBottomOf="@+id/channelNameView"
app:srcCompat="@drawable/qrcode" />
<ImageButton
android:id="@+id/lockButton"
style="@android:style/Widget.Material.ImageButton"
<!--
geeksville: no longer used but keeping as a good example of a button group. instead I use
a toggleable icon.
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/editGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="96dp"
android:layout_marginTop="16dp"
android:contentDescription="Lock/Unlock button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/channelOptions"
app:srcCompat="@drawable/ic_twotone_lock_open_24" />
app:singleSelection="true"
app:selectionRequired="true"
app:layout_constraintTop_toBottomOf="@+id/channelOptions">
<Button
android:id="@+id/locked"
style="@style/Widget.App.Button.OutlinedButton.IconOnly"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:icon="@drawable/ic_twotone_lock_24" />
<Button
android:id="@+id/unlocked"
style="@style/Widget.App.Button.OutlinedButton.IconOnly"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:icon="@drawable/ic_twotone_lock_open_24" />
</com.google.android.material.button.MaterialButtonToggleGroup>
-->
<CheckBox
android:id="@+id/editableCheckbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="96dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
android:button="@drawable/sl_lock_24dp"
app:layout_constraintTop_toBottomOf="@+id/channelOptions"></CheckBox>
<ImageButton
android:id="@+id/shareButton"
@ -58,7 +88,7 @@
android:layout_marginEnd="96dp"
android:contentDescription="Share button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/lockButton"
app:layout_constraintTop_toTopOf="@+id/editableCheckbox"
app:srcCompat="@drawable/ic_twotone_share_24" />
<com.google.android.material.textfield.TextInputLayout

View file

@ -18,4 +18,14 @@
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="Widget.App.Button.OutlinedButton.IconOnly" parent="Widget.MaterialComponents.Button.OutlinedButton">
<item name="iconPadding">0dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
<item name="android:paddingLeft">12dp</item>
<item name="android:paddingRight">12dp</item>
<item name="android:minWidth">48dp</item>
<item name="android:minHeight">48dp</item>
</style>
</resources>