Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Casanowow Life for love
VLC-Android
Commits
bacaa78c
Commit
bacaa78c
authored
Feb 19, 2014
by
Adrien Maglo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advanced options menu: use different styles for audio and video mode
parent
4d49b64f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
77 deletions
+104
-77
vlc-android/res/drawable/advanced_options_audio_background.xml
...ndroid/res/drawable/advanced_options_audio_background.xml
+11
-0
vlc-android/res/drawable/advanced_options_video_background.xml
...ndroid/res/drawable/advanced_options_video_background.xml
+11
-0
vlc-android/res/layout/advanced_options.xml
vlc-android/res/layout/advanced_options.xml
+51
-56
vlc-android/res/values/attrs.xml
vlc-android/res/values/attrs.xml
+1
-0
vlc-android/res/values/colors.xml
vlc-android/res/values/colors.xml
+2
-0
vlc-android/res/values/styles.xml
vlc-android/res/values/styles.xml
+19
-8
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
+9
-13
No files found.
vlc-android/res/drawable/advanced_options_audio_background.xml
0 → 100644
View file @
bacaa78c
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/background_player"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/darkgrey"
/>
</shape>
\ No newline at end of file
vlc-android/res/drawable/advanced_options_video_background.xml
0 → 100644
View file @
bacaa78c
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/black"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
vlc-android/res/layout/advanced_options.xml
View file @
bacaa78c
<?xml version="1.0" encoding="utf-8"?>
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/advanced_layout"
android:layout_width=
"300dp"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/advanced_layout"
<org.videolan.vlc.gui.expandable.SpeedSelector
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"?attr/advanced_options_divider"
tools:ignore=
"PxUsage"
/>
<org.videolan.vlc.gui.expandable.TimeSleep
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"?attr/advanced_options_divider"
tools:ignore=
"PxUsage"
/>
<org.videolan.vlc.gui.expandable.JumpToTime
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"?attr/advanced_options_divider"
tools:ignore=
"PxUsage"
/>
<TextView
android:id=
"@+id/add_subtitle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<org.videolan.vlc.gui.expandable.SpeedSelector
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:background=
"#8FFF"
tools:ignore=
"PxUsage"
/>
<org.videolan.vlc.gui.expandable.TimeSleep
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:background=
"#8FFF"
tools:ignore=
"PxUsage"
/>
<org.videolan.vlc.gui.expandable.JumpToTime
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:background=
"#8FFF"
tools:ignore=
"PxUsage"
/>
<TextView
android:id=
"@+id/add_subtitle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/background_item"
android:text=
"@string/subtitle_label"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
<TextView
android:id=
"@+id/equalizer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/background_item"
android:text=
"@string/equalizer"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
</LinearLayout>
</ScrollView>
\ No newline at end of file
android:layout_margin=
"10dp"
android:background=
"@drawable/background_item"
android:text=
"@string/subtitle_label"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
<TextView
android:id=
"@+id/equalizer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
android:background=
"@drawable/background_item"
android:text=
"@string/equalizer"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
</LinearLayout>
\ No newline at end of file
vlc-android/res/values/attrs.xml
View file @
bacaa78c
...
...
@@ -16,6 +16,7 @@
<attr
name=
"darkorange"
format=
"reference|color"
/>
<attr
name=
"darkerorange"
format=
"reference|color"
/>
<attr
name=
"transparent_gray"
format=
"reference|color"
/>
<attr
name=
"advanced_options_divider"
format=
"reference|color"
/>
<declare-styleable
name=
"SlidingPaneLayout"
>
<attr
name=
"overhangSize"
format=
"dimension"
/>
...
...
vlc-android/res/values/colors.xml
View file @
bacaa78c
...
...
@@ -17,7 +17,9 @@
<color
name=
"darkorange"
>
#ff8800
</color>
<color
name=
"darkerorange"
>
#ff7200
</color>
<color
name=
"black"
>
#000001
</color>
<color
name=
"white"
>
#FFFFFF
</color>
<color
name=
"transparent_gray"
>
#8000
</color>
<color
name=
"action_bar_title"
>
#FFFFFF
</color>
<color
name=
"darkgrey"
>
#ffa0a0a0
</color>
</resources>
\ No newline at end of file
vlc-android/res/values/styles.xml
View file @
bacaa78c
...
...
@@ -85,13 +85,24 @@
<item
name=
"android:textColor"
>
@color/action_bar_title
</item>
</style>
<style
name=
"Theme.VLC.AlertMenu"
parent=
"android:Theme.Dialog"
>
<item
name=
"android:windowBackground"
>
@null
</item>
<item
name=
"android:windowFrame"
>
@null
</item>
<item
name=
"windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowAnimationStyle"
>
@null
</item>
<item
name=
"android:backgroundDimEnabled"
>
false
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<!-- Advanced options menu styles -->
<style
name=
"Theme.VLC.AdvancedOptions"
parent=
"@android:style/Theme.Dialog"
>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:backgroundDimEnabled"
>
false
</item>
<item
name=
"android:windowIsTranslucent"
>
false
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
</style>
<style
name=
"Theme.VLC.AdvancedOptionsAudio"
parent=
"Theme.VLC.AdvancedOptions"
>
<item
name=
"android:windowBackground"
>
@drawable/advanced_options_audio_background
</item>
<item
name=
"android:textColor"
>
@color/black
</item>
<item
name=
"advanced_options_divider"
>
@color/darkgrey
</item>
</style>
<style
name=
"Theme.VLC.AdvancedOptionsVideo"
parent=
"Theme.VLC.AdvancedOptions"
>
<item
name=
"android:windowBackground"
>
@drawable/advanced_options_video_background
</item>
<item
name=
"android:textColor"
>
@color/white
</item>
<item
name=
"advanced_options_divider"
>
@color/white
</item>
</style>
</resources>
vlc-android/src/org/videolan/vlc/gui/CommonDialogs.java
View file @
bacaa78c
...
...
@@ -25,14 +25,13 @@ import java.net.URI;
import
java.net.URISyntaxException
;
import
org.videolan.vlc.R
;
import
org.videolan.vlc.VLCApplication
;
import
org.videolan.vlc.VlcRunnable
;
import
org.videolan.vlc.interfaces.OnExpandableListener
;
import
org.videolan.vlc.widget.ExpandableLayout
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.app.
AlertDialog.Builder
;
import
android.app.
Dialog
;
import
android.content.ActivityNotFoundException
;
import
android.content.Context
;
import
android.content.DialogInterface
;
...
...
@@ -40,9 +39,7 @@ import android.content.Intent;
import
android.content.pm.PackageManager
;
import
android.net.Uri
;
import
android.util.Log
;
import
android.view.ContextThemeWrapper
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.WindowManager.LayoutParams
;
import
android.widget.LinearLayout
;
...
...
@@ -87,17 +84,16 @@ public class CommonDialogs {
}
public
static
void
advancedOptions
(
final
Context
context
,
View
v
,
MenuType
t
)
{
LayoutInflater
inflater
=
LayoutInflater
.
from
(
VLCApplication
.
getAppContext
());
View
view
=
inflater
.
inflate
(
R
.
layout
.
advanced_options
,
null
);
// build dialog
Builder
builder
=
new
AlertDialog
.
Builder
(
new
ContextThemeWrapper
(
context
,
R
.
style
.
Theme_VLC_AlertMenu
))
.
setView
(
view
);
final
AlertDialog
dialog
=
builder
.
create
();
int
style
=
t
==
MenuType
.
Video
?
R
.
style
.
Theme_VLC_AdvancedOptionsVideo
:
R
.
style
.
Theme_VLC_AdvancedOptionsAudio
;
final
Dialog
dialog
=
new
Dialog
(
context
,
style
);
dialog
.
setContentView
(
R
.
layout
.
advanced_options
);
dialog
.
setCanceledOnTouchOutside
(
true
);
// register listener on each ExpandableLayout in advanced_layout
LinearLayout
advanced_layout
=
(
LinearLayout
)
view
.
findViewById
(
R
.
id
.
advanced_layout
);
LinearLayout
advanced_layout
=
(
LinearLayout
)
dialog
.
findViewById
(
R
.
id
.
advanced_layout
);
OnExpandableListener
mExpandableListener
=
new
OnExpandableListener
()
{
@Override
public
void
onDismiss
()
{
...
...
@@ -112,8 +108,8 @@ public class CommonDialogs {
}
}
TextView
add_subtitle
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
add_subtitle
);
TextView
equalizer
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
equalizer
);
TextView
add_subtitle
=
(
TextView
)
dialog
.
findViewById
(
R
.
id
.
add_subtitle
);
TextView
equalizer
=
(
TextView
)
dialog
.
findViewById
(
R
.
id
.
equalizer
);
if
(
t
==
MenuType
.
Video
)
{
add_subtitle
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment