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
b84c0468
Commit
b84c0468
authored
11 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Make setup wizard step number highlighted when activated
Bug: 8159728 Change-Id: I62ccbebaae0a0c4a93ad7c155fc3020a7f357f3c
parent
46420204
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
+3
-0
3 additions, 0 deletions
java/res/layout/setup_wizard.xml
java/src/com/android/inputmethod/latin/setup/SetupActivity.java
+28
-20
28 additions, 20 deletions
...rc/com/android/inputmethod/latin/setup/SetupActivity.java
with
31 additions
and
20 deletions
java/res/layout/setup_wizard.xml
+
3
−
0
View file @
b84c0468
...
@@ -46,12 +46,15 @@
...
@@ -46,12 +46,15 @@
android:paddingTop=
"16dp"
android:paddingTop=
"16dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
android:id=
"@+id/setup_step1_bullet"
style=
"@style/setupStepBulletStyle"
style=
"@style/setupStepBulletStyle"
android:text=
"@string/setup_step1_bullet"
/>
android:text=
"@string/setup_step1_bullet"
/>
<TextView
<TextView
android:id=
"@+id/setup_step2_bullet"
style=
"@style/setupStepBulletStyle"
style=
"@style/setupStepBulletStyle"
android:text=
"@string/setup_step2_bullet"
/>
android:text=
"@string/setup_step2_bullet"
/>
<TextView
<TextView
android:id=
"@+id/setup_step3_bullet"
style=
"@style/setupStepBulletStyle"
style=
"@style/setupStepBulletStyle"
android:text=
"@string/setup_step3_bullet"
/>
android:text=
"@string/setup_step3_bullet"
/>
</LinearLayout>
</LinearLayout>
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/setup/SetupActivity.java
+
28
−
20
View file @
b84c0468
...
@@ -108,16 +108,15 @@ public final class SetupActivity extends Activity {
...
@@ -108,16 +108,15 @@ public final class SetupActivity extends Activity {
return
;
return
;
}
}
// TODO: Use sans-serif-thin font family depending on the system locale white list and
// the SDK version.
final
TextView
titleView
=
(
TextView
)
findViewById
(
R
.
id
.
setup_title
);
final
TextView
titleView
=
(
TextView
)
findViewById
(
R
.
id
.
setup_title
);
final
in
t
appName
=
getApplicationInfo
().
labelRes
;
final
Str
in
g
app
lication
Name
=
getResources
().
getString
(
getApplicationInfo
().
labelRes
)
;
titleView
.
setText
(
getString
(
R
.
string
.
setup_steps_title
,
getString
(
app
Name
))
)
;
titleView
.
setText
(
getString
(
R
.
string
.
setup_steps_title
,
application
Name
));
mStepIndicatorView
=
(
SetupStepIndicatorView
)
findViewById
(
R
.
id
.
setup_step_indicator
);
mStepIndicatorView
=
(
SetupStepIndicatorView
)
findViewById
(
R
.
id
.
setup_step_indicator
);
final
SetupStep
step1
=
new
SetupStep
(
findViewById
(
R
.
id
.
setup_step1
),
final
SetupStep
step1
=
new
SetupStep
(
applicationName
,
appName
,
R
.
string
.
setup_step1_title
,
R
.
string
.
setup_step1_instruction
,
(
TextView
)
findViewById
(
R
.
id
.
setup_step1_bullet
),
findViewById
(
R
.
id
.
setup_step1
),
R
.
string
.
setup_step1_title
,
R
.
string
.
setup_step1_instruction
,
R
.
drawable
.
ic_setup_step1
,
R
.
string
.
setup_step1_action
);
R
.
drawable
.
ic_setup_step1
,
R
.
string
.
setup_step1_action
);
step1
.
setAction
(
new
Runnable
()
{
step1
.
setAction
(
new
Runnable
()
{
@Override
@Override
...
@@ -128,8 +127,9 @@ public final class SetupActivity extends Activity {
...
@@ -128,8 +127,9 @@ public final class SetupActivity extends Activity {
});
});
mSetupSteps
.
addStep
(
STEP_1
,
step1
);
mSetupSteps
.
addStep
(
STEP_1
,
step1
);
final
SetupStep
step2
=
new
SetupStep
(
findViewById
(
R
.
id
.
setup_step2
),
final
SetupStep
step2
=
new
SetupStep
(
applicationName
,
appName
,
R
.
string
.
setup_step2_title
,
R
.
string
.
setup_step2_instruction
,
(
TextView
)
findViewById
(
R
.
id
.
setup_step2_bullet
),
findViewById
(
R
.
id
.
setup_step2
),
R
.
string
.
setup_step2_title
,
R
.
string
.
setup_step2_instruction
,
R
.
drawable
.
ic_setup_step2
,
R
.
string
.
setup_step2_action
);
R
.
drawable
.
ic_setup_step2
,
R
.
string
.
setup_step2_action
);
step2
.
setAction
(
new
Runnable
()
{
step2
.
setAction
(
new
Runnable
()
{
@Override
@Override
...
@@ -141,8 +141,9 @@ public final class SetupActivity extends Activity {
...
@@ -141,8 +141,9 @@ public final class SetupActivity extends Activity {
});
});
mSetupSteps
.
addStep
(
STEP_2
,
step2
);
mSetupSteps
.
addStep
(
STEP_2
,
step2
);
final
SetupStep
step3
=
new
SetupStep
(
findViewById
(
R
.
id
.
setup_step3
),
final
SetupStep
step3
=
new
SetupStep
(
applicationName
,
appName
,
R
.
string
.
setup_step3_title
,
R
.
string
.
setup_step3_instruction
,
(
TextView
)
findViewById
(
R
.
id
.
setup_step3_bullet
),
findViewById
(
R
.
id
.
setup_step3
),
R
.
string
.
setup_step3_title
,
R
.
string
.
setup_step3_instruction
,
R
.
drawable
.
ic_setup_step3
,
R
.
string
.
setup_step3_action
);
R
.
drawable
.
ic_setup_step3
,
R
.
string
.
setup_step3_action
);
step3
.
setAction
(
new
Runnable
()
{
step3
.
setAction
(
new
Runnable
()
{
@Override
@Override
...
@@ -286,20 +287,26 @@ public final class SetupActivity extends Activity {
...
@@ -286,20 +287,26 @@ public final class SetupActivity extends Activity {
}
}
static
final
class
SetupStep
implements
View
.
OnClickListener
{
static
final
class
SetupStep
implements
View
.
OnClickListener
{
private
final
View
mRootView
;
private
final
View
mStepView
;
private
final
TextView
mBulletView
;
private
final
int
mActivatedColor
;
private
final
int
mDeactivatedColor
;
private
final
TextView
mActionLabel
;
private
final
TextView
mActionLabel
;
private
Runnable
mAction
;
private
Runnable
mAction
;
public
SetupStep
(
final
View
rootView
,
final
int
appName
,
final
int
title
,
public
SetupStep
(
final
String
applicationName
,
final
TextView
bulletView
,
final
int
instruction
,
final
int
actionIcon
,
final
int
actionLabel
)
{
final
View
stepView
,
final
int
title
,
final
int
instruction
,
final
int
actionIcon
,
mRootView
=
rootView
;
final
int
actionLabel
)
{
final
Resources
res
=
rootView
.
getResources
();
mStepView
=
stepView
;
final
String
applicationName
=
res
.
getString
(
appName
);
mBulletView
=
bulletView
;
final
Resources
res
=
stepView
.
getResources
();
mActivatedColor
=
res
.
getColor
(
R
.
color
.
setup_text_action
);
mDeactivatedColor
=
res
.
getColor
(
R
.
color
.
setup_text_dark
);
final
TextView
titleView
=
(
TextView
)
root
View
.
findViewById
(
R
.
id
.
setup_step_title
);
final
TextView
titleView
=
(
TextView
)
mStep
View
.
findViewById
(
R
.
id
.
setup_step_title
);
titleView
.
setText
(
res
.
getString
(
title
,
applicationName
));
titleView
.
setText
(
res
.
getString
(
title
,
applicationName
));
final
TextView
instructionView
=
(
TextView
)
root
View
.
findViewById
(
final
TextView
instructionView
=
(
TextView
)
mStep
View
.
findViewById
(
R
.
id
.
setup_step_instruction
);
R
.
id
.
setup_step_instruction
);
if
(
instruction
==
0
)
{
if
(
instruction
==
0
)
{
instructionView
.
setVisibility
(
View
.
GONE
);
instructionView
.
setVisibility
(
View
.
GONE
);
...
@@ -307,7 +314,7 @@ public final class SetupActivity extends Activity {
...
@@ -307,7 +314,7 @@ public final class SetupActivity extends Activity {
instructionView
.
setText
(
res
.
getString
(
instruction
,
applicationName
));
instructionView
.
setText
(
res
.
getString
(
instruction
,
applicationName
));
}
}
mActionLabel
=
(
TextView
)
root
View
.
findViewById
(
R
.
id
.
setup_step_action_label
);
mActionLabel
=
(
TextView
)
mStep
View
.
findViewById
(
R
.
id
.
setup_step_action_label
);
mActionLabel
.
setText
(
res
.
getString
(
actionLabel
));
mActionLabel
.
setText
(
res
.
getString
(
actionLabel
));
if
(
actionIcon
==
0
)
{
if
(
actionIcon
==
0
)
{
final
int
paddingEnd
=
ViewCompatUtils
.
getPaddingEnd
(
mActionLabel
);
final
int
paddingEnd
=
ViewCompatUtils
.
getPaddingEnd
(
mActionLabel
);
...
@@ -321,7 +328,8 @@ public final class SetupActivity extends Activity {
...
@@ -321,7 +328,8 @@ public final class SetupActivity extends Activity {
}
}
public
void
setEnabled
(
final
boolean
enabled
)
{
public
void
setEnabled
(
final
boolean
enabled
)
{
mRootView
.
setVisibility
(
enabled
?
View
.
VISIBLE
:
View
.
GONE
);
mStepView
.
setVisibility
(
enabled
?
View
.
VISIBLE
:
View
.
GONE
);
mBulletView
.
setTextColor
(
enabled
?
mActivatedColor
:
mDeactivatedColor
);
}
}
public
void
setAction
(
final
Runnable
action
)
{
public
void
setAction
(
final
Runnable
action
)
{
...
...
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