Skip to content

Commit

Permalink
Version 2.2.0
Browse files Browse the repository at this point in the history
Implémentation issue #14
  • Loading branch information
pascalheude committed Jul 17, 2022
1 parent 8163464 commit d7a054f
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
applicationId "com.assistanceinformatiquetoulouse.chronos24hlemans"
minSdkVersion 19
targetSdkVersion 23
versionCode 210
versionCode 220
versionName '2.1.0'
archivesBaseName = "AIT-Chronos24hLeMans-$versionName"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.os.SystemClock;
import android.os.Vibrator;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -71,6 +72,8 @@ public void onFinish() {
private TextView pTextViewNbTour;
private Chronometer pChronometre;
private MediaPlayer pMediaPlayer;
private boolean pEcranVerrouille;
private FloatingActionButton pFAB;

// Méthode programmerAlerteCoureur
private void programmerAlerteCoureur(String nom) {
Expand Down Expand Up @@ -123,6 +126,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
pNomCoureur = "";
pCourseDemarree = false;
pPauseDemarree = false;
pEcranVerrouille = false;
pAlerteCoureur = null;
pMediaPlayer = MediaPlayer.create(getContext(), R.raw.woodpecker);
}
Expand Down Expand Up @@ -182,7 +186,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
pBoutonCoureur[i].ecrireTemporisation(TEMPORISATION);
pBoutonCoureur[i].setBackgroundColor(getResources().getColor(R.color.bouton_nonselectionne));
}
afficherBouton();
pBoutonPause = (Button) lView.findViewById(R.id.ButtonPause);
pBoutonArreter = (Button) lView.findViewById(R.id.ButtonArreter);
pTextViewNbTour = (TextView) lView.findViewById(R.id.textViewNbTour);
Expand All @@ -192,6 +195,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
pBoutonArreter.setEnabled(false);
} else {
}
pFAB = (FloatingActionButton) lView.findViewById(R.id.fab);
pBoutonPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down Expand Up @@ -236,6 +240,32 @@ public void onClick(View view) {
pIndexCoureur = pNbCoureur;
}
});
pFAB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int i;
if (!pEcranVerrouille) {
pEcranVerrouille = true;
for (i = 0; i < pNbCoureur; i++) {
pBoutonCoureur[i].setEnabled(false);
}
pFAB.setImageResource(R.drawable.ic_unlock);
} else {
}
}
});
pFAB.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
if (pEcranVerrouille) {
pEcranVerrouille = false;
afficherBouton();
pFAB.setImageResource(R.drawable.ic_lock);
} else {
}
return (true);
}
});
for (i = 0; i < pNbCoureur; i++) {
final int final_i = i;
pBoutonCoureur[i].setOnClickListener(new View.OnClickListener() {
Expand Down Expand Up @@ -280,8 +310,17 @@ public void onClick(View v) {
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
int i;
if (isVisibleToUser == true) {
afficherBouton();
if (pEcranVerrouille) {
for (i = 0; i < pNbCoureur; i++) {
pBoutonCoureur[i].setEnabled(false);
}
pFAB.setImageResource(R.drawable.ic_unlock);
} else {
afficherBouton();
pFAB.setImageResource(R.drawable.ic_lock);
}
}
else {
}
Expand Down
Binary file added app/src/main/res/drawable/ic_lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_unlock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 15 additions & 5 deletions app/src/main/res/layout/tab_course.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">

<Button
android:id="@+id/ButtonPause"
Expand Down Expand Up @@ -203,4 +203,14 @@
android:visibility="invisible"
android:clickable="false" />

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:clickable="true"
app:backgroundTint="@color/colorGrey"
app:srcCompat="@drawable/ic_lock" />

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<color name="colorAccent">#FF4081</color>
<color name="bouton_nonselectionne">#F781F3</color>
<color name="bouton_selectionne">#819FF7</color>
<color name="colorGrey">#909090</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">Chronos24hLeMans</string>
<string name="version">2.1.0</string>
<string name="version">2.2.0</string>
<string name="nom">Nom d\'équipe</string>
<string name="courriel">[email protected]</string>
<!-- Equipe -->
Expand Down

0 comments on commit d7a054f

Please sign in to comment.