Added Redirect settings page
This commit is contained in:
parent
4ce065425b
commit
e8549c8841
13 changed files with 268 additions and 35 deletions
11
app/src/main/res/drawable/call_split_24px.xml
Normal file
11
app/src/main/res/drawable/call_split_24px.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M440,800L440,496L240,296L240,400L160,400L160,160L400,160L400,240L296,240L520,464L520,800L440,800ZM594,424L536,366L664,240L560,240L560,160L800,160L800,400L720,400L720,296L594,424Z"/>
|
||||
</vector>
|
|
@ -1,10 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||
</vector>
|
|
@ -15,7 +15,7 @@
|
|||
android:id="@+id/titleText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Support Pulse Development 💖"
|
||||
android:text="@string/donate_title"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
@ -24,7 +24,7 @@
|
|||
android:id="@+id/descText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pulse is free and open-source. You can support future development through Ko-fi. As a thank-you, donors get special animation effects!"
|
||||
android:text="@string/donate_description"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
|
@ -43,14 +43,14 @@
|
|||
android:id="@+id/kofiButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Donate via Ko-fi 💙"
|
||||
android:text="@string/donate_button"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/postDonatePrompt"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Already donated? Tap below to activate your token."
|
||||
android:text="@string/donate_post_prompt"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
@ -59,7 +59,7 @@
|
|||
android:id="@+id/openTokenSection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="I have a token"
|
||||
android:text="@string/donate_have_token"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<!-- Token activation section (initially hidden) -->
|
||||
|
@ -74,7 +74,7 @@
|
|||
android:id="@+id/instruction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Enter your Ko-fi token:"
|
||||
android:text="@string/donate_token_instruction"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
|||
android:id="@+id/tokenInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="token:abcd1234efgh5678"
|
||||
android:hint="@string/donate_token_hint"
|
||||
android:inputType="text"
|
||||
android:maxLength="32"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
|
@ -91,7 +91,7 @@
|
|||
android:id="@+id/verifyButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Activate Token" />
|
||||
android:text="@string/donate_token_activate" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/resultText"
|
||||
|
|
57
app/src/main/res/layout/fragment_redirect_settings.xml
Normal file
57
app/src/main/res/layout/fragment_redirect_settings.xml
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="32dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- Redirect on WiFi -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switchRedirectWifi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirect_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- Redirect on Data -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switchRedirectData"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirect_data"
|
||||
app:layout_constraintTop_toBottomOf="@id/switchRedirectWifi"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<!-- Redirect only international numbers -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switchRedirectInternational"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirect_international"
|
||||
app:layout_constraintTop_toBottomOf="@id/switchRedirectData"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<!-- Redirect only on roaming -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switchRedirectRoaming"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/redirect_roaming"
|
||||
app:layout_constraintTop_toBottomOf="@id/switchRedirectInternational"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
|
@ -21,6 +21,11 @@
|
|||
android:title="@string/services_name"
|
||||
android:icon="@drawable/services_24"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_redirect_settings"
|
||||
android:title="@string/redirect_name"
|
||||
android:icon="@drawable/call_split_24px"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<!-- About section -->
|
||||
<item
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<string name="popup_name">Popup</string>
|
||||
<string name="services_name">Services</string>
|
||||
<string name="whitelist_name">Allowlist</string>
|
||||
<string name="redirect_name">Redirect</string>
|
||||
<string name="tools_name">Tools</string>
|
||||
<string name="about_name">About</string>
|
||||
<string name="donate_name">Donate</string>
|
||||
|
@ -25,6 +26,13 @@
|
|||
<string name="source_code">Source Code</string>
|
||||
<string name="license">License</string>
|
||||
|
||||
<!-- Redirect Settings -->
|
||||
<string name="redirect_wifi">Redirect while using Wi-Fi</string>
|
||||
<string name="redirect_data">Redirect while on mobile data</string>
|
||||
<string name="redirect_international">Redirect only international numbers</string>
|
||||
<string name="redirect_roaming">Redirect only if roaming</string>
|
||||
|
||||
<!-- Popup Animations -->
|
||||
<string name="popup_effect_label">Popup Animation</string>
|
||||
<string-array name="popup_effects">
|
||||
<item>None</item>
|
||||
|
@ -36,4 +44,27 @@
|
|||
<item>Random</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Donate screen -->
|
||||
<string name="donate_title">Support Pulse Development 💖</string>
|
||||
<string name="donate_description">Pulse is free and open-source. You can support future development through Ko-fi. As a thank-you, donors get special popup animation effects!</string>
|
||||
<string name="donate_button">Donate via Ko-fi 💙</string>
|
||||
<string name="donate_post_prompt">Already donated? Tap below to activate your token.</string>
|
||||
<string name="donate_have_token">I have a token</string>
|
||||
<string name="donate_token_instruction">Enter your Ko-fi token:</string>
|
||||
<string name="donate_token_hint">token: abcd1234efgh5678</string>
|
||||
<string name="donate_token_activate">Activate Token</string>
|
||||
|
||||
<!-- DonateFragment -->
|
||||
<string name="donate_token_copied">Token copied to clipboard</string>
|
||||
<string name="donate_token_invalid_format">Invalid token format</string>
|
||||
<string name="donate_missing_permission">❌ Missing INTERNET permission</string>
|
||||
<string name="donate_no_internet">❌ No internet access</string>
|
||||
<string name="donate_server_unreachable">❌ Activation server is unreachable</string>
|
||||
<string name="donate_server_not_responding">❌ Server not responding</string>
|
||||
<string name="donate_token_check_failed">❌ Could not check token</string>
|
||||
<string name="donate_token_invalid">❌ Invalid or expired token</string>
|
||||
<string name="donate_activation_failed">❌ Activation failed</string>
|
||||
<string name="donate_token_activated">✅ Token activated! You had %1$s activations left.</string>
|
||||
<string name="donate_token_already_activated">✅ Already activated</string>
|
||||
<string name="donate_toast_reminder">Make sure to include your token in the donation message to get rewarded 😊</string>
|
||||
</resources>
|
Loading…
Add table
Add a link
Reference in a new issue