diff --git a/README.md b/README.md
index 7a5be55..7712460 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,21 @@
ParkenDD
========
-Android App for parking spots in Dresden.
-If you want to contribute a translation be free to do so on [poeditor.com](https://poeditor.com/join/project/eu2wqvnR4z).
+An android application to find free parking sports in Dresden and other cities.
-
-
-
-
+
+
-This app shows the free parking lots in Dresden with the possibility to view them with a maps application.
+## Features
+![Different screenshots of ParkenDD: the main list of parking spots, a forecast showing how many places are available at a certain date and a map of Dresden and its free parking spots.](resources/readmeScreenshots/assortment.png)
+* See how many free places are available in the parking spots near you
+* Find out how busy parking spots will be at a certain date and time
+* Display a map showing all your city's parking spots
+## Translation
+ParkenDD is available in several languages including English, German and French.
+If you want to contribute a translation be free to do so on [poeditor.com](https://poeditor.com/join/project/eu2wqvnR4z)!
+
+## Licenses
Licenses can be viewed in the files LICENSE and LICENSE-EXTRA.
-![screen](http://jkliemann.de/parkendd/media/parkendd4.png "screenshot")
diff --git a/app/build.gradle b/app/build.gradle
index fbfc5db..e2cbc57 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 22
+ compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "de.jkliemann.parkendd"
minSdkVersion 14
- targetSdkVersion 22
- versionCode 28
- versionName "1.2.3"
+ targetSdkVersion 25
+ versionCode 27
+ versionName "1.2.2"
}
buildTypes {
release {
@@ -24,12 +24,12 @@ android {
}
dependencies {
- compile 'com.android.support:appcompat-v7:22.2.1'
- compile 'com.android.support:support-v4:22.2.1'
- compile 'com.android.support:design:22.2.1'
+ compile 'com.android.support:appcompat-v7:25.4.0'
+ compile 'com.android.support:support-v4:25.4.0'
+ compile 'com.android.support:design:25.4.0'
compile 'org.piwik.sdk:piwik-sdk:0.0.3'
compile 'org.osmdroid:osmdroid-android:5.0.1@aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile 'com.android.support:recyclerview-v7:22.2.1'
- compile 'com.android.support:cardview-v7:22.2.1'
+ compile 'com.android.support:recyclerview-v7:25.4.0'
+ compile 'com.android.support:cardview-v7:25.4.0'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3434557..a34d895 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -13,7 +13,8 @@
> spotmap;
private Date date;
+ private int previousGroup = -1;
+
ProgressBar pg;
ParkingSpot[] spotList;
Loader forecastLoader;
@@ -89,15 +89,10 @@ public void onCreate(Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_forecast, container, false);
- relativeLayout = (RelativeLayout) view.findViewById(R.id.RelativeLayout);
- datePickerLayout = (RelativeLayout) view.findViewById(R.id.datePickerLayout);
- datePickerLayout.setVisibility(View.INVISIBLE);
-
mView = view;
-
+ setupDateText();
+ setupHourText();
setupProgressBar();
- setupOkButton();
- setupCancelButton();
setupTimePicker();
((ParkenDD) getActivity().getApplication()).getTracker().trackScreenView("/forecast/" + city.id(), "Vorhersage-" + city.name());
return view;
@@ -147,7 +142,7 @@ public void onLoaderFinished(String[] data, Loader instance) {
spotmap.put(spotList[i], dateMap);
}
- updateList(timePicker.getCurrentHour());
+ updateTimeGUIElements(date);
onProgressUpdated();
}
@@ -163,33 +158,37 @@ private void setupProgressBar() {
pg.setIndeterminate(true);
}
- private void setupOkButton() {
- Button okButton = (Button)mView.findViewById(R.id.okbutton);
- okButton.setOnClickListener(this);
- }
-
- private void setupCancelButton() {
- Button cancelButton = (Button)mView.findViewById(R.id.cancelbutton);
- cancelButton.setOnClickListener(this);
- }
-
private void setupTimePicker() {
Calendar cal = Calendar.getInstance();
- date = new Date(cal.get(Calendar.YEAR) - dateOffset, cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
+ date = new Date(cal.get(Calendar.YEAR) - DATE_OFFSET, cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH),
+ cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));
TimeZone tz = Calendar.getInstance().getTimeZone();
dateFormat = android.text.format.DateFormat.getDateFormat(getActivity());
dateFormat.setTimeZone(tz);
- String locDate = dateFormat.format(date);
- city = ((ParkenDD) getActivity().getApplication()).currentCity();
- getActivity().setTitle(city.name() + " - " + locDate);
- loadDate();
- timePicker = (TimePicker)mView.findViewById(R.id.timePicker);
- timePicker.setIs24HourView(true);
- timePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
+
+ updateDateGUIElements(date);
+ updateTimeGUIElements(date);
+ }
+
+ private void setupDateText() {
+ displayedDate = (TextView) mView.findViewById(R.id.dateText);
+
+ displayedDate.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openDatePicker();
+ }
+ });
+ }
+
+ private void setupHourText() {
+ displayedTime = (TextView) mView.findViewById(R.id.hourText);
+
+ displayedTime.setOnClickListener(new View.OnClickListener() {
@Override
- public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
- updateList(hourOfDay);
+ public void onClick(View view) {
+ openTimePicker();
}
});
}
@@ -249,7 +248,15 @@ private void updateList(int hour){
}
private void setList(ArrayList spots){
- ExpandableListView spotView = (ExpandableListView)mView.findViewById(R.id.listView);
+ final ExpandableListView spotView = (ExpandableListView)getView().findViewById(R.id.listView);
+ spotView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
+ @Override
+ public void onGroupExpand(int groupPosition) {
+ if(groupPosition != previousGroup)
+ spotView.collapseGroup(previousGroup);
+ previousGroup = groupPosition;
+ }
+ });
String sortOptions[] = getResources().getStringArray(R.array.setting_sort_options);
String sortPreference = PreferenceManager.getDefaultSharedPreferences(getActivity()).getString("sorting", sortOptions[0]);
Boolean hide_closed = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("hide_closed", true);
@@ -316,45 +323,83 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
{
menu.clear();
}
- inflater.inflate(R.menu.menu_forecast, menu);
super.onCreateOptionsMenu(menu,inflater);
}
+ private void updateDateGUIElements(Date aDate) {
+ loadDate();
+
+ String locDate = dateFormat.format(aDate);
+ city = ((ParkenDD) getActivity().getApplication()).currentCity();
+ getActivity().setTitle(city.name() + " - " + locDate);
+ displayedDate.setText(locDate);
+ }
+
+ private void updateTimeGUIElements(Date aDate) {
+ Calendar cal = Calendar.getInstance();
+ cal.set(Calendar.HOUR_OF_DAY, aDate.getHours());
+ cal.set(Calendar.MINUTE, aDate.getMinutes());
+ displayedTime.setText(formatTime(cal));
+
+ updateList(cal.get(Calendar.HOUR_OF_DAY));
+ }
+
+ private void openDatePicker() {
+ Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ int year = c.get(Calendar.YEAR);
+ int month = c.get(Calendar.MONTH);
+ int day = c.get(Calendar.DAY_OF_MONTH);
+
+ DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(), this, year, month, day);
+ datePickerDialog.show();
+ }
+
+ private void openTimePicker() {
+ Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ int hourOfDay = c.get(Calendar.HOUR_OF_DAY);
+ int minute = c.get(Calendar.MINUTE);
+
+ TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity(),this,hourOfDay, minute, true);
+ timePickerDialog.show();
+ }
+
@Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle action bar item clicks here. The action bar will
- // automatically handle clicks on the Home/Up button, so long
- // as you specify a parent activity in AndroidManifest.xml.
- int id = item.getItemId();
-
- //noinspection SimplifiableIfStatement
- if (id == R.id.action_datePicker) {
- relativeLayout.setVisibility(View.INVISIBLE);
- datePickerLayout.setVisibility(View.VISIBLE);
- return true;
- }
+ public void onDateSet(DatePicker datePicker, int i, int i1, int i2) {
+ date = new Date(datePicker.getYear() - DATE_OFFSET, datePicker.getMonth(), datePicker.getDayOfMonth());
- return super.onOptionsItemSelected(item);
+ updateDateGUIElements(date);
}
@Override
- public void onClick(View view) {
- switch (view.getId()) {
- case R.id.okbutton :
- relativeLayout.setVisibility(View.VISIBLE);
- datePickerLayout.setVisibility(View.INVISIBLE);
- DatePicker datePicker = (DatePicker) datePickerLayout.findViewById(R.id.datePicker);
- date = new Date(datePicker.getYear() - dateOffset, datePicker.getMonth(), datePicker.getDayOfMonth());
- loadDate();
- String locDate = dateFormat.format(date);
- getActivity().setTitle(city.name() + " - " + locDate);
- break;
-
- case R.id.cancelbutton:
- relativeLayout.setVisibility(View.VISIBLE);
- datePickerLayout.setVisibility(View.INVISIBLE);
- break;
- }
+ public void onTimeSet(TimePicker timePicker, int i, int i1) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.set(Calendar.HOUR_OF_DAY, timePicker.getCurrentHour());
+ cal.set(Calendar.MINUTE, timePicker.getCurrentMinute());
+ date = new Date(cal.get(Calendar.YEAR) - DATE_OFFSET, cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH),
+ cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE));
+
+ updateTimeGUIElements(date);
+ }
+
+ private String formatTime(Calendar cal) {
+ int hours = cal.get(Calendar.HOUR_OF_DAY);
+ String hoursText;
+ if(hours < 10)
+ hoursText = "0" + hours;
+ else
+ hoursText = hours + "";
+
+ int minutes = cal.get(Calendar.MINUTE);
+ String minutesText;
+ if(minutes < 10)
+ minutesText = "0" + minutes;
+ else
+ minutesText = minutes + "";
+
+ return hoursText + ":" + minutesText;
}
/**
diff --git a/app/src/main/java/de/jkliemann/parkendd/Views/Main/LocalParkingSlotListFragment.java b/app/src/main/java/de/jkliemann/parkendd/Views/Main/LocalParkingSlotListFragment.java
index 7a4d0f5..3fa4adf 100644
--- a/app/src/main/java/de/jkliemann/parkendd/Views/Main/LocalParkingSlotListFragment.java
+++ b/app/src/main/java/de/jkliemann/parkendd/Views/Main/LocalParkingSlotListFragment.java
@@ -51,6 +51,8 @@ public class LocalParkingSlotListFragment extends Fragment implements LoaderInte
private OnFragmentInteractionListener mListener;
+ private int previousGroup = -1;
+
public LocalParkingSlotListFragment() {
// Required empty public constructor
}
@@ -133,7 +135,15 @@ private void updateCities(ArrayList citylist){
}
private void setList(City CITY){
- ExpandableListView spotView = (ExpandableListView)getView().findViewById(R.id.spotListView);
+ final ExpandableListView spotView = (ExpandableListView)getView().findViewById(R.id.spotListView);
+ spotView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
+ @Override
+ public void onGroupExpand(int groupPosition) {
+ if(groupPosition != previousGroup)
+ spotView.collapseGroup(previousGroup);
+ previousGroup = groupPosition;
+ }
+ });
String sortOptions[] = getResources().getStringArray(R.array.setting_sort_options);
String sortPreference = PreferenceManager.getDefaultSharedPreferences(getActivity()).getString("sorting", sortOptions[0]);
Boolean hide_closed = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("hide_closed", true);
diff --git a/app/src/main/java/de/jkliemann/parkendd/Views/Main/MainActivity.java b/app/src/main/java/de/jkliemann/parkendd/Views/Main/MainActivity.java
index bb067d3..c89b0c9 100644
--- a/app/src/main/java/de/jkliemann/parkendd/Views/Main/MainActivity.java
+++ b/app/src/main/java/de/jkliemann/parkendd/Views/Main/MainActivity.java
@@ -76,7 +76,7 @@ private void setUpNavigationDrawer() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.open, R.string.closed);
- drawer.setDrawerListener(toggle);
+ drawer.addDrawerListener(toggle);
toggle.syncState();
@@ -159,14 +159,15 @@ public boolean onCreateOptionsMenu(Menu menu) {
private void setupSearchView(Menu menu) {
final SearchView search = (SearchView) menu.findItem(R.id.action_search).getActionView();
-
+ search.setQueryHint(getResources().getString(R.string.search_hint));
search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
setFragment(RemoteParkingSlotListFragment.newInstance(s));
- search.setQuery("", false);
+ search.setQuery("",false);
search.clearFocus();
search.onActionViewCollapsed();
+ search.clearFocus();
return true;
}
diff --git a/app/src/main/java/de/jkliemann/parkendd/Views/Main/MapFragment.java b/app/src/main/java/de/jkliemann/parkendd/Views/Main/MapFragment.java
index c5fa03d..8f46bc6 100644
--- a/app/src/main/java/de/jkliemann/parkendd/Views/Main/MapFragment.java
+++ b/app/src/main/java/de/jkliemann/parkendd/Views/Main/MapFragment.java
@@ -7,6 +7,8 @@
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -64,8 +66,9 @@ public void onCreate(Bundle savedInstanceState) {
}else{
self = city.location();
}
-
+
getActivity().setTitle(city.name());
+ setHasOptionsMenu(true);
}
@@ -95,10 +98,19 @@ public void onDetach() {
mListener = null;
}
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ if(menu != null)
+ {
+ menu.clear();
+ }
+ super.onCreateOptionsMenu(menu,inflater);
+ }
+
private void setUpMapView(View view) {
final MapView map = (MapView) view.findViewById(R.id.osmap);
map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
- map.setBuiltInZoomControls(true);
+ map.setBuiltInZoomControls(false);
map.setMultiTouchControls(true);
final IMapController mapctl = map.getController();
mapctl.setZoom(15);
diff --git a/app/src/main/java/de/jkliemann/parkendd/Views/Main/RemoteParkingSlotListFragment.java b/app/src/main/java/de/jkliemann/parkendd/Views/Main/RemoteParkingSlotListFragment.java
index ba0c80e..d53e81d 100644
--- a/app/src/main/java/de/jkliemann/parkendd/Views/Main/RemoteParkingSlotListFragment.java
+++ b/app/src/main/java/de/jkliemann/parkendd/Views/Main/RemoteParkingSlotListFragment.java
@@ -60,6 +60,8 @@ public class RemoteParkingSlotListFragment extends Fragment implements LoaderInt
private OnFragmentInteractionListener mListener;
+ private int previousGroup = -1;
+
public RemoteParkingSlotListFragment() {
// Required empty public constructor
}
@@ -206,7 +208,15 @@ private void refresh(){
}
private void setList(City CITY){
- ExpandableListView spotView = (ExpandableListView)getView().findViewById(R.id.spotListView);
+ final ExpandableListView spotView = (ExpandableListView)getView().findViewById(R.id.spotListView);
+ spotView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
+ @Override
+ public void onGroupExpand(int groupPosition) {
+ if(groupPosition != previousGroup)
+ spotView.collapseGroup(previousGroup);
+ previousGroup = groupPosition;
+ }
+ });
String sortOptions[] = getResources().getStringArray(R.array.setting_sort_options);
String sortPreference = PreferenceManager.getDefaultSharedPreferences(getActivity()).getString("sorting", sortOptions[0]);
Boolean hide_closed = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("hide_closed", true);
diff --git a/app/src/main/java/de/jkliemann/parkendd/Views/SlotListAdapter.java b/app/src/main/java/de/jkliemann/parkendd/Views/SlotListAdapter.java
index f626dad..28b2cef 100644
--- a/app/src/main/java/de/jkliemann/parkendd/Views/SlotListAdapter.java
+++ b/app/src/main/java/de/jkliemann/parkendd/Views/SlotListAdapter.java
@@ -4,7 +4,6 @@
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
-import android.graphics.Color;
import android.location.Location;
import android.net.Uri;
import android.view.LayoutInflater;
@@ -21,6 +20,7 @@
import de.jkliemann.parkendd.Model.ParkingSpot;
import de.jkliemann.parkendd.ParkenDD;
import de.jkliemann.parkendd.R;
+import de.jkliemann.parkendd.Utilities.ColorUtilities;
import de.jkliemann.parkendd.Utilities.Error;
import de.jkliemann.parkendd.Utilities.Util;
@@ -30,10 +30,6 @@ public class SlotListAdapter extends BaseExpandableListAdapter {
private final Context context;
private final ParkingSpot[] spots;
private final Location currentLocation;
- private final int red = Color.argb(0xaa, 0xef, 0x53, 0x50);
- private final int green = Color.argb(0xaa, 0x66, 0xbb, 0x6a);
- private final int yellow = Color.argb(0xaa, 0xff, 0xee, 0x58);
- private final int blue = Color.argb(0xaa, 0x42, 0xa5, 0xf5);
private static final String CLOSED = "closed";
private static final String NODATA = "nodata";
private static final Map typeMap;
@@ -91,26 +87,44 @@ public View getGroupView(int position, boolean isExpanded, View view, ViewGroup
LayoutInflater inflater = (LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
View slotView = inflater.inflate(R.layout.slot_list_adapter, parent, false);
TextView countView = (TextView)slotView.findViewById(R.id.countView);
+ TextView percentView = (TextView)slotView.findViewById(R.id.percentView);
TextView nameView = (TextView)slotView.findViewById(R.id.nameView);
TextView distanceView = (TextView)slotView.findViewById(R.id.distanceView);
+ TextView parkingTypeView = (TextView)slotView.findViewById(R.id.parkingTypeView);
+
ParkingSpot spot = spots[position];
+
nameView.setText(spot.name());
+
if(spot.state().equals(CLOSED)) {
countView.setText(context.getString(R.string.closed));
- slotView.setBackgroundColor(red);
- }else if(spot.state().equals(NODATA)){
+ slotView.setBackgroundColor(context.getResources().getColor(R.color.parkingNoData));
+ }
+ else if(spot.state().equals(NODATA)){
countView.setText(context.getString(R.string.nodata) + " (" + Integer.toString(spot.count()) + ")");
- slotView.setBackgroundColor(blue);
- }else{
- countView.setText(Integer.toString(spot.free()) + " " + context.getString(R.string.of) + " " + Integer.toString(spot.count()));
- double perc = (double)spot.free() / (double)spot.count();
- if(perc < 0.05){
- slotView.setBackgroundColor(red);
- }else if(perc < 0.2){
- slotView.setBackgroundColor(yellow);
- }else{
- slotView.setBackgroundColor(green);
+ slotView.setBackgroundColor(context.getResources().getColor(R.color.parkingNoData));
+ }
+ else{
+ // Count
+ countView.setText(Integer.toString(spot.free()));
+
+ // Parking type
+ try {
+ parkingTypeView.setText(context.getString(typeMap.get(spot.type())));
+ }catch (NullPointerException e) {
+ e.printStackTrace();
}
+
+
+ // Percentage of free places
+ float percentageFreePlaces = (float)spot.free() / (float)spot.count();
+ int percentageFreePlacesFormatted = (int) (percentageFreePlaces * 100);
+ percentView.setText(context.getResources().getString(R.string.free,percentageFreePlacesFormatted));
+
+ // Background color
+ slotView.setBackgroundColor(ColorUtilities.mixBetweenColors(percentageFreePlaces,
+ context.getResources().getColor(R.color.parkingFull),
+ context.getResources().getColor(R.color.parkingFree)));
}
if(currentLocation != null && spot.location() != null){
distanceView.setText(Util.getViewDistance(Util.getDistance(currentLocation, spot.location())));
@@ -124,34 +138,43 @@ public View getGroupView(int position, boolean isExpanded, View view, ViewGroup
public View getChildView(int groupId, int childId, boolean isLastChild, View view, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
final View detailView = inflater.inflate(R.layout.list_detail, null);
- final ParkingSpot child = spots[groupId];
- TextView type = (TextView)detailView.findViewById(R.id.type);
- try{
- type.setText(context.getString(typeMap.get(child.type())));
- }catch (NullPointerException e){
- e.printStackTrace();
- type.setText(child.type());
- }
+ final ParkingSpot spot = spots[groupId];
+
TextView address = (TextView)detailView.findViewById(R.id.address);
- address.setText(child.address());
- TextView region = (TextView)detailView.findViewById(R.id.region);
- region.setText(child.category());
+ address.setText(spot.address());
+
ImageButton mapButton = (ImageButton)detailView.findViewById(R.id.mapButton);
+
mapButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Uri geouri = child.geoUri();
- try{
- Intent map = new Intent(Intent.ACTION_VIEW, geouri);
- String city = ((ParkenDD) ((Activity)context).getApplication()).currentCity().name();
- ((ParkenDD) ((Activity) context).getApplication()).getTracker().trackEvent(city, child.name());
- context.startActivity(map);
- }catch (ActivityNotFoundException e){
- e.printStackTrace();
- Error.showLongErrorToast(context, context.getString(R.string.intent_error));
+ openMap(spot);
+ }
+ });
+
+ detailView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openMap(spot);
}
- }
});
+
+ // Background color
+ if(!spot.state().equals(CLOSED) && !spot.state().equals(NODATA))
+ {
+ float percentageFreePlaces = (float)spot.free() / (float)spot.count();
+ int parentColor = ColorUtilities.mixBetweenColors(percentageFreePlaces,
+ context.getResources().getColor(R.color.parkingFull),
+ context.getResources().getColor(R.color.parkingFree));
+
+ detailView.setBackgroundColor(ColorUtilities.darkenColor(parentColor, 5));
+ }
+ else
+ {
+ detailView.setBackgroundColor(ColorUtilities.darkenColor(context.getResources().getColor(R.color.parkingNoData), 5));
+ }
+
+
return detailView;
}
@@ -164,4 +187,18 @@ public boolean isChildSelectable(int i, int i1) {
public void onGroupExpanded(int position){
super.onGroupExpanded(position);
}
+
+ private void openMap(ParkingSpot spot) {
+ Uri geouri = spot.geoUri();
+ try {
+ Intent map = new Intent(Intent.ACTION_VIEW, geouri);
+ String city = ((ParkenDD) ((Activity) context).getApplication()).currentCity().name();
+ ((ParkenDD) ((Activity) context).getApplication()).getTracker().trackEvent(city, spot.name());
+ context.startActivity(map);
+ } catch (ActivityNotFoundException e) {
+ e.printStackTrace();
+ Error.showLongErrorToast(context, context.getString(R.string.intent_error));
+ }
+ }
+
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-hdpi/drawer_header.png b/app/src/main/res/drawable-hdpi/drawer_header.png
new file mode 100644
index 0000000..c0a4472
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_app_icon.png b/app/src/main/res/drawable-hdpi/ic_app_icon.png
deleted file mode 100644
index dfeba27..0000000
Binary files a/app/src/main/res/drawable-hdpi/ic_app_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable-hdpi/ic_directions_black_48dp.png b/app/src/main/res/drawable-hdpi/ic_directions_black_48dp.png
new file mode 100644
index 0000000..6ebfddb
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_directions_black_48dp.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_map_black_48dp.png b/app/src/main/res/drawable-hdpi/ic_map_black_48dp.png
deleted file mode 100644
index 827c9fc..0000000
Binary files a/app/src/main/res/drawable-hdpi/ic_map_black_48dp.png and /dev/null differ
diff --git a/app/src/main/res/drawable-ldpi/drawer_header.png b/app/src/main/res/drawable-ldpi/drawer_header.png
new file mode 100644
index 0000000..4e239b7
Binary files /dev/null and b/app/src/main/res/drawable-ldpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-mdpi/drawer_header.png b/app/src/main/res/drawable-mdpi/drawer_header.png
new file mode 100644
index 0000000..0c53864
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_app_icon.png b/app/src/main/res/drawable-mdpi/ic_app_icon.png
deleted file mode 100644
index 547c7fc..0000000
Binary files a/app/src/main/res/drawable-mdpi/ic_app_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable-mdpi/ic_directions_black_48dp.png b/app/src/main/res/drawable-mdpi/ic_directions_black_48dp.png
new file mode 100644
index 0000000..56284b3
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_directions_black_48dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_map_black_48dp.png b/app/src/main/res/drawable-mdpi/ic_map_black_48dp.png
deleted file mode 100644
index a3ecc71..0000000
Binary files a/app/src/main/res/drawable-mdpi/ic_map_black_48dp.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/drawer_header.png b/app/src/main/res/drawable-xhdpi/drawer_header.png
new file mode 100644
index 0000000..63afd25
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_app_icon.png b/app/src/main/res/drawable-xhdpi/ic_app_icon.png
deleted file mode 100644
index 887526d..0000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_app_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_directions_black_48dp.png b/app/src/main/res/drawable-xhdpi/ic_directions_black_48dp.png
new file mode 100644
index 0000000..0ad2fbb
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_directions_black_48dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_map_black_48dp.png b/app/src/main/res/drawable-xhdpi/ic_map_black_48dp.png
deleted file mode 100644
index da75c65..0000000
Binary files a/app/src/main/res/drawable-xhdpi/ic_map_black_48dp.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/drawer_header.png b/app/src/main/res/drawable-xxhdpi/drawer_header.png
new file mode 100644
index 0000000..b72b501
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_app_icon.png b/app/src/main/res/drawable-xxhdpi/ic_app_icon.png
deleted file mode 100644
index 3ac5760..0000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_app_icon.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_directions_black_48dp.png b/app/src/main/res/drawable-xxhdpi/ic_directions_black_48dp.png
new file mode 100644
index 0000000..26ef874
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_directions_black_48dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_map_black_48dp.png b/app/src/main/res/drawable-xxhdpi/ic_map_black_48dp.png
deleted file mode 100644
index 75c0d4d..0000000
Binary files a/app/src/main/res/drawable-xxhdpi/ic_map_black_48dp.png and /dev/null differ
diff --git a/app/src/main/res/drawable-xxxhdpi/drawer_header.png b/app/src/main/res/drawable-xxxhdpi/drawer_header.png
new file mode 100644
index 0000000..d041a90
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/drawer_header.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_directions_black_48dp.png b/app/src/main/res/drawable-xxxhdpi/ic_directions_black_48dp.png
new file mode 100644
index 0000000..f02aee2
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_directions_black_48dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_map_black_48dp.png b/app/src/main/res/drawable-xxxhdpi/ic_map_black_48dp.png
deleted file mode 100644
index 9de90c3..0000000
Binary files a/app/src/main/res/drawable-xxxhdpi/ic_map_black_48dp.png and /dev/null differ
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
index e898bdd..9cf9cc6 100644
--- a/app/src/main/res/layout/activity_about.xml
+++ b/app/src/main/res/layout/activity_about.xml
@@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
- android:background="@drawable/ic_app_icon"/>
+ android:background="@mipmap/ic_launcher"/>
-
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginBottom="4dp"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
+ android:layout_marginTop="4dp"
+ android:foreground="?android:attr/selectableItemBackground"
+ card_view:cardCornerRadius="@dimen/cardview_default_radius"
+ card_view:cardElevation="@dimen/cardview_default_elevation">
-
-
-
+ android:orientation="vertical">
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_forecast.xml b/app/src/main/res/layout/fragment_forecast.xml
index 66ee7f0..6323712 100644
--- a/app/src/main/res/layout/fragment_forecast.xml
+++ b/app/src/main/res/layout/fragment_forecast.xml
@@ -1,68 +1,75 @@
-
-
-
+ android:id="@+id/listView"
+ android:layout_above="@+id/dateTimePicker"
+ android:groupIndicator="@null"
-
-
-
+ android:divider="@null"/>
-
+ android:minHeight="48dp"
+
+ android:orientation="horizontal"
+ android:layout_alignParentBottom="true"
+ android:background="@android:color/white"
+ android:elevation="10dp">
+
+
+
+
-
-
-
-
+
+
+
+
-
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/dateText"
+ android:layout_marginLeft="32dp"
+ android:clickable="true"
+ android:background="?attr/selectableItemBackgroundBorderless"
+
+ android:textColor="@color/colorTextSecondary"
+ android:textSize="20sp"
+ android:text="00:05" />
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_parking_slot_list.xml b/app/src/main/res/layout/fragment_parking_slot_list.xml
index 91c3c05..c1ecd27 100644
--- a/app/src/main/res/layout/fragment_parking_slot_list.xml
+++ b/app/src/main/res/layout/fragment_parking_slot_list.xml
@@ -14,7 +14,9 @@
android:layout_height="wrap_content"
android:id="@+id/spotListView"
android:layout_below="@+id/searchView"
- android:layout_centerHorizontal="true"/>
+ android:layout_centerHorizontal="true"
+ android:divider="@null"
+ android:groupIndicator="@null"/>
diff --git a/app/src/main/res/layout/list_detail.xml b/app/src/main/res/layout/list_detail.xml
index 4beac42..079c7ff 100644
--- a/app/src/main/res/layout/list_detail.xml
+++ b/app/src/main/res/layout/list_detail.xml
@@ -1,56 +1,41 @@
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="?attr/selectableItemBackground"
+ android:clickable="true">
-
-
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+
+ android:textColor="@color/colorTextPrimary"
+ android:textSize="20sp" />
+
-
-
-
-
+ android:layout_marginRight="32dp"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_directions_black_48dp"
+ android:background="?attr/selectableItemBackgroundBorderless"/>
diff --git a/app/src/main/res/layout/list_layout.xml b/app/src/main/res/layout/list_layout.xml
deleted file mode 100644
index 16513ab..0000000
--- a/app/src/main/res/layout/list_layout.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/nav_header.xml b/app/src/main/res/layout/nav_header.xml
index 39319f2..aaad58e 100644
--- a/app/src/main/res/layout/nav_header.xml
+++ b/app/src/main/res/layout/nav_header.xml
@@ -1,35 +1,39 @@
-
-
-
-
+
+ android:layout_alignParentBottom="true"
+ android:background="@color/navHeaderTextBackground"
+ android:orientation="vertical"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin">
-
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/slot_list_adapter.xml b/app/src/main/res/layout/slot_list_adapter.xml
index 63c4b9e..160d3b9 100644
--- a/app/src/main/res/layout/slot_list_adapter.xml
+++ b/app/src/main/res/layout/slot_list_adapter.xml
@@ -1,52 +1,86 @@
-
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:background="?attr/selectableItemBackground"
+ android:drawSelectorOnTop="true">
-
-
-
-
-
+ android:layout_alignParentLeft="true"
+ android:layout_marginLeft="16dp"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="32dp"
+ android:layout_centerVertical="true">
+
+
+
+
+
+
+
+
+
+
-
+
+
diff --git a/app/src/main/res/menu/menu_cities.xml b/app/src/main/res/menu/menu_cities.xml
deleted file mode 100644
index ff1a731..0000000
--- a/app/src/main/res/menu/menu_cities.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_details.xml b/app/src/main/res/menu/menu_details.xml
deleted file mode 100644
index 28503cf..0000000
--- a/app/src/main/res/menu/menu_details.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/app/src/main/res/menu/menu_empty.xml b/app/src/main/res/menu/menu_empty.xml
deleted file mode 100644
index 2a79711..0000000
--- a/app/src/main/res/menu/menu_empty.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_forecast.xml b/app/src/main/res/menu/menu_forecast.xml
deleted file mode 100644
index f4169f2..0000000
--- a/app/src/main/res/menu/menu_forecast.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..16cde37
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..6dbcdb4
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..11969c1
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b0c9df3
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..17f37b9
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..73c6977
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..a5c2bf5
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..366785c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..83a515e
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..3b63a7d
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index b1ba0d5..249f9ee 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -55,4 +55,5 @@
Status
geöffnet
Kartensymbolgröße
+ %1$d%% frei
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 700aae4..d90016c 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -59,4 +59,6 @@
Display
Information
Settings
+ %1$d%% free
+ Enter an address
\ No newline at end of file
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 63e55fe..73d3fdc 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -76,4 +76,6 @@
Affichage
Informations
Paramètres
+ %1$d%% libre
+ Saisissez une adresse
diff --git a/app/src/main/res/values/attrs_slot_list_adapter.xml b/app/src/main/res/values/attrs_slot_list_adapter.xml
deleted file mode 100644
index 6092523..0000000
--- a/app/src/main/res/values/attrs_slot_list_adapter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index ffa30ec..02c0c1c 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -9,4 +9,10 @@
#FFFFFF
#BDBDBD
#EEEEEE
+
+ #FFE082
+ #66BB6A
+ #CFD8DC
+
+ #40000000
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 05d0933..ddf1e4f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -95,6 +95,8 @@
Available cities
Currently selected city
+ %1$d\\%% free
+ Enter an address
diff --git a/build.gradle b/build.gradle
index 5966013..477cd22 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,5 +15,8 @@ buildscript {
allprojects {
repositories {
jcenter()
+ maven {
+ url "https://maven.google.com"
+ }
}
}
diff --git a/resources/drawerHeader/drawer_header.psd b/resources/drawerHeader/drawer_header.psd
new file mode 100644
index 0000000..d9e4ffb
Binary files /dev/null and b/resources/drawerHeader/drawer_header.psd differ
diff --git a/resources/drawerHeader/drawer_header_sizes.txt b/resources/drawerHeader/drawer_header_sizes.txt
new file mode 100644
index 0000000..ec399c4
--- /dev/null
+++ b/resources/drawerHeader/drawer_header_sizes.txt
@@ -0,0 +1,8 @@
+indep: 304 ; 140
+
+xxxhdpi: 1216; 560
+xxhdpi: 912; 420
+xhdpi: 608; 280
+hdpi: 456;210
+mdpi: 304;140
+ldpi: 228; 105
\ No newline at end of file
diff --git a/resources/launcherIcon/launcherIcon.png b/resources/launcherIcon/launcherIcon.png
new file mode 100644
index 0000000..d61cf46
Binary files /dev/null and b/resources/launcherIcon/launcherIcon.png differ
diff --git a/resources/launcherIcon/launcherIcon.psd b/resources/launcherIcon/launcherIcon.psd
new file mode 100644
index 0000000..64a7305
Binary files /dev/null and b/resources/launcherIcon/launcherIcon.psd differ
diff --git a/resources/readmeScreenshots/assortment.png b/resources/readmeScreenshots/assortment.png
new file mode 100644
index 0000000..3620df1
Binary files /dev/null and b/resources/readmeScreenshots/assortment.png differ
diff --git a/resources/readmeScreenshots/drawer.png b/resources/readmeScreenshots/drawer.png
new file mode 100644
index 0000000..d18db58
Binary files /dev/null and b/resources/readmeScreenshots/drawer.png differ
diff --git a/resources/readmeScreenshots/forecast.png b/resources/readmeScreenshots/forecast.png
new file mode 100644
index 0000000..8e3cf76
Binary files /dev/null and b/resources/readmeScreenshots/forecast.png differ
diff --git a/resources/readmeScreenshots/home.png b/resources/readmeScreenshots/home.png
new file mode 100644
index 0000000..cc1473a
Binary files /dev/null and b/resources/readmeScreenshots/home.png differ
diff --git a/resources/readmeScreenshots/map.png b/resources/readmeScreenshots/map.png
new file mode 100644
index 0000000..8ff6b9e
Binary files /dev/null and b/resources/readmeScreenshots/map.png differ