├── .gitignore
├── .idea
├── caches
│ ├── build_file_checksums.ser
│ └── gradle_models.ser
├── codeStyles
│ └── Project.xml
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
└── runConfigurations.xml
├── 01.png
├── 02.png
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── urizev
│ │ └── flags
│ │ └── test
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ │ └── com
│ │ │ └── urizev
│ │ │ └── flags
│ │ │ └── test
│ │ │ ├── AspectRatioImageView.java
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── cell_flag.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── urizev
│ └── flags
│ └── test
│ └── ExampleUnitTest.java
├── build.gradle
├── flags-lib
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── urizev
│ │ └── flags
│ │ └── lib
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── urizev
│ │ │ └── flags
│ │ │ └── lib
│ │ │ └── CountryFlag.java
│ └── res
│ │ └── drawable
│ │ ├── flag__unknown.xml
│ │ ├── flag_ad.xml
│ │ ├── flag_ae.xml
│ │ ├── flag_af.xml
│ │ ├── flag_ag.xml
│ │ ├── flag_ai.xml
│ │ ├── flag_al.xml
│ │ ├── flag_am.xml
│ │ ├── flag_ar.xml
│ │ ├── flag_at.xml
│ │ ├── flag_au.xml
│ │ ├── flag_az.xml
│ │ ├── flag_ba.xml
│ │ ├── flag_bb.xml
│ │ ├── flag_bd.xml
│ │ ├── flag_be.xml
│ │ ├── flag_bf.xml
│ │ ├── flag_bg.xml
│ │ ├── flag_br.xml
│ │ ├── flag_ca.xml
│ │ ├── flag_ch.xml
│ │ ├── flag_cn.xml
│ │ ├── flag_cz.xml
│ │ ├── flag_de.xml
│ │ ├── flag_dk.xml
│ │ ├── flag_es.xml
│ │ ├── flag_fr.xml
│ │ ├── flag_gb.xml
│ │ ├── flag_ge.xml
│ │ ├── flag_gr.xml
│ │ ├── flag_hk.xml
│ │ ├── flag_it.xml
│ │ ├── flag_jp.xml
│ │ ├── flag_kr.xml
│ │ ├── flag_lt.xml
│ │ ├── flag_mx.xml
│ │ ├── flag_my.xml
│ │ ├── flag_nl.xml
│ │ ├── flag_pl.xml
│ │ ├── flag_ps.xml
│ │ ├── flag_qa.xml
│ │ ├── flag_ru.xml
│ │ ├── flag_sy.xml
│ │ ├── flag_uk.xml
│ │ ├── flag_us.xml
│ │ └── flag_vn.xml
│ └── test
│ └── java
│ └── com
│ └── urizev
│ └── flags
│ └── lib
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.iml
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | /.idea/vcs.xml
8 | .DS_Store
9 | /build
10 | /captures
11 | .externalNativeBuild
12 |
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/.idea/caches/gradle_models.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/.idea/caches/gradle_models.ser
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 1.7
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/01.png
--------------------------------------------------------------------------------
/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/02.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 | Copyright (c) 2016 Juan Carlos Vallejo
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android Vector Flags
2 |
3 | Small library for Android with vector drawables of the world country flags
4 |
5 | ### Current Existing flags:
6 |
7 | Current flag country (code) list:
8 | * Andorra (ad)
9 | * United Arab Emirates (ae)
10 | * Afghanistan (af)
11 | * Antigua and Barbuda (ag)
12 | * Anguilla (ai)
13 | * Albania (al)
14 | * Armenia (am)
15 | * Argentina (ar)
16 | * Austria (at)
17 | * Australia (au)
18 | * Azerbaijan (az)
19 | * Bosnia and Herzegovina (ba)
20 | * Barbados (bb)
21 | * Belgium (bd)
22 | * Burkina Faso (bf)
23 | * Bulgaria (bg)
24 | * Brazil (br)
25 | * Canada (ca)
26 | * Switzerland (ch)
27 | * China (cn)
28 | * Czeck Republic (cz)
29 | * Germany (de)
30 | * Denmark (dk)
31 | * Spain (es)
32 | * France (fr)
33 | * Great Britain (gb)
34 | * Georgia (ge)
35 | * Greece (gr)
36 | * Hong Kong (hk)
37 | * Italy (it)
38 | * Japan (jp)
39 | * Lithuania (lt)
40 | * Mexico (mx)
41 | * Malaysia (my)
42 | * Neetherlands (nl)
43 | * Palestinian Territory, Occupied (ps)
44 | * Polland (pl)
45 | * Qatar (qa)
46 | * Rusia (ru)
47 | * Syria (sy)
48 | * United Kingdom (uk)
49 | * United States of America (us)
50 | * Viet Nam (vn)
51 |
52 | ### update and test
53 | This project is updated to run in Android Studio 3.3.2
54 |
55 | The project tested in Pixel Emulator with API 27
56 |
57 |
58 | ### TODO
59 | Too many flags still needed to be added.
60 |
61 |
62 |
63 |
64 | | Existed | Missed |
65 | |---------------------------|---------------------------|
66 | |
|
|
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion "28.0.3"
6 | defaultConfig {
7 | applicationId "com.urizev.flags.test"
8 | minSdkVersion 21
9 | targetSdkVersion 28
10 | versionCode 200
11 | versionName "0.2"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(include: ['*.jar'], dir: 'libs')
24 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | implementation project(':flags-lib')
28 |
29 | implementation 'com.android.support:appcompat-v7:28.0.+'
30 | testImplementation 'junit:junit:4.12'
31 | implementation 'com.android.support:recyclerview-v7:28.0.+'
32 | implementation 'com.android.support:cardview-v7:28.0.+'
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jcvallejo/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/urizev/flags/test/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.test;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.urizev.flags.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/urizev/flags/test/AspectRatioImageView.java:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Square, Inc.
2 | package com.urizev.flags.test;
3 |
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.util.AttributeSet;
7 | import android.widget.ImageView;
8 |
9 | /** Maintains an aspect ratio based on either width or height. Disabled by default. */
10 | public class AspectRatioImageView extends ImageView {
11 | // NOTE: These must be kept in sync with the AspectRatioImageView attributes in attrs.xml.
12 | public static final int MEASUREMENT_WIDTH = 0;
13 | public static final int MEASUREMENT_HEIGHT = 1;
14 |
15 | private static final float DEFAULT_ASPECT_RATIO = 1f;
16 | private static final boolean DEFAULT_ASPECT_RATIO_ENABLED = false;
17 | private static final int DEFAULT_DOMINANT_MEASUREMENT = MEASUREMENT_WIDTH;
18 |
19 | private float aspectRatio;
20 | private boolean aspectRatioEnabled;
21 | private int dominantMeasurement;
22 |
23 | public AspectRatioImageView(Context context) {
24 | this(context, null);
25 | }
26 |
27 | public AspectRatioImageView(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 |
30 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AspectRatioImageView);
31 | aspectRatio = a.getFloat(R.styleable.AspectRatioImageView_aspectRatio, DEFAULT_ASPECT_RATIO);
32 | aspectRatioEnabled = a.getBoolean(R.styleable.AspectRatioImageView_aspectRatioEnabled,
33 | DEFAULT_ASPECT_RATIO_ENABLED);
34 | dominantMeasurement = a.getInt(R.styleable.AspectRatioImageView_dominantMeasurement,
35 | DEFAULT_DOMINANT_MEASUREMENT);
36 | a.recycle();
37 | }
38 |
39 | @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
41 | if (!aspectRatioEnabled) return;
42 |
43 | int newWidth;
44 | int newHeight;
45 | switch (dominantMeasurement) {
46 | case MEASUREMENT_WIDTH:
47 | newWidth = getMeasuredWidth();
48 | newHeight = (int) (newWidth / aspectRatio);
49 | break;
50 |
51 | case MEASUREMENT_HEIGHT:
52 | newHeight = getMeasuredHeight();
53 | newWidth = (int) (newHeight * aspectRatio);
54 | break;
55 |
56 | default:
57 | throw new IllegalStateException("Unknown measurement with ID " + dominantMeasurement);
58 | }
59 |
60 | setMeasuredDimension(newWidth, newHeight);
61 | }
62 |
63 | /** Get the aspect ratio for this image view. */
64 | public float getAspectRatio() {
65 | return aspectRatio;
66 | }
67 |
68 | /** Set the aspect ratio for this image view. This will update the view instantly. */
69 | public void setAspectRatio(float aspectRatio) {
70 | this.aspectRatio = aspectRatio;
71 | if (aspectRatioEnabled) {
72 | requestLayout();
73 | }
74 | }
75 |
76 | /** Get whether or not forcing the aspect ratio is enabled. */
77 | public boolean getAspectRatioEnabled() {
78 | return aspectRatioEnabled;
79 | }
80 |
81 | /** set whether or not forcing the aspect ratio is enabled. This will re-layout the view. */
82 | public void setAspectRatioEnabled(boolean aspectRatioEnabled) {
83 | this.aspectRatioEnabled = aspectRatioEnabled;
84 | requestLayout();
85 | }
86 |
87 | /** Get the dominant measurement for the aspect ratio. */
88 | public int getDominantMeasurement() {
89 | return dominantMeasurement;
90 | }
91 |
92 | /**
93 | * Set the dominant measurement for the aspect ratio.
94 | *
95 | * @see #MEASUREMENT_WIDTH
96 | * @see #MEASUREMENT_HEIGHT
97 | */
98 | public void setDominantMeasurement(int dominantMeasurement) {
99 | if (dominantMeasurement != MEASUREMENT_HEIGHT && dominantMeasurement != MEASUREMENT_WIDTH) {
100 | throw new IllegalArgumentException("Invalid measurement type.");
101 | }
102 | this.dominantMeasurement = dominantMeasurement;
103 | requestLayout();
104 | }
105 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/urizev/flags/test/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.test;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import com.urizev.flags.lib.CountryFlag;
13 |
14 | import java.util.ArrayList;
15 | import java.util.Map;
16 | import java.util.TreeMap;
17 |
18 | public class MainActivity extends AppCompatActivity {
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_main);
24 |
25 | RecyclerView recycler = (RecyclerView) this.findViewById(R.id.recycler);
26 | recycler.setAdapter(new CountryAdapter());
27 | }
28 |
29 | private class CountryAdapter extends RecyclerView.Adapter {
30 | private final ArrayList codes;
31 | private Map countries;
32 |
33 | CountryAdapter() {
34 | countries = new TreeMap<>();
35 | countries.put("AF", "Afghanistan");
36 | countries.put("AX", "Aland Islands");
37 | countries.put("AL", "Albania");
38 | countries.put("DZ", "Algeria");
39 | countries.put("AS", "American Samoa");
40 | countries.put("AD", "Andorra");
41 | countries.put("AO", "Angola");
42 | countries.put("AI", "Anguilla");
43 | countries.put("AQ", "Antarctica");
44 | countries.put("AG", "Antigua And Barbuda");
45 | countries.put("AR", "Argentina");
46 | countries.put("AM", "Armenia");
47 | countries.put("AW", "Aruba");
48 | countries.put("AU", "Australia");
49 | countries.put("AT", "Austria");
50 | countries.put("AZ", "Azerbaijan");
51 | countries.put("BS", "Bahamas");
52 | countries.put("BH", "Bahrain");
53 | countries.put("BD", "Bangladesh");
54 | countries.put("BB", "Barbados");
55 | countries.put("BY", "Belarus");
56 | countries.put("BE", "Belgium");
57 | countries.put("BZ", "Belize");
58 | countries.put("BJ", "Benin");
59 | countries.put("BM", "Bermuda");
60 | countries.put("BT", "Bhutan");
61 | countries.put("BO", "Bolivia");
62 | countries.put("BA", "Bosnia And Herzegovina");
63 | countries.put("BW", "Botswana");
64 | countries.put("BV", "Bouvet Island");
65 | countries.put("BR", "Brazil");
66 | countries.put("IO", "British Indian Ocean Territory");
67 | countries.put("BN", "Brunei Darussalam");
68 | countries.put("BG", "Bulgaria");
69 | countries.put("BF", "Burkina Faso");
70 | countries.put("BI", "Burundi");
71 | countries.put("KH", "Cambodia");
72 | countries.put("CM", "Cameroon");
73 | countries.put("CA", "Canada");
74 | countries.put("CV", "Cape Verde");
75 | countries.put("KY", "Cayman Islands");
76 | countries.put("CF", "Central African Republic");
77 | countries.put("TD", "Chad");
78 | countries.put("CL", "Chile");
79 | countries.put("CN", "China");
80 | countries.put("CX", "Christmas Island");
81 | countries.put("CC", "Cocos (Keeling) Islands");
82 | countries.put("CO", "Colombia");
83 | countries.put("KM", "Comoros");
84 | countries.put("CG", "Congo");
85 | countries.put("CD", "Congo, Democratic Republic");
86 | countries.put("CK", "Cook Islands");
87 | countries.put("CR", "Costa Rica");
88 | countries.put("CI", "Cote D\'Ivoire");
89 | countries.put("HR", "Croatia");
90 | countries.put("CU", "Cuba");
91 | countries.put("CY", "Cyprus");
92 | countries.put("CZ", "Czech Republic");
93 | countries.put("DK", "Denmark");
94 | countries.put("DJ", "Djibouti");
95 | countries.put("DM", "Dominica");
96 | countries.put("DO", "Dominican Republic");
97 | countries.put("EC", "Ecuador");
98 | countries.put("EG", "Egypt");
99 | countries.put("SV", "El Salvador");
100 | countries.put("GQ", "Equatorial Guinea");
101 | countries.put("ER", "Eritrea");
102 | countries.put("EE", "Estonia");
103 | countries.put("ET", "Ethiopia");
104 | countries.put("FK", "Falkland Islands (Malvinas)");
105 | countries.put("FO", "Faroe Islands");
106 | countries.put("FJ", "Fiji");
107 | countries.put("FI", "Finland");
108 | countries.put("FR", "France");
109 | countries.put("GF", "French Guiana");
110 | countries.put("PF", "French Polynesia");
111 | countries.put("TF", "French Southern Territories");
112 | countries.put("GA", "Gabon");
113 | countries.put("GM", "Gambia");
114 | countries.put("GE", "Georgia");
115 | countries.put("DE", "Germany");
116 | countries.put("GH", "Ghana");
117 | countries.put("GI", "Gibraltar");
118 | countries.put("GR", "Greece");
119 | countries.put("GL", "Greenland");
120 | countries.put("GD", "Grenada");
121 | countries.put("GP", "Guadeloupe");
122 | countries.put("GU", "Guam");
123 | countries.put("GT", "Guatemala");
124 | countries.put("GG", "Guernsey");
125 | countries.put("GN", "Guinea");
126 | countries.put("GW", "Guinea-Bissau");
127 | countries.put("GY", "Guyana");
128 | countries.put("HT", "Haiti");
129 | countries.put("HM", "Heard Island & Mcdonald Islands");
130 | countries.put("VA", "Holy See (Vatican City State)");
131 | countries.put("HN", "Honduras");
132 | countries.put("HK", "Hong Kong");
133 | countries.put("HU", "Hungary");
134 | countries.put("IS", "Iceland");
135 | countries.put("IN", "India");
136 | countries.put("ID", "Indonesia");
137 | countries.put("IR", "Iran, Islamic Republic Of");
138 | countries.put("IQ", "Iraq");
139 | countries.put("IE", "Ireland");
140 | countries.put("IM", "Isle Of Man");
141 | countries.put("IL", "Israel");
142 | countries.put("IT", "Italy");
143 | countries.put("JM", "Jamaica");
144 | countries.put("JP", "Japan");
145 | countries.put("JE", "Jersey");
146 | countries.put("JO", "Jordan");
147 | countries.put("KZ", "Kazakhstan");
148 | countries.put("KE", "Kenya");
149 | countries.put("KI", "Kiribati");
150 | countries.put("KR", "Korea");
151 | countries.put("KW", "Kuwait");
152 | countries.put("KG", "Kyrgyzstan");
153 | countries.put("LA", "Lao People\'s Democratic Republic");
154 | countries.put("LV", "Latvia");
155 | countries.put("LB", "Lebanon");
156 | countries.put("LS", "Lesotho");
157 | countries.put("LR", "Liberia");
158 | countries.put("LY", "Libyan Arab Jamahiriya");
159 | countries.put("LI", "Liechtenstein");
160 | countries.put("LT", "Lithuania");
161 | countries.put("LU", "Luxembourg");
162 | countries.put("MO", "Macao");
163 | countries.put("MK", "Macedonia");
164 | countries.put("MG", "Madagascar");
165 | countries.put("MW", "Malawi");
166 | countries.put("MY", "Malaysia");
167 | countries.put("MV", "Maldives");
168 | countries.put("ML", "Mali");
169 | countries.put("MT", "Malta");
170 | countries.put("MH", "Marshall Islands");
171 | countries.put("MQ", "Martinique");
172 | countries.put("MR", "Mauritania");
173 | countries.put("MU", "Mauritius");
174 | countries.put("YT", "Mayotte");
175 | countries.put("MX", "Mexico");
176 | countries.put("FM", "Micronesia, Federated States Of");
177 | countries.put("MD", "Moldova");
178 | countries.put("MC", "Monaco");
179 | countries.put("MN", "Mongolia");
180 | countries.put("ME", "Montenegro");
181 | countries.put("MS", "Montserrat");
182 | countries.put("MA", "Morocco");
183 | countries.put("MZ", "Mozambique");
184 | countries.put("MM", "Myanmar");
185 | countries.put("NA", "Namibia");
186 | countries.put("NR", "Nauru");
187 | countries.put("NP", "Nepal");
188 | countries.put("NL", "Netherlands");
189 | countries.put("AN", "Netherlands Antilles");
190 | countries.put("NC", "New Caledonia");
191 | countries.put("NZ", "New Zealand");
192 | countries.put("NI", "Nicaragua");
193 | countries.put("NE", "Niger");
194 | countries.put("NG", "Nigeria");
195 | countries.put("NU", "Niue");
196 | countries.put("NF", "Norfolk Island");
197 | countries.put("MP", "Northern Mariana Islands");
198 | countries.put("NO", "Norway");
199 | countries.put("OM", "Oman");
200 | countries.put("PK", "Pakistan");
201 | countries.put("PW", "Palau");
202 | countries.put("PS", "Palestinian Territory, Occupied");
203 | countries.put("PA", "Panama");
204 | countries.put("PG", "Papua New Guinea");
205 | countries.put("PY", "Paraguay");
206 | countries.put("PE", "Peru");
207 | countries.put("PH", "Philippines");
208 | countries.put("PN", "Pitcairn");
209 | countries.put("PL", "Poland");
210 | countries.put("PT", "Portugal");
211 | countries.put("PR", "Puerto Rico");
212 | countries.put("QA", "Qatar");
213 | countries.put("RE", "Reunion");
214 | countries.put("RO", "Romania");
215 | countries.put("RU", "Russian Federation");
216 | countries.put("RW", "Rwanda");
217 | countries.put("BL", "Saint Barthelemy");
218 | countries.put("SH", "Saint Helena");
219 | countries.put("KN", "Saint Kitts And Nevis");
220 | countries.put("LC", "Saint Lucia");
221 | countries.put("MF", "Saint Martin");
222 | countries.put("PM", "Saint Pierre And Miquelon");
223 | countries.put("VC", "Saint Vincent And Grenadines");
224 | countries.put("WS", "Samoa");
225 | countries.put("SM", "San Marino");
226 | countries.put("ST", "Sao Tome And Principe");
227 | countries.put("SA", "Saudi Arabia");
228 | countries.put("SN", "Senegal");
229 | countries.put("RS", "Serbia");
230 | countries.put("SC", "Seychelles");
231 | countries.put("SL", "Sierra Leone");
232 | countries.put("SG", "Singapore");
233 | countries.put("SK", "Slovakia");
234 | countries.put("SI", "Slovenia");
235 | countries.put("SB", "Solomon Islands");
236 | countries.put("SO", "Somalia");
237 | countries.put("ZA", "South Africa");
238 | countries.put("GS", "South Georgia And Sandwich Isl.");
239 | countries.put("ES", "Spain");
240 | countries.put("LK", "Sri Lanka");
241 | countries.put("SD", "Sudan");
242 | countries.put("SR", "Suriname");
243 | countries.put("SJ", "Svalbard And Jan Mayen");
244 | countries.put("SZ", "Swaziland");
245 | countries.put("SE", "Sweden");
246 | countries.put("CH", "Switzerland");
247 | countries.put("SY", "Syrian Arab Republic");
248 | countries.put("TW", "Taiwan");
249 | countries.put("TJ", "Tajikistan");
250 | countries.put("TZ", "Tanzania");
251 | countries.put("TH", "Thailand");
252 | countries.put("TL", "Timor-Leste");
253 | countries.put("TG", "Togo");
254 | countries.put("TK", "Tokelau");
255 | countries.put("TO", "Tonga");
256 | countries.put("TT", "Trinidad And Tobago");
257 | countries.put("TN", "Tunisia");
258 | countries.put("TR", "Turkey");
259 | countries.put("TM", "Turkmenistan");
260 | countries.put("TC", "Turks And Caicos Islands");
261 | countries.put("TV", "Tuvalu");
262 | countries.put("UG", "Uganda");
263 | countries.put("UA", "Ukraine");
264 | countries.put("AE", "United Arab Emirates");
265 | countries.put("GB", "United Kingdom");
266 | countries.put("US", "United States");
267 | countries.put("UM", "United States Outlying Islands");
268 | countries.put("UY", "Uruguay");
269 | countries.put("UZ", "Uzbekistan");
270 | countries.put("VU", "Vanuatu");
271 | countries.put("VE", "Venezuela");
272 | countries.put("VN", "Viet Nam");
273 | countries.put("VG", "Virgin Islands, British");
274 | countries.put("VI", "Virgin Islands, U.S.");
275 | countries.put("WF", "Wallis And Futuna");
276 | countries.put("EH", "Western Sahara");
277 | countries.put("YE", "Yemen");
278 | countries.put("ZM", "Zambia");
279 | countries.put("ZW", "Zimbabwe");
280 | this.codes = new ArrayList<>(countries.keySet());
281 | }
282 |
283 | @Override
284 | public CountryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
285 | return new CountryViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.cell_flag, parent, false));
286 | }
287 |
288 | @Override
289 | public int getItemCount() {
290 | return this.codes.size();
291 | }
292 |
293 | @Override
294 | public void onBindViewHolder(CountryViewHolder holder, int position) {
295 | holder.update(this.codes.get(position));
296 | }
297 |
298 | class CountryViewHolder extends RecyclerView.ViewHolder {
299 | private final ImageView flag;
300 | private final TextView name;
301 |
302 | CountryViewHolder(View itemView) {
303 | super(itemView);
304 | this.flag = (ImageView) itemView.findViewById(R.id.flag);
305 | this.name = (TextView) itemView.findViewById(R.id.name);
306 | }
307 |
308 | void update(String code) {
309 | String name = countries.get(code);
310 | this.flag.setImageResource(CountryFlag.flag(itemView.getContext(), code));
311 | this.name.setText(name);
312 | }
313 | }
314 |
315 | }
316 |
317 | }
318 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/cell_flag.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
18 |
26 |
27 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Android Flags
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/urizev/flags/test/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.test;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.3.2'
10 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/flags-lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/flags-lib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 |
4 | group = "com.github.urizev"
5 |
6 | android {
7 | compileSdkVersion 28
8 | buildToolsVersion "28.0.3"
9 |
10 | defaultConfig {
11 | minSdkVersion 21
12 | targetSdkVersion 28
13 | versionCode 100
14 | versionName "0.1"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | }
26 |
27 | dependencies {
28 | implementation fileTree(dir: 'libs', include: ['*.jar'])
29 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
30 | exclude group: 'com.android.support', module: 'support-annotations'
31 | })
32 | androidTestImplementation 'com.android.support:appcompat-v7:28.0.+'
33 | testImplementation 'junit:junit:4.12'
34 | }
35 |
36 | // build a jar with source files
37 | task sourcesJar(type: Jar) {
38 | from android.sourceSets.main.java.srcDirs
39 | classifier = 'sources'
40 | }
41 |
42 | task javadoc(type: Javadoc) {
43 | failOnError false
44 | source = android.sourceSets.main.java.sourceFiles
45 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
46 | classpath += configurations.compile
47 | }
48 |
49 | task javadocJar(type: Jar, dependsOn: javadoc) {
50 | classifier = 'javadoc'
51 | from javadoc.getDestinationDir()
52 | }
53 |
54 | artifacts {
55 | archives sourcesJar
56 | archives javadocJar
57 | }
--------------------------------------------------------------------------------
/flags-lib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jcvallejo/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/flags-lib/src/androidTest/java/com/urizev/flags/lib/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.lib;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.urizev.flags.lib.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/flags-lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flags-lib/src/main/java/com/urizev/flags/lib/CountryFlag.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.lib;
2 |
3 | import android.content.Context;
4 | import android.text.TextUtils;
5 |
6 | import java.util.Locale;
7 |
8 | /**
9 | * Creado por jcvallejo en 31/3/16.
10 | */
11 | public class CountryFlag {
12 | public static int flag(Context context, Locale locale) {
13 | return CountryFlag.flag(context, locale.getCountry().toLowerCase());
14 | }
15 |
16 | public static int flag(Context context, String iso) {
17 | if (TextUtils.isEmpty(iso)) {
18 | return R.drawable.flag__unknown;
19 | }
20 | if (iso.length() > 3) {
21 | iso = iso.substring(0, 3);
22 | }
23 | String name = "flag_" + iso.toLowerCase();
24 |
25 | int resId = context.getResources().getIdentifier(name, "drawable", context.getPackageName());
26 | if (resId > 0) {
27 | return resId;
28 | }
29 | else {
30 | return R.drawable.flag__unknown;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag__unknown.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ad.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ae.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_af.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ag.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
29 |
32 |
35 |
38 |
41 |
44 |
47 |
50 |
53 |
56 |
59 |
62 |
65 |
68 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ai.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
16 |
21 |
26 |
31 |
34 |
37 |
40 |
43 |
46 |
49 |
52 |
55 |
58 |
61 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_al.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_am.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ar.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_at.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_au.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
19 |
20 |
23 |
28 |
29 |
30 |
33 |
38 |
39 |
42 |
47 |
48 |
51 |
52 |
57 |
58 |
61 |
66 |
67 |
70 |
75 |
76 |
80 |
83 |
86 |
90 |
94 |
98 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_az.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
28 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ba.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
17 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
56 |
57 |
58 |
59 |
62 |
63 |
64 |
65 |
68 |
69 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_bb.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
23 |
32 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_bd.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_be.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
13 |
16 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_bf.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
29 |
32 |
35 |
38 |
41 |
44 |
47 |
50 |
53 |
56 |
59 |
62 |
65 |
68 |
71 |
74 |
77 |
80 |
83 |
86 |
89 |
92 |
95 |
98 |
101 |
104 |
107 |
110 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_br.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ca.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
15 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ch.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_cn.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
25 |
28 |
31 |
32 |
33 |
34 |
38 |
41 |
44 |
45 |
46 |
47 |
51 |
54 |
57 |
58 |
59 |
60 |
64 |
67 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_cz.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_de.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_dk.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_es.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_fr.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_gb.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
23 |
24 |
27 |
28 |
31 |
32 |
35 |
36 |
39 |
40 |
43 |
44 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ge.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
15 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_gr.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
23 |
24 |
27 |
28 |
31 |
32 |
35 |
36 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_hk.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
18 |
23 |
29 |
30 |
31 |
37 |
42 |
48 |
49 |
50 |
56 |
61 |
67 |
68 |
69 |
75 |
80 |
86 |
87 |
88 |
94 |
99 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_it.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
13 |
16 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_jp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_kr.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
16 |
19 |
20 |
23 |
24 |
27 |
28 |
31 |
32 |
33 |
37 |
40 |
43 |
46 |
47 |
48 |
52 |
55 |
58 |
61 |
64 |
65 |
66 |
70 |
73 |
76 |
79 |
82 |
85 |
86 |
87 |
91 |
94 |
97 |
100 |
103 |
106 |
109 |
110 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_lt.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_mx.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_my.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
20 |
23 |
26 |
29 |
32 |
35 |
40 |
49 |
58 |
59 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_nl.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_pl.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ps.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_qa.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
15 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_ru.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_sy.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
19 |
22 |
26 |
29 |
30 |
34 |
37 |
41 |
44 |
45 |
46 |
50 |
53 |
57 |
60 |
61 |
62 |
68 |
71 |
75 |
78 |
79 |
83 |
86 |
90 |
93 |
94 |
95 |
96 |
97 |
101 |
104 |
108 |
111 |
112 |
116 |
119 |
123 |
126 |
127 |
128 |
132 |
135 |
139 |
142 |
143 |
144 |
150 |
153 |
157 |
160 |
161 |
165 |
168 |
172 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_uk.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
23 |
24 |
27 |
28 |
31 |
32 |
35 |
36 |
39 |
40 |
43 |
44 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_us.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
49 |
50 |
51 |
54 |
55 |
56 |
59 |
60 |
61 |
64 |
65 |
66 |
69 |
70 |
71 |
74 |
75 |
76 |
79 |
80 |
81 |
82 |
83 |
84 |
87 |
88 |
89 |
92 |
93 |
94 |
97 |
98 |
99 |
102 |
103 |
104 |
107 |
108 |
109 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
121 |
122 |
123 |
126 |
127 |
128 |
131 |
132 |
133 |
136 |
137 |
138 |
141 |
142 |
143 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
155 |
156 |
157 |
160 |
161 |
162 |
165 |
166 |
167 |
170 |
171 |
172 |
175 |
176 |
177 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
189 |
190 |
191 |
194 |
195 |
196 |
199 |
200 |
201 |
204 |
205 |
206 |
209 |
210 |
211 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
224 |
225 |
226 |
229 |
230 |
231 |
234 |
235 |
236 |
239 |
240 |
241 |
244 |
245 |
246 |
247 |
248 |
249 |
252 |
253 |
254 |
257 |
258 |
259 |
262 |
263 |
264 |
267 |
268 |
269 |
272 |
273 |
274 |
275 |
276 |
277 |
280 |
281 |
282 |
285 |
286 |
287 |
290 |
291 |
292 |
295 |
296 |
297 |
300 |
301 |
302 |
303 |
304 |
305 |
308 |
309 |
310 |
313 |
314 |
315 |
318 |
319 |
320 |
323 |
324 |
325 |
328 |
329 |
330 |
331 |
--------------------------------------------------------------------------------
/flags-lib/src/main/res/drawable/flag_vn.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
15 |
18 |
19 |
22 |
23 |
24 |
27 |
28 |
29 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/flags-lib/src/test/java/com/urizev/flags/lib/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.urizev.flags.lib;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/urizev/android-vector-flags/0457a6a837f350c57d1bccf84bcb6ccd0f912e56/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Apr 20 14:40:58 EEST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':flags-lib'
2 |
--------------------------------------------------------------------------------