Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-07-07 01:17:44 +02:00
commit 62ea811a1e
4 changed files with 113 additions and 67 deletions

View file

@ -1,64 +1,100 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView 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="fill_parent" >
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TableRow> <TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TextView <TableRow>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_name" />
<EditText <TextView
android:id="@+id/Name" android:paddingLeft="3dp"
android:layout_width="fill_parent" android:layout_span="2"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:paddingLeft="3dp" /> android:layout_height="wrap_content"
</TableRow> android:id="@+id/osmo_group_create_info"
android:textSize="18sp"
android:drawableRight="@drawable/ic_action_info_dark"
android:text="@string/osmo_group_information" />
</TableRow>
<TableRow> <TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_description" />
<EditText <TextView
android:id="@+id/Description" android:paddingLeft="3dp"
android:layout_width="fill_parent" android:id="@+id/osmo_group_create_dinfo"
android:layout_height="wrap_content" android:textSize="16sp"
android:lines="3" android:layout_span="2"
android:paddingLeft="3dp" /> android:minLines="3"
</TableRow> android:layout_width="wrap_content"
<TableRow> android:layout_height="wrap_content"
<TextView android:text="@string/osmo_group_information_desc"
android:layout_width="wrap_content" android:animateLayoutChanges="true"
android:layout_height="wrap_content" android:visibility="gone" />
android:text="@string/osmo_expire_group" /> </TableRow>
<Spinner <TableRow>
android:id="@+id/ExpireGroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_policy" />
<EditText <TextView
android:id="@+id/Policy" android:layout_width="wrap_content"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/osmo_group_name" />
android:lines="2"
android:paddingLeft="3dp" /> <EditText
</TableRow> android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_description" />
<EditText
android:id="@+id/Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="3"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
</TableLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_by_invite" />
<CheckBox
android:id="@+id/OnlyByInvite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_policy" />
<EditText
android:id="@+id/Policy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="2"
android:paddingLeft="3dp" />
</TableRow>
</TableLayout>
</ScrollView>

View file

@ -9,6 +9,14 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
--> -->
<string name="osmo_group_by_invite">Enter by invite</string>
<string name="osmo_group_information_desc">
- All created groups are public! If you want to be anonymous, connect devices directly via Tracker ids.\n
- The group could be registered up to 16 people.\n
- In case of inactivity or only 1 person activity for 2 weeks, group will be deleted.\n
- You can restrict group entrance, as only by invite, but to control group you need to go to admin console.\n
- If you need to create a group, but with other conditions please contact http://osmo.mobi</string>
<string name="osmo_group_information">Please read before creating a group!</string>
<string name="osmo_not_signed_in">OsMo login failed</string> <string name="osmo_not_signed_in">OsMo login failed</string>
<string name="osmo_gpx_points_downloaded">OsMo points %1$s downloaded.</string> <string name="osmo_gpx_points_downloaded">OsMo points %1$s downloaded.</string>
<string name="osmo_auto_connect_descr">Automatically connect to the service after application startup</string> <string name="osmo_auto_connect_descr">Automatically connect to the service after application startup</string>

View file

@ -358,11 +358,11 @@ public class OsMoGroups implements OsMoReactor, OsmoTrackerListener {
} }
public String createGroup(String groupName, long expireTime, String description, String policy) { public String createGroup(String groupName, boolean onlyByInvite, String description, String policy) {
JSONObject obj = new JSONObject(); JSONObject obj = new JSONObject();
try { try {
obj.put("name", groupName); obj.put("name", groupName);
obj.put("expireTime", expireTime); obj.put("onlyByInvite", onlyByInvite);
obj.put("description", description); obj.put("description", description);
obj.put("policy", policy); obj.put("policy", policy);
service.pushCommand("GROUP_CREATE|" + obj.toString()); service.pushCommand("GROUP_CREATE|" + obj.toString());

View file

@ -69,7 +69,7 @@ import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import android.widget.ArrayAdapter; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
@ -749,16 +749,19 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
final EditText policy = (EditText) v.findViewById(R.id.Policy); final EditText policy = (EditText) v.findViewById(R.id.Policy);
final EditText description = (EditText) v.findViewById(R.id.Description); final EditText description = (EditText) v.findViewById(R.id.Description);
final EditText name = (EditText) v.findViewById(R.id.Name); final EditText name = (EditText) v.findViewById(R.id.Name);
final Spinner expire = (Spinner) v.findViewById(R.id.ExpireGroup); final CheckBox onlyByInvite = (CheckBox) v.findViewById(R.id.OnlyByInvite);
final int[] days = new int[]{1,2,3,7,14}; final TextView warnCreate = (TextView) v.findViewById(R.id.osmo_group_create_info);
String[] ds = new String[days.length]; final TextView warnCreateDesc = (TextView) v.findViewById(R.id.osmo_group_create_dinfo);
for(int k = 0; k < days.length; k++) { View.OnClickListener click = new View.OnClickListener() {
ds[k] = days[k] + " " + getString(R.string.int_days);
} @Override
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, ds); public void onClick(View v) {
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); int vls = warnCreateDesc.getVisibility();
expire.setAdapter(adapter); warnCreateDesc.setVisibility(vls == View.VISIBLE? View.GONE : View.VISIBLE);
expire.setSelection(3); }
};
warnCreate.setOnClickListener(click);
warnCreateDesc.setOnClickListener(click);
builder.setView(v); builder.setView(v);
builder.setNegativeButton(R.string.default_buttons_cancel, null); builder.setNegativeButton(R.string.default_buttons_cancel, null);
@ -768,8 +771,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
if(!checkOperationIsNotRunning()) { if(!checkOperationIsNotRunning()) {
return ; return ;
} }
long eTime = days[expire.getSelectedItemPosition()] * 60 * 60 * 24 * 1000 + System.currentTimeMillis(); String op = osMoPlugin.getGroups().createGroup(name.getText().toString(), onlyByInvite.isChecked(),
String op = osMoPlugin.getGroups().createGroup(name.getText().toString(), eTime,
description.getText().toString(), policy.getText().toString()); description.getText().toString(), policy.getText().toString());
startLongRunningOperation(op); startLongRunningOperation(op);
} }