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
36752a94
Commit
36752a94
authored
Mar 05, 2015
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for support library crash
parent
0028bc3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
12 deletions
+66
-12
vlc-android/res/layout/main.xml
vlc-android/res/layout/main.xml
+2
-2
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+8
-10
vlc-android/src/org/videolan/vlc/widget/HackyDrawerLayout.java
...ndroid/src/org/videolan/vlc/widget/HackyDrawerLayout.java
+56
-0
No files found.
vlc-android/res/layout/main.xml
View file @
36752a94
...
...
@@ -5,7 +5,7 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<
android.support.v4.widget.
DrawerLayout
<
org.videolan.vlc.widget.Hacky
DrawerLayout
android:id=
"@+id/root_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -81,7 +81,7 @@
<!-- The navigation drawer -->
<include
layout=
"@layout/sidebar"
/>
</
android.support.v4.widget.
DrawerLayout>
</
org.videolan.vlc.widget.Hacky
DrawerLayout>
<include
layout=
"@layout/toolbar"
/>
</FrameLayout>
vlc-android/src/org/videolan/vlc/gui/MainActivity.java
View file @
36752a94
...
...
@@ -41,7 +41,6 @@ import android.support.v4.app.FragmentManager;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.view.GravityCompat
;
import
android.support.v4.view.MenuItemCompat
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.ActionBarActivity
;
import
android.support.v7.app.ActionBarDrawerToggle
;
...
...
@@ -53,7 +52,6 @@ import android.view.LayoutInflater;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
...
...
@@ -69,7 +67,6 @@ import org.videolan.libvlc.LibVlcUtil;
import
org.videolan.vlc.BuildConfig
;
import
org.videolan.vlc.MediaDatabase
;
import
org.videolan.vlc.MediaLibrary
;
import
org.videolan.vlc.MediaWrapper
;
import
org.videolan.vlc.R
;
import
org.videolan.vlc.VLCApplication
;
import
org.videolan.vlc.audio.AudioService
;
...
...
@@ -88,6 +85,7 @@ import org.videolan.vlc.util.AndroidDevices;
import
org.videolan.vlc.util.Util
;
import
org.videolan.vlc.util.VLCInstance
;
import
org.videolan.vlc.util.WeakHandler
;
import
org.videolan.vlc.widget.HackyDrawerLayout
;
import
org.videolan.vlc.widget.SlidingPaneLayout
;
import
java.util.Arrays
;
...
...
@@ -113,7 +111,7 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
private
AudioPlayer
mAudioPlayer
;
private
AudioServiceController
mAudioController
;
private
SlidingPaneLayout
mSlidingPane
;
private
DrawerLayout
mRootContainer
;
private
Hacky
DrawerLayout
mRootContainer
;
private
ListView
mListView
;
private
ActionBarDrawerToggle
mDrawerToggle
;
private
View
mSideMenu
;
...
...
@@ -219,7 +217,7 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
mInfoProgress
=
(
ProgressBar
)
findViewById
(
R
.
id
.
info_progress
);
mInfoText
=
(
TextView
)
findViewById
(
R
.
id
.
info_text
);
mAudioPlayerFilling
=
findViewById
(
R
.
id
.
audio_player_filling
);
mRootContainer
=
(
DrawerLayout
)
findViewById
(
R
.
id
.
root_container
);
mRootContainer
=
(
Hacky
DrawerLayout
)
findViewById
(
R
.
id
.
root_container
);
/* Set up the action bar */
prepareActionBar
();
...
...
@@ -954,7 +952,7 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
if
(
resId
!=
0
)
mSlidingPane
.
setShadowResource
(
resId
);
mAudioPlayer
.
setHeaderVisibilities
(
false
,
false
,
true
,
true
,
true
);
mRootContainer
.
setDrawerLockMode
(
DrawerLayout
.
LOCK_MODE_UNLOCKED
);
mRootContainer
.
setDrawerLockMode
(
Hacky
DrawerLayout
.
LOCK_MODE_UNLOCKED
);
removeTipViewIfDisplayed
();
mAudioPlayer
.
showAudioPlayerTips
();
}
...
...
@@ -962,13 +960,13 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
@Override
public
void
onPanelOpenedEntirely
()
{
mSlidingPane
.
setShadowDrawable
(
null
);
mRootContainer
.
setDrawerLockMode
(
DrawerLayout
.
LOCK_MODE_UNLOCKED
);
mRootContainer
.
setDrawerLockMode
(
Hacky
DrawerLayout
.
LOCK_MODE_UNLOCKED
);
}
@Override
public
void
onPanelClosed
()
{
mAudioPlayer
.
setHeaderVisibilities
(
true
,
true
,
false
,
false
,
false
);
mRootContainer
.
setDrawerLockMode
(
DrawerLayout
.
LOCK_MODE_LOCKED_CLOSED
);
mRootContainer
.
setDrawerLockMode
(
Hacky
DrawerLayout
.
LOCK_MODE_LOCKED_CLOSED
);
mAudioPlayer
.
showPlaylistTips
();
}
...
...
@@ -984,8 +982,8 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
removeTipViewIfDisplayed
();
View
v
=
LayoutInflater
.
from
(
this
).
inflate
(
layoutId
,
null
);
mRootContainer
.
addView
(
v
,
new
DrawerLayout
.
LayoutParams
(
DrawerLayout
.
LayoutParams
.
MATCH_PARENT
,
DrawerLayout
.
LayoutParams
.
MATCH_PARENT
));
new
HackyDrawerLayout
.
LayoutParams
(
Hacky
DrawerLayout
.
LayoutParams
.
MATCH_PARENT
,
Hacky
DrawerLayout
.
LayoutParams
.
MATCH_PARENT
));
v
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
vlc-android/src/org/videolan/vlc/widget/HackyDrawerLayout.java
0 → 100644
View file @
36752a94
/*
* *************************************************************************
* HackyDrawerLayout.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package
org.videolan.vlc.widget
;
import
android.content.Context
;
import
android.support.v4.widget.DrawerLayout
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
/*
* Workaround for support lib bug, see https://code.google.com/p/android/issues/detail?id=60464
*/
public
class
HackyDrawerLayout
extends
DrawerLayout
{
public
HackyDrawerLayout
(
Context
context
)
{
super
(
context
);
}
public
HackyDrawerLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
HackyDrawerLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
}
@Override
public
boolean
onInterceptTouchEvent
(
MotionEvent
ev
)
{
try
{
return
super
.
onInterceptTouchEvent
(
ev
);
}
catch
(
Throwable
t
)
{
t
.
printStackTrace
();
return
false
;
}
}
}
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