Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented different theme color for each competitions, colored comp…
…etition list items
- Loading branch information
Showing
14 changed files
with
182 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/tech/joeyck/livefootball/utilities/CompetitionUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package tech.joeyck.livefootball.utilities; | ||
|
||
import android.util.SparseIntArray; | ||
|
||
import java.util.HashMap; | ||
|
||
import tech.joeyck.livefootball.R; | ||
|
||
public class CompetitionUtils { | ||
|
||
private static final SparseIntArray competitionColors; | ||
static | ||
{ | ||
competitionColors = new SparseIntArray(); | ||
competitionColors.put(2013, R.color.serie_a_brazil); | ||
competitionColors.put(2021, R.color.permier_league); | ||
competitionColors.put(2016, R.color.championship); | ||
competitionColors.put(2018, R.color.europa_league); | ||
competitionColors.put(2001, R.color.champions_league); | ||
competitionColors.put(2015, R.color.ligue_1); | ||
competitionColors.put(2019, R.color.seria_A_italy); | ||
competitionColors.put(2002, R.color.bundesliga); | ||
competitionColors.put(2003, R.color.eredivise); | ||
competitionColors.put(2017, R.color.primeira_liga); | ||
competitionColors.put(2014, R.color.la_liga); | ||
competitionColors.put(2000, R.color.world_cup); | ||
} | ||
|
||
public static int getColorResourceId(int competitionId){ | ||
return competitionColors.get(competitionId); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:color="@color/light_gray"> | ||
<item> | ||
<selector> | ||
<item android:state_selected="true"> | ||
<shape> | ||
<corners android:radius="4dp"/> | ||
<solid android:color="@color/light_gray"/> | ||
</shape> | ||
</item> | ||
|
||
<item android:state_activated="true"> | ||
<shape> | ||
<corners android:radius="4dp" /> | ||
<solid android:color="@color/light_gray"/> | ||
</shape> | ||
</item> | ||
|
||
<item> | ||
<shape> | ||
<corners android:radius="4dp"/> | ||
<solid android:color="@color/white"/> | ||
</shape> | ||
</item> | ||
</selector> | ||
</item> | ||
</ripple> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<corners android:bottomRightRadius="4dp" android:bottomLeftRadius="4dp"/> | ||
<solid android:color="#11000000"/> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
<android.support.v7.widget.CardView | ||
xmlns:card_view="http://schemas.android.com/apk/res-auto" | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingBottom="8dp" | ||
android:paddingTop="8dp" | ||
android:layout_margin="8dp" | ||
android:elevation="2dp" | ||
android:background="@drawable/competition_item_background" | ||
android:orientation="vertical"> | ||
card_view:cardCornerRadius="4dp" | ||
android:orientation="vertical" | ||
android:foreground="?android:attr/selectableItemBackground" | ||
card_view:cardBackgroundColor="@color/colorPrimary" | ||
android:clickable="true" | ||
android:focusable="true"> | ||
|
||
<TextView | ||
android:id="@+id/competition_name" | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:text="Competition Name" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingBottom="8dp" | ||
android:gravity="center_vertical" | ||
android:textStyle="bold"/> | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="1dp" | ||
android:background="#11000000" /> | ||
<TextView | ||
android:id="@+id/competition_name" | ||
android:layout_width="match_parent" | ||
android:layout_height="60dp" | ||
android:text="Competition Name" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingBottom="8dp" | ||
android:paddingTop="8dp" | ||
android:textColor="@color/white" | ||
android:gravity="center_vertical" | ||
android:textStyle="bold"/> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="1dp" | ||
android:background="#22000000" /> | ||
|
||
<TextView | ||
android:id="@+id/competition_country" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:paddingStart="16dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="6dp" | ||
android:fontFamily="sans-serif-light" | ||
android:text="Country" /> | ||
<TextView | ||
android:id="@+id/competition_country" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingStart="16dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="12dp" | ||
android:textColor="@color/white" | ||
android:fontFamily="sans-serif-light" | ||
android:background="@drawable/rounded_item_bottom_background" | ||
android:text="Country" /> | ||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
</android.support.v7.widget.CardView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="permier_league">#3F1052</color> | ||
<color name="serie_a_brazil">#10502f</color> | ||
<color name="championship">#777777</color> | ||
<color name="europa_league">#093E84</color> | ||
<color name="champions_league">#162E58</color> | ||
<color name="ligue_1">#90A5B6</color> | ||
<color name="seria_A_italy">#1D9647</color> | ||
<color name="bundesliga">#B12829</color> | ||
<color name="eredivise">#FF9A00</color> | ||
<color name="primeira_liga">#822B31</color> | ||
<color name="la_liga">#003472</color> | ||
<color name="world_cup">#0087e6</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.