Skip to content

Commit

Permalink
zoomView added
Browse files Browse the repository at this point in the history
  • Loading branch information
jdagnogo committed Oct 27, 2017
1 parent f687da3 commit 9c576de
Show file tree
Hide file tree
Showing 6 changed files with 371 additions and 344 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.jdagnogo.tournament"
minSdkVersion 21
Expand All @@ -24,7 +24,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile project(':mytournament')
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Expand Down
9 changes: 5 additions & 4 deletions mytournament/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 21
Expand All @@ -22,11 +22,12 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.otaliastudios:zoomlayout:1.1.0'
testCompile 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public TournamentView(Context context, @Nullable AttributeSet attrs) {
setupLayout(context);
initViews();
updateElementsAccordingToAttributs(context, attrs);

}

private void initViews() {
Expand Down Expand Up @@ -169,18 +168,18 @@ private Team updateScoreandGetWinner(BinderTeamTextView semi1, BinderTeamTextVie
.scoreA(Integer.valueOf(semi1.getTextViewScore().getText().toString()))
.scoreB(Integer.valueOf(semi2.getTextViewScore().getText().toString()))
.build();
if (matchResult.getWinner().equals(semi1.getTeam())) {
setColorsBgForLoserAndWinner(semi1, semi2);
} else {
setColorsBgForLoserAndWinner(semi2, semi1);
Team winner = matchResult.getWinner();
if (null!= winner){
if (winner.equals(semi1.getTeam())) {
setColorsBgForLoserAndWinner(semi1, semi2);
} else {
setColorsBgForLoserAndWinner(semi2, semi1);
}
return winner;
}

return matchResult.getWinner();


} else return null;
}
}
else return null;
return null;
}

private TextWatcher watcherSemi1 = new TextWatcher() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public Team getWinner(){
if (scoreA>scoreB){
teamB.setHasBeenEliminated(true);
return teamA;
}else if (scoreA == scoreB) {
return null;
}else {
return teamB;
}
Expand Down
Loading

0 comments on commit 9c576de

Please sign in to comment.