Commit 540bb41c49ab6fc29f9607b12ee3aa44b16decd7
1 parent
6905a587
Exists in
master
commit inicial
Showing
47 changed files
with
1538 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,19 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<module external.linked.project.id="MonitoraMunicipio" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | |
3 | + <component name="FacetManager"> | |
4 | + <facet type="java-gradle" name="Java-Gradle"> | |
5 | + <configuration> | |
6 | + <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | |
7 | + <option name="BUILDABLE" value="false" /> | |
8 | + </configuration> | |
9 | + </facet> | |
10 | + </component> | |
11 | + <component name="NewModuleRootManager" inherit-compiler-output="true"> | |
12 | + <exclude-output /> | |
13 | + <content url="file://$MODULE_DIR$"> | |
14 | + <excludeFolder url="file://$MODULE_DIR$/.gradle" /> | |
15 | + </content> | |
16 | + <orderEntry type="inheritedJdk" /> | |
17 | + <orderEntry type="sourceFolder" forTests="false" /> | |
18 | + </component> | |
19 | +</module> | |
0 | 20 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1 @@ |
1 | +/build | ... | ... |
... | ... | @@ -0,0 +1,106 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="MonitoraMunicipio" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | |
3 | + <component name="FacetManager"> | |
4 | + <facet type="android-gradle" name="Android-Gradle"> | |
5 | + <configuration> | |
6 | + <option name="GRADLE_PROJECT_PATH" value=":app" /> | |
7 | + </configuration> | |
8 | + </facet> | |
9 | + <facet type="android" name="Android"> | |
10 | + <configuration> | |
11 | + <option name="SELECTED_BUILD_VARIANT" value="debug" /> | |
12 | + <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> | |
13 | + <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> | |
14 | + <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> | |
15 | + <option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" /> | |
16 | + <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" /> | |
17 | + <option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" /> | |
18 | + <option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" /> | |
19 | + <option name="ALLOW_USER_CONFIGURATION" value="false" /> | |
20 | + <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> | |
21 | + <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> | |
22 | + <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> | |
23 | + <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> | |
24 | + </configuration> | |
25 | + </facet> | |
26 | + </component> | |
27 | + <component name="NewModuleRootManager" inherit-compiler-output="false"> | |
28 | + <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> | |
29 | + <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" /> | |
30 | + <exclude-output /> | |
31 | + <content url="file://$MODULE_DIR$"> | |
32 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> | |
33 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> | |
34 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" /> | |
35 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" /> | |
36 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" /> | |
37 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" /> | |
38 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" /> | |
39 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" /> | |
40 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" /> | |
41 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" /> | |
42 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" /> | |
43 | + <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" /> | |
44 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> | |
45 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> | |
46 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> | |
47 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> | |
48 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> | |
49 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> | |
50 | + <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> | |
51 | + <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> | |
52 | + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | |
53 | + <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> | |
54 | + <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> | |
55 | + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | |
56 | + <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> | |
57 | + <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> | |
58 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> | |
59 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> | |
60 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> | |
61 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> | |
62 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> | |
63 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> | |
64 | + <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> | |
65 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> | |
66 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> | |
67 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> | |
68 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" /> | |
69 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> | |
70 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> | |
71 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" /> | |
72 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" /> | |
73 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.0/jars" /> | |
74 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.3/jars" /> | |
75 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" /> | |
76 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars" /> | |
77 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.6/jars" /> | |
78 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | |
79 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> | |
80 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" /> | |
81 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" /> | |
82 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" /> | |
83 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> | |
84 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" /> | |
85 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> | |
86 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" /> | |
87 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> | |
88 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> | |
89 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> | |
90 | + <excludeFolder url="file://$MODULE_DIR$/build/outputs" /> | |
91 | + <excludeFolder url="file://$MODULE_DIR$/build/tmp" /> | |
92 | + </content> | |
93 | + <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> | |
94 | + <orderEntry type="sourceFolder" forTests="false" /> | |
95 | + <orderEntry type="library" exported="" name="gson-2.3.1" level="project" /> | |
96 | + <orderEntry type="library" exported="" name="design-22.2.0" level="project" /> | |
97 | + <orderEntry type="library" exported="" name="iconics-1.0.2" level="project" /> | |
98 | + <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" /> | |
99 | + <orderEntry type="library" exported="" name="Parse-1.9.2" level="project" /> | |
100 | + <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" /> | |
101 | + <orderEntry type="library" exported="" name="bolts-android-1.2.0" level="project" /> | |
102 | + <orderEntry type="library" exported="" name="materialdrawer-3.0.6" level="project" /> | |
103 | + <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" /> | |
104 | + <orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" /> | |
105 | + </component> | |
106 | +</module> | |
0 | 107 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +apply plugin: 'com.android.application' | |
2 | + | |
3 | +android { | |
4 | + compileSdkVersion 22 | |
5 | + buildToolsVersion "23.0.0 rc2" | |
6 | + | |
7 | + defaultConfig { | |
8 | + applicationId "com.monitorabrasil.monitoramunicipio" | |
9 | + minSdkVersion 15 | |
10 | + targetSdkVersion 22 | |
11 | + versionCode 1 | |
12 | + versionName "1.0" | |
13 | + } | |
14 | + buildTypes { | |
15 | + release { | |
16 | + minifyEnabled false | |
17 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
18 | + } | |
19 | + } | |
20 | +} | |
21 | + | |
22 | +dependencies { | |
23 | + compile fileTree(dir: 'libs', include: ['*.jar']) | |
24 | + compile 'com.android.support:appcompat-v7:22.2.0' | |
25 | + compile 'com.android.support:recyclerview-v7:21.0.3' | |
26 | + compile 'com.android.support:design:22.2.0' | |
27 | + | |
28 | + | |
29 | + compile('com.mikepenz:materialdrawer:3.0.6@aar') { | |
30 | + transitive = true | |
31 | + } | |
32 | + compile 'com.parse.bolts:bolts-android:1.+' | |
33 | + compile fileTree(dir: 'libs', include: 'Parse-*.jar') | |
34 | + compile 'com.google.code.gson:gson:2.3.1' | |
35 | +} | ... | ... |
No preview for this file type
... | ... | @@ -0,0 +1,17 @@ |
1 | +# Add project specific ProGuard rules here. | |
2 | +# By default, the flags in this file are appended to flags specified | |
3 | +# in /Users/geraugu/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 | +#} | ... | ... |
app/src/androidTest/java/com/monitorabrasil/monitoralegislativo/ApplicationTest.java
0 → 100644
... | ... | @@ -0,0 +1,13 @@ |
1 | +package com.monitorabrasil.monitoralegislativo; | |
2 | + | |
3 | +import android.app.Application; | |
4 | +import android.test.ApplicationTestCase; | |
5 | + | |
6 | +/** | |
7 | + * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | |
8 | + */ | |
9 | +public class ApplicationTest extends ApplicationTestCase<Application> { | |
10 | + public ApplicationTest() { | |
11 | + super(Application.class); | |
12 | + } | |
13 | +} | |
0 | 14 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,34 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + package="com.monitorabrasil.monitoralegislativo" > | |
4 | + | |
5 | + <uses-permission android:name="android.permission.CALL_PHONE" /> | |
6 | + <uses-permission android:name="android.permission.INTERNET" /> | |
7 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
8 | + | |
9 | + <application | |
10 | + android:allowBackup="true" | |
11 | + android:icon="@mipmap/ic_launcher" | |
12 | + android:label="@string/app_name" | |
13 | + android:theme="@style/Theme.MyTheme" | |
14 | + android:name=".application.MyApp"> | |
15 | + <activity | |
16 | + android:name=".MainActivity" | |
17 | + android:label="@string/app_name" > | |
18 | + <intent-filter> | |
19 | + <action android:name="android.intent.action.MAIN" /> | |
20 | + | |
21 | + <category android:name="android.intent.category.LAUNCHER" /> | |
22 | + </intent-filter> | |
23 | + </activity> | |
24 | + <activity | |
25 | + android:name=".PoliticosActivity" | |
26 | + android:label="@string/title_activity_politicos" | |
27 | + android:parentActivityName=".MainActivity" > | |
28 | + <meta-data | |
29 | + android:name="android.support.PARENT_ACTIVITY" | |
30 | + android:value="com.monitorabrasil.monitoralegislativo.MainActivity" /> | |
31 | + </activity> | |
32 | + </application> | |
33 | + | |
34 | +</manifest> | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/MainActivity.java
0 → 100644
... | ... | @@ -0,0 +1,195 @@ |
1 | +package com.monitorabrasil.monitoralegislativo; | |
2 | + | |
3 | +import android.content.Intent; | |
4 | +import android.net.Uri; | |
5 | +import android.support.v4.app.FragmentTransaction; | |
6 | +import android.support.v7.app.ActionBarActivity; | |
7 | +import android.os.Bundle; | |
8 | +import android.support.v7.app.AppCompatActivity; | |
9 | +import android.support.v7.widget.LinearLayoutManager; | |
10 | +import android.support.v7.widget.RecyclerView; | |
11 | +import android.support.v7.widget.Toolbar; | |
12 | +import android.util.Log; | |
13 | +import android.view.Gravity; | |
14 | +import android.view.Menu; | |
15 | +import android.view.MenuItem; | |
16 | +import android.view.View; | |
17 | +import android.widget.AdapterView; | |
18 | +import android.widget.Toast; | |
19 | + | |
20 | +import com.mikepenz.materialdrawer.Drawer; | |
21 | +import com.mikepenz.materialdrawer.DrawerBuilder; | |
22 | +import com.mikepenz.materialdrawer.accountswitcher.AccountHeader; | |
23 | +import com.mikepenz.materialdrawer.accountswitcher.AccountHeaderBuilder; | |
24 | +import com.mikepenz.materialdrawer.model.DividerDrawerItem; | |
25 | +import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; | |
26 | +import com.mikepenz.materialdrawer.model.ProfileDrawerItem; | |
27 | +import com.mikepenz.materialdrawer.model.SecondaryDrawerItem; | |
28 | +import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; | |
29 | +import com.mikepenz.materialdrawer.model.interfaces.IProfile; | |
30 | +import com.monitorabrasil.monitoralegislativo.adapters.VereadorAdapter; | |
31 | +import com.monitorabrasil.monitoralegislativo.fragments.HomeFragment; | |
32 | +import com.monitorabrasil.monitoralegislativo.fragments.ListaPoliticoFragment; | |
33 | +import com.monitorabrasil.monitoralegislativo.interfaces.RecyclerViewOnClickListenerHack; | |
34 | +import com.parse.FindCallback; | |
35 | +import com.parse.Parse; | |
36 | +import com.parse.ParseObject; | |
37 | +import com.parse.ParseQuery; | |
38 | + | |
39 | +import java.util.List; | |
40 | + | |
41 | + | |
42 | +public class MainActivity extends AppCompatActivity implements HomeFragment.OnFragmentInteractionListener { | |
43 | + | |
44 | + | |
45 | + | |
46 | + private Toolbar mToolbar; | |
47 | + private AccountHeader headerNavigationLeft; | |
48 | + private Drawer navigationDrawerLeft; | |
49 | + | |
50 | + | |
51 | + | |
52 | + | |
53 | + | |
54 | + @Override | |
55 | + protected void onCreate(Bundle savedInstanceState) { | |
56 | + super.onCreate(savedInstanceState); | |
57 | + setContentView(R.layout.activity_main); | |
58 | + | |
59 | + | |
60 | + | |
61 | + | |
62 | + //FRAGMENT | |
63 | + HomeFragment homeFragment = (HomeFragment) getSupportFragmentManager().findFragmentByTag("homeFrag"); | |
64 | + if(homeFragment == null) { | |
65 | + homeFragment = homeFragment.newInstance(); | |
66 | + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
67 | + ft.replace(R.id.rl_fragment_container, homeFragment, "homeFrag"); | |
68 | + ft.commit(); | |
69 | + } | |
70 | + | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | + | |
76 | + | |
77 | + | |
78 | + // TOOLBAR | |
79 | + mToolbar = (Toolbar) findViewById(R.id.tb_main); | |
80 | + mToolbar.setTitle("Monitora, Ouro Branco!"); | |
81 | + //mToolbar.setSubtitle("just a subtitle"); | |
82 | + //mToolbar.setLogo(R.drawable.ic_launcher); | |
83 | + setSupportActionBar(mToolbar); | |
84 | + mToolbar.setTitleTextColor(getResources().getColor(R.color.md_white_1000)); | |
85 | + | |
86 | + /*getSupportActionBar().setDisplayHomeAsUpEnabled(true); | |
87 | + getSupportActionBar().setHomeButtonEnabled(false);*/ | |
88 | + | |
89 | + headerNavigationLeft = new AccountHeaderBuilder() | |
90 | + .withActivity(this) | |
91 | + .withHeaderBackground(R.drawable.rsz_ourobranco) | |
92 | + .addProfiles( | |
93 | + new ProfileDrawerItem().withName("Geraldo"). | |
94 | + withEmail("geraldo.morais@gmail.com") | |
95 | + .withIcon(getResources().getDrawable(R.drawable.person_1)) | |
96 | + ) | |
97 | + .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { | |
98 | + @Override | |
99 | + public boolean onProfileChanged(View view, IProfile profile, boolean currentProfile) { | |
100 | + return false; | |
101 | + } | |
102 | + }) | |
103 | + .build(); | |
104 | + | |
105 | + navigationDrawerLeft = new DrawerBuilder() | |
106 | + .withActivity(this) | |
107 | + .withToolbar(mToolbar) | |
108 | + .withDisplayBelowToolbar(false) | |
109 | + .withActionBarDrawerToggleAnimated(true) | |
110 | + .withDrawerGravity(Gravity.START) | |
111 | + .withSavedInstance(savedInstanceState) | |
112 | + .withActionBarDrawerToggle(true) | |
113 | + .withAccountHeader(headerNavigationLeft) | |
114 | + .addDrawerItems( | |
115 | + new PrimaryDrawerItem().withName("Home"), | |
116 | + new DividerDrawerItem(), | |
117 | + new PrimaryDrawerItem().withName("Vereadores"), | |
118 | + new SecondaryDrawerItem().withName("Projetos"), | |
119 | + new SecondaryDrawerItem().withName("Câmara") | |
120 | + ) | |
121 | + .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { | |
122 | + @Override | |
123 | + public boolean onItemClick(AdapterView<?> parent, View view, int position, long id, IDrawerItem drawerItem) { | |
124 | + switch (position){ | |
125 | + case 0: | |
126 | + HomeFragment homeFragment = (HomeFragment) getSupportFragmentManager().findFragmentByTag("homeFrag"); | |
127 | + if(homeFragment == null) { | |
128 | + homeFragment = homeFragment.newInstance(); | |
129 | + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
130 | + ft.replace(R.id.rl_fragment_container, homeFragment, "homeFrag"); | |
131 | + ft.commit(); | |
132 | + } | |
133 | + break; | |
134 | + | |
135 | + case 2: | |
136 | + startActivity(new Intent(getApplicationContext(), PoliticosActivity.class)); | |
137 | + | |
138 | + | |
139 | + break; | |
140 | + } | |
141 | + navigationDrawerLeft.closeDrawer(); | |
142 | + | |
143 | + return true; | |
144 | + } | |
145 | + }) | |
146 | + .build(); | |
147 | + | |
148 | + | |
149 | + } | |
150 | + | |
151 | + | |
152 | + | |
153 | + | |
154 | + | |
155 | + @Override | |
156 | + public boolean onCreateOptionsMenu(Menu menu) { | |
157 | + // Inflate the menu; this adds items to the action bar if it is present. | |
158 | + getMenuInflater().inflate(R.menu.menu_main, menu); | |
159 | + return true; | |
160 | + } | |
161 | + | |
162 | + @Override | |
163 | + public boolean onOptionsItemSelected(MenuItem item) { | |
164 | + // Handle action bar item clicks here. The action bar will | |
165 | + // automatically handle clicks on the Home/Up button, so long | |
166 | + // as you specify a parent activity in AndroidManifest.xml. | |
167 | + int id = item.getItemId(); | |
168 | + | |
169 | + //noinspection SimplifiableIfStatement | |
170 | + if (id == R.id.action_settings) { | |
171 | + return true; | |
172 | + } | |
173 | + | |
174 | + return super.onOptionsItemSelected(item); | |
175 | + } | |
176 | + | |
177 | + @Override | |
178 | + public void onBackPressed() { | |
179 | + if(navigationDrawerLeft.isDrawerOpen()){ | |
180 | + navigationDrawerLeft.closeDrawer(); | |
181 | + } | |
182 | + /*else if(fab.isOpened()){ | |
183 | + fab.close(true); | |
184 | + }*/ | |
185 | + else{ | |
186 | + super.onBackPressed(); | |
187 | + } | |
188 | + } | |
189 | + | |
190 | + | |
191 | + @Override | |
192 | + public void onFragmentInteraction(Uri uri) { | |
193 | + | |
194 | + } | |
195 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/PoliticosActivity.java
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +package com.monitorabrasil.monitoralegislativo; | |
2 | + | |
3 | +import android.support.v4.app.FragmentTransaction; | |
4 | +import android.support.v7.app.ActionBarActivity; | |
5 | +import android.os.Bundle; | |
6 | +import android.support.v7.app.AppCompatActivity; | |
7 | +import android.support.v7.widget.Toolbar; | |
8 | +import android.view.Menu; | |
9 | +import android.view.MenuItem; | |
10 | + | |
11 | +import com.monitorabrasil.monitoralegislativo.R; | |
12 | +import com.monitorabrasil.monitoralegislativo.fragments.ListaPoliticoFragment; | |
13 | + | |
14 | +public class PoliticosActivity extends AppCompatActivity { | |
15 | + | |
16 | + @Override | |
17 | + protected void onCreate(Bundle savedInstanceState) { | |
18 | + super.onCreate(savedInstanceState); | |
19 | + setContentView(R.layout.activity_politicos); | |
20 | + | |
21 | + ListaPoliticoFragment frag = (ListaPoliticoFragment) getSupportFragmentManager().findFragmentByTag("listaPoliticoFrag"); | |
22 | + if(frag == null) { | |
23 | + frag = new ListaPoliticoFragment(); | |
24 | + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
25 | + ft.replace(R.id.rl_fragment_container, frag, "listaPoliticoFrag"); | |
26 | + ft.commit(); | |
27 | + } | |
28 | + | |
29 | + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | |
30 | + setSupportActionBar(toolbar); | |
31 | + | |
32 | + // toolbar.setNavigationIcon(R.drawable.ic_good); | |
33 | + toolbar.setTitle("Vereadores"); | |
34 | + toolbar.setSubtitle("Ouro Branco - MG"); | |
35 | + setSupportActionBar(toolbar); | |
36 | + getSupportActionBar().setDisplayHomeAsUpEnabled(true); | |
37 | + // toolbar.setLogo(R.drawable.ic_launcher); | |
38 | + } | |
39 | + | |
40 | + | |
41 | + @Override | |
42 | + public boolean onCreateOptionsMenu(Menu menu) { | |
43 | + // Inflate the menu; this adds items to the action bar if it is present. | |
44 | + getMenuInflater().inflate(R.menu.menu_politicos, menu); | |
45 | + return true; | |
46 | + } | |
47 | + | |
48 | + @Override | |
49 | + public boolean onOptionsItemSelected(MenuItem item) { | |
50 | + // Handle action bar item clicks here. The action bar will | |
51 | + // automatically handle clicks on the Home/Up button, so long | |
52 | + // as you specify a parent activity in AndroidManifest.xml. | |
53 | + int id = item.getItemId(); | |
54 | + | |
55 | + //noinspection SimplifiableIfStatement | |
56 | + if (id == R.id.action_settings) { | |
57 | + return true; | |
58 | + } | |
59 | + | |
60 | + return super.onOptionsItemSelected(item); | |
61 | + } | |
62 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/adapters/VereadorAdapter.java
0 → 100644
... | ... | @@ -0,0 +1,74 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.adapters; | |
2 | + | |
3 | +import android.support.v7.widget.RecyclerView; | |
4 | +import android.view.LayoutInflater; | |
5 | +import android.view.View; | |
6 | +import android.view.ViewGroup; | |
7 | +import android.widget.TextView; | |
8 | + | |
9 | +import com.monitorabrasil.monitoralegislativo.R; | |
10 | +import com.monitorabrasil.monitoralegislativo.interfaces.RecyclerViewOnClickListenerHack; | |
11 | +import com.parse.ParseObject; | |
12 | + | |
13 | +import java.util.List; | |
14 | + | |
15 | +/** | |
16 | + * Created by geraugu on 6/7/15. | |
17 | + */ | |
18 | +public class VereadorAdapter extends RecyclerView.Adapter<VereadorAdapter.ViewHolder> { | |
19 | + | |
20 | + private List<ParseObject> mDataset; | |
21 | + private RecyclerViewOnClickListenerHack mRecyclerViewOnClickListenerHack; | |
22 | + | |
23 | + // Provide a reference to the views for each data item | |
24 | + // Complex data items may need more than one view per item, and | |
25 | + // you provide access to all the views for a data item in a view holder | |
26 | + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ | |
27 | + // each data item is just a string in this case | |
28 | + public TextView mTextView; | |
29 | + public TextView txtPartido; | |
30 | + public ViewHolder(View v) { | |
31 | + super(v); | |
32 | + mTextView = (TextView) v.findViewById(R.id.txtNome); | |
33 | + txtPartido = (TextView) v.findViewById(R.id.txtPartido); | |
34 | + | |
35 | + itemView.setOnClickListener(this); | |
36 | + } | |
37 | + | |
38 | + @Override | |
39 | + public void onClick(View v) { | |
40 | + if(mRecyclerViewOnClickListenerHack != null){ | |
41 | + mRecyclerViewOnClickListenerHack.onClickListener(v, getPosition()); | |
42 | + } | |
43 | + } | |
44 | + } | |
45 | + | |
46 | + public VereadorAdapter(List<ParseObject> myDataset) { | |
47 | + mDataset = myDataset; | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public VereadorAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { | |
52 | + // create a new view | |
53 | + View v = LayoutInflater.from(viewGroup.getContext()) | |
54 | + .inflate(R.layout.item_politico, viewGroup, false); | |
55 | + // set the view's size, margins, paddings and layout parameter | |
56 | + ViewHolder vh = new ViewHolder(v); | |
57 | + return vh; | |
58 | + } | |
59 | + public void setRecyclerViewOnClickListenerHack(RecyclerViewOnClickListenerHack r){ | |
60 | + mRecyclerViewOnClickListenerHack = r; | |
61 | + } | |
62 | + | |
63 | + @Override | |
64 | + public void onBindViewHolder(VereadorAdapter.ViewHolder viewHolder, int i) { | |
65 | + ParseObject vereador = mDataset.get(i); | |
66 | + viewHolder.mTextView.setText(vereador.get("nome").toString()); | |
67 | + viewHolder.txtPartido.setText(vereador.get("partido").toString()); | |
68 | + } | |
69 | + | |
70 | + @Override | |
71 | + public int getItemCount() { | |
72 | + return mDataset.size(); | |
73 | + } | |
74 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/application/MyApp.java
0 → 100644
... | ... | @@ -0,0 +1,21 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.application; | |
2 | + | |
3 | +import android.app.Application; | |
4 | +import android.os.Bundle; | |
5 | + | |
6 | +import com.parse.Parse; | |
7 | + | |
8 | +/** | |
9 | + * Created by geraugu on 6/10/15. | |
10 | + */ | |
11 | +public class MyApp extends Application { | |
12 | + | |
13 | + @Override | |
14 | + public void onCreate() { | |
15 | + super.onCreate(); | |
16 | +// Enable Local Datastore. | |
17 | + | |
18 | + Parse.enableLocalDatastore(this); | |
19 | + Parse.initialize(this, "pcGL19NalihMwcHaKnTuYpLkQU4ndrCH2Yxx9von", "tdWwopcuTXJ2ysxZW7pc9ZcZQCmqPSWwSokzCEzl"); | |
20 | + } | |
21 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/HomeFragment.java
0 → 100644
... | ... | @@ -0,0 +1,96 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.fragments; | |
2 | + | |
3 | +import android.app.Activity; | |
4 | +import android.net.Uri; | |
5 | +import android.os.Bundle; | |
6 | +import android.support.v4.app.Fragment; | |
7 | +import android.view.LayoutInflater; | |
8 | +import android.view.View; | |
9 | +import android.view.ViewGroup; | |
10 | + | |
11 | +import com.monitorabrasil.monitoralegislativo.R; | |
12 | + | |
13 | +/** | |
14 | + * A simple {@link Fragment} subclass. | |
15 | + * Activities that contain this fragment must implement the | |
16 | + * {@link HomeFragment.OnFragmentInteractionListener} interface | |
17 | + * to handle interaction events. | |
18 | + * Use the {@link HomeFragment#newInstance} factory method to | |
19 | + * create an instance of this fragment. | |
20 | + */ | |
21 | +public class HomeFragment extends Fragment { | |
22 | + | |
23 | + | |
24 | + private OnFragmentInteractionListener mListener; | |
25 | + | |
26 | + /** | |
27 | + * Use this factory method to create a new instance of | |
28 | + * this fragment using the provided parameters. | |
29 | + * @return A new instance of fragment HomeFragment. | |
30 | + */ | |
31 | + // TODO: Rename and change types and number of parameters | |
32 | + public static HomeFragment newInstance() { | |
33 | + HomeFragment fragment = new HomeFragment(); | |
34 | + Bundle args = new Bundle(); | |
35 | + | |
36 | + fragment.setArguments(args); | |
37 | + return fragment; | |
38 | + } | |
39 | + | |
40 | + public HomeFragment() { | |
41 | + // Required empty public constructor | |
42 | + } | |
43 | + | |
44 | + @Override | |
45 | + public void onCreate(Bundle savedInstanceState) { | |
46 | + super.onCreate(savedInstanceState); | |
47 | + | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
52 | + Bundle savedInstanceState) { | |
53 | + // Inflate the layout for this fragment | |
54 | + return inflater.inflate(R.layout.fragment_home, container, false); | |
55 | + } | |
56 | + | |
57 | + // TODO: Rename method, update argument and hook method into UI event | |
58 | + public void onButtonPressed(Uri uri) { | |
59 | + if (mListener != null) { | |
60 | + mListener.onFragmentInteraction(uri); | |
61 | + } | |
62 | + } | |
63 | + | |
64 | + @Override | |
65 | + public void onAttach(Activity activity) { | |
66 | + super.onAttach(activity); | |
67 | + try { | |
68 | + mListener = (OnFragmentInteractionListener) activity; | |
69 | + } catch (ClassCastException e) { | |
70 | + throw new ClassCastException(activity.toString() | |
71 | + + " must implement OnFragmentInteractionListener"); | |
72 | + } | |
73 | + } | |
74 | + | |
75 | + @Override | |
76 | + public void onDetach() { | |
77 | + super.onDetach(); | |
78 | + mListener = null; | |
79 | + } | |
80 | + | |
81 | + /** | |
82 | + * This interface must be implemented by activities that contain this | |
83 | + * fragment to allow an interaction in this fragment to be communicated | |
84 | + * to the activity and potentially other fragments contained in that | |
85 | + * activity. | |
86 | + * <p/> | |
87 | + * See the Android Training lesson <a href= | |
88 | + * "http://developer.android.com/training/basics/fragments/communicating.html" | |
89 | + * >Communicating with Other Fragments</a> for more information. | |
90 | + */ | |
91 | + public interface OnFragmentInteractionListener { | |
92 | + // TODO: Update argument type and name | |
93 | + public void onFragmentInteraction(Uri uri); | |
94 | + } | |
95 | + | |
96 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/ListaPoliticoFragment.java
0 → 100644
... | ... | @@ -0,0 +1,104 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.fragments; | |
2 | + | |
3 | +import android.os.Bundle; | |
4 | +import android.support.v4.app.Fragment; | |
5 | +import android.support.v4.app.FragmentTransaction; | |
6 | +import android.support.v7.widget.LinearLayoutManager; | |
7 | +import android.support.v7.widget.RecyclerView; | |
8 | +import android.util.Log; | |
9 | +import android.view.LayoutInflater; | |
10 | +import android.view.View; | |
11 | +import android.view.ViewGroup; | |
12 | +import android.widget.Toast; | |
13 | + | |
14 | +import com.google.gson.Gson; | |
15 | +import com.monitorabrasil.monitoralegislativo.R; | |
16 | +import com.monitorabrasil.monitoralegislativo.adapters.VereadorAdapter; | |
17 | +import com.monitorabrasil.monitoralegislativo.interfaces.RecyclerViewOnClickListenerHack; | |
18 | +import com.parse.FindCallback; | |
19 | +import com.parse.ParseException; | |
20 | +import com.parse.ParseObject; | |
21 | +import com.parse.ParseQuery; | |
22 | + | |
23 | +import java.util.List; | |
24 | + | |
25 | +/** | |
26 | + * Created by geraugu on 6/10/15. | |
27 | + */ | |
28 | +public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnClickListenerHack { | |
29 | + | |
30 | + private RecyclerView mRecyclerView; | |
31 | + private VereadorAdapter mAdapter; | |
32 | + private RecyclerView.LayoutManager mLayoutManager; | |
33 | + private List<ParseObject> ob; | |
34 | + | |
35 | + @Override | |
36 | + public View onCreateView(LayoutInflater inflater, | |
37 | + ViewGroup container, | |
38 | + Bundle savedInstanceState) { | |
39 | + View view = inflater.inflate(R.layout.fragment_list_politico, container, false); | |
40 | + | |
41 | + //tableview | |
42 | + mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view); | |
43 | + | |
44 | + // use this setting to improve performance if you know that changes | |
45 | + // in content do not change the layout size of the RecyclerView | |
46 | + mRecyclerView.setHasFixedSize(true); | |
47 | + | |
48 | + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); | |
49 | + llm.setOrientation(LinearLayoutManager.VERTICAL); | |
50 | + mRecyclerView.setLayoutManager(llm); | |
51 | + | |
52 | + buscaVereadores(); | |
53 | + | |
54 | + return view; | |
55 | + | |
56 | + } | |
57 | + | |
58 | + //busca objetos | |
59 | + public void buscaVereadores(){ | |
60 | + ParseQuery<ParseObject> query = ParseQuery.getQuery("Politico"); | |
61 | + query.addAscendingOrder("nome"); | |
62 | + //query.whereEqualTo("playerName", "Dan Stemkoski"); | |
63 | + query.findInBackground(new FindCallback<ParseObject>() { | |
64 | + @Override | |
65 | + public void done(List<ParseObject> list, com.parse.ParseException e) { | |
66 | + if (e == null) { | |
67 | + ob = list; | |
68 | + carregaList(list); | |
69 | + } else { | |
70 | + Log.d("score", "Error: " + e.getMessage()); | |
71 | + } | |
72 | + } | |
73 | + | |
74 | + | |
75 | + }); | |
76 | + } | |
77 | + | |
78 | + public void carregaList(List<ParseObject> list){ | |
79 | + mAdapter = new VereadorAdapter(list); | |
80 | + mAdapter.setRecyclerViewOnClickListenerHack(this); | |
81 | + mRecyclerView.setAdapter(mAdapter); | |
82 | + } | |
83 | + | |
84 | + | |
85 | + | |
86 | + @Override | |
87 | + public void onClickListener(View view, int position) { | |
88 | + | |
89 | + | |
90 | + PoliticoFragment frag = new PoliticoFragment(); | |
91 | + Bundle bundle = new Bundle(); | |
92 | + try { | |
93 | + ob.get(position).pin(); | |
94 | + } catch (ParseException e) { | |
95 | + e.printStackTrace(); | |
96 | + } | |
97 | + bundle.putString("politico", ob.get(position).getObjectId()); | |
98 | + frag.setArguments(bundle); | |
99 | + FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction(); | |
100 | + ft.replace(R.id.rl_fragment_container, frag, "politicoFrag"); | |
101 | + ft.addToBackStack(null); | |
102 | + ft.commit(); | |
103 | + } | |
104 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/PoliticoFragment.java
0 → 100644
... | ... | @@ -0,0 +1,69 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.fragments; | |
2 | + | |
3 | +import android.app.ActionBar; | |
4 | +import android.os.Bundle; | |
5 | +import android.support.design.widget.TabLayout; | |
6 | +import android.support.v4.app.Fragment; | |
7 | +import android.support.v4.app.FragmentTransaction; | |
8 | +import android.view.LayoutInflater; | |
9 | +import android.view.View; | |
10 | +import android.view.ViewGroup; | |
11 | +import android.widget.TableLayout; | |
12 | +import android.widget.TextView; | |
13 | + | |
14 | +import com.google.gson.Gson; | |
15 | +import com.monitorabrasil.monitoralegislativo.R; | |
16 | +import com.parse.GetCallback; | |
17 | +import com.parse.ParseObject; | |
18 | +import com.parse.ParseQuery; | |
19 | + | |
20 | +import java.text.ParseException; | |
21 | + | |
22 | +/** | |
23 | + * Created by geraugu on 6/10/15. | |
24 | + */ | |
25 | +public class PoliticoFragment extends Fragment { | |
26 | + | |
27 | + @Override | |
28 | + public View onCreateView(LayoutInflater inflater, | |
29 | + ViewGroup container, | |
30 | + Bundle savedInstanceState) { | |
31 | + View view = inflater.inflate(R.layout.fragment_politico_detalhe, container, false); | |
32 | + | |
33 | + //TABS | |
34 | + final ActionBar actionBar = getActivity().getActionBar(); | |
35 | + // Create a tab listener that is called when the user changes tabs. | |
36 | + | |
37 | + TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tabLayout); | |
38 | + tabLayout.addTab(tabLayout.newTab().setText("Ficha")); | |
39 | + tabLayout.addTab(tabLayout.newTab().setText("Gastos")); | |
40 | + | |
41 | + | |
42 | + | |
43 | + Bundle bundle = getArguments(); | |
44 | + ParseObject politico = buscaPolitico(bundle.getString("politico")) ; | |
45 | + | |
46 | + TextView txtNome = (TextView) view.findViewById(R.id.txtNome); | |
47 | + txtNome.setText(politico.get("nome").toString()); | |
48 | + | |
49 | + | |
50 | + | |
51 | + return view; | |
52 | + } | |
53 | + | |
54 | + private ParseObject buscaPolitico(String id) { | |
55 | + | |
56 | + ParseQuery<ParseObject> query = ParseQuery.getQuery("Politico"); | |
57 | + query.fromLocalDatastore(); | |
58 | + try { | |
59 | + return query.get(id); | |
60 | + } catch (com.parse.ParseException e) { | |
61 | + e.printStackTrace(); | |
62 | + } | |
63 | + return null; | |
64 | + } | |
65 | + | |
66 | + | |
67 | + | |
68 | + | |
69 | +} | ... | ... |
app/src/main/java/com/monitorabrasil/monitoralegislativo/interfaces/RecyclerViewOnClickListenerHack.java
0 → 100644
... | ... | @@ -0,0 +1,10 @@ |
1 | +package com.monitorabrasil.monitoralegislativo.interfaces; | |
2 | + | |
3 | +import android.view.View; | |
4 | + | |
5 | +/** | |
6 | + * Created by viniciusthiengo on 4/5/15. | |
7 | + */ | |
8 | +public interface RecyclerViewOnClickListenerHack { | |
9 | + public void onClickListener(View view, int position); | |
10 | +} | ... | ... |
90.6 KB
14.3 KB
192 KB
... | ... | @@ -0,0 +1,31 @@ |
1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + xmlns:tools="http://schemas.android.com/tools" | |
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
4 | + xmlns:fab="http://schemas.android.com/apk/res-auto" | |
5 | + android:layout_width="match_parent" | |
6 | + android:layout_height="match_parent" | |
7 | + android:background="@color/grey" | |
8 | + android:orientation="vertical" | |
9 | + tools:context=".MainActivity"> | |
10 | + | |
11 | + <android.support.v7.widget.Toolbar | |
12 | + android:id="@+id/tb_main" | |
13 | + android:elevation="0dp" | |
14 | + android:layout_height="?attr/actionBarSize" | |
15 | + android:layout_width="match_parent" | |
16 | + android:minHeight="?attr/actionBarSize" | |
17 | + android:layout_alignParentLeft="true" | |
18 | + android:background="?attr/colorPrimary" | |
19 | + app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" /> | |
20 | + | |
21 | + | |
22 | + | |
23 | + <RelativeLayout | |
24 | + android:id="@+id/rl_fragment_container" | |
25 | + android:layout_width="match_parent" | |
26 | + android:layout_height="match_parent"> | |
27 | + </RelativeLayout> | |
28 | + | |
29 | + | |
30 | + | |
31 | +</LinearLayout> | ... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + xmlns:tools="http://schemas.android.com/tools" | |
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
4 | + android:layout_width="match_parent" | |
5 | + android:layout_height="match_parent" | |
6 | + android:paddingTop="@dimen/activity_horizontal_margin" | |
7 | + android:background="@color/grey" | |
8 | + android:orientation="vertical" | |
9 | + tools:context=".MainActivity"> | |
10 | + | |
11 | + <android.support.v7.widget.Toolbar | |
12 | + android:id="@+id/toolbar" | |
13 | + android:elevation="0dp" | |
14 | + android:layout_height="?attr/actionBarSize" | |
15 | + android:layout_width="match_parent" | |
16 | + android:minHeight="?attr/actionBarSize" | |
17 | + android:layout_alignParentLeft="true" | |
18 | + android:navigationIcon="@style/DrawerArrowStyle" | |
19 | + android:background="?attr/colorPrimary" | |
20 | + | |
21 | + /> | |
22 | + <RelativeLayout | |
23 | + android:id="@+id/rl_fragment_container" | |
24 | + android:layout_width="match_parent" | |
25 | + android:layout_height="match_parent"> | |
26 | + | |
27 | + </RelativeLayout> | |
28 | + </LinearLayout> | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
3 | + android:layout_height="match_parent" | |
4 | + tools:context="com.monitorabrasil.monitoralegislativo.fragments.HomeFragment"> | |
5 | + | |
6 | + <!-- TODO: Update blank fragment layout --> | |
7 | + <TextView android:layout_width="match_parent" android:layout_height="match_parent" | |
8 | + android:text="@string/hello_blank_fragment" /> | |
9 | + | |
10 | +</FrameLayout> | ... | ... |
... | ... | @@ -0,0 +1,13 @@ |
1 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + android:layout_width="match_parent" | |
3 | + android:layout_height="match_parent" | |
4 | + | |
5 | + > | |
6 | + | |
7 | + <android.support.v7.widget.RecyclerView | |
8 | + android:id="@+id/my_recycler_view" | |
9 | + android:scrollbars="vertical" | |
10 | + android:layout_width="match_parent" | |
11 | + android:layout_height="match_parent"/> | |
12 | + | |
13 | +</FrameLayout> | |
0 | 14 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,71 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:orientation="vertical" android:layout_width="match_parent" | |
4 | + android:layout_height="match_parent" | |
5 | + android:paddingLeft="@dimen/activity_vertical_margin" | |
6 | + android:paddingTop="5dp"> | |
7 | + <android.support.design.widget.TabLayout | |
8 | + android:layout_width="match_parent" | |
9 | + android:layout_height="30dp" | |
10 | + android:id="@+id/tabLayout" | |
11 | + > | |
12 | + | |
13 | + </android.support.design.widget.TabLayout> | |
14 | + | |
15 | + <ImageView | |
16 | + android:layout_width="150dp" | |
17 | + android:layout_height="150dp" | |
18 | + android:id="@+id/imageView" | |
19 | + android:layout_gravity="center_horizontal" | |
20 | + android:src="@drawable/person_1" /> | |
21 | + | |
22 | + <TextView | |
23 | + android:layout_width="wrap_content" | |
24 | + android:layout_height="wrap_content" | |
25 | + android:textAppearance="?android:attr/textAppearanceLarge" | |
26 | + android:text="Nome" | |
27 | + android:id="@+id/txtNome" | |
28 | + android:layout_gravity="center_horizontal" /> | |
29 | + | |
30 | + <TextView | |
31 | + android:layout_width="wrap_content" | |
32 | + android:layout_height="wrap_content" | |
33 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
34 | + android:text="Partido" | |
35 | + android:id="@+id/textView2" /> | |
36 | + | |
37 | + <TextView | |
38 | + android:layout_width="wrap_content" | |
39 | + android:layout_height="wrap_content" | |
40 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
41 | + android:text="Telefone" | |
42 | + android:id="@+id/textView3" /> | |
43 | + | |
44 | + <TextView | |
45 | + android:layout_width="wrap_content" | |
46 | + android:layout_height="wrap_content" | |
47 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
48 | + android:text="Email" | |
49 | + android:id="@+id/textView4" /> | |
50 | + | |
51 | + <TextView | |
52 | + android:layout_width="wrap_content" | |
53 | + android:layout_height="wrap_content" | |
54 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
55 | + android:text="Facebook" | |
56 | + android:id="@+id/textView5" /> | |
57 | + | |
58 | + <TextView | |
59 | + android:layout_width="wrap_content" | |
60 | + android:layout_height="wrap_content" | |
61 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
62 | + android:text="Gastos na campanha" | |
63 | + android:id="@+id/textView6" /> | |
64 | + | |
65 | + <TextView | |
66 | + android:layout_width="wrap_content" | |
67 | + android:layout_height="wrap_content" | |
68 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
69 | + android:text="Bens Declarados" | |
70 | + android:id="@+id/textView7" /> | |
71 | +</LinearLayout> | |
0 | 72 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,26 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:orientation="vertical" android:layout_width="match_parent" | |
4 | + android:layout_height="match_parent" | |
5 | + android:paddingTop="3dp" | |
6 | + android:paddingBottom="3dp"> | |
7 | + | |
8 | + <TextView | |
9 | + android:layout_width="wrap_content" | |
10 | + android:layout_height="wrap_content" | |
11 | + android:text="Vereador XXXXXX" | |
12 | + android:id="@+id/txtNome" | |
13 | + android:textSize="22dp" | |
14 | + android:textColor="@color/black" | |
15 | + android:textStyle="bold" | |
16 | + android:layout_marginLeft="@dimen/activity_horizontal_margin" | |
17 | + android:layout_marginTop="3dp" /> | |
18 | + | |
19 | + <TextView | |
20 | + android:layout_width="wrap_content" | |
21 | + android:layout_height="wrap_content" | |
22 | + android:textAppearance="?android:attr/textAppearanceMedium" | |
23 | + android:text="Partido" | |
24 | + android:id="@+id/txtPartido" | |
25 | + android:layout_marginLeft="20dp" /> | |
26 | +</LinearLayout> | |
0 | 27 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,6 @@ |
1 | +<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
3 | + xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> | |
4 | + <item android:id="@+id/action_settings" android:title="@string/action_settings" | |
5 | + android:orderInCategory="100" app:showAsAction="never" /> | |
6 | +</menu> | ... | ... |
... | ... | @@ -0,0 +1,7 @@ |
1 | +<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
3 | + xmlns:tools="http://schemas.android.com/tools" | |
4 | + tools:context="com.monitorabrasil.monitoralegislativo.PoliticosActivity"> | |
5 | + <item android:id="@+id/action_settings" android:title="@string/action_settings" | |
6 | + android:orderInCategory="100" app:showAsAction="never" /> | |
7 | +</menu> | ... | ... |
3.34 KB
2.15 KB
4.73 KB
7.54 KB
... | ... | @@ -0,0 +1,6 @@ |
1 | +<resources> | |
2 | + <!-- Example customization of dimensions originally defined in res/values/dimens.xml | |
3 | + (such as screen margins) for screens with more than 820dp of available width. This | |
4 | + would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | |
5 | + <dimen name="activity_horizontal_margin">64dp</dimen> | |
6 | +</resources> | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<resources> | |
3 | + <color name="grey">#ddd</color> | |
4 | + <color name="black">#000</color> | |
5 | + | |
6 | + <color name="colorPrimaryLight">#00c9af</color> | |
7 | + <color name="colorPrimary">#009688</color> | |
8 | + <color name="colorPrimaryDark">#00796B</color> | |
9 | + <color name="colorPrimarytext">#212121</color> | |
10 | + <color name="colorSecondText">#999</color> | |
11 | + <color name="coloLink">#1ea4f7</color> | |
12 | + <color name="colorDivider">#ccc</color> | |
13 | + | |
14 | + <color name="colorAccent">#795548</color> | |
15 | + | |
16 | + <color name="colorFAB">#FF9800</color> | |
17 | + <color name="colorFABPressed">#F57C00</color> | |
18 | +</resources> | |
19 | + | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +<resources> | |
2 | + <string name="app_name">MonitoraMunicipio</string> | |
3 | + | |
4 | + <string name="hello_world">Hello world!</string> | |
5 | + <string name="action_settings">Settings</string> | |
6 | + | |
7 | + <!-- TODO: Remove or change this placeholder text --> | |
8 | + <string name="hello_blank_fragment">Hello blank fragment</string> | |
9 | + <string name="navigation_drawer_open">opened</string> | |
10 | + <string name="navigation_drawer_close">closed</string> | |
11 | + <string name="title_activity_car">CarActivity</string> | |
12 | + <string name="action_transition_activity">Transition</string> | |
13 | + <string name="title_activity_transition">TransitionActivity</string> | |
14 | + <string name="title_activity_politicos">PoliticosActivity</string> | |
15 | +</resources> | ... | ... |
... | ... | @@ -0,0 +1,48 @@ |
1 | +<resources> | |
2 | + | |
3 | + <!-- Base application theme. --> | |
4 | + <style name="Theme.MyTheme" parent="MaterialDrawerTheme.Light.DarkToolbar.TranslucentStatus"> | |
5 | + <!-- colorPrimary is used for the default action bar background --> | |
6 | + <item name="colorPrimary">@color/colorPrimary</item> | |
7 | + | |
8 | + <!-- colorPrimaryDark is used for the status bar --> | |
9 | + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
10 | + | |
11 | + <!-- colorAccent is used as the default value for colorControlActivated, | |
12 | + which is used to tint widgets --> | |
13 | + <item name="colorAccent">@color/colorAccent</item> | |
14 | + | |
15 | + <!-- You can also set colorControlNormal, colorControlActivated | |
16 | + colorControlHighlight, and colorSwitchThumbNormal. --> | |
17 | + | |
18 | + <item name="colorControlNormal">@android:color/white</item> | |
19 | + | |
20 | + <!-- MaterialDrawer specific values --> | |
21 | + <item name="material_drawer_primary_text">@color/colorPrimarytext</item> | |
22 | + <item name="material_drawer_selected_text">@color/colorPrimary</item> | |
23 | + </style> | |
24 | + | |
25 | + <style name="Theme.MyThemeBottom" parent="Theme.MyTheme"> | |
26 | + <item name="colorPrimary">@android:color/white</item> | |
27 | + </style> | |
28 | + | |
29 | + <style name="MyAlertDialog" parent="MaterialDrawerBaseTheme.Light.Dialog"> | |
30 | + <item name="android:windowBackground">@null</item> | |
31 | + <item name="android:background">@null</item> | |
32 | + <item name="android:padding">0dp</item> | |
33 | + </style> | |
34 | + | |
35 | + <!-- Style arrow --> | |
36 | + <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> | |
37 | + <!-- this will set your arrow color --> | |
38 | + <item name="color">@android:color/black</item> | |
39 | + | |
40 | + <!-- You can customize other stuff too --> | |
41 | + <item name="spinBars">true</item> | |
42 | + <item name="thickness">3dp</item> | |
43 | + <item name="barSize">21dp</item> | |
44 | + <item name="drawableSize">48dp</item> | |
45 | + | |
46 | + </style> | |
47 | + | |
48 | +</resources> | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
2 | + | |
3 | +buildscript { | |
4 | + repositories { | |
5 | + jcenter() | |
6 | + } | |
7 | + dependencies { | |
8 | + classpath 'com.android.tools.build:gradle:1.2.3' | |
9 | + | |
10 | + // NOTE: Do not place your application dependencies here; they belong | |
11 | + // in the individual module build.gradle files | |
12 | + } | |
13 | +} | |
14 | + | |
15 | +allprojects { | |
16 | + repositories { | |
17 | + jcenter() | |
18 | + } | |
19 | +} | ... | ... |
... | ... | @@ -0,0 +1,82 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<items version="2" > | |
3 | + | |
4 | + <item | |
5 | + jar="/Users/geraugu/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.3.1/ecb6e1f8e4b0e84c4b886c2f14a1500caf309757/gson-2.3.1.jar" | |
6 | + jumboMode="false" | |
7 | + revision="23.0.0 rc2" | |
8 | + sha1="ecb6e1f8e4b0e84c4b886c2f14a1500caf309757"> | |
9 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/gson-2.3.1-15f2065dc9c45d8f097a420d0f96430a7f86f99c.jar" /> | |
10 | + </item> | |
11 | + <item | |
12 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.3/jars/classes.jar" | |
13 | + jumboMode="false" | |
14 | + revision="23.0.0 rc2" | |
15 | + sha1="4b8945fc23a7461c6fdde15753456d64b0a9358b"> | |
16 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-038b98c21a70b101292fa48686c0b39883bb7819.jar" /> | |
17 | + </item> | |
18 | + <item | |
19 | + jar="/Users/geraugu/.gradle/caches/modules-2/files-2.1/com.parse.bolts/bolts-android/1.2.0/6ee2953ccf51ce72b6d548c30c4633b99eb4f9dd/bolts-android-1.2.0.jar" | |
20 | + jumboMode="false" | |
21 | + revision="23.0.0 rc2" | |
22 | + sha1="6ee2953ccf51ce72b6d548c30c4633b99eb4f9dd"> | |
23 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/bolts-android-1.2.0-af46abb3f8d650c6ae4aa77b8e169dccb05595f8.jar" /> | |
24 | + </item> | |
25 | + <item | |
26 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars/libs/internal_impl-22.2.0.jar" | |
27 | + jumboMode="false" | |
28 | + revision="23.0.0 rc2" | |
29 | + sha1="57f2ab85c164ff1676ec64dee787981c046fab79"> | |
30 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/internal_impl-22.2.0-cd0fa37f0246382b1779bbace21bf44a7cb362ac.jar" /> | |
31 | + </item> | |
32 | + <item | |
33 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars/classes.jar" | |
34 | + jumboMode="false" | |
35 | + revision="23.0.0 rc2" | |
36 | + sha1="1ee588ff2c4daf7b97c1cbf922a6c7f027285c2f"> | |
37 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-74ca070d003e38231a8fead5c5b4c36a771b6da9.jar" /> | |
38 | + </item> | |
39 | + <item | |
40 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.6/jars/classes.jar" | |
41 | + jumboMode="false" | |
42 | + revision="23.0.0 rc2" | |
43 | + sha1="e5903cef3e56a5780845f4699d37331ec2710b2c"> | |
44 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-97ba54923af5c7743afe125fcf0b82144b29f76e.jar" /> | |
45 | + </item> | |
46 | + <item | |
47 | + jar="/Users/geraugu/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/22.2.0/support-annotations-22.2.0.jar" | |
48 | + jumboMode="false" | |
49 | + revision="23.0.0 rc2" | |
50 | + sha1="66b42a1f3eb7676070b7ef7f14b603483aecbee1"> | |
51 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/support-annotations-22.2.0-ca29a6d86f93b18656474850c1c5dd7475ef0c9b.jar" /> | |
52 | + </item> | |
53 | + <item | |
54 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars/classes.jar" | |
55 | + jumboMode="false" | |
56 | + revision="23.0.0 rc2" | |
57 | + sha1="73753982da6bde518f3a4c6b372749981d14d1a0"> | |
58 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-44da2753140f3fd20197805a166ed5a207586077.jar" /> | |
59 | + </item> | |
60 | + <item | |
61 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/libs/Parse-1.9.2.jar" | |
62 | + jumboMode="false" | |
63 | + revision="23.0.0 rc2" | |
64 | + sha1="fe739334780fe321141e62720822c2d456061899"> | |
65 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/Parse-1.9.2-05d7e53a3d649de3d369838173795dcf91cab83c.jar" /> | |
66 | + </item> | |
67 | + <item | |
68 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars/classes.jar" | |
69 | + jumboMode="false" | |
70 | + revision="23.0.0 rc2" | |
71 | + sha1="1520399b5434780b68c85c0e9266caa2f381ada3"> | |
72 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-a54739dc8a54c329e679b81e7edf46929d3c9f34.jar" /> | |
73 | + </item> | |
74 | + <item | |
75 | + jar="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/exploded-aar/com.android.support/design/22.2.0/jars/classes.jar" | |
76 | + jumboMode="false" | |
77 | + revision="23.0.0 rc2" | |
78 | + sha1="fc63b820d54c8a27a3a614bdd93920e0076581c2"> | |
79 | + <dex dex="/Users/geraugu/Documents/Projects/MonitoraMunicipio/app/build/intermediates/pre-dexed/debug/classes-2895b5860558fa9dd2a386bfa233fb15fa84c3e9.jar" /> | |
80 | + </item> | |
81 | + | |
82 | +</items> | ... | ... |
No preview for this file type
... | ... | @@ -0,0 +1,18 @@ |
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 | +# Default value: -Xmx10248m -XX:MaxPermSize=256m | |
13 | +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | |
14 | + | |
15 | +# When configured, Gradle will run in incubating parallel mode. | |
16 | +# This option should only be used with decoupled projects. More details, visit | |
17 | +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | |
18 | +# org.gradle.parallel=true | |
0 | 19 | \ No newline at end of file | ... | ... |
No preview for this file type
... | ... | @@ -0,0 +1,164 @@ |
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 | +# For Cygwin, ensure paths are in UNIX format before anything is touched. | |
46 | +if $cygwin ; then | |
47 | + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` | |
48 | +fi | |
49 | + | |
50 | +# Attempt to set APP_HOME | |
51 | +# Resolve links: $0 may be a link | |
52 | +PRG="$0" | |
53 | +# Need this for relative symlinks. | |
54 | +while [ -h "$PRG" ] ; do | |
55 | + ls=`ls -ld "$PRG"` | |
56 | + link=`expr "$ls" : '.*-> \(.*\)$'` | |
57 | + if expr "$link" : '/.*' > /dev/null; then | |
58 | + PRG="$link" | |
59 | + else | |
60 | + PRG=`dirname "$PRG"`"/$link" | |
61 | + fi | |
62 | +done | |
63 | +SAVED="`pwd`" | |
64 | +cd "`dirname \"$PRG\"`/" >&- | |
65 | +APP_HOME="`pwd -P`" | |
66 | +cd "$SAVED" >&- | |
67 | + | |
68 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | |
69 | + | |
70 | +# Determine the Java command to use to start the JVM. | |
71 | +if [ -n "$JAVA_HOME" ] ; then | |
72 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | |
73 | + # IBM's JDK on AIX uses strange locations for the executables | |
74 | + JAVACMD="$JAVA_HOME/jre/sh/java" | |
75 | + else | |
76 | + JAVACMD="$JAVA_HOME/bin/java" | |
77 | + fi | |
78 | + if [ ! -x "$JAVACMD" ] ; then | |
79 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | |
80 | + | |
81 | +Please set the JAVA_HOME variable in your environment to match the | |
82 | +location of your Java installation." | |
83 | + fi | |
84 | +else | |
85 | + JAVACMD="java" | |
86 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | |
87 | + | |
88 | +Please set the JAVA_HOME variable in your environment to match the | |
89 | +location of your Java installation." | |
90 | +fi | |
91 | + | |
92 | +# Increase the maximum file descriptors if we can. | |
93 | +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then | |
94 | + MAX_FD_LIMIT=`ulimit -H -n` | |
95 | + if [ $? -eq 0 ] ; then | |
96 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | |
97 | + MAX_FD="$MAX_FD_LIMIT" | |
98 | + fi | |
99 | + ulimit -n $MAX_FD | |
100 | + if [ $? -ne 0 ] ; then | |
101 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | |
102 | + fi | |
103 | + else | |
104 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | |
105 | + fi | |
106 | +fi | |
107 | + | |
108 | +# For Darwin, add options to specify how the application appears in the dock | |
109 | +if $darwin; then | |
110 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | |
111 | +fi | |
112 | + | |
113 | +# For Cygwin, switch paths to Windows format before running java | |
114 | +if $cygwin ; then | |
115 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | |
116 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | |
117 | + | |
118 | + # We build the pattern for arguments to be converted via cygpath | |
119 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | |
120 | + SEP="" | |
121 | + for dir in $ROOTDIRSRAW ; do | |
122 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | |
123 | + SEP="|" | |
124 | + done | |
125 | + OURCYGPATTERN="(^($ROOTDIRS))" | |
126 | + # Add a user-defined pattern to the cygpath arguments | |
127 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | |
128 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | |
129 | + fi | |
130 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | |
131 | + i=0 | |
132 | + for arg in "$@" ; do | |
133 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | |
134 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | |
135 | + | |
136 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | |
137 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | |
138 | + else | |
139 | + eval `echo args$i`="\"$arg\"" | |
140 | + fi | |
141 | + i=$((i+1)) | |
142 | + done | |
143 | + case $i in | |
144 | + (0) set -- ;; | |
145 | + (1) set -- "$args0" ;; | |
146 | + (2) set -- "$args0" "$args1" ;; | |
147 | + (3) set -- "$args0" "$args1" "$args2" ;; | |
148 | + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | |
149 | + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | |
150 | + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | |
151 | + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | |
152 | + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | |
153 | + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | |
154 | + esac | |
155 | +fi | |
156 | + | |
157 | +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules | |
158 | +function splitJvmOpts() { | |
159 | + JVM_OPTS=("$@") | |
160 | +} | |
161 | +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS | |
162 | +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" | |
163 | + | |
164 | +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" | ... | ... |
... | ... | @@ -0,0 +1,90 @@ |
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 | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +## This file is automatically generated by Android Studio. | |
2 | +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | |
3 | +# | |
4 | +# This file should *NOT* be checked into Version Control Systems, | |
5 | +# as it contains information specific to your local configuration. | |
6 | +# | |
7 | +# Location of the SDK. This is only used by Gradle. | |
8 | +# For customization when using a Version Control System, please read the | |
9 | +# header note. | |
10 | +sdk.dir=/Users/geraugu/Library/Android/sdk | |
0 | 11 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1 @@ |
1 | +include ':app' | ... | ... |