Fix http scheme

This commit is contained in:
vshcherb 2014-05-29 03:00:29 +02:00
parent 0b1708cb17
commit 10873687ce
8 changed files with 48 additions and 51 deletions

View file

@ -132,7 +132,7 @@
<activity android:name="net.osmand.plus.osmo.SettingsOsMoActivity" android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity">
<intent-filter>
<data android:scheme="http" android:host="osmo.mobi" />
<data android:scheme="http" android:host="m.osmo.mobi" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"></category>

View file

@ -2,8 +2,8 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TableRow>

View file

@ -2,8 +2,8 @@
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TableRow>

View file

@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:orientation="vertical" >
<TableLayout
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TableRow>
@ -47,6 +43,5 @@
android:layout_marginRight="5dp" >
</Spinner>
</TableRow>
</TableLayout>
</LinearLayout>
</TableLayout>

View file

@ -629,6 +629,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
private void createGroup() {
if(osMoPlugin.getService().getRegisteredUserName() == null) {
signin();
return;
}
Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.osmo_create_group);

View file

@ -24,7 +24,7 @@ public class OsMoIntentHandler extends AsyncTask<Intent, Void, String> {
for (Intent intent : params) {
String scheme = intent.getScheme();
Uri data = intent.getData();
if ("http".equals(scheme) && data.getHost().equals("osmo.mobi")) {
if ("http".equals(scheme) && data.getHost().equals("m.osmo.mobi")) {
String path = data.getPath();
String lastPath = path.substring(path.lastIndexOf('/') + 1);
if(lastPath.equals("login")) {

View file

@ -38,8 +38,9 @@ public class OsMoService implements OsMoReactor {
private ConcurrentLinkedQueue<String> commands = new ConcurrentLinkedQueue<String>();
private OsmandApplication app;
private static final Log log = PlatformUtil.getLog(OsMoService.class);
public static final String SHARE_TRACKER_URL = "http://osmo.mobi/connect?id=";
public static final String SHARE_GROUP_URL = "http://osmo.mobi/join?id=";
public static final String SHARE_TRACKER_URL = "http://m.osmo.mobi/connect?id=";
public static final String SHARE_GROUP_URL = "http://m.osmo.mobi/join?id=";
public static final String TRACK_URL = "http://test1342.osmo.mobi/u/";
private String lastRegistrationError = null;

View file

@ -42,7 +42,7 @@ public class OsMoTracker implements OsMoReactor {
if (!isEnabledTracker()) {
return null;
}
return "http://test1342.osmo.mobi/u/" + sessionURL;
return OsMoService.TRACK_URL + sessionURL;
}
public boolean isEnabledTracker() {