aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard/android/fragment (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ui: only register contracts in constructorsJason A. Donenfeld2023-05-081-2/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: reformat all codeJason A. Donenfeld2023-05-056-34/+57
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: handle update signaturesJason A. Donenfeld2023-05-011-0/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: display latest handshake timeJason A. Donenfeld2023-04-241-7/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: set app list button text on main threadJason A. Donenfeld2023-04-071-1/+1
| | | | | | | | Hopefully will fix, "Only the original thread that creted a view hierarchy can touch its views." Reported-by: Damir <2k1dmg@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: do not crash if tunnel preparation failsJason A. Donenfeld2023-04-041-6/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: show bottom sheet sync to prevent double addJason A. Donenfeld2023-04-041-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: do not allow double clicking fab to show menu twiceJason A. Donenfeld2023-03-301-0/+2
| | | | | | | | | | | | | | | | | | | | | Exception java.lang.IllegalStateException: at androidx.fragment.app.FragmentStore.addFragment (FragmentStore.java:92) at androidx.fragment.app.FragmentManager.addFragment (FragmentManager.java:1481) at androidx.fragment.app.BackStackRecord.executeOps (BackStackRecord.java:387) at androidx.fragment.app.FragmentManager.executeOps (FragmentManager.java:1965) at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:1873) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:1823) at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:1760) at androidx.fragment.app.FragmentManager$5.run (FragmentManager.java:547) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:268) at android.app.ActivityThread.main (ActivityThread.java:8101) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:627) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:997) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: remove unneeded @JvmStatic annotationsJason A. Donenfeld2023-03-302-1/+1
| | | | | | | These are only needed on methods called from databindings, since those compile to java. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: use app resources instead of ctx for strings in callbackJason A. Donenfeld2023-03-301-1/+1
| | | | | | | | | | | | | | | | | Exception java.lang.IllegalStateException: at androidx.fragment.app.Fragment.requireContext (Fragment.java:967) at com.wireguard.android.fragment.TunnelListFragment$tunnelFileImportResultLauncher$1$1.invokeSuspend (TunnelListFragment.kt:64) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104) at android.os.Handler.handleCallback (Handler.java:761) at android.os.Handler.dispatchMessage (Handler.java:98) at android.os.Looper.loop (Looper.java:156) at android.app.ActivityThread.main (ActivityThread.java:6617) at java.lang.reflect.Method.invoke at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: cancel actionmode when pressing back buttonJason A. Donenfeld2023-03-271-0/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: simplify actionmode castJason A. Donenfeld2023-03-271-3/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: introduce a fresh set of Material3 themes and migrate to themHarsh Shandilya2023-03-271-5/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: use AndroidX `BundleCompat` for extracting parcelableHarsh Shandilya2023-03-271-6/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: simplify IME displaying in ConfigNamingDialogFragmentJason A. Donenfeld2023-03-241-43/+5
| | | | | | Also cleanup some event listener flow. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: migrate to MenuProviderHarsh Shandilya2023-03-222-13/+26
| | | | | | | AndroidX Activity 1.4.0 introduced the new lifecycle-dependent MenuProvider APIs that supersede existing onCreateOptionsMenu-style menus. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: address Parcelable API deprecationsHarsh Shandilya2023-03-221-1/+7
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: address PackageManager API deprecationsHarsh Shandilya2023-03-221-1/+14
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: set button text after loading app list in AppListDialogFragmentJason A. Donenfeld2023-03-221-0/+1
| | | | | | | Otherwise, for lots of apps, the dialog shows before they're enumerated, and the button text never gets set. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2023-03-217-7/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: move default style to Material3 with Dynamic ColorsHarsh Shandilya2022-05-262-2/+4
| | | | | | | The TV theme has been kept as-is since Material You guidance around this is a bit scarce at the moment. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: make validity check from QR code image scanner staticHarsh Shandilya2022-03-061-2/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: allow importing tunnel from an QR image stored on the deviceNikita Pustovoi2022-03-061-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Add a new feature to import a tunnel from a saved QR image, this feature integrates into 'import from file' flow, however adds a condition, if file is an image, attempt to parse it as QR image file. My use case for this feature, is to allow easier sharing of tunnels to family. Scanning QR code is ok when you have an external display to show it, but if you sent QR code to someone, there is no way to import it in the app. If you share a config file, that becomes way harder for a non-technical person to import as now they need to find a file with that name in the file picker etc etc, Where the images are very visible in the file picker, and user can easily recognize it for import. Testing: - Click "+" blue button, try to import a valid `.conf` file - the 'original' file flow should not be affected - Click "+" blue button, try to import a valid QR code image - if QR code was parsed, then a new tunnel will be added. - Click "+" blue button, try to import an invalid QR code image - Error message will be shown Signed-off-by: Nikita Pustovoi <deishelon@gmail.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: make when statements exhaustive everywhereHarsh Shandilya2022-01-081-0/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: bump copyright yearJason A. Donenfeld2021-10-297-7/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: upgrade zxing-android-embeddedHarsh Shandilya2021-10-251-10/+10
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: remove some more non-null assertions on binding fieldsHarsh Shandilya2021-04-212-2/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* TunnelListFragment: drop incorrect non-null assertionHarsh Shandilya2021-04-211-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: show all apps with internet permission in exclusions listHarsh Shandilya2020-11-161-7/+6
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: test for any camera, not just rear oneJason A. Donenfeld2020-11-101-1/+1
| | | | | | | Some folks use chromebooks, which don't have rear cameras. Reported-by: Jay Tuley <jay.tuley@ekonbenefits.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: account for binding disappearing on detail fragmentJason A. Donenfeld2020-09-301-7/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: queue up tunnel mutating on activity scope instead of fragment scopeJason A. Donenfeld2020-09-264-66/+75
| | | | | | | | | | | | Fragment scopes get cancelled when the fragment goes away, but we don't actually want to cancel an in-flight transition in that case. Also, before when the fragment would cancel, there'd be an exception, and the exception handler would call Fragment::getString, which in turn called requireContext, which caused an exception. Work around this by using the `activity ?: Application.get()` idiom to always have a context for strings and toasts. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: account for null data in callbackJason A. Donenfeld2020-09-241-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: cleanup code after churnJason A. Donenfeld2020-09-231-15/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: wire in statsJason A. Donenfeld2020-09-221-11/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: abstract out tunnel importingJason A. Donenfeld2020-09-222-129/+18
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tv: initial draft of Android TV supportHarsh Shandilya2020-09-221-11/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* TunnelEditorFragment: do not assume a contextJason A. Donenfeld2020-09-201-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelListFragment: do not assume binding always existsJason A. Donenfeld2020-09-201-4/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelDetailFragment: use kotlin coroutine for timer and rework nullabilityJason A. Donenfeld2020-09-201-43/+38
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* BaseFragment: avoid using requireContext() in permission result callbackJason A. Donenfeld2020-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | java.lang.IllegalStateException: at androidx.fragment.app.Fragment.requireContext (Fragment.java:17) at com.wireguard.android.fragment.BaseFragment$setTunnelStateWithPermissionsResult$1.invokeSuspend (BaseFragment.java:4) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:2) at kotlinx.coroutines.UndispatchedCoroutine.afterResume (UndispatchedCoroutine.java:19) at kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.java:13) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:2) at kotlinx.coroutines.UndispatchedCoroutine.afterResume (UndispatchedCoroutine.java:19) at kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.java:13) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:2) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:2) at android.os.Handler.handleCallback (Handler.java:790) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:164) at android.app.ActivityThread.main (ActivityThread.java:7025) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AddTunnelsSheet: disable qrcode scanning if no cameraJason A. Donenfeld2020-09-201-1/+8
| | | | | | Part of the enhancements for Android TV. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: reformat codeJason A. Donenfeld2020-09-182-4/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: retire EdgeToEdgeHarsh Shandilya2020-09-173-17/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: replace deprecated onActivityCreated with onViewCreatedHarsh Shandilya2020-09-171-2/+2
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: refactor AddTunnelsSheet's selection communicationHarsh Shandilya2020-09-172-37/+43
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: refactor AppListDialogFragment's selection communicationHarsh Shandilya2020-09-172-33/+31
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* activityx: use contracts more and refineJason A. Donenfeld2020-09-171-13/+12
| | | | | | | This is the beginning; there are still many of the old API's callsites to convert. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ConfigNamingDialogFragment: fix focus request for config naming dialogHarsh Shandilya2020-09-161-3/+17
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* TunnelEditorFragment: move backwards using fragment manager instead of hackJason A. Donenfeld2020-09-162-7/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>