Skip to content

Commit

Permalink
Merge branch 'fix_web_history'
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Jul 28, 2024
2 parents 481d52b + 793e571 commit 13d1bb1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import de.blau.android.osm.Relation;
import de.blau.android.osm.RelationMember;
import de.blau.android.osm.RelationUtils;
import de.blau.android.osm.Server;
import de.blau.android.osm.Tags;
import de.blau.android.osm.Way;
import de.blau.android.prefs.PrefEditor;
Expand Down Expand Up @@ -573,10 +574,14 @@ public static void checkEmptyRelations(@NonNull FragmentActivity activity, @Null

/**
* Opens the history page of the selected element in a browser
*
* FIXME To avoid being caught by the pathPatterns in the manifest we use the API url, that is redirected
* to the website in this special case, this is a hack that will require API 31 with better pattern support
* to fix properly.
*/
private void showHistory() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(prefs.getServer().getWebsiteBaseUrl() + element.getName() + "/" + element.getOsmId() + "/history"));
intent.setData(Uri.parse(Server.getBaseUrl(prefs.getServer().getReadWriteUrl()) + element.getName() + "/" + element.getOsmId() + "/history"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
main.startActivity(intent);
}
Expand Down

0 comments on commit 13d1bb1

Please sign in to comment.