Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Inclusão de página de erro de conexão
Browse files Browse the repository at this point in the history
  • Loading branch information
ehans committed Aug 29, 2014
1 parent 945d9aa commit ac49621
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 8 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
#VouDeBikePoa - Mobile Version

Um aplicativo que permite traçar rota entre um ponto de partida e destino utilizando as bicicletas do BikePoa.
![Vou de Bike POA](https://raw.githubusercontent.com/8cteto/voudebikepoa/master/assets/images/logo2.png)

De onde eu estiver, poderei pedir para chegar a algum lugar utilizando as bicicletas do BikePoa.
Vou de Bike POA é uma ferramenta de apoio para todas as pessoas que utilizam a bicicleta como meio de transporte e que praticam o ciclismo como um estilo de vida contribuindo para a redução dos problemas de mobilidade urbana e para o meio ambiente, além de ser um hábito que contribui para a saúde dos praticantes do ciclismo.

O software irá me sugerir o ponto mais próximo de onde eu estiver para pegar uma Bike e o ponto mais próximo do destino para devolve-la, além da rota entre estes pontos.
Nossa ideia é facilitar seu passeio, além de torná-lo mais seguro e divertido. Hoje nossa App atende a cidade de Porto Alegre e nossa ideia é atender também outras cidades do Brasil.

Poderei também selecionar se gostaria de utilizar a rota mais rápida ou mais segura, utilizando assim as ciclovias e talvez dados de acidentes.
Temos ainda a possibilidade de sugerir pontos turísticos e culturais na rota do passeio.
As principais funcionalidades que você encontrará aqui são:

Poderemos tentar facilitar também passeios de bike com sua própria bicicleta, permitindo utilizar os recursos de rota segura ou rápida entre pontos de partida e destino.
* A localização de todas as estações do Bike Poa
*Criação de rotas, incluindo a estação Bike Poa mais da sua localização atual e do seu local de destino

Dataset que utilizaremos (se implementadas todas as funcionalidades):
Funcionalidades em planejamento/implementação:

* Criação de rotas para quem possui bicicleta e não necessita das informações do Bike POA
* Criação de rotas seguras, incluindo as ciclovias e trajetos com menor incidência de acidentes de trânsito
* Criação de rotas incluindo espaços culturais de acordo com suas preferências
* Visualização da quantidade de bicicletas nas estações Bike POA
* Informações sobre o estado de funcionamento das bicicletas do Bike POA

Vou de Bike POA é um projeto open source criado pela equipe 8cteto e utiliza dados de fontes abertas da Prefeitura Municipal de Porto Alegre distribuídos no portal datapoa. Nossa ideia nasceu durante o evento GUDay 2014 promovido pela Sucesu-RS.

Se você se interessar, estamos abertos a novos colaboradores e novas ideias. Contribua!

Mande seu feedback através de nossa [fanpage](https://www.facebook.com/VouDeBikePOA)!

##Datasets abertos utilizados
* http://datapoa.com.br/dataset/bikepoa
* http://datapoa.com.br/dataset/ciclovias-implantadas
* http://datapoa.com.br/dataset/espacos-culturais
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,8 @@ public static String getStartUrl() {
public static String getErrorUrl() {
return errorUrl;
}

public static String getNoConnectionErrorUrl() {
return "file:///android_asset/www/no_connection_error.html";
}
}
14 changes: 13 additions & 1 deletion platforms/android/src/br/com/voudebikepoa/VouDeBikePOA.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import org.apache.cordova.Config;
import org.apache.cordova.CordovaActivity;

import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;

public class VouDeBikePOA extends CordovaActivity
Expand All @@ -31,7 +33,17 @@ public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
super.loadUrl(Config.getStartUrl());
}

@Override
protected void onResume() {
super.onResume();
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected())
super.loadUrl(Config.getStartUrl());
else
super.loadUrl(Config.getNoConnectionErrorUrl());
}
}

114 changes: 114 additions & 0 deletions www/css/no_connection_error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#006FA0;
background-image:linear-gradient(top, #006FA0 0%, #006FA0 51%);
background-image:-webkit-linear-gradient(top, #006FA0 0%, #006FA0 51%);
background-image:-ms-linear-gradient(top, #006FA0 0%, #006FA0 51%);
background-image:-webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #006FA0),
color-stop(0.51, #006FA0)
);
background-attachment:fixed;
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-size:12px;
height:100%;
margin:0px;
padding:0px;
width:100%;
}

/* Portrait layout (default) */
.app {
background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
position:absolute; /* position in the center of the screen */
left:50%;
top:50%;
height:50px; /* text area height */
width:225px; /* text area width */
text-align:center;
padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
/* offset horizontal: half of text area width */
}

/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
background-position:left center;
padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
/* offset horizontal: half of image width and text area width */
}
}

h1 {
font-size:24px;
font-weight:normal;
margin:0px;
overflow:visible;
padding:0px;
text-align:center;
}

.pedaling{
float:left;
position:absolute; /* position in the center of the screen */
left:7%;
top:80%;
}

.event {
border-radius:4px;
-webkit-border-radius:4px;
color:#000000;
font-size:12px;
margin-top: 5%;
margin-left: 20%;
padding:5px 5px;
font-weight: bold;
width:130px;
}

.event.listening {
background-color:#E4E4E4;
display:block;
}

.event.received {
background-color:#000111;
display:none;
}

.social-links {
position:absolute; /* position in the center of the screen */
left:22%;
top:130%;
text-align: center;
color:#FFFFFF;
}

@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}

@-webkit-keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.4; }
to { opacity: 1.0; }
}

.blink {
animation:fade 3000ms infinite;
-webkit-animation:fade 3000ms infinite;
}
25 changes: 25 additions & 0 deletions www/no_connection_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/no_connection_error.css" />
<meta name="msapplication-tap-highlight" content="no" />
<title>No connection error</title>
</head>
<body>
<div class="app">
<div id="deviceready" class="pedaling">
<p class="event listening">
Você está off-line.<br/>
Por favor verifique suas configurações.
</p>
</div>
<div class="social-links">
<p><b>fb.com/voudebikepoa</b></p>
</div>
</div>

</body>
</html>

0 comments on commit ac49621

Please sign in to comment.