Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.navigation.NavigationBarView
import com.google.android.material.snackbar.Snackbar
import com.js8call.example.R
Expand All @@ -29,7 +28,7 @@ class DecodeFragment : Fragment() {

private lateinit var recyclerView: RecyclerView
private lateinit var emptyText: TextView
private lateinit var clearFab: FloatingActionButton
private lateinit var clearButton: View

private var myGroups: Set<String> = emptySet()

Expand Down Expand Up @@ -66,7 +65,7 @@ class DecodeFragment : Fragment() {
// Find views
recyclerView = view.findViewById(R.id.decodes_recycler_view)
emptyText = view.findViewById(R.id.empty_text)
clearFab = view.findViewById(R.id.clear_fab)
clearButton = view.findViewById(R.id.clear_button)

// Set up RecyclerView
adapter = DecodeListAdapter().apply {
Expand All @@ -80,8 +79,8 @@ class DecodeFragment : Fragment() {
}
recyclerView.adapter = adapter

// Set up FAB
clearFab.setOnClickListener {
// Set up clear button
clearButton.setOnClickListener {
confirmClearDecodes()
}

Expand Down
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ic_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z" />
</vector>
13 changes: 0 additions & 13 deletions android/app/src/main/res/drawable/ic_notes.xml

This file was deleted.

40 changes: 40 additions & 0 deletions android/app/src/main/res/layout-land/fragment_monitor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<!-- Waterfall and status strip on the left -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">

<com.js8call.example.ui.WaterfallView
android:id="@+id/waterfall_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/waterfall_background" />

<include
layout="@layout/monitor_status_card"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<!-- Embedded decode list, full height on the right -->
<androidx.fragment.app.FragmentContainerView
android:id="@+id/decode_pane"
android:name="com.js8call.example.ui.DecodeFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:clipToPadding="false"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />

</LinearLayout>
31 changes: 31 additions & 0 deletions android/app/src/main/res/layout-sw600dp-land/fragment_monitor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!-- Waterfall View -->
<com.js8call.example.ui.WaterfallView
android:id="@+id/waterfall_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="@dimen/monitor_waterfall_weight"
android:background="@color/waterfall_background" />

<!-- Status strip -->
<include
layout="@layout/monitor_status_card"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<!-- Embedded decode list -->
<androidx.fragment.app.FragmentContainerView
android:id="@+id/decode_pane"
android:name="com.js8call.example.ui.DecodeFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="@dimen/monitor_decodes_weight"
android:clipToPadding="false"
android:padding="8dp" />

</LinearLayout>
121 changes: 66 additions & 55 deletions android/app/src/main/res/layout/fragment_decodes.xml
Original file line number Diff line number Diff line change
@@ -1,59 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView 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:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Toolbar with actions -->
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorSurface"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/decodes_title" />

<!-- RecyclerView for decodes -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/decodes_recycler_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingVertical="4dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
tools:listitem="@layout/item_decode" />

<!-- Empty state -->
<TextView
android:id="@+id/empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/decodes_empty"
android:textAppearance="?attr/textAppearanceBodyLarge"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />

<!-- FAB for clear/actions -->
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/clear_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:contentDescription="@string/decodes_clear"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@android:drawable/ic_menu_delete" />

</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="match_parent"
app:cardElevation="2dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!-- Header strip, same idiom as the Transmit tab's Queue card -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurfaceVariant"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="4dp">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingVertical="8dp"
android:text="@string/decodes_title"
android:textAppearance="?attr/textAppearanceTitleMedium" />

<com.google.android.material.button.MaterialButton
android:id="@+id/clear_button"
style="@style/Widget.Material3.Button.IconButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/decodes_clear"
app:icon="@drawable/ic_delete"
app:iconTint="?attr/colorOnSurfaceVariant" />
</LinearLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/decodes_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingVertical="4dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_decode" />

<TextView
android:id="@+id/empty_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/decodes_empty"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOnSurfaceVariant"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>

</LinearLayout>

</com.google.android.material.card.MaterialCardView>
12 changes: 11 additions & 1 deletion android/app/src/main/res/layout/fragment_monitor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:id="@+id/waterfall_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_weight="@dimen/monitor_waterfall_weight"
android:background="@color/waterfall_background" />

<!-- Status strip -->
Expand All @@ -18,4 +18,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<!-- Embedded decode list -->
<androidx.fragment.app.FragmentContainerView
android:id="@+id/decode_pane"
android:name="com.js8call.example.ui.DecodeFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="@dimen/monitor_decodes_weight"
android:clipToPadding="false"
android:padding="8dp" />

</LinearLayout>
5 changes: 0 additions & 5 deletions android/app/src/main/res/menu/bottom_nav_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
android:icon="@drawable/ic_graphic_eq"
android:title="@string/nav_monitor" />

<item
android:id="@+id/navigation_decodes"
android:icon="@drawable/ic_notes"
android:title="@string/nav_decodes" />

<item
android:id="@+id/navigation_messages"
android:icon="@drawable/ic_chat_bubble"
Expand Down
5 changes: 0 additions & 5 deletions android/app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
android:name="com.js8call.example.ui.MonitorFragment"
android:label="@string/nav_monitor" />

<fragment
android:id="@+id/navigation_decodes"
android:name="com.js8call.example.ui.DecodeFragment"
android:label="@string/nav_decodes" />

<fragment
android:id="@+id/navigation_messages"
android:name="com.js8call.example.ui.MessagesFragment"
Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-sw600dp-land/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="monitor_waterfall_weight" format="float" type="dimen">1</item>
<item name="monitor_decodes_weight" format="float" type="dimen">1.3</item>
</resources>
6 changes: 6 additions & 0 deletions android/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Monitor split between the waterfall and the decode list -->
<item name="monitor_waterfall_weight" format="float" type="dimen">1.1</item>
<item name="monitor_decodes_weight" format="float" type="dimen">1</item>
</resources>
1 change: 0 additions & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<!-- Bottom navigation -->
<string name="nav_monitor">Monitor</string>
<string name="nav_decodes">Decodes</string>
<string name="nav_messages">Messages</string>
<string name="nav_transmit">Transmit</string>
<string name="nav_settings">Settings</string>
Expand Down
Loading