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.SettingsOsMoActivity" android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity"> <activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity">
<intent-filter> <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" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"></category> <category android:name="android.intent.category.BROWSABLE"></category>

View file

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

View file

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

View file

@ -1,52 +1,47 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:paddingLeft="7dp"
android:orientation="vertical" > android:paddingRight="7dp"
android:stretchColumns="1" >
<TableLayout <TableRow>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="1" >
<TableRow> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_connect_to_device_name" />
<TextView <EditText
android:layout_width="wrap_content" android:id="@+id/Name"
android:layout_height="wrap_content" android:layout_width="180dp"
android:text="@string/osmo_connect_to_device_name" /> android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="" >
<EditText <requestFocus />
android:id="@+id/Name" </EditText>
android:layout_width="180dp" </TableRow>
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="" >
<requestFocus /> <TableRow
</EditText> android:layout_width="fill_parent"
</TableRow> android:layout_height="wrap_content" >
<TableRow <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_edit_color" >
</TextView>
<Spinner
android:id="@+id/ColorSpinner"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
</Spinner>
</TableRow>
<TextView </TableLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_edit_color" >
</TextView>
<Spinner
android:id="@+id/ColorSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
</Spinner>
</TableRow>
</TableLayout>
</LinearLayout>

View file

@ -629,6 +629,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
private void createGroup() { private void createGroup() {
if(osMoPlugin.getService().getRegisteredUserName() == null) { if(osMoPlugin.getService().getRegisteredUserName() == null) {
signin(); signin();
return;
} }
Builder builder = new AlertDialog.Builder(this); Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.osmo_create_group); 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) { for (Intent intent : params) {
String scheme = intent.getScheme(); String scheme = intent.getScheme();
Uri data = intent.getData(); 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 path = data.getPath();
String lastPath = path.substring(path.lastIndexOf('/') + 1); String lastPath = path.substring(path.lastIndexOf('/') + 1);
if(lastPath.equals("login")) { if(lastPath.equals("login")) {

View file

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

View file

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