Comments (19)
The way this should be implemented is to always remember the latest (transport) product selection in the SharedPreferences.
from transportr.
Implementation notes:
The preferences should be by transport network. In order to not have products * networks
new preferences, a new preference should only be created when a user deselects products. By default all products are activated. If there is no preference, then the product is active in this network.
Also consider issue #106 for the implementation.
from transportr.
I'd like to work on this one, because it affects me almost every time i use Transportr.
Unfortunately, i can't build Transportr in Android Studio because of some dependency issue :/
from transportr.
Did you follow the instructions from Building From Source? If yes, what is the error you are getting?
from transportr.
Yes, i get:
Error:A problem occurred configuring root project 'Transportr'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not resolve com.github.orangegangsters:swipy:1.2.2.
Required by:
:Transportr:unspecified
> Could not resolve com.github.orangegangsters:swipy:1.2.2.
> Could not get resource 'https://jcenter.bintray.com/com/github/orangegangsters/swipy/1.2.2/swipy-1.2.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/orangegangsters/swipy/1.2.2/swipy-1.2.2.pom'.
> peer not authenticated
> Could not resolve de.cketti.library.changelog:ckchangelog:1.2.2.
Required by:
:Transportr:unspecified
> Could not resolve de.cketti.library.changelog:ckchangelog:1.2.2.
> Could not get resource 'https://jcenter.bintray.com/de/cketti/library/changelog/ckchangelog/1.2.2/ckchangelog-1.2.2.pom'.
> Could not GET 'https://jcenter.bintray.com/de/cketti/library/changelog/ckchangelog/1.2.2/ckchangelog-1.2.2.pom'.
> peer not authenticated
> Could not resolve org.apmem.tools:layouts:1.10.
Required by:
:Transportr:unspecified
> Could not resolve org.apmem.tools:layouts:1.10.
> Could not get resource 'https://jcenter.bintray.com/org/apmem/tools/layouts/1.10/layouts-1.10.pom'.
> Could not GET 'https://jcenter.bintray.com/org/apmem/tools/layouts/1.10/layouts-1.10.pom'.
> peer not authenticated
> Could not resolve com.mikepenz:materialdrawer:5.1.6.
Required by:
:Transportr:unspecified
> Could not resolve com.mikepenz:materialdrawer:5.1.6.
> Could not get resource 'https://jcenter.bintray.com/com/mikepenz/materialdrawer/5.1.6/materialdrawer-5.1.6.pom'.
> Could not GET 'https://jcenter.bintray.com/com/mikepenz/materialdrawer/5.1.6/materialdrawer-5.1.6.pom'.
> peer not authenticated
> Could not resolve com.mikepenz:aboutlibraries:5.6.2.
Required by:
:Transportr:unspecified
> Could not resolve com.mikepenz:aboutlibraries:5.6.2.
> Could not get resource 'https://jcenter.bintray.com/com/mikepenz/aboutlibraries/5.6.2/aboutlibraries-5.6.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/mikepenz/aboutlibraries/5.6.2/aboutlibraries-5.6.2.pom'.
> peer not authenticated
> Could not resolve com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7.
Required by:
:Transportr:unspecified
> Could not resolve com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7.
> Could not get resource 'https://jcenter.bintray.com/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
> peer not authenticated
> Could not resolve org.slf4j:slf4j-api:1.7.14.
Required by:
:Transportr:unspecified
> Could not resolve org.slf4j:slf4j-api:1.7.14.
> Could not get resource 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.14/slf4j-api-1.7.14.pom'.
> Could not GET 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.14/slf4j-api-1.7.14.pom'.
> peer not authenticated
> Could not resolve com.github.tony19:logback-android-classic:1.1.1-4.
Required by:
:Transportr:unspecified
> Could not resolve com.github.tony19:logback-android-classic:1.1.1-4.
> Could not get resource 'https://jcenter.bintray.com/com/github/tony19/logback-android-classic/1.1.1-4/logback-android-classic-1.1.1-4.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/tony19/logback-android-classic/1.1.1-4/logback-android-classic-1.1.1-4.pom'.
> peer not authenticated
> Could not resolve com.github.tony19:logback-android-core:1.1.1-4.
Required by:
:Transportr:unspecified
> Could not resolve com.github.tony19:logback-android-core:1.1.1-4.
> Could not get resource 'https://jcenter.bintray.com/com/github/tony19/logback-android-core/1.1.1-4/logback-android-core-1.1.1-4.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/tony19/logback-android-core/1.1.1-4/logback-android-core-1.1.1-4.pom'.
> peer not authenticated
> Could not resolve com.google.guava:guava:18.0.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve com.google.guava:guava:18.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom'.
> peer not authenticated
> Could not resolve org.slf4j:slf4j-api:1.7.14.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve org.slf4j:slf4j-api:1.7.14.
> Could not get resource 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.14/slf4j-api-1.7.14.pom'.
> Could not GET 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.14/slf4j-api-1.7.14.pom'.
> peer not authenticated
> Could not resolve com.google.code.findbugs:jsr305:3.0.0.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve com.google.code.findbugs:jsr305:3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom'.
> peer not authenticated
> Could not resolve org.json:json:20090211.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve org.json:json:20090211.
> Could not get resource 'https://jcenter.bintray.com/org/json/json/20090211/json-20090211.pom'.
> Could not GET 'https://jcenter.bintray.com/org/json/json/20090211/json-20090211.pom'.
> peer not authenticated
> Could not resolve all dependencies for configuration ':compile'.
> Could not resolve com.github.orangegangsters:swipy:1.2.2.
Required by:
:Transportr:unspecified
> Could not resolve com.github.orangegangsters:swipy:1.2.2.
> Could not get resource 'https://jcenter.bintray.com/com/github/orangegangsters/swipy/1.2.2/swipy-1.2.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/orangegangsters/swipy/1.2.2/swipy-1.2.2.pom'.
> peer not authenticated
> Could not resolve de.cketti.library.changelog:ckchangelog:1.2.2.
Required by:
:Transportr:unspecified
> Could not resolve de.cketti.library.changelog:ckchangelog:1.2.2.
> Could not get resource 'https://jcenter.bintray.com/de/cketti/library/changelog/ckchangelog/1.2.2/ckchangelog-1.2.2.pom'.
> Could not GET 'https://jcenter.bintray.com/de/cketti/library/changelog/ckchangelog/1.2.2/ckchangelog-1.2.2.pom'.
> peer not authenticated
> Could not resolve org.apmem.tools:layouts:1.10.
Required by:
:Transportr:unspecified
> Could not resolve org.apmem.tools:layouts:1.10.
> Could not get resource 'https://jcenter.bintray.com/org/apmem/tools/layouts/1.10/layouts-1.10.pom'.
> Could not GET 'https://jcenter.bintray.com/org/apmem/tools/layouts/1.10/layouts-1.10.pom'.
> peer not authenticated
> Could not resolve com.mikepenz:materialdrawer:5.1.6.
Required by:
:Transportr:unspecified
> Could not resolve com.mikepenz:materialdrawer:5.1.6.
> Could not get resource 'https://jcenter.bintray.com/com/mikepenz/materialdrawer/5.1.6/materialdrawer-5.1.6.pom'.
> Could not GET 'https://jcenter.bintray.com/com/mikepenz/materialdrawer/5.1.6/materialdrawer-5.1.6.pom'.
> peer not authenticated
> Could not resolve com.mikepenz:aboutlibraries:5.6.2.
Required by:
:Transportr:unspecified
> Could not resolve com.mikepenz:aboutlibraries:5.6.2.
> Could not get resource 'https://jcenter.bintray.com/com/mikepenz/aboutlibraries/5.6.2/aboutlibraries-5.6.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/mikepenz/aboutlibraries/5.6.2/aboutlibraries-5.6.2.pom'.
> peer not authenticated
> Could not resolve com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7.
Required by:
:Transportr:unspecified
> Could not resolve com.github.MKergall.osmbonuspack:OSMBonusPack:v5.7.
> Could not get resource 'https://jcenter.bintray.com/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/MKergall/osmbonuspack/OSMBonusPack/v5.7/OSMBonusPack-v5.7.pom'.
> peer not authenticated
> Could not resolve com.google.guava:guava:18.0.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve com.google.guava:guava:18.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.pom'.
> peer not authenticated
> Could not resolve org.slf4j:slf4j-api:1.7.12.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve org.slf4j:slf4j-api:1.7.12.
> Could not get resource 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.pom'.
> Could not GET 'https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.pom'.
> peer not authenticated
> Could not resolve com.google.code.findbugs:jsr305:3.0.0.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve com.google.code.findbugs:jsr305:3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.pom'.
> peer not authenticated
> Could not resolve org.json:json:20090211.
Required by:
:Transportr:unspecified > Transportr.sublibs.public-transport-enabler:enabler:unspecified
> Could not resolve org.json:json:20090211.
> Could not get resource 'https://jcenter.bintray.com/org/json/json/20090211/json-20090211.pom'.
> Could not GET 'https://jcenter.bintray.com/org/json/json/20090211/json-20090211.pom'.
> peer not authenticated
from transportr.
What gradle version are you using? gradle --version
If you are on 2.10, try at least 2.11.
from transportr.
It was 2.10.
I now changed distributionUrl in gradle-wrapper.properties to https\://services.gradle.org/distributions/gradle-2.13-all.zip
Now i get:
Error:Cause: unable to find valid certification path to requested target
from transportr.
Welcome to the beautiful world of Android ;)
Sounds like you are using gradle wrapper. Don't you have gradle installed on your system? I usually prefer to use my own gradle.
Otherwise, you need to search around and try various things. I haven't had this problem myself, so maybe one of those helps:
- https://stackoverflow.com/questions/26697118/android-studio-unable-to-find-valid-certification-path-to-requested-target
- https://stackoverflow.com/questions/29584328/gradlew-bat-and-gradlew-sslhandshakeexception
from transportr.
Any news?
from transportr.
I finally accomplished to be able to build Transportr in Android Studio with the help of this post: http://stackoverflow.com/a/33421921.
However, i'll need some time to get into the code;)
from transportr.
Awesome, let me know if you have any questions and please make sure to read the implementation notes above.
from transportr.
This is my roadmap:
- in the ProductDialogFragment: check, if at least one product is not selected, when ok is clicked.
- if this is the case -> remember the ones, which are not selected
- get the current transport network
- check if there's already a preference for this network
- create/update the shared preference with all the products, which were selected
- when resuming to the main activity: check if there's a preference file. If there's one, only use the products of the preference
from transportr.
First question: How do i check, if items in the Fragment are selected or not?
from transportr.
My original idea was to use one boolean preference per product per network, but you might be able to transform the products into a StringSet and use putStringSet
instead. In order to distinguish between networks, you would probably need to create one preferences file per network and use the networkId as name similar to here: https://github.com/grote/Transportr/blob/master/src/de/grobox/liberario/Preferences.java#L40
get the current transport network
You should be able to use the static method Preferences.getTransportNetwork()
.
check if there's already a preference for this network
You can just call getStringSet()
with a default value of null
that you can check for.
when resuming to the main activity: check if there's a preference file. If there's one, only use the products of the preference
You would probably make the same call to getStringSet()
. You could probably just add to methods to the Preferences
class: getProducts()
and setProducts()
or something like that.
How do i check, if items in the Fragment are selected or not?
You might be able to hook in here: https://github.com/grote/Transportr/blob/master/src/de/grobox/liberario/fragments/ProductDialogFragment.java#L110
Just make sure you store new preferences asynchronously.
Also once the user selects all products, it is maybe best to just delete the shared preferences again, or at least clear the product related ones in case we want to add more network specific settings in the future.
from transportr.
Thank you for your detailed explanations. Nice to see, that some of my thoughts matches with yours;)
How do i check, if items in the Fragment are selected or not?
You might be able to hook in here: https://github.com/grote/Transportr/blob/master/src/de/grobox/liberario/fragments/ProductDialogFragment.java#L110
But how do i get the information, if all products are selected? Can i get the full number of products of the current network and compare it to the size of the EnumSet products?
from transportr.
Can i get the full number of products of the current network and compare it to the size of the EnumSet products?
Yes for example, but every network potentially has all products even they do not actually exist in it. There's something like Product.ALL
you can call and compare.
from transportr.
Maybe it even makes sense to add the two methods not to the Preferences
class, but to the TransportNetwork
class.
from transportr.
Can i just open a WIP pull request? I think i'll need some further advise. Sorry 🙈
from transportr.
Sure, why not?
from transportr.
Related Issues (20)
- Bussteig Angabe HOT 1
- No maps HOT 1
- Please open an issue at https://github.com/grote/Transportr/issues.
- NVV/RMV: wrong stop position HOT 5
- RfT: Icons for MBTA support HOT 4
- Caen, France twisto bus network disapeared from schedules HOT 3
- Bug with search reloag give liste date before time HOT 3
- Target Android 12 (API level 32)
- Find an alternative for lost HOT 2
- UX - tap to show full line and stops HOT 1
- "Created by Transportr" entry in event description HOT 2
- Adding back support for broken regions HOT 1
- Remove broken Navitia endpoints HOT 4
- The app is not working in Brazil HOT 1
- Fdroid shows Version from 2018 HOT 1
- 9292 provider returns no stops in the Netherlands HOT 2
- Latest release (2.1.5) is missing in Google Play Store HOT 4
- Can't found Transportr in F-droid HOT 1
- Is this project dead? Again? HOT 3
- No stops or addresses in UK HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transportr.