Skip to content

Commit

Permalink
Merge pull request #21 from rapidpro/feature/new-countries
Browse files Browse the repository at this point in the history
Feature/new countries
  • Loading branch information
johncordeiro authored Jan 16, 2017
2 parents 098a139 + 2a22a20 commit ea46318
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
43 changes: 35 additions & 8 deletions app/src/main/java/in/ureport/managers/CountryProgramManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import android.support.annotation.NonNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import br.com.ilhasoft.support.tool.ResourceUtil;
import br.com.ilhasoft.support.tool.StatusBarDesigner;
Expand All @@ -16,10 +14,12 @@

import static in.ureport.R.string.brasil_channel;
import static in.ureport.R.string.chile_channel;
import static in.ureport.R.string.cotedivoire_channel;
import static in.ureport.R.string.global_channel;
import static in.ureport.R.string.indonesia_channel;
import static in.ureport.R.string.ireland_channel;
import static in.ureport.R.string.mexico_channel;
import static in.ureport.R.string.newguinea_channel;
import static in.ureport.R.string.thailand_channel;
import static in.ureport.R.string.nigeria_channel;
import static in.ureport.R.string.rapidpro_host_address1;
Expand All @@ -36,7 +36,7 @@
import static in.ureport.R.style.AppTheme_Burundi;
import static in.ureport.R.style.AppTheme_Cameroun;
import static in.ureport.R.style.AppTheme_Chile;
import static in.ureport.R.style.AppTheme_Drc;
import static in.ureport.R.style.AppTheme_CoteDIvoire;
import static in.ureport.R.style.AppTheme_Fiji;
import static in.ureport.R.style.AppTheme_Guatemala;
import static in.ureport.R.style.AppTheme_Indonesia;
Expand All @@ -46,6 +46,7 @@
import static in.ureport.R.style.AppTheme_Mexico;
import static in.ureport.R.style.AppTheme_Nigeria;
import static in.ureport.R.style.AppTheme_Pakistan;
import static in.ureport.R.style.AppTheme_PapuaNewGuinea;
import static in.ureport.R.style.AppTheme_RepubliqueCentrafricaine;
import static in.ureport.R.style.AppTheme_Senegal;
import static in.ureport.R.style.AppTheme_SierraLeone;
Expand All @@ -55,7 +56,6 @@
import static in.ureport.R.style.AppTheme_Uganda;
import static in.ureport.R.style.AppTheme_Ukraine;
import static in.ureport.R.style.AppTheme_UnitedKingdom;
import static in.ureport.R.style.AppTheme_Zambia;
import static in.ureport.R.style.AppTheme_Zimbabwe;

/**
Expand Down Expand Up @@ -123,8 +123,7 @@ public static List<CountryProgram> getAvailableCountryPrograms() {
, rapidpro_host_address1, ureport_host_address1, "UReportCameroon", "ureportcameroon", null));
countryPrograms.add(buildCountryProgram("CHL", AppTheme_Chile, chile_channel, "Chile", 12
, rapidpro_host_address1, ureport_host_address1, "ureportchile", "ureportchile", "UReporters"));
countryPrograms.add(buildCountryProgram("COD", AppTheme_Drc, INVALID_VALUE, "DRC", INVALID_VALUE
, rapidpro_host_address1, ureport_host_address1, "UReportDRC", "UNICEFRDC", null));
countryPrograms.add(buildCoteDIvoire());
countryPrograms.add(buildCountryProgram("FJI", AppTheme_Fiji, R.string.fiji_channel, "Fiji", INVALID_VALUE
, rapidpro_host_address1, ureport_host_address1, null, null, "UReporters"));
countryPrograms.add(buildGtmCountry());
Expand All @@ -143,6 +142,7 @@ public static List<CountryProgram> getAvailableCountryPrograms() {
, rapidpro_host_address1, ureport_host_address1, "UReportNigeria", "U-report-Nigeria-1429673597287501", "UReporters"));
countryPrograms.add(buildCountryProgram("PAK", AppTheme_Pakistan, INVALID_VALUE, "Pakistan", 16
, rapidpro_host_address1, ureport_host_address1, "PakAvaz", "ureportpakavaz", null));
countryPrograms.add(buildPapuaNewGuinea());
countryPrograms.add(buildCountryProgram("CAF", AppTheme_RepubliqueCentrafricaine, INVALID_VALUE, "République Centrafricaine", 8
, rapidpro_host_address1, ureport_host_address1, "Ureport_rca", "ureport.rca", null));
countryPrograms.add(buildCountryProgram("SEN", AppTheme_Senegal, INVALID_VALUE, "Sénégal", 14
Expand All @@ -159,8 +159,6 @@ public static List<CountryProgram> getAvailableCountryPrograms() {
countryPrograms.add(buildGbrCountry());
countryPrograms.add(buildCountryProgram("UKR", AppTheme_Ukraine, ukraine_channel, "Ukraine", 19
, rapidpro_host_address1, ureport_host_address1, "ureportukraine", "ureportukraine", "UReporters"));
countryPrograms.add(buildCountryProgram("ZMB", AppTheme_Zambia, INVALID_VALUE, "Zambia", INVALID_VALUE
, rapidpro_host_address1, ureport_host_address1, "ZambiaUReport", "Zambia-U-Report-421536867911449", null));
countryPrograms.add(buildCountryProgram("ZWE", AppTheme_Zimbabwe, INVALID_VALUE, "Zimbabwe", 2
, rapidpro_host_address1, ureport_host_address1, "Ureportzim", "U-Report-Zimbabwe-1477396805878097", null));
}
Expand All @@ -178,6 +176,35 @@ private static CountryProgram buildGtmCountry() {
return gtmCountry;
}

@NonNull
private static CountryProgram buildCoteDIvoire() {
CountryProgram cviCountry = buildCountryProgram("CIV", AppTheme_CoteDIvoire, cotedivoire_channel, "Côte d'Ivoire", 26
, rapidpro_host_address1, ureport_host_address1, "UReport_CIV", "U-Report-Côte-dIvoire-1218965818134275", "U-Reporters Cote d'Ivoire");
cviCountry.setMaleGroup("U-Reporters Homme");
cviCountry.setFemaleGroup("U-Reporters Femmes");

List<AgeGroup> ageGroups = new ArrayList<>();
ageGroups.add(new AgeGroup("Adolescents", 14, 19));
ageGroups.add(new AgeGroup("Jeunes", 20, 24));
ageGroups.add(new AgeGroup("Adults Jeunes", 25, 35));
ageGroups.add(new AgeGroup("Adulte", 36));
cviCountry.setAgeGroups(ageGroups);
cviCountry.setStateField("state");

return cviCountry;
}

@NonNull
private static CountryProgram buildPapuaNewGuinea() {
CountryProgram pngCountry = buildCountryProgram("PNG", AppTheme_PapuaNewGuinea, newguinea_channel, "Papua New Guinea", 28
, rapidpro_host_address1, ureport_host_address1, null, "UReportPNG", "U-Reporters");
pngCountry.setMaleGroup("U-Reporters Male");
pngCountry.setFemaleGroup("U-Reporters Female");
pngCountry.setStateField("region");

return pngCountry;
}

@NonNull
private static CountryProgram buildTha() {
CountryProgram thaCountry = buildCountryProgram("THA", AppTheme_Thailand, thailand_channel, "Thailand", 5
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/res/values/country_themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<item name="colorAccent">#760021</item>
</style>

<style name="AppTheme.Drc" parent="AppTheme">
<item name="colorPrimary">#05b5e8</item>
<item name="colorPrimaryDark">#048db6</item>
<item name="colorAccent">#047ea2</item>
<style name="AppTheme.CoteDIvoire" parent="AppTheme">
<item name="colorPrimary">#00a200</item>
<item name="colorPrimaryDark">#007000</item>
<item name="colorAccent">#005c00</item>
</style>

<style name="AppTheme.Fiji" parent="AppTheme">
Expand Down Expand Up @@ -91,6 +91,12 @@
<item name="colorAccent">#005c00</item>
</style>

<style name="AppTheme.PapuaNewGuinea" parent="AppTheme">
<item name="colorPrimary">#c6002a</item>
<item name="colorPrimaryDark">#b20028</item>
<item name="colorAccent">#760021</item>
</style>

<style name="AppTheme.RepubliqueCentrafricaine" parent="AppTheme">
<item name="colorPrimary">#d70020</item>
<item name="colorPrimaryDark">#c3001b</item>
Expand Down Expand Up @@ -145,12 +151,6 @@
<item name="colorAccent">#047ea2</item>
</style>

<style name="AppTheme.Zambia" parent="AppTheme">
<item name="colorPrimary">#00a200</item>
<item name="colorPrimaryDark">#007000</item>
<item name="colorAccent">#005c00</item>
</style>

<style name="AppTheme.Zimbabwe" parent="AppTheme">
<item name="colorPrimary">#155ad0</item>
<item name="colorPrimaryDark">#13469e</item>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:1.3.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit ea46318

Please sign in to comment.