General fixes, UI cleanup and popup animations
This commit is contained in:
parent
e810208a14
commit
6d9024a580
20 changed files with 457 additions and 77 deletions
|
@ -19,9 +19,11 @@
|
|||
app:titleTextColor="?attr/colorOnSurface"
|
||||
app:navigationIconTint="?attr/colorOnSurface"
|
||||
app:title="@string/app_name"
|
||||
app:titleTextAppearance="@style/Toolbar.Title.Small"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
|
|
|
@ -5,44 +5,24 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="32dp"
|
||||
tools:context=".PopupSettingsFragment">
|
||||
android:padding="32dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- Delay label -->
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:id="@+id/delayDescription"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/popup_settings_description"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/redirection_delay_description"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/popupEnabledCheckbox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/popup_enabled"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/description"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/popupPreview"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/popupPreview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/test"
|
||||
app:layout_constraintTop_toTopOf="@id/popupEnabledCheckbox"
|
||||
app:layout_constraintBottom_toBottomOf="@id/popupEnabledCheckbox"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
<!-- Delay slider -->
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/redirectionDelay"
|
||||
android:layout_width="0dp"
|
||||
|
@ -51,22 +31,24 @@
|
|||
android:valueFrom="2"
|
||||
android:valueTo="4"
|
||||
android:contentDescription="@string/redirection_delay_description"
|
||||
app:layout_constraintTop_toBottomOf="@id/popupEnabledCheckbox"
|
||||
app:layout_constraintTop_toBottomOf="@id/delayDescription"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<!-- Position label -->
|
||||
<TextView
|
||||
android:id="@+id/delayDescription"
|
||||
android:id="@+id/heightDescription"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirection_delay_description"
|
||||
android:text="@string/popup_position"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/redirectionDelay"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="4dp" />
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<!-- Position slider -->
|
||||
<com.google.android.material.slider.Slider
|
||||
android:id="@+id/popupHeightSlider"
|
||||
android:layout_width="0dp"
|
||||
|
@ -75,21 +57,43 @@
|
|||
android:valueTo="100"
|
||||
android:stepSize="1"
|
||||
android:contentDescription="@string/popup_position"
|
||||
app:layout_constraintTop_toBottomOf="@id/delayDescription"
|
||||
app:layout_constraintTop_toBottomOf="@id/heightDescription"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<!-- Animation label -->
|
||||
<TextView
|
||||
android:id="@+id/heightDescription"
|
||||
android:id="@+id/popupEffectLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/popup_position"
|
||||
android:text="@string/popup_effect_label"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/popupHeightSlider"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="4dp" />
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<!-- Animation dropdown -->
|
||||
<Spinner
|
||||
android:id="@+id/popupEffectSpinner"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/popupEffectLabel"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<!-- Test button -->
|
||||
<Button
|
||||
android:id="@+id/popupPreview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/test"
|
||||
app:layout_constraintTop_toBottomOf="@id/popupEffectSpinner"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
|
|
|
@ -6,23 +6,25 @@
|
|||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/serviceHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/service_settings_title"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/serviceRecycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/serviceHeader"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/serviceHeader"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/serviceHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/services_desc"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/serviceRecycler"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="4dp"
|
||||
android:padding="24dp"
|
||||
app:cardBackgroundColor="?attr/colorSurface">
|
||||
|
||||
<LinearLayout
|
||||
|
|
7
app/src/main/res/layout/switch_item.xml
Normal file
7
app/src/main/res/layout/switch_item.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/globalPopupToggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:checked="true" />
|
|
@ -4,32 +4,32 @@
|
|||
<!-- Settings section -->
|
||||
<item
|
||||
android:id="@+id/section_settings"
|
||||
android:title="Settings"
|
||||
android:title="@string/settings_name"
|
||||
android:enabled="false" />
|
||||
<item
|
||||
android:id="@+id/action_contacts"
|
||||
android:title="Contacts"
|
||||
android:title="@string/whitelist_name"
|
||||
android:icon="@drawable/group_24px"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_popup_settings"
|
||||
android:title="Popup"
|
||||
android:title="@string/popup_name"
|
||||
android:icon="@drawable/tooltip_24px"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_services"
|
||||
android:title="Services"
|
||||
android:title="@string/services_name"
|
||||
android:icon="@drawable/services_24"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<!-- About section -->
|
||||
<item
|
||||
android:id="@+id/section_about"
|
||||
android:title="About"
|
||||
android:title="@string/about_name"
|
||||
android:enabled="false" />
|
||||
<item
|
||||
android:id="@+id/action_about"
|
||||
android:title="About"
|
||||
android:title="@string/about_name"
|
||||
android:icon="@drawable/info_24px"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
|
7
app/src/main/res/menu/topbar_toggle.xml
Normal file
7
app/src/main/res/menu/topbar_toggle.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/globalPopupToggle"
|
||||
app:actionLayout="@layout/switch_item"
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
|
@ -9,5 +9,4 @@
|
|||
<string name="destination_whatsapp">WhatsApp</string>
|
||||
<string name="redirection_delay_description">Задержка до того, как звонок будет перенаправлен.</string>
|
||||
<string name="popup_position">Позиция всплывающего окна</string>
|
||||
<string name="fallback">Обратная совместимость</string>
|
||||
</resources>
|
|
@ -3,21 +3,36 @@
|
|||
<string name="app_name">Pulse</string>
|
||||
<string name="description">Redirects outgoing calls to E2EE apps if available.</string>
|
||||
<string name="popup">Redirecting to %1$s</string>
|
||||
<string name="settings_name">Settings</string>
|
||||
<string name="popup_name">Popup</string>
|
||||
<string name="services_name">Services</string>
|
||||
<string name="whitelist_name">Allowlist</string>
|
||||
<string name="tools_name">Tools</string>
|
||||
<string name="about_name">About</string>
|
||||
<string name="donate_name">Donate</string>
|
||||
<string name="destination_signal">Signal</string>
|
||||
<string name="destination_telegram">Telegram</string>
|
||||
<string name="destination_threema">Threema</string>
|
||||
<string name="destination_whatsapp">WhatsApp</string>
|
||||
<string name="redirection_delay_description">The delay before a call will be redirected.</string>
|
||||
<string name="services_desc">Here you can enable or disable redirection to individual services and change their priority by dragging them. Redirection will be handled in order from top to bottom.</string>
|
||||
<string name="popup_position">Popup position</string>
|
||||
<string name="fallback">Fallback</string>
|
||||
<string name="activate_description">To start, grant the required permissions by tapping the Activate button.</string>
|
||||
<string name="service_settings_title">Service Preferences</string>
|
||||
<string name="activate">Activate</string>
|
||||
<string name="navigation_drawer_open">Open menu</string>
|
||||
<string name="navigation_drawer_close">Close menu</string>
|
||||
<string name="popup_settings_description">Configure popup behavior, position, and delay.</string>
|
||||
<string name="popup_enabled">Popup enabled</string>
|
||||
<string name="test">Test</string>
|
||||
<string name="source_code">Source Code</string>
|
||||
<string name="license">License</string>
|
||||
|
||||
<string name="popup_effect_label">Popup Animation</string>
|
||||
<string-array name="popup_effects">
|
||||
<item>None</item>
|
||||
<item>Fade</item>
|
||||
<item>Scale</item>
|
||||
<item>Bounce</item>
|
||||
<item>Flop</item>
|
||||
<item>Matrix</item>
|
||||
<item>Random</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
|
@ -4,4 +4,7 @@
|
|||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">100%</item>
|
||||
</style>
|
||||
<style name="Toolbar.Title.Small" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue