-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1489 from DroidPlanner/feature_custom_alt_prefere…
…nces Feature custom altitude preferences
- Loading branch information
Showing
44 changed files
with
1,563 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Android/src/org/droidplanner/android/data/DatabaseState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.droidplanner.android.data; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import org.droidplanner.android.maps.providers.mapbox.offline.OfflineDatabaseHandler; | ||
|
||
import java.util.Locale; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
/** | ||
* Created by Fredia Huya-Kouadio on 5/13/15. | ||
*/ | ||
public class DatabaseState { | ||
|
||
private static final ConcurrentHashMap<String, OfflineDatabaseHandler> databaseHandlers = new ConcurrentHashMap<>(); | ||
|
||
public static OfflineDatabaseHandler getOfflineDatabaseHandlerForMapId(Context context, String dbName) { | ||
final String lowerMapId = dbName.toLowerCase(Locale.US); | ||
if (databaseHandlers.containsKey(lowerMapId)) { | ||
return databaseHandlers.get(dbName); | ||
} | ||
|
||
OfflineDatabaseHandler dbh = new OfflineDatabaseHandler(context, lowerMapId); | ||
databaseHandlers.put(lowerMapId, dbh); | ||
return dbh; | ||
} | ||
|
||
public static void deleteDatabase(Context context, String dbName){ | ||
if(context == null || TextUtils.isEmpty(dbName)) | ||
return; | ||
|
||
final String lowerMapId = dbName.toLowerCase(Locale.US); | ||
OfflineDatabaseHandler dbHandler = databaseHandlers.remove(lowerMapId); | ||
if(dbHandler != null) | ||
dbHandler.close(); | ||
|
||
context.deleteDatabase(lowerMapId); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Android/src/org/droidplanner/android/dialogs/EditInputDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Android/src/org/droidplanner/android/dialogs/YesNoWithPrefsDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.