Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Raph El
android
Commits
9698d737
Commit
9698d737
authored
Mar 07, 2015
by
rakam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First Serve Fault
parent
6f77c339
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
23 deletions
+45
-23
app/src/main/java/fr/istic/masteru/android/activities/MatchActivity.java
...va/fr/istic/masteru/android/activities/MatchActivity.java
+14
-4
app/src/main/java/fr/istic/masteru/android/fragments/ResultFragment.java
...va/fr/istic/masteru/android/fragments/ResultFragment.java
+1
-1
app/src/main/java/fr/istic/masteru/android/fragments/SelectCourtFragment.java
.../istic/masteru/android/fragments/SelectCourtFragment.java
+0
-1
app/src/main/java/fr/istic/masteru/android/fragments/SelectMatchFragment.java
.../istic/masteru/android/fragments/SelectMatchFragment.java
+1
-1
app/src/main/java/fr/istic/masteru/android/utils/ScoreSyncManager.java
...java/fr/istic/masteru/android/utils/ScoreSyncManager.java
+1
-1
app/src/main/res/layout/match_activity.xml
app/src/main/res/layout/match_activity.xml
+26
-14
app/src/main/res/layout/result_fragment.xml
app/src/main/res/layout/result_fragment.xml
+1
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/fr/istic/masteru/android/activities/MatchActivity.java
View file @
9698d737
...
...
@@ -68,6 +68,7 @@ public abstract class MatchActivity extends Activity {
protected
PlayerInfo
playerInfoB1
,
playerInfoB2
;
protected
String
nameA
,
nameB
;
protected
Button
fsfButton
;
protected
View
leftButtons
,
rightButtons
;
protected
SecureDelayButton
leftPointButton
,
rightPointButton
;
protected
SecureDelayButton
leftAceButton
,
rightAceButton
;
...
...
@@ -107,6 +108,7 @@ public abstract class MatchActivity extends Activity {
backButton
=
(
Button
)
findViewById
(
R
.
id
.
back
);
// Stats views
fsfButton
=
(
Button
)
findViewById
(
R
.
id
.
fsfButton
);
leftButtons
=
findViewById
(
R
.
id
.
leftButtons
);
rightButtons
=
findViewById
(
R
.
id
.
rightButtons
);
...
...
@@ -120,6 +122,13 @@ public abstract class MatchActivity extends Activity {
animatedRightButtons
.
add
(
rightAceButton
);
animatedRightButtons
.
add
(
rightPointButton
);
fsfButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
fsfButton
.
setSelected
(!
fsfButton
.
isSelected
());
}
});
((
TextView
)
findViewById
(
R
.
id
.
categorie
)).
setText
(
Utils
.
getCategorieName
(
match
.
getCategory
()));
findViewById
(
R
.
id
.
optionsButton
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -236,6 +245,7 @@ public abstract class MatchActivity extends Activity {
protected
void
updateUI
(
final
Point
point
)
{
fsfButton
.
setSelected
(
false
);
Score
score
=
point
.
getScore
();
if
(
score
.
isSideLeftA
()
!=
isPlayerALeft
&&
score
.
getVainqueur
()
==
-
1
)
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
...
...
@@ -383,26 +393,26 @@ public abstract class MatchActivity extends Activity {
leftPointButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
updateUI
(
new
Point
(
automate
.
point
(
leftPlayer
),
new
Stats
(
Stats
.
Type
.
NONE
,
f
alse
,
leftPlayer
)));
updateUI
(
new
Point
(
automate
.
point
(
leftPlayer
),
new
Stats
(
Stats
.
Type
.
NONE
,
f
sfButton
.
isSelected
()
,
leftPlayer
)));
}
});
leftAceButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
updateUI
(
new
Point
(
automate
.
point
(
leftPlayer
),
new
Stats
(
Stats
.
Type
.
ACE
,
f
alse
,
leftPlayer
)));
updateUI
(
new
Point
(
automate
.
point
(
leftPlayer
),
new
Stats
(
Stats
.
Type
.
ACE
,
f
sfButton
.
isSelected
()
,
leftPlayer
)));
}
});
rightPointButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
updateUI
(
new
Point
(
automate
.
point
(
rightPlayer
),
new
Stats
(
Stats
.
Type
.
NONE
,
f
alse
,
rightPlayer
)));
updateUI
(
new
Point
(
automate
.
point
(
rightPlayer
),
new
Stats
(
Stats
.
Type
.
NONE
,
f
sfButton
.
isSelected
()
,
rightPlayer
)));
}
});
rightAceButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
updateUI
(
new
Point
(
automate
.
point
(
rightPlayer
),
new
Stats
(
Stats
.
Type
.
ACE
,
f
alse
,
rightPlayer
)));
updateUI
(
new
Point
(
automate
.
point
(
rightPlayer
),
new
Stats
(
Stats
.
Type
.
ACE
,
f
sfButton
.
isSelected
()
,
rightPlayer
)));
}
});
}
...
...
app/src/main/java/fr/istic/masteru/android/fragments/ResultFragment.java
View file @
9698d737
...
...
@@ -55,7 +55,7 @@ public class ResultFragment extends Fragment {
playerA2TV
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
playerA2
);
playerB1TV
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
playerB1
);
playerB2TV
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
playerB2
);
firstService
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
f
irstService
);
firstService
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
f
sfButton
);
sideA
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
sideA
);
sideB
=
(
TextView
)
root
.
findViewById
(
R
.
id
.
sideB
);
return
root
;
...
...
app/src/main/java/fr/istic/masteru/android/fragments/SelectCourtFragment.java
View file @
9698d737
...
...
@@ -116,7 +116,6 @@ public class SelectCourtFragment extends SetupFragment {
int
courtId
=
courtsArray
.
get
(
i
).
getAsInt
();
buttons
.
get
(
courtId
-
1
).
setEnabled
(
true
);
}
buttons
.
get
(
3
).
setEnabled
(
false
);
}
});
}
...
...
app/src/main/java/fr/istic/masteru/android/fragments/SelectMatchFragment.java
View file @
9698d737
...
...
@@ -85,7 +85,7 @@ public class SelectMatchFragment extends SetupFragment implements OnMatchSelecte
tableau
=
"1/4"
;
Ion
.
with
(
matchSetupActivity
)
.
load
(
"GET"
,
API_URLS
.
MATCHS
+
"?round=1/
4
"
)
.
load
(
"GET"
,
API_URLS
.
MATCHS
+
"?round=1/
2
"
)
.
setTimeout
(
1000
*
10
)
.
asJsonObject
()
.
setCallback
(
new
FutureCallback
<
JsonObject
>()
{
...
...
app/src/main/java/fr/istic/masteru/android/utils/ScoreSyncManager.java
View file @
9698d737
...
...
@@ -159,7 +159,7 @@ public class ScoreSyncManager {
param
.
addProperty
(
"server"
,
score
.
getService
());
param
.
addProperty
(
"pointWinner"
,
point
.
getStats
().
getWinner
()
==
0
?
"A"
:
"B"
);
param
.
addProperty
(
"stats"
,
point
.
getStats
().
getType
().
name
());
param
.
addProperty
(
"fsf"
,
point
.
getStats
().
isFsf
()
?
"
0
"
:
"
1
"
);
param
.
addProperty
(
"fsf"
,
point
.
getStats
().
isFsf
()
?
"
1
"
:
"
0
"
);
Ion
.
with
(
context
)
.
load
(
"POST"
,
API_URLS
.
UPDATE_SCORE
(
idMatch
,
score
.
getId
()))
...
...
app/src/main/res/layout/match_activity.xml
View file @
9698d737
...
...
@@ -110,36 +110,42 @@
android:id=
"@+id/_scoreMiddle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/playerLeftNatTV"
android:layout_below=
"@id/categorie"
android:layout_above=
"@+id/fsfButton"
android:gravity=
"center_vertical"
android:layout_centerHorizontal=
"true"
android:layout_marginLeft=
"5dp"
android:layout_marginRight=
"5dp"
android:text=
"-"
android:textSize=
"2
8
sp"
android:textSize=
"
3
2sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/scoreLeft"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/playerLeftNatTV"
android:layout_below=
"@id/categorie"
android:layout_above=
"@+id/fsfButton"
android:gravity=
"center_vertical"
android:layout_marginLeft=
"5dp"
android:layout_marginRight=
"5dp"
android:layout_toLeftOf=
"@id/_scoreMiddle"
android:text=
"0"
android:textSize=
"2
8
sp"
android:textSize=
"
3
2sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/scoreRight"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/playerLeftNatTV"
android:layout_below=
"@id/categorie"
android:layout_above=
"@+id/fsfButton"
android:gravity=
"center_vertical"
android:layout_marginLeft=
"5dp"
android:layout_marginRight=
"5dp"
android:layout_toRightOf=
"@id/_scoreMiddle"
android:text=
"0"
android:textSize=
"2
8
sp"
android:textSize=
"
3
2sp"
android:textStyle=
"bold"
/>
<ImageView
...
...
@@ -147,7 +153,9 @@
android:layout_width=
"26dp"
android:layout_height=
"0px"
android:layout_alignBottom=
"@id/_scoreMiddle"
android:layout_below=
"@id/playerLeftNatTV"
android:layout_below=
"@id/categorie"
android:layout_above=
"@+id/fsfButton"
android:gravity=
"center_vertical"
android:layout_toLeftOf=
"@id/scoreLeft"
android:src=
"@drawable/tennis_ball"
/>
...
...
@@ -156,28 +164,32 @@
android:layout_width=
"26dp"
android:layout_height=
"0px"
android:layout_alignBottom=
"@id/_scoreMiddle"
android:layout_below=
"@id/playerLeftNatTV"
android:layout_below=
"@id/categorie"
android:layout_above=
"@+id/fsfButton"
android:gravity=
"center_vertical"
android:layout_toRightOf=
"@id/scoreRight"
android:src=
"@drawable/tennis_ball"
android:visibility=
"gone"
/>
<Button
android:id=
"@+id/f
irstService
"
android:id=
"@+id/f
sfButton
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_below=
"@id/
_scoreMiddle
"
android:layout_below=
"@id/
playerLeft1Photo
"
android:background=
"@drawable/ac_button"
android:padding=
"22dp"
android:layout_margin=
"6dp"
android:text=
"Fault First Service"
/>
android:text=
"@string/FIRST_SERVE_FAULT"
android:textColor=
"#444"
android:textStyle=
"bold"
/>
<View
android:id=
"@+id/_separator"
android:layout_width=
"1px"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_below=
"@id/f
irstService
"
android:layout_below=
"@id/f
sfButton
"
android:layout_centerHorizontal=
"true"
android:layout_marginLeft=
"7dp"
android:layout_marginRight=
"7dp"
...
...
@@ -191,7 +203,7 @@
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/_separator"
android:layout_above=
"@+id/footer"
android:layout_below=
"@id/f
irstService
"
android:layout_below=
"@id/f
sfButton
"
android:layout_marginLeft=
"6dp"
android:weightSum=
"60"
>
...
...
@@ -264,7 +276,7 @@
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/_separator"
android:layout_above=
"@+id/footer"
android:layout_below=
"@id/f
irstService
"
android:layout_below=
"@id/f
sfButton
"
android:layout_marginRight=
"6dp"
android:weightSum=
"60"
>
...
...
app/src/main/res/layout/result_fragment.xml
View file @
9698d737
...
...
@@ -43,7 +43,7 @@
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/f
irstService
"
android:id=
"@+id/f
sfButton
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/refereeingType"
...
...
app/src/main/res/values/strings.xml
View file @
9698d737
...
...
@@ -33,5 +33,6 @@
<string
name=
"test"
>
Faute
<sup>
1er
</sup>
Service
</string>
<string
name=
"ace"
>
ACE
</string>
<string
name=
"POINT"
>
POINT
</string>
<string
name=
"FIRST_SERVE_FAULT"
>
FIRST SERVE FAULT
</string>
</resources>
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