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"?>
<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_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
android:layout_height="fill_parent" >
<TableRow>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:stretchColumns="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_name" />
<TableRow>
<EditText
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TextView
android:paddingLeft="3dp"
android:layout_span="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_description" />
<TableRow>
<EditText
android:id="@+id/Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="3"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_expire_group" />
<TextView
android:paddingLeft="3dp"
android:id="@+id/osmo_group_create_dinfo"
android:textSize="16sp"
android:layout_span="2"
android:minLines="3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_information_desc"
android:animateLayoutChanges="true"
android:visibility="gone" />
</TableRow>
<Spinner
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" />
<TableRow>
<EditText
android:id="@+id/Policy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="2"
android:paddingLeft="3dp" />
</TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/osmo_group_name" />
<EditText
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp" />
</TableRow>
<TableRow>
</TableLayout>
<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>
<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).
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_gpx_points_downloaded">OsMo points %1$s downloaded.</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();
try {
obj.put("name", groupName);
obj.put("expireTime", expireTime);
obj.put("onlyByInvite", onlyByInvite);
obj.put("description", description);
obj.put("policy", policy);
service.pushCommand("GROUP_CREATE|" + obj.toString());

View file

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