Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
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
501aaad6
Commit
501aaad6
authored
7 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Improve 'About' view loading
parent
9e93b1d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/AboutFragment.java
+25
-10
25 additions, 10 deletions
vlc-android/src/org/videolan/vlc/gui/AboutFragment.java
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+7
-7
7 additions, 7 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
with
32 additions
and
17 deletions
vlc-android/src/org/videolan/vlc/gui/AboutFragment.java
+
25
−
10
View file @
501aaad6
...
...
@@ -21,6 +21,7 @@
package
org.videolan.vlc.gui
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.TabLayout
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.view.ViewPager
;
...
...
@@ -50,31 +51,45 @@ public class AboutFragment extends Fragment {
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
return
inflater
.
inflate
(
R
.
layout
.
about
,
container
,
false
);
}
@Override
public
void
onViewCreated
(
final
View
v
,
@Nullable
Bundle
savedInstanceState
)
{
super
.
onViewCreated
(
v
,
savedInstanceState
);
if
(
getActivity
()
instanceof
AppCompatActivity
)
((
AppCompatActivity
)
getActivity
()).
getSupportActionBar
().
setTitle
(
"VLC "
+
BuildConfig
.
VERSION_NAME
);
View
v
=
inflater
.
inflate
(
R
.
layout
.
about
,
container
,
false
);
//Fix android 7 Locale problem with webView
//https://stackoverflow.com/questions/40398528/android-webview-locale-changes-abruptly-on-android-n
if
(
AndroidUtil
.
isNougatOrLater
)
VLCApplication
.
setLocale
();
View
aboutMain
=
v
.
findViewById
(
R
.
id
.
about_main
);
WebView
webView
=
(
WebView
)
v
.
findViewById
(
R
.
id
.
webview
);
String
revision
=
getString
(
R
.
string
.
build_revision
);
webView
.
loadData
(
Util
.
readAsset
(
"licence.htm"
,
""
).
replace
(
"!COMMITID!"
,
revision
),
"text/html"
,
"UTF8"
);
final
View
aboutMain
=
v
.
findViewById
(
R
.
id
.
about_main
);
final
WebView
webView
=
v
.
findViewById
(
R
.
id
.
webview
);
final
String
revision
=
getString
(
R
.
string
.
build_revision
);
UiTools
.
fillAboutView
(
v
);
View
[]
lists
=
new
View
[]{
aboutMain
,
webView
};
String
[]
titles
=
new
String
[]
{
getString
(
R
.
string
.
about
),
getString
(
R
.
string
.
licence
)};
mViewPager
=
(
ViewPager
)
v
.
findViewById
(
R
.
id
.
pager
);
mViewPager
=
v
.
findViewById
(
R
.
id
.
pager
);
mViewPager
.
setOffscreenPageLimit
(
MODE_TOTAL
-
1
);
mViewPager
.
setAdapter
(
new
AudioPagerAdapter
(
lists
,
titles
));
mTabLayout
=
(
TabLayout
)
v
.
findViewById
(
R
.
id
.
sliding_tabs
);
mTabLayout
=
v
.
findViewById
(
R
.
id
.
sliding_tabs
);
mTabLayout
.
setupWithViewPager
(
mViewPager
);
return
v
;
VLCApplication
.
runBackground
(
new
Runnable
()
{
@Override
public
void
run
()
{
final
String
asset
=
Util
.
readAsset
(
"licence.htm"
,
""
).
replace
(
"!COMMITID!"
,
revision
);
VLCApplication
.
runOnMainThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
UiTools
.
fillAboutView
(
v
);
webView
.
loadData
(
asset
,
"text/html"
,
"UTF8"
);
}
});
}
});
}
}
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+
7
−
7
View file @
501aaad6
...
...
@@ -219,19 +219,19 @@ public class UiTools {
}
public
static
void
fillAboutView
(
View
v
)
{
TextView
link
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
main_link
);
final
TextView
link
=
v
.
findViewById
(
R
.
id
.
main_link
);
link
.
setText
(
Html
.
fromHtml
(
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
about_link
)));
String
revision
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_revision
)+
" VLC: "
+
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_vlc_revision
);
String
builddate
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_time
);
String
builder
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_host
);
final
String
revision
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_revision
)+
" VLC: "
+
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_vlc_revision
);
final
String
builddate
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_time
);
final
String
builder
=
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
build_host
);
TextView
compiled
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
main_compiled
);
final
TextView
compiled
=
v
.
findViewById
(
R
.
id
.
main_compiled
);
compiled
.
setText
(
builder
+
" ("
+
builddate
+
")"
);
TextView
textview_rev
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
main_revision
);
final
TextView
textview_rev
=
v
.
findViewById
(
R
.
id
.
main_revision
);
textview_rev
.
setText
(
VLCApplication
.
getAppResources
().
getString
(
R
.
string
.
revision
)
+
" "
+
revision
+
" ("
+
builddate
+
") "
+
BuildConfig
.
FLAVOR_abi
);
final
ImageView
logo
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
logo
);
final
ImageView
logo
=
v
.
findViewById
(
R
.
id
.
logo
);
logo
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
...
...
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