Commit 2072b1478b20b873519682be72bd21087e8ae398
1 parent
540bb41c
Exists in
master
iniciando os modulos de projetos e da camara
Showing
22 changed files
with
617 additions
and
34 deletions
Show diff stats
app/app.iml
1 | <?xml version="1.0" encoding="UTF-8"?> | 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"> | 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="monitoraLegislativo" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> |
3 | <component name="FacetManager"> | 3 | <component name="FacetManager"> |
4 | <facet type="android-gradle" name="Android-Gradle"> | 4 | <facet type="android-gradle" name="Android-Gradle"> |
5 | <configuration> | 5 | <configuration> |
@@ -70,11 +70,17 @@ | @@ -70,11 +70,17 @@ | ||
70 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> | 70 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> |
71 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" /> | 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" /> | 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/cardview-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/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/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.android.support/support-v4/22.2.0/jars" /> |
77 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.crashlytics.sdk.android/answers/1.2.2/jars" /> | ||
78 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.crashlytics.sdk.android/beta/1.1.3/jars" /> | ||
79 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.crashlytics.sdk.android/crashlytics-core/2.3.3/jars" /> | ||
80 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.crashlytics.sdk.android/crashlytics/2.4.0/jars" /> | ||
76 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics/1.0.2/jars" /> | 81 | <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" /> | 82 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/materialdrawer/3.0.6/jars" /> |
83 | + <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/io.fabric.sdk.android/fabric/1.3.4/jars" /> | ||
78 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | 84 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> |
79 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> | 85 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> |
80 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" /> | 86 | <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" /> |
@@ -93,14 +99,21 @@ | @@ -93,14 +99,21 @@ | ||
93 | <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> | 99 | <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> |
94 | <orderEntry type="sourceFolder" forTests="false" /> | 100 | <orderEntry type="sourceFolder" forTests="false" /> |
95 | <orderEntry type="library" exported="" name="gson-2.3.1" level="project" /> | 101 | <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" /> | 102 | <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" /> | 103 | + <orderEntry type="library" exported="" name="fabric-1.3.4" level="project" /> |
104 | + <orderEntry type="library" exported="" name="beta-1.1.3" level="project" /> | ||
100 | <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" /> | 105 | <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" /> | 106 | + <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" /> |
107 | + <orderEntry type="library" exported="" name="crashlytics-core-2.3.3" level="project" /> | ||
102 | <orderEntry type="library" exported="" name="materialdrawer-3.0.6" level="project" /> | 108 | <orderEntry type="library" exported="" name="materialdrawer-3.0.6" level="project" /> |
103 | <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" /> | 109 | <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" /> |
110 | + <orderEntry type="library" exported="" name="crashlytics-2.4.0" level="project" /> | ||
111 | + <orderEntry type="library" exported="" name="Parse-1.9.2" level="project" /> | ||
104 | <orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" /> | 112 | <orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" /> |
113 | + <orderEntry type="library" exported="" name="MPAndroidChart-v2.1.0" level="project" /> | ||
114 | + <orderEntry type="library" exported="" name="bolts-android-1.2.0" level="project" /> | ||
115 | + <orderEntry type="library" exported="" name="design-22.2.0" level="project" /> | ||
116 | + <orderEntry type="library" exported="" name="answers-1.2.2" level="project" /> | ||
117 | + <orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" /> | ||
105 | </component> | 118 | </component> |
106 | </module> | 119 | </module> |
107 | \ No newline at end of file | 120 | \ No newline at end of file |
app/build.gradle
1 | +buildscript { | ||
2 | + repositories { | ||
3 | + maven { url 'https://maven.fabric.io/public' } | ||
4 | + } | ||
5 | + | ||
6 | + dependencies { | ||
7 | + classpath 'io.fabric.tools:gradle:1.+' | ||
8 | + } | ||
9 | +} | ||
1 | apply plugin: 'com.android.application' | 10 | apply plugin: 'com.android.application' |
11 | +apply plugin: 'io.fabric' | ||
12 | + | ||
13 | +repositories { | ||
14 | + maven { url 'https://maven.fabric.io/public' } | ||
15 | +} | ||
16 | + | ||
2 | 17 | ||
3 | android { | 18 | android { |
4 | compileSdkVersion 22 | 19 | compileSdkVersion 22 |
@@ -8,8 +23,8 @@ android { | @@ -8,8 +23,8 @@ android { | ||
8 | applicationId "com.monitorabrasil.monitoramunicipio" | 23 | applicationId "com.monitorabrasil.monitoramunicipio" |
9 | minSdkVersion 15 | 24 | minSdkVersion 15 |
10 | targetSdkVersion 22 | 25 | targetSdkVersion 22 |
11 | - versionCode 1 | ||
12 | - versionName "1.0" | 26 | + versionCode 2 |
27 | + versionName "0.2" | ||
13 | } | 28 | } |
14 | buildTypes { | 29 | buildTypes { |
15 | release { | 30 | release { |
@@ -23,6 +38,7 @@ dependencies { | @@ -23,6 +38,7 @@ dependencies { | ||
23 | compile fileTree(dir: 'libs', include: ['*.jar']) | 38 | compile fileTree(dir: 'libs', include: ['*.jar']) |
24 | compile 'com.android.support:appcompat-v7:22.2.0' | 39 | compile 'com.android.support:appcompat-v7:22.2.0' |
25 | compile 'com.android.support:recyclerview-v7:21.0.3' | 40 | compile 'com.android.support:recyclerview-v7:21.0.3' |
41 | + compile 'com.android.support:cardview-v7:22.2.0' | ||
26 | compile 'com.android.support:design:22.2.0' | 42 | compile 'com.android.support:design:22.2.0' |
27 | 43 | ||
28 | 44 | ||
@@ -32,4 +48,8 @@ dependencies { | @@ -32,4 +48,8 @@ dependencies { | ||
32 | compile 'com.parse.bolts:bolts-android:1.+' | 48 | compile 'com.parse.bolts:bolts-android:1.+' |
33 | compile fileTree(dir: 'libs', include: 'Parse-*.jar') | 49 | compile fileTree(dir: 'libs', include: 'Parse-*.jar') |
34 | compile 'com.google.code.gson:gson:2.3.1' | 50 | compile 'com.google.code.gson:gson:2.3.1' |
51 | + compile 'com.github.PhilJay:MPAndroidChart:v2.1.0' | ||
52 | + compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') { | ||
53 | + transitive = true; | ||
54 | + } | ||
35 | } | 55 | } |
app/src/main/AndroidManifest.xml
@@ -7,11 +7,11 @@ | @@ -7,11 +7,11 @@ | ||
7 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | 7 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
8 | 8 | ||
9 | <application | 9 | <application |
10 | + android:name=".application.MyApp" | ||
10 | android:allowBackup="true" | 11 | android:allowBackup="true" |
11 | android:icon="@mipmap/ic_launcher" | 12 | android:icon="@mipmap/ic_launcher" |
12 | android:label="@string/app_name" | 13 | android:label="@string/app_name" |
13 | - android:theme="@style/Theme.MyTheme" | ||
14 | - android:name=".application.MyApp"> | 14 | + android:theme="@style/Theme.MyTheme" > |
15 | <activity | 15 | <activity |
16 | android:name=".MainActivity" | 16 | android:name=".MainActivity" |
17 | android:label="@string/app_name" > | 17 | android:label="@string/app_name" > |
@@ -24,6 +24,28 @@ | @@ -24,6 +24,28 @@ | ||
24 | <activity | 24 | <activity |
25 | android:name=".PoliticosActivity" | 25 | android:name=".PoliticosActivity" |
26 | android:label="@string/title_activity_politicos" | 26 | android:label="@string/title_activity_politicos" |
27 | + android:parentActivityName=".MainActivity" | ||
28 | + android:theme="@style/Theme.MyTheme" > | ||
29 | + <meta-data | ||
30 | + android:name="android.support.PARENT_ACTIVITY" | ||
31 | + android:value="com.monitorabrasil.monitoralegislativo.MainActivity" /> | ||
32 | + </activity> | ||
33 | + | ||
34 | + <meta-data | ||
35 | + android:name="io.fabric.ApiKey" | ||
36 | + android:value="fb370c047719aaf76293ffecd977d8476584bbee" /> | ||
37 | + | ||
38 | + <activity | ||
39 | + android:name=".CamaraActivity" | ||
40 | + android:label="@string/title_activity_camara" | ||
41 | + android:parentActivityName=".MainActivity" > | ||
42 | + <meta-data | ||
43 | + android:name="android.support.PARENT_ACTIVITY" | ||
44 | + android:value="com.monitorabrasil.monitoralegislativo.MainActivity" /> | ||
45 | + </activity> | ||
46 | + <activity | ||
47 | + android:name=".ProjetosActivity" | ||
48 | + android:label="@string/title_activity_projetos" | ||
27 | android:parentActivityName=".MainActivity" > | 49 | android:parentActivityName=".MainActivity" > |
28 | <meta-data | 50 | <meta-data |
29 | android:name="android.support.PARENT_ACTIVITY" | 51 | android:name="android.support.PARENT_ACTIVITY" |
app/src/main/java/com/monitorabrasil/monitoralegislativo/MainActivity.java
@@ -132,11 +132,19 @@ public class MainActivity extends AppCompatActivity implements HomeFragment.OnFr | @@ -132,11 +132,19 @@ public class MainActivity extends AppCompatActivity implements HomeFragment.OnFr | ||
132 | } | 132 | } |
133 | break; | 133 | break; |
134 | 134 | ||
135 | + | ||
135 | case 2: | 136 | case 2: |
136 | startActivity(new Intent(getApplicationContext(), PoliticosActivity.class)); | 137 | startActivity(new Intent(getApplicationContext(), PoliticosActivity.class)); |
138 | + break; | ||
137 | 139 | ||
140 | + case 3: | ||
141 | + startActivity(new Intent(getApplicationContext(),ProjetosActivity.class)); | ||
142 | + break; | ||
138 | 143 | ||
144 | + case 4: | ||
145 | + startActivity(new Intent(getApplicationContext(), CamaraActivity.class)); | ||
139 | break; | 146 | break; |
147 | + | ||
140 | } | 148 | } |
141 | navigationDrawerLeft.closeDrawer(); | 149 | navigationDrawerLeft.closeDrawer(); |
142 | 150 |
app/src/main/java/com/monitorabrasil/monitoralegislativo/PoliticosActivity.java
@@ -32,6 +32,9 @@ public class PoliticosActivity extends AppCompatActivity { | @@ -32,6 +32,9 @@ public class PoliticosActivity extends AppCompatActivity { | ||
32 | // toolbar.setNavigationIcon(R.drawable.ic_good); | 32 | // toolbar.setNavigationIcon(R.drawable.ic_good); |
33 | toolbar.setTitle("Vereadores"); | 33 | toolbar.setTitle("Vereadores"); |
34 | toolbar.setSubtitle("Ouro Branco - MG"); | 34 | toolbar.setSubtitle("Ouro Branco - MG"); |
35 | + | ||
36 | + toolbar.setTitleTextColor(getResources().getColor(R.color.md_white_1000)); | ||
37 | + toolbar.setSubtitleTextColor(getResources().getColor(R.color.md_white_1000)); | ||
35 | setSupportActionBar(toolbar); | 38 | setSupportActionBar(toolbar); |
36 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); | 39 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
37 | // toolbar.setLogo(R.drawable.ic_launcher); | 40 | // toolbar.setLogo(R.drawable.ic_launcher); |
@@ -41,7 +44,7 @@ public class PoliticosActivity extends AppCompatActivity { | @@ -41,7 +44,7 @@ public class PoliticosActivity extends AppCompatActivity { | ||
41 | @Override | 44 | @Override |
42 | public boolean onCreateOptionsMenu(Menu menu) { | 45 | public boolean onCreateOptionsMenu(Menu menu) { |
43 | // Inflate the menu; this adds items to the action bar if it is present. | 46 | // Inflate the menu; this adds items to the action bar if it is present. |
44 | - getMenuInflater().inflate(R.menu.menu_politicos, menu); | 47 | +// getMenuInflater().inflate(R.menu.menu_politicos, menu); |
45 | return true; | 48 | return true; |
46 | } | 49 | } |
47 | 50 |
app/src/main/java/com/monitorabrasil/monitoralegislativo/ProjetosActivity.java
0 → 100644
@@ -0,0 +1,62 @@ | @@ -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.widget.Toolbar; | ||
7 | +import android.view.Menu; | ||
8 | +import android.view.MenuItem; | ||
9 | + | ||
10 | +import com.monitorabrasil.monitoralegislativo.R; | ||
11 | +import com.monitorabrasil.monitoralegislativo.fragments.ListaPoliticoFragment; | ||
12 | +import com.monitorabrasil.monitoralegislativo.fragments.ListaProjetosFragment; | ||
13 | + | ||
14 | +public class ProjetosActivity extends ActionBarActivity { | ||
15 | + | ||
16 | + @Override | ||
17 | + protected void onCreate(Bundle savedInstanceState) { | ||
18 | + super.onCreate(savedInstanceState); | ||
19 | + setContentView(R.layout.activity_projetos); | ||
20 | + ListaProjetosFragment frag = (ListaProjetosFragment) getSupportFragmentManager().findFragmentByTag("listaProjFrag"); | ||
21 | + if(frag == null) { | ||
22 | + frag = new ListaProjetosFragment(); | ||
23 | + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | ||
24 | + ft.replace(R.id.rl_fragment_container, frag, "listaProjFrag"); | ||
25 | + ft.commit(); | ||
26 | + } | ||
27 | + | ||
28 | + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
29 | + setSupportActionBar(toolbar); | ||
30 | + | ||
31 | + // toolbar.setNavigationIcon(R.drawable.ic_good); | ||
32 | + toolbar.setTitle("Projetos"); | ||
33 | + toolbar.setSubtitle("Ouro Branco - MG"); | ||
34 | + | ||
35 | + toolbar.setTitleTextColor(getResources().getColor(R.color.md_white_1000)); | ||
36 | + toolbar.setSubtitleTextColor(getResources().getColor(R.color.md_white_1000)); | ||
37 | + setSupportActionBar(toolbar); | ||
38 | + getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
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_projetos, 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/ProjetoAdapter.java
0 → 100644
@@ -0,0 +1,112 @@ | @@ -0,0 +1,112 @@ | ||
1 | +package com.monitorabrasil.monitoralegislativo.adapters; | ||
2 | + | ||
3 | +import android.support.design.widget.Snackbar; | ||
4 | +import android.support.v7.widget.RecyclerView; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.Button; | ||
9 | +import android.widget.TextView; | ||
10 | + | ||
11 | +import com.monitorabrasil.monitoralegislativo.R; | ||
12 | +import com.monitorabrasil.monitoralegislativo.interfaces.RecyclerViewOnClickListenerHack; | ||
13 | +import com.parse.ParseException; | ||
14 | +import com.parse.ParseObject; | ||
15 | + | ||
16 | +import org.w3c.dom.Text; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | + | ||
20 | +/** | ||
21 | + * Created by geral_000 on 25/06/2015. | ||
22 | + */ | ||
23 | +public class ProjetoAdapter extends RecyclerView.Adapter<ProjetoAdapter.ViewHolder> { | ||
24 | + | ||
25 | + private List<ParseObject> mDataset; | ||
26 | + private RecyclerViewOnClickListenerHack mRecyclerViewOnClickListenerHack; | ||
27 | + | ||
28 | + // Provide a reference to the views for each data item | ||
29 | + // Complex data items may need more than one view per item, and | ||
30 | + // you provide access to all the views for a data item in a view holder | ||
31 | + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ | ||
32 | + // each data item is just a string in this case | ||
33 | + public TextView classificacao; | ||
34 | + public TextView data; | ||
35 | + public TextView autor; | ||
36 | + public TextView descricao; | ||
37 | + public Button btnConcordo; | ||
38 | + public Button btnDiscordo; | ||
39 | + public ViewHolder(View v) { | ||
40 | + super(v); | ||
41 | + classificacao = (TextView) v.findViewById(R.id.classificacao); | ||
42 | + data = (TextView) v.findViewById(R.id.data); | ||
43 | + autor = (TextView) v.findViewById(R.id.autor); | ||
44 | + descricao = (TextView) v.findViewById(R.id.descricao); | ||
45 | + btnConcordo = (Button) v.findViewById(R.id.btnConcordo); | ||
46 | + btnDiscordo = (Button) v.findViewById(R.id.btnDiscordo); | ||
47 | + | ||
48 | + itemView.setOnClickListener(this); | ||
49 | + } | ||
50 | + | ||
51 | + @Override | ||
52 | + public void onClick(View v) { | ||
53 | + if(mRecyclerViewOnClickListenerHack != null){ | ||
54 | + mRecyclerViewOnClickListenerHack.onClickListener(v, getPosition()); | ||
55 | + } | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + public ProjetoAdapter(List<ParseObject> myDataset) { | ||
60 | + mDataset = myDataset; | ||
61 | + } | ||
62 | + | ||
63 | + @Override | ||
64 | + public ProjetoAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { | ||
65 | + // create a new view | ||
66 | + View v = LayoutInflater.from(viewGroup.getContext()) | ||
67 | + .inflate(R.layout.item_projeto, viewGroup, false); | ||
68 | + // set the view's size, margins, paddings and layout parameter | ||
69 | + ViewHolder vh = new ViewHolder(v); | ||
70 | + return vh; | ||
71 | + } | ||
72 | + | ||
73 | + @Override | ||
74 | + public void onBindViewHolder(final ViewHolder viewHolder, int i) { | ||
75 | + ParseObject projeto = mDataset.get(i); | ||
76 | + viewHolder.classificacao.setText(projeto.get("classificacao").toString()); | ||
77 | + viewHolder.data.setText(projeto.get("data").toString()); | ||
78 | + viewHolder.descricao.setText(projeto.get("descricao").toString()); | ||
79 | + ParseObject autor = (ParseObject) projeto.get("politico"); | ||
80 | + try { | ||
81 | + autor.fetchFromLocalDatastore(); | ||
82 | + viewHolder.autor.setText(autor.get("nome").toString()); | ||
83 | + } catch (ParseException e) { | ||
84 | + e.printStackTrace(); | ||
85 | + } | ||
86 | + | ||
87 | + viewHolder.btnConcordo.setOnClickListener(new View.OnClickListener() { | ||
88 | + @Override | ||
89 | + public void onClick(View v) { | ||
90 | + Snackbar.make(v, "Voto registrado para "+viewHolder.classificacao.getText().toString(), Snackbar.LENGTH_LONG) | ||
91 | + .setAction("Action", null).show(); | ||
92 | + } | ||
93 | + }); | ||
94 | + | ||
95 | + viewHolder.btnDiscordo.setOnClickListener(new View.OnClickListener() { | ||
96 | + @Override | ||
97 | + public void onClick(View v) { | ||
98 | + Snackbar.make(v, "Voto registrado para "+viewHolder.classificacao.getText().toString(), Snackbar.LENGTH_LONG) | ||
99 | + .setAction("Action", null).show(); | ||
100 | + } | ||
101 | + }); | ||
102 | + } | ||
103 | + | ||
104 | + public void setRecyclerViewOnClickListenerHack(RecyclerViewOnClickListenerHack r){ | ||
105 | + mRecyclerViewOnClickListenerHack = r; | ||
106 | + } | ||
107 | + | ||
108 | + @Override | ||
109 | + public int getItemCount() { | ||
110 | + return mDataset.size(); | ||
111 | + } | ||
112 | +} |
app/src/main/java/com/monitorabrasil/monitoralegislativo/adapters/VereadorAdapter.java
@@ -63,6 +63,7 @@ public class VereadorAdapter extends RecyclerView.Adapter<VereadorAdapter.ViewHo | @@ -63,6 +63,7 @@ public class VereadorAdapter extends RecyclerView.Adapter<VereadorAdapter.ViewHo | ||
63 | @Override | 63 | @Override |
64 | public void onBindViewHolder(VereadorAdapter.ViewHolder viewHolder, int i) { | 64 | public void onBindViewHolder(VereadorAdapter.ViewHolder viewHolder, int i) { |
65 | ParseObject vereador = mDataset.get(i); | 65 | ParseObject vereador = mDataset.get(i); |
66 | + vereador.pinInBackground(); | ||
66 | viewHolder.mTextView.setText(vereador.get("nome").toString()); | 67 | viewHolder.mTextView.setText(vereador.get("nome").toString()); |
67 | viewHolder.txtPartido.setText(vereador.get("partido").toString()); | 68 | viewHolder.txtPartido.setText(vereador.get("partido").toString()); |
68 | } | 69 | } |
app/src/main/java/com/monitorabrasil/monitoralegislativo/application/MyApp.java
@@ -4,6 +4,8 @@ import android.app.Application; | @@ -4,6 +4,8 @@ import android.app.Application; | ||
4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
5 | 5 | ||
6 | import com.parse.Parse; | 6 | import com.parse.Parse; |
7 | +import com.crashlytics.android.Crashlytics; | ||
8 | +import io.fabric.sdk.android.Fabric; | ||
7 | 9 | ||
8 | /** | 10 | /** |
9 | * Created by geraugu on 6/10/15. | 11 | * Created by geraugu on 6/10/15. |
@@ -13,9 +15,14 @@ public class MyApp extends Application { | @@ -13,9 +15,14 @@ public class MyApp extends Application { | ||
13 | @Override | 15 | @Override |
14 | public void onCreate() { | 16 | public void onCreate() { |
15 | super.onCreate(); | 17 | super.onCreate(); |
18 | + Fabric.with(this, new Crashlytics()); | ||
16 | // Enable Local Datastore. | 19 | // Enable Local Datastore. |
17 | 20 | ||
18 | Parse.enableLocalDatastore(this); | 21 | Parse.enableLocalDatastore(this); |
19 | Parse.initialize(this, "pcGL19NalihMwcHaKnTuYpLkQU4ndrCH2Yxx9von", "tdWwopcuTXJ2ysxZW7pc9ZcZQCmqPSWwSokzCEzl"); | 22 | Parse.initialize(this, "pcGL19NalihMwcHaKnTuYpLkQU4ndrCH2Yxx9von", "tdWwopcuTXJ2ysxZW7pc9ZcZQCmqPSWwSokzCEzl"); |
20 | } | 23 | } |
24 | + | ||
25 | + public String getCidade(){ | ||
26 | + return "Ouro Branco - MG"; | ||
27 | + } | ||
21 | } | 28 | } |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/ListaPoliticoFragment.java
@@ -9,6 +9,7 @@ import android.util.Log; | @@ -9,6 +9,7 @@ import android.util.Log; | ||
9 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
10 | import android.view.View; | 10 | import android.view.View; |
11 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
12 | +import android.widget.ProgressBar; | ||
12 | import android.widget.Toast; | 13 | import android.widget.Toast; |
13 | 14 | ||
14 | import com.google.gson.Gson; | 15 | import com.google.gson.Gson; |
@@ -29,8 +30,8 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | @@ -29,8 +30,8 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | ||
29 | 30 | ||
30 | private RecyclerView mRecyclerView; | 31 | private RecyclerView mRecyclerView; |
31 | private VereadorAdapter mAdapter; | 32 | private VereadorAdapter mAdapter; |
32 | - private RecyclerView.LayoutManager mLayoutManager; | ||
33 | private List<ParseObject> ob; | 33 | private List<ParseObject> ob; |
34 | + private ProgressBar pb; | ||
34 | 35 | ||
35 | @Override | 36 | @Override |
36 | public View onCreateView(LayoutInflater inflater, | 37 | public View onCreateView(LayoutInflater inflater, |
@@ -38,6 +39,9 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | @@ -38,6 +39,9 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | ||
38 | Bundle savedInstanceState) { | 39 | Bundle savedInstanceState) { |
39 | View view = inflater.inflate(R.layout.fragment_list_politico, container, false); | 40 | View view = inflater.inflate(R.layout.fragment_list_politico, container, false); |
40 | 41 | ||
42 | + pb = (ProgressBar) view.findViewById(R.id.progressBar); | ||
43 | + | ||
44 | + | ||
41 | //tableview | 45 | //tableview |
42 | mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view); | 46 | mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view); |
43 | 47 | ||
@@ -79,6 +83,7 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | @@ -79,6 +83,7 @@ public class ListaPoliticoFragment extends Fragment implements RecyclerViewOnCli | ||
79 | mAdapter = new VereadorAdapter(list); | 83 | mAdapter = new VereadorAdapter(list); |
80 | mAdapter.setRecyclerViewOnClickListenerHack(this); | 84 | mAdapter.setRecyclerViewOnClickListenerHack(this); |
81 | mRecyclerView.setAdapter(mAdapter); | 85 | mRecyclerView.setAdapter(mAdapter); |
86 | + pb.setVisibility(View.INVISIBLE); | ||
82 | } | 87 | } |
83 | 88 | ||
84 | 89 |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/ListaProjetosFragment.java
0 → 100644
@@ -0,0 +1,108 @@ | @@ -0,0 +1,108 @@ | ||
1 | +package com.monitorabrasil.monitoralegislativo.fragments; | ||
2 | + | ||
3 | + | ||
4 | +import android.os.Bundle; | ||
5 | +import android.support.v4.app.Fragment; | ||
6 | +import android.support.v4.app.FragmentTransaction; | ||
7 | +import android.support.v7.widget.LinearLayoutManager; | ||
8 | +import android.support.v7.widget.RecyclerView; | ||
9 | +import android.util.Log; | ||
10 | +import android.view.LayoutInflater; | ||
11 | +import android.view.View; | ||
12 | +import android.view.ViewGroup; | ||
13 | +import android.widget.ProgressBar; | ||
14 | + | ||
15 | +import com.monitorabrasil.monitoralegislativo.R; | ||
16 | +import com.monitorabrasil.monitoralegislativo.adapters.ProjetoAdapter; | ||
17 | +import com.monitorabrasil.monitoralegislativo.adapters.VereadorAdapter; | ||
18 | +import com.monitorabrasil.monitoralegislativo.interfaces.RecyclerViewOnClickListenerHack; | ||
19 | +import com.parse.FindCallback; | ||
20 | +import com.parse.ParseException; | ||
21 | +import com.parse.ParseObject; | ||
22 | +import com.parse.ParseQuery; | ||
23 | + | ||
24 | +import java.util.List; | ||
25 | + | ||
26 | +/** | ||
27 | + * A simple {@link Fragment} subclass. | ||
28 | + */ | ||
29 | +public class ListaProjetosFragment extends Fragment implements RecyclerViewOnClickListenerHack { | ||
30 | + | ||
31 | + private RecyclerView mRecyclerView; | ||
32 | + private ProjetoAdapter mAdapter; | ||
33 | + private List<ParseObject> ob; | ||
34 | + private ProgressBar pb; | ||
35 | + public ListaProjetosFragment() { | ||
36 | + // Required empty public constructor | ||
37 | + } | ||
38 | + | ||
39 | + | ||
40 | + @Override | ||
41 | + public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||
42 | + Bundle savedInstanceState) { | ||
43 | + // Inflate the layout for this fragment | ||
44 | + View view = inflater.inflate(R.layout.fragment_lista_projetos, container, false); | ||
45 | + | ||
46 | + pb = (ProgressBar) view.findViewById(R.id.progressBar); | ||
47 | + | ||
48 | + | ||
49 | + //tableview | ||
50 | + mRecyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view); | ||
51 | + | ||
52 | + // use this setting to improve performance if you know that changes | ||
53 | + // in content do not change the layout size of the RecyclerView | ||
54 | + mRecyclerView.setHasFixedSize(true); | ||
55 | + | ||
56 | + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); | ||
57 | + llm.setOrientation(LinearLayoutManager.VERTICAL); | ||
58 | + mRecyclerView.setLayoutManager(llm); | ||
59 | + | ||
60 | + buscaProjetos(); | ||
61 | + return view; | ||
62 | + } | ||
63 | + | ||
64 | + public void buscaProjetos(){ | ||
65 | + ParseQuery<ParseObject> query = ParseQuery.getQuery("Projeto"); | ||
66 | + query.addDescendingOrder("createdAt"); | ||
67 | + //query.whereEqualTo("playerName", "Dan Stemkoski"); | ||
68 | + query.findInBackground(new FindCallback<ParseObject>() { | ||
69 | + @Override | ||
70 | + public void done(List<ParseObject> list, com.parse.ParseException e) { | ||
71 | + if (e == null) { | ||
72 | + ob = list; | ||
73 | + carregaList(list); | ||
74 | + } else { | ||
75 | + Log.d("score", "Error: " + e.getMessage()); | ||
76 | + } | ||
77 | + } | ||
78 | + | ||
79 | + | ||
80 | + }); | ||
81 | + } | ||
82 | + public void carregaList(List<ParseObject> list){ | ||
83 | + mAdapter = new ProjetoAdapter(list); | ||
84 | + mAdapter.setRecyclerViewOnClickListenerHack(this); | ||
85 | + mRecyclerView.setAdapter(mAdapter); | ||
86 | + pb.setVisibility(View.INVISIBLE); | ||
87 | + } | ||
88 | + | ||
89 | + @Override | ||
90 | + public void onClickListener(View view, int position) { | ||
91 | + | ||
92 | + | ||
93 | + PoliticoFragment frag = new PoliticoFragment(); | ||
94 | + Bundle bundle = new Bundle(); | ||
95 | + try { | ||
96 | + ob.get(position).pin(); | ||
97 | + } catch (ParseException e) { | ||
98 | + e.printStackTrace(); | ||
99 | + } | ||
100 | + bundle.putString("politico", ob.get(position).getObjectId()); | ||
101 | + frag.setArguments(bundle); | ||
102 | + FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction(); | ||
103 | + ft.replace(R.id.rl_fragment_container, frag, "politicoFrag"); | ||
104 | + ft.addToBackStack(null); | ||
105 | + ft.commit(); | ||
106 | + } | ||
107 | + | ||
108 | +} |
app/src/main/java/com/monitorabrasil/monitoralegislativo/fragments/PoliticoFragment.java
@@ -2,9 +2,17 @@ package com.monitorabrasil.monitoralegislativo.fragments; | @@ -2,9 +2,17 @@ package com.monitorabrasil.monitoralegislativo.fragments; | ||
2 | 2 | ||
3 | import android.app.ActionBar; | 3 | import android.app.ActionBar; |
4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
5 | +import android.support.design.widget.FloatingActionButton; | ||
6 | +import android.support.design.widget.Snackbar; | ||
5 | import android.support.design.widget.TabLayout; | 7 | import android.support.design.widget.TabLayout; |
6 | import android.support.v4.app.Fragment; | 8 | import android.support.v4.app.Fragment; |
9 | +import android.support.v4.app.FragmentManager; | ||
10 | +import android.support.v4.app.FragmentPagerAdapter; | ||
11 | +import android.support.v4.app.FragmentStatePagerAdapter; | ||
7 | import android.support.v4.app.FragmentTransaction; | 12 | import android.support.v4.app.FragmentTransaction; |
13 | +import android.support.v4.view.ViewPager; | ||
14 | +import android.support.v4.widget.DrawerLayout; | ||
15 | +import android.support.v7.widget.Toolbar; | ||
8 | import android.view.LayoutInflater; | 16 | import android.view.LayoutInflater; |
9 | import android.view.View; | 17 | import android.view.View; |
10 | import android.view.ViewGroup; | 18 | import android.view.ViewGroup; |
@@ -12,45 +20,86 @@ import android.widget.TableLayout; | @@ -12,45 +20,86 @@ import android.widget.TableLayout; | ||
12 | import android.widget.TextView; | 20 | import android.widget.TextView; |
13 | 21 | ||
14 | import com.google.gson.Gson; | 22 | import com.google.gson.Gson; |
23 | +import com.monitorabrasil.monitoralegislativo.PoliticosActivity; | ||
15 | import com.monitorabrasil.monitoralegislativo.R; | 24 | import com.monitorabrasil.monitoralegislativo.R; |
16 | import com.parse.GetCallback; | 25 | import com.parse.GetCallback; |
17 | import com.parse.ParseObject; | 26 | import com.parse.ParseObject; |
18 | import com.parse.ParseQuery; | 27 | import com.parse.ParseQuery; |
19 | 28 | ||
20 | import java.text.ParseException; | 29 | import java.text.ParseException; |
30 | +import java.util.ArrayList; | ||
31 | +import java.util.List; | ||
21 | 32 | ||
22 | /** | 33 | /** |
23 | * Created by geraugu on 6/10/15. | 34 | * Created by geraugu on 6/10/15. |
24 | */ | 35 | */ |
25 | public class PoliticoFragment extends Fragment { | 36 | public class PoliticoFragment extends Fragment { |
26 | 37 | ||
38 | + | ||
39 | + private DrawerLayout mDrawerLayout; | ||
40 | + private ParseObject politico; | ||
41 | + | ||
27 | @Override | 42 | @Override |
28 | public View onCreateView(LayoutInflater inflater, | 43 | public View onCreateView(LayoutInflater inflater, |
29 | ViewGroup container, | 44 | ViewGroup container, |
30 | Bundle savedInstanceState) { | 45 | Bundle savedInstanceState) { |
31 | - View view = inflater.inflate(R.layout.fragment_politico_detalhe, container, false); | 46 | + View view = inflater.inflate(R.layout.fragment_politico_tabs, container, false); |
32 | 47 | ||
33 | //TABS | 48 | //TABS |
34 | final ActionBar actionBar = getActivity().getActionBar(); | 49 | final ActionBar actionBar = getActivity().getActionBar(); |
35 | // Create a tab listener that is called when the user changes tabs. | 50 | // Create a tab listener that is called when the user changes tabs. |
36 | 51 | ||
37 | - TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tabLayout); | ||
38 | - tabLayout.addTab(tabLayout.newTab().setText("Ficha")); | ||
39 | - tabLayout.addTab(tabLayout.newTab().setText("Gastos")); | 52 | + ViewPager viewPager = (ViewPager) view.findViewById(R.id.viewpager); |
53 | + if (viewPager != null) { | ||
54 | + setupViewPager(viewPager); | ||
55 | + } | ||
56 | + | ||
57 | + FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab); | ||
58 | + fab.setOnClickListener(new View.OnClickListener() { | ||
59 | + @Override | ||
60 | + public void onClick(View view) { | ||
61 | + Snackbar.make(view, "Here's a Snackbar", Snackbar.LENGTH_LONG) | ||
62 | + .setAction("Action", null).show(); | ||
63 | + } | ||
64 | + }); | ||
65 | + | ||
66 | + TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tabs); | ||
67 | + tabLayout.setupWithViewPager(viewPager); | ||
68 | + | ||
69 | + | ||
70 | + // getActivity() .setSupportActionBar(toolbar); | ||
71 | + | ||
72 | +// TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tabLayout); | ||
73 | +// tabLayout.addTab(tabLayout.newTab().setText("Ficha")); | ||
74 | +// tabLayout.addTab(tabLayout.newTab().setText("Gastos")); | ||
40 | 75 | ||
41 | 76 | ||
42 | 77 | ||
43 | Bundle bundle = getArguments(); | 78 | Bundle bundle = getArguments(); |
44 | - ParseObject politico = buscaPolitico(bundle.getString("politico")) ; | 79 | + politico = buscaPolitico(bundle.getString("politico")) ; |
80 | + | ||
45 | 81 | ||
46 | - TextView txtNome = (TextView) view.findViewById(R.id.txtNome); | ||
47 | - txtNome.setText(politico.get("nome").toString()); | 82 | + // TextView txtNome = (TextView) view.findViewById(R.id.txtNome); |
83 | + // txtNome.setText(politico.get("nome").toString()); | ||
48 | 84 | ||
49 | 85 | ||
50 | 86 | ||
51 | return view; | 87 | return view; |
52 | } | 88 | } |
53 | 89 | ||
90 | + private void setupViewPager(ViewPager viewPager) { | ||
91 | + Adapter adapter = new Adapter(getActivity().getSupportFragmentManager()); | ||
92 | + PoliticoFichaFragment ficha = new PoliticoFichaFragment(); | ||
93 | + ficha.setArguments(getArguments()); | ||
94 | + adapter.addFragment(ficha, "Ficha"); | ||
95 | + GastosFragment gastos = new GastosFragment(); | ||
96 | + gastos.setArguments(getArguments()); | ||
97 | + adapter.addFragment(gastos, "Gastos"); | ||
98 | + //adapter.addFragment(new CheeseListFragment(), "Category 3"); | ||
99 | + viewPager.setAdapter(adapter); | ||
100 | + viewPager.getAdapter().notifyDataSetChanged(); | ||
101 | + } | ||
102 | + | ||
54 | private ParseObject buscaPolitico(String id) { | 103 | private ParseObject buscaPolitico(String id) { |
55 | 104 | ||
56 | ParseQuery<ParseObject> query = ParseQuery.getQuery("Politico"); | 105 | ParseQuery<ParseObject> query = ParseQuery.getQuery("Politico"); |
@@ -63,6 +112,36 @@ public class PoliticoFragment extends Fragment { | @@ -63,6 +112,36 @@ public class PoliticoFragment extends Fragment { | ||
63 | return null; | 112 | return null; |
64 | } | 113 | } |
65 | 114 | ||
115 | + static class Adapter extends FragmentStatePagerAdapter { | ||
116 | + private final List<Fragment> mFragments = new ArrayList<>(); | ||
117 | + private final List<String> mFragmentTitles = new ArrayList<>(); | ||
118 | + | ||
119 | + public Adapter(FragmentManager fm) { | ||
120 | + super(fm); | ||
121 | + } | ||
122 | + | ||
123 | + public void addFragment(Fragment fragment, String title) { | ||
124 | + mFragments.add(fragment); | ||
125 | + mFragmentTitles.add(title); | ||
126 | + } | ||
127 | + | ||
128 | + @Override | ||
129 | + public Fragment getItem(int position) { | ||
130 | + | ||
131 | + return mFragments.get(position); | ||
132 | + } | ||
133 | + | ||
134 | + | ||
135 | + @Override | ||
136 | + public int getCount() { | ||
137 | + return mFragments.size(); | ||
138 | + } | ||
139 | + | ||
140 | + @Override | ||
141 | + public CharSequence getPageTitle(int position) { | ||
142 | + return mFragmentTitles.get(position); | ||
143 | + } | ||
144 | + } | ||
66 | 145 | ||
67 | 146 | ||
68 | 147 |
app/src/main/res/layout/activity_politicos.xml
@@ -10,12 +10,9 @@ | @@ -10,12 +10,9 @@ | ||
10 | 10 | ||
11 | <android.support.v7.widget.Toolbar | 11 | <android.support.v7.widget.Toolbar |
12 | android:id="@+id/toolbar" | 12 | android:id="@+id/toolbar" |
13 | - android:elevation="0dp" | ||
14 | android:layout_height="?attr/actionBarSize" | 13 | android:layout_height="?attr/actionBarSize" |
15 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
16 | android:minHeight="?attr/actionBarSize" | 15 | android:minHeight="?attr/actionBarSize" |
17 | - android:layout_alignParentLeft="true" | ||
18 | - android:navigationIcon="@style/DrawerArrowStyle" | ||
19 | android:background="?attr/colorPrimary" | 16 | android:background="?attr/colorPrimary" |
20 | 17 | ||
21 | /> | 18 | /> |
@@ -0,0 +1,26 @@ | @@ -0,0 +1,26 @@ | ||
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="com.monitorabrasil.monitoralegislativo.ProjetosActivity"> | ||
10 | + | ||
11 | + <android.support.v7.widget.Toolbar | ||
12 | + android:id="@+id/toolbar" | ||
13 | + android:layout_height="?attr/actionBarSize" | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:minHeight="?attr/actionBarSize" | ||
16 | + android:background="?attr/colorPrimary" | ||
17 | + | ||
18 | + /> | ||
19 | + <RelativeLayout | ||
20 | + android:id="@+id/rl_fragment_container" | ||
21 | + android:layout_width="match_parent" | ||
22 | + android:layout_height="match_parent"> | ||
23 | + | ||
24 | + </RelativeLayout> | ||
25 | + | ||
26 | +</LinearLayout> |
app/src/main/res/layout/fragment_list_politico.xml
@@ -10,4 +10,11 @@ | @@ -10,4 +10,11 @@ | ||
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="match_parent"/> | 11 | android:layout_height="match_parent"/> |
12 | 12 | ||
13 | + <ProgressBar | ||
14 | + android:layout_width="wrap_content" | ||
15 | + android:layout_height="wrap_content" | ||
16 | + android:id="@+id/progressBar" | ||
17 | + android:layout_gravity="center" | ||
18 | + android:indeterminate="false" /> | ||
19 | + | ||
13 | </FrameLayout> | 20 | </FrameLayout> |
14 | \ No newline at end of file | 21 | \ No newline at end of file |
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
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 | + <ProgressBar | ||
14 | + android:layout_width="wrap_content" | ||
15 | + android:layout_height="wrap_content" | ||
16 | + android:id="@+id/progressBar" | ||
17 | + android:layout_gravity="center" | ||
18 | + android:indeterminate="false" /> | ||
19 | + | ||
20 | +</FrameLayout> | ||
0 | \ No newline at end of file | 21 | \ No newline at end of file |
app/src/main/res/layout/fragment_politico_detalhe.xml
@@ -4,20 +4,15 @@ | @@ -4,20 +4,15 @@ | ||
4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
5 | android:paddingLeft="@dimen/activity_vertical_margin" | 5 | android:paddingLeft="@dimen/activity_vertical_margin" |
6 | android:paddingTop="5dp"> | 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 | 7 | ||
13 | - </android.support.design.widget.TabLayout> | ||
14 | 8 | ||
15 | <ImageView | 9 | <ImageView |
16 | android:layout_width="150dp" | 10 | android:layout_width="150dp" |
17 | android:layout_height="150dp" | 11 | android:layout_height="150dp" |
18 | android:id="@+id/imageView" | 12 | android:id="@+id/imageView" |
19 | android:layout_gravity="center_horizontal" | 13 | android:layout_gravity="center_horizontal" |
20 | - android:src="@drawable/person_1" /> | 14 | + android:src="@drawable/person_1" |
15 | + android:layout_marginTop="60dp" /> | ||
21 | 16 | ||
22 | <TextView | 17 | <TextView |
23 | android:layout_width="wrap_content" | 18 | android:layout_width="wrap_content" |
@@ -32,40 +27,40 @@ | @@ -32,40 +27,40 @@ | ||
32 | android:layout_height="wrap_content" | 27 | android:layout_height="wrap_content" |
33 | android:textAppearance="?android:attr/textAppearanceMedium" | 28 | android:textAppearance="?android:attr/textAppearanceMedium" |
34 | android:text="Partido" | 29 | android:text="Partido" |
35 | - android:id="@+id/textView2" /> | 30 | + android:id="@+id/txtPartido" /> |
36 | 31 | ||
37 | <TextView | 32 | <TextView |
38 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
39 | android:layout_height="wrap_content" | 34 | android:layout_height="wrap_content" |
40 | android:textAppearance="?android:attr/textAppearanceMedium" | 35 | android:textAppearance="?android:attr/textAppearanceMedium" |
41 | android:text="Telefone" | 36 | android:text="Telefone" |
42 | - android:id="@+id/textView3" /> | 37 | + android:id="@+id/txtTelefone" /> |
43 | 38 | ||
44 | <TextView | 39 | <TextView |
45 | android:layout_width="wrap_content" | 40 | android:layout_width="wrap_content" |
46 | android:layout_height="wrap_content" | 41 | android:layout_height="wrap_content" |
47 | android:textAppearance="?android:attr/textAppearanceMedium" | 42 | android:textAppearance="?android:attr/textAppearanceMedium" |
48 | android:text="Email" | 43 | android:text="Email" |
49 | - android:id="@+id/textView4" /> | 44 | + android:id="@+id/email" /> |
50 | 45 | ||
51 | <TextView | 46 | <TextView |
52 | android:layout_width="wrap_content" | 47 | android:layout_width="wrap_content" |
53 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
54 | android:textAppearance="?android:attr/textAppearanceMedium" | 49 | android:textAppearance="?android:attr/textAppearanceMedium" |
55 | android:text="Facebook" | 50 | android:text="Facebook" |
56 | - android:id="@+id/textView5" /> | 51 | + android:id="@+id/facebook" /> |
57 | 52 | ||
58 | <TextView | 53 | <TextView |
59 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
60 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
61 | android:textAppearance="?android:attr/textAppearanceMedium" | 56 | android:textAppearance="?android:attr/textAppearanceMedium" |
62 | android:text="Gastos na campanha" | 57 | android:text="Gastos na campanha" |
63 | - android:id="@+id/textView6" /> | 58 | + android:id="@+id/gastos" /> |
64 | 59 | ||
65 | <TextView | 60 | <TextView |
66 | android:layout_width="wrap_content" | 61 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 62 | android:layout_height="wrap_content" |
68 | android:textAppearance="?android:attr/textAppearanceMedium" | 63 | android:textAppearance="?android:attr/textAppearanceMedium" |
69 | android:text="Bens Declarados" | 64 | android:text="Bens Declarados" |
70 | - android:id="@+id/textView7" /> | 65 | + android:id="@+id/bens" /> |
71 | </LinearLayout> | 66 | </LinearLayout> |
72 | \ No newline at end of file | 67 | \ No newline at end of file |
@@ -0,0 +1,77 @@ | @@ -0,0 +1,77 @@ | ||
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 | + | ||
6 | + <android.support.v7.widget.CardView | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="wrap_content" | ||
9 | + android:layout_margin="@dimen/card_margin"> | ||
10 | + | ||
11 | + <LinearLayout | ||
12 | + style="@style/Widget.CardContent" | ||
13 | + android:layout_width="match_parent" | ||
14 | + android:layout_height="wrap_content"> | ||
15 | + | ||
16 | + <TextView | ||
17 | + android:layout_width="match_parent" | ||
18 | + android:layout_height="wrap_content" | ||
19 | + android:text="Info" | ||
20 | + android:id="@+id/classificacao" | ||
21 | + android:textAppearance="@style/TextAppearance.AppCompat.Title" /> | ||
22 | + | ||
23 | + <TextView | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="wrap_content" | ||
26 | + android:id="@+id/data" | ||
27 | + android:textAppearance="@style/TextAppearance.AppCompat.Small" | ||
28 | + /> | ||
29 | + | ||
30 | + <TextView | ||
31 | + android:layout_width="match_parent" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:id="@+id/autor" | ||
34 | + android:textAppearance="@style/TextAppearance.AppCompat.Medium" | ||
35 | + /> | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + <TextView | ||
40 | + android:layout_width="match_parent" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:id="@+id/descricao" /> | ||
43 | + | ||
44 | + <LinearLayout | ||
45 | + android:orientation="horizontal" | ||
46 | + android:layout_width="match_parent" | ||
47 | + android:layout_height="match_parent"> | ||
48 | + | ||
49 | + <Button | ||
50 | + android:layout_width="match_parent" | ||
51 | + android:layout_height="match_parent" | ||
52 | + android:text="Concordo" | ||
53 | + android:id="@+id/btnConcordo" | ||
54 | + | ||
55 | + | ||
56 | + android:layout_gravity="center_horizontal" | ||
57 | + style="@style/Base.Widget.AppCompat.Button.ButtonBar.AlertDialog" | ||
58 | + android:layout_weight="1" /> | ||
59 | + | ||
60 | + <Button | ||
61 | + style="@style/Base.Widget.AppCompat.Button.Borderless.Colored" | ||
62 | + android:layout_width="match_parent" | ||
63 | + android:layout_height="match_parent" | ||
64 | + android:text="Discordo" | ||
65 | + android:id="@+id/btnDiscordo" | ||
66 | + android:layout_gravity="center_horizontal" | ||
67 | + android:layout_weight="1" /> | ||
68 | + </LinearLayout> | ||
69 | + | ||
70 | + | ||
71 | + </LinearLayout> | ||
72 | + | ||
73 | + </android.support.v7.widget.CardView> | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | +</LinearLayout> | ||
0 | \ No newline at end of file | 78 | \ No newline at end of file |
@@ -0,0 +1,7 @@ | @@ -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.ProjetosActivity"> | ||
5 | + <item android:id="@+id/action_settings" android:title="@string/action_settings" | ||
6 | + android:orderInCategory="100" app:showAsAction="never" /> | ||
7 | +</menu> |
app/src/main/res/values/dimens.xml
@@ -3,4 +3,8 @@ | @@ -3,4 +3,8 @@ | ||
3 | <dimen name="activity_horizontal_margin">16dp</dimen> | 3 | <dimen name="activity_horizontal_margin">16dp</dimen> |
4 | <dimen name="activity_vertical_margin">16dp</dimen> | 4 | <dimen name="activity_vertical_margin">16dp</dimen> |
5 | <dimen name="padding_top_toolbar">0dp</dimen> | 5 | <dimen name="padding_top_toolbar">0dp</dimen> |
6 | + <dimen name="detail_backdrop_height">256dp</dimen> | ||
7 | + <dimen name="card_margin">16dp</dimen> | ||
8 | + <dimen name="fab_margin">16dp</dimen> | ||
9 | + <dimen name="list_item_avatar_size">40dp</dimen> | ||
6 | </resources> | 10 | </resources> |
app/src/main/res/values/strings.xml
@@ -12,4 +12,6 @@ | @@ -12,4 +12,6 @@ | ||
12 | <string name="action_transition_activity">Transition</string> | 12 | <string name="action_transition_activity">Transition</string> |
13 | <string name="title_activity_transition">TransitionActivity</string> | 13 | <string name="title_activity_transition">TransitionActivity</string> |
14 | <string name="title_activity_politicos">PoliticosActivity</string> | 14 | <string name="title_activity_politicos">PoliticosActivity</string> |
15 | + <string name="title_activity_camara">CamaraActivity</string> | ||
16 | + <string name="title_activity_projetos">ProjetosActivity</string> | ||
15 | </resources> | 17 | </resources> |
app/src/main/res/values/styles.xml
@@ -45,4 +45,12 @@ | @@ -45,4 +45,12 @@ | ||
45 | 45 | ||
46 | </style> | 46 | </style> |
47 | 47 | ||
48 | + <style name="Widget.CardContent" parent="android:Widget"> | ||
49 | + <item name="android:paddingLeft">16dp</item> | ||
50 | + <item name="android:paddingRight">16dp</item> | ||
51 | + <item name="android:paddingTop">24dp</item> | ||
52 | + <item name="android:paddingBottom">24dp</item> | ||
53 | + <item name="android:orientation">vertical</item> | ||
54 | + </style> | ||
55 | + | ||
48 | </resources> | 56 | </resources> |