Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
4705c0fa
Commit
4705c0fa
authored
11 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Fix screen flash when launching settings activity
Bug: 8336068 Change-Id: I90a0f259129a3f3319b158b060154cc43960c234
parent
2b5c9726
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
java/res/layout/setup_wizard.xml
+1
-0
1 addition, 0 deletions
java/res/layout/setup_wizard.xml
java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
+16
-10
16 additions, 10 deletions
.../android/inputmethod/latin/setup/SetupWizardActivity.java
with
17 additions
and
10 deletions
java/res/layout/setup_wizard.xml
+
1
−
0
View file @
4705c0fa
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
-->
-->
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/setup_wizard"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/setup_background"
android:background=
"@color/setup_background"
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
+
16
−
10
View file @
4705c0fa
...
@@ -46,6 +46,7 @@ import java.util.ArrayList;
...
@@ -46,6 +46,7 @@ import java.util.ArrayList;
public
final
class
SetupWizardActivity
extends
Activity
implements
View
.
OnClickListener
{
public
final
class
SetupWizardActivity
extends
Activity
implements
View
.
OnClickListener
{
static
final
String
TAG
=
SetupWizardActivity
.
class
.
getSimpleName
();
static
final
String
TAG
=
SetupWizardActivity
.
class
.
getSimpleName
();
private
View
mSetupWizard
;
private
View
mWelcomeScreen
;
private
View
mWelcomeScreen
;
private
View
mSetupScreen
;
private
View
mSetupScreen
;
private
Uri
mWelcomeVideoUri
;
private
Uri
mWelcomeVideoUri
;
...
@@ -64,7 +65,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -64,7 +65,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
private
static
final
int
STEP_LAUNCHING_IME_SETTINGS
=
4
;
private
static
final
int
STEP_LAUNCHING_IME_SETTINGS
=
4
;
private
static
final
int
STEP_BACK_FROM_IME_SETTINGS
=
5
;
private
static
final
int
STEP_BACK_FROM_IME_SETTINGS
=
5
;
private
final
SettingsPoolingHandler
mHandler
=
new
SettingsPoolingHandler
(
this
);
final
SettingsPoolingHandler
mHandler
=
new
SettingsPoolingHandler
(
this
);
static
final
class
SettingsPoolingHandler
static
final
class
SettingsPoolingHandler
extends
StaticInnerHandlerWrapper
<
SetupWizardActivity
>
{
extends
StaticInnerHandlerWrapper
<
SetupWizardActivity
>
{
...
@@ -104,10 +105,11 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -104,10 +105,11 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
@Override
@Override
protected
void
onCreate
(
final
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
final
Bundle
savedInstanceState
)
{
setTheme
(
android
.
R
.
style
.
Theme_
DeviceDefault_Light_NoAction
Bar
);
setTheme
(
android
.
R
.
style
.
Theme_
Translucent_NoTitle
Bar
);
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
setup_wizard
);
setContentView
(
R
.
layout
.
setup_wizard
);
mSetupWizard
=
findViewById
(
R
.
id
.
setup_wizard
);
RichInputMethodManager
.
init
(
this
);
RichInputMethodManager
.
init
(
this
);
...
@@ -179,27 +181,28 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -179,27 +181,28 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
.
authority
(
getPackageName
())
.
authority
(
getPackageName
())
.
path
(
Integer
.
toString
(
R
.
raw
.
setup_welcome_video
))
.
path
(
Integer
.
toString
(
R
.
raw
.
setup_welcome_video
))
.
build
();
.
build
();
mW
elcomeVideoView
=
(
VideoView
)
findViewById
(
R
.
id
.
setup_welcome_video
);
final
VideoView
w
elcomeVideoView
=
(
VideoView
)
findViewById
(
R
.
id
.
setup_welcome_video
);
mW
elcomeVideoView
.
setOnPreparedListener
(
new
MediaPlayer
.
OnPreparedListener
()
{
w
elcomeVideoView
.
setOnPreparedListener
(
new
MediaPlayer
.
OnPreparedListener
()
{
@Override
@Override
public
void
onPrepared
(
final
MediaPlayer
mp
)
{
public
void
onPrepared
(
final
MediaPlayer
mp
)
{
// Now VideoView has been laid-out and ready to play, remove background of it to
// Now VideoView has been laid-out and ready to play, remove background of it to
// reveal the video.
// reveal the video.
mW
elcomeVideoView
.
setBackgroundResource
(
0
);
w
elcomeVideoView
.
setBackgroundResource
(
0
);
mp
.
setLooping
(
true
);
mp
.
setLooping
(
true
);
}
}
});
});
final
ImageView
welcomeImageView
=
(
ImageView
)
findViewById
(
R
.
id
.
setup_welcome_image
);
final
ImageView
welcomeImageView
=
(
ImageView
)
findViewById
(
R
.
id
.
setup_welcome_image
);
mW
elcomeVideoView
.
setOnErrorListener
(
new
MediaPlayer
.
OnErrorListener
()
{
w
elcomeVideoView
.
setOnErrorListener
(
new
MediaPlayer
.
OnErrorListener
()
{
@Override
@Override
public
boolean
onError
(
final
MediaPlayer
mp
,
final
int
what
,
final
int
extra
)
{
public
boolean
onError
(
final
MediaPlayer
mp
,
final
int
what
,
final
int
extra
)
{
Log
.
e
(
TAG
,
"Playing welcome video causes error: what="
+
what
+
" extra="
+
extra
);
Log
.
e
(
TAG
,
"Playing welcome video causes error: what="
+
what
+
" extra="
+
extra
);
mW
elcomeVideoView
.
setVisibility
(
View
.
GONE
);
w
elcomeVideoView
.
setVisibility
(
View
.
GONE
);
welcomeImageView
.
setImageResource
(
R
.
raw
.
setup_welcome_image
);
welcomeImageView
.
setImageResource
(
R
.
raw
.
setup_welcome_image
);
welcomeImageView
.
setVisibility
(
View
.
VISIBLE
);
welcomeImageView
.
setVisibility
(
View
.
VISIBLE
);
return
true
;
return
true
;
}
}
});
});
mWelcomeVideoView
=
welcomeVideoView
;
mActionStart
=
findViewById
(
R
.
id
.
setup_start_label
);
mActionStart
=
findViewById
(
R
.
id
.
setup_start_label
);
mActionStart
.
setOnClickListener
(
this
);
mActionStart
.
setOnClickListener
(
this
);
...
@@ -234,7 +237,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -234,7 +237,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
}
}
}
}
private
void
invokeSetupWizardOfThisIme
()
{
void
invokeSetupWizardOfThisIme
()
{
final
Intent
intent
=
new
Intent
();
final
Intent
intent
=
new
Intent
();
intent
.
setClass
(
this
,
SetupWizardActivity
.
class
);
intent
.
setClass
(
this
,
SetupWizardActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
...
@@ -251,14 +254,14 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -251,14 +254,14 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
startActivity
(
intent
);
startActivity
(
intent
);
}
}
private
void
invokeLanguageAndInputSettings
()
{
void
invokeLanguageAndInputSettings
()
{
final
Intent
intent
=
new
Intent
();
final
Intent
intent
=
new
Intent
();
intent
.
setAction
(
Settings
.
ACTION_INPUT_METHOD_SETTINGS
);
intent
.
setAction
(
Settings
.
ACTION_INPUT_METHOD_SETTINGS
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
startActivity
(
intent
);
startActivity
(
intent
);
}
}
private
void
invokeSubtypeEnablerOfThisIme
()
{
void
invokeSubtypeEnablerOfThisIme
()
{
final
InputMethodInfo
imi
=
final
InputMethodInfo
imi
=
RichInputMethodManager
.
getInstance
().
getInputMethodInfoOfThisIme
();
RichInputMethodManager
.
getInstance
().
getInputMethodInfoOfThisIme
();
final
Intent
intent
=
new
Intent
();
final
Intent
intent
=
new
Intent
();
...
@@ -318,6 +321,8 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -318,6 +321,8 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
if
(
mStepNumber
==
STEP_LAUNCHING_IME_SETTINGS
)
{
if
(
mStepNumber
==
STEP_LAUNCHING_IME_SETTINGS
)
{
// Prevent white screen flashing while launching settings activity.
mSetupWizard
.
setVisibility
(
View
.
INVISIBLE
);
invokeSettingsOfThisIme
();
invokeSettingsOfThisIme
();
mStepNumber
=
STEP_BACK_FROM_IME_SETTINGS
;
mStepNumber
=
STEP_BACK_FROM_IME_SETTINGS
;
return
;
return
;
...
@@ -360,6 +365,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
...
@@ -360,6 +365,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
}
}
private
void
updateSetupStepView
()
{
private
void
updateSetupStepView
()
{
mSetupWizard
.
setVisibility
(
View
.
VISIBLE
);
final
boolean
welcomeScreen
=
(
mStepNumber
==
STEP_WELCOME
);
final
boolean
welcomeScreen
=
(
mStepNumber
==
STEP_WELCOME
);
mWelcomeScreen
.
setVisibility
(
welcomeScreen
?
View
.
VISIBLE
:
View
.
GONE
);
mWelcomeScreen
.
setVisibility
(
welcomeScreen
?
View
.
VISIBLE
:
View
.
GONE
);
mSetupScreen
.
setVisibility
(
welcomeScreen
?
View
.
GONE
:
View
.
VISIBLE
);
mSetupScreen
.
setVisibility
(
welcomeScreen
?
View
.
GONE
:
View
.
VISIBLE
);
...
...
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