Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
530
Issue boards
Milestones
Wiki
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
e2e6d282
Commit
e2e6d282
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Network login: fix cancel event
(cherry picked from commit
8320cad2
)
parent
95b675e4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/dialogs/VlcDialog.kt
+4
-6
4 additions, 6 deletions
vlc-android/src/org/videolan/vlc/gui/dialogs/VlcDialog.kt
vlc-android/src/org/videolan/vlc/gui/dialogs/VlcLoginDialog.kt
+15
-10
15 additions, 10 deletions
...ndroid/src/org/videolan/vlc/gui/dialogs/VlcLoginDialog.kt
with
19 additions
and
16 deletions
vlc-android/src/org/videolan/vlc/gui/dialogs/VlcDialog.kt
+
4
−
6
View file @
e2e6d282
...
...
@@ -65,17 +65,15 @@ abstract class VlcDialog<T : Dialog, B : ViewDataBinding> : DialogFragment() {
override
fun
onDestroy
()
{
super
.
onDestroy
()
if
(
::
vlcDialog
.
isInitialized
)
vlcDialog
.
dismiss
()
activity
!!
.
finish
()
if
(
::
vlcDialog
.
isInitialized
)
vlcDialog
.
dismiss
()
activity
?.
finish
()
}
fun
onCancel
(
v
:
View
)
{
open
fun
onCancel
(
v
:
View
)
{
dismiss
()
}
override
fun
dismiss
()
{
if
(
isResumed
)
super
.
dismiss
()
if
(
isResumed
)
super
.
dismiss
()
}
}
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/dialogs/VlcLoginDialog.kt
+
15
−
10
View file @
e2e6d282
...
...
@@ -25,6 +25,7 @@
package
org.videolan.vlc.gui.dialogs
import
android.content.Context
import
android.content.DialogInterface
import
android.content.Intent
import
android.content.SharedPreferences
import
android.os.Bundle
...
...
@@ -41,11 +42,10 @@ import org.videolan.vlc.util.Settings
class
VlcLoginDialog
:
VlcDialog
<
Dialog
.
LoginDialog
,
VlcLoginDialogBinding
>(),
View
.
OnFocusChangeListener
{
private
lateinit
var
mS
ettings
:
SharedPreferences
private
lateinit
var
s
ettings
:
SharedPreferences
override
val
layout
:
Int
get
()
=
R
.
layout
.
vlc_login_dialog
override
val
layout
=
R
.
layout
.
vlc_login_dialog
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
...
...
@@ -59,27 +59,32 @@ class VlcLoginDialog : VlcDialog<Dialog.LoginDialog, VlcLoginDialogBinding>(), V
override
fun
onAttach
(
context
:
Context
)
{
super
.
onAttach
(
context
)
mS
ettings
=
Settings
.
getInstance
(
requireActivity
())
s
ettings
=
Settings
.
getInstance
(
requireActivity
())
}
fun
onLogin
(
v
:
View
)
{
vlcDialog
.
postLogin
(
binding
.
login
.
text
.
toString
().
trim
(),
binding
.
password
.
text
.
toString
().
trim
(),
binding
.
store
.
isChecked
)
mS
ettings
.
edit
().
putBoolean
(
LOGIN_STORE
,
binding
.
store
.
isChecked
).
apply
()
s
ettings
.
edit
().
putBoolean
(
LOGIN_STORE
,
binding
.
store
.
isChecked
).
apply
()
dismiss
()
}
fun
store
():
Boolean
{
return
mSettings
.
getBoolean
(
LOGIN_STORE
,
true
)
}
fun
store
()
=
settings
.
getBoolean
(
LOGIN_STORE
,
true
)
override
fun
onFocusChange
(
v
:
View
,
hasFocus
:
Boolean
)
{
if
(
hasFocus
)
UiTools
.
setKeyboardVisibility
(
v
,
v
is
EditText
)
}
override
fun
onDestroy
()
{
// Cancel from LibVLC
override
fun
onCancel
(
dialog
:
DialogInterface
)
{
LocalBroadcastManager
.
getInstance
(
requireContext
()).
sendBroadcast
(
Intent
(
ACTION_DIALOG_CANCELED
))
super
.
onCancel
(
dialog
)
}
// Cancel from UI
override
fun
onCancel
(
v
:
View
)
{
LocalBroadcastManager
.
getInstance
(
requireContext
()).
sendBroadcast
(
Intent
(
ACTION_DIALOG_CANCELED
))
super
.
on
Destroy
(
)
super
.
on
Cancel
(
v
)
}
companion
object
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment