mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
merge heads
This commit is contained in:
@@ -17,8 +17,8 @@ limitations under the License.
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.android.maps.mytracks"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="33"
|
||||
android:versionName="1.1.10">
|
||||
android:versionCode="34"
|
||||
android:versionName="1.1.11">
|
||||
<application android:icon="@drawable/arrow_icon"
|
||||
android:label="@string/my_tracks_app_name"
|
||||
android:name="com.google.android.apps.mytracks.MyTracksApplication"
|
||||
|
||||
@@ -15,110 +15,121 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/screen"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:background="@drawable/list_bar"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_bar">
|
||||
android:layout_width="fill_parent">
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_title"
|
||||
android:textSize="20dip"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginLeft="10dip"/>
|
||||
android:textSize="20dip"/>
|
||||
</LinearLayout>
|
||||
<ScrollView android:id="@+id/sendtogoogle_scrollview"
|
||||
android:layout_width="fill_parent"
|
||||
<ScrollView
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1">
|
||||
android:layout_marginBottom="5dip"
|
||||
android:layout_marginLeft="5dip"
|
||||
android:layout_marginTop="5dip"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent">
|
||||
<TableLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1"
|
||||
android:layout_marginTop="5dip"
|
||||
android:layout_marginLeft="5dip">
|
||||
android:layout_width="fill_parent"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<!-- My Maps -->
|
||||
<!-- Google My Maps -->
|
||||
<TableRow>
|
||||
<ImageView android:src="@drawable/mymaps_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dip">
|
||||
<CheckBox android:id="@+id/sendtogoogle_google_mymaps"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/mymaps_icon"/>
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<CheckBox
|
||||
android:checked="true"
|
||||
android:id="@+id/send_google_my_maps"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/send_google_my_maps"
|
||||
android:textSize="20dip"
|
||||
android:checked="true"/>
|
||||
<RadioGroup android:id="@+id/sendtogoogle_group_mymaps"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<RadioButton android:id="@+id/sendtogoogle_create_new_map"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_my_maps"
|
||||
android:textSize="18dip"/>
|
||||
<RadioGroup
|
||||
android:id="@+id/send_google_my_maps_group"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<RadioButton
|
||||
android:id="@+id/send_google_new_map"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_new_map"/>
|
||||
<RadioButton android:id="@+id/sendtogoogle_pick_existing_map"
|
||||
android:layout_width="fill_parent"
|
||||
<RadioButton
|
||||
android:id="@+id/send_google_existing_map"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_existing_map"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<!-- Fusion Tables -->
|
||||
<!-- Google Fusion Tables -->
|
||||
<TableRow>
|
||||
<ImageView android:src="@drawable/googledocs_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dip">
|
||||
<CheckBox android:id="@+id/sendtogoogle_google_fusiontables"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/googledocs_icon"/>
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<CheckBox
|
||||
android:checked="true"
|
||||
android:id="@+id/send_google_fusion_tables"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_fusion_tables"
|
||||
android:textSize="20dip"
|
||||
android:checked="true"/>
|
||||
android:textSize="18dip"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<!-- Google Docs -->
|
||||
<TableRow>
|
||||
<ImageView android:src="@drawable/googledocs_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dip">
|
||||
<CheckBox android:id="@+id/sendtogoogle_google_docs"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/googledocs_icon"/>
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<CheckBox
|
||||
android:checked="true"
|
||||
android:id="@+id/send_google_docs"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/send_google_docs"
|
||||
android:textSize="20dip"
|
||||
android:checked="true"/>
|
||||
android:textSize="18dip"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</ScrollView>
|
||||
<LinearLayout style="@style/ButtonLayout">
|
||||
<LinearLayout style="@style/ButtonSpacer"/>
|
||||
<Button android:id="@+id/sendtogoogle_send_now"
|
||||
<Button
|
||||
android:id="@+id/send_google_send_now"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/send_google_send_now"
|
||||
style="@style/Button"/>
|
||||
<Button android:id="@+id/sendtogoogle_cancel"
|
||||
<Button
|
||||
android:id="@+id/send_google_cancel"
|
||||
android:layout_gravity="right"
|
||||
android:text="@string/generic_cancel"
|
||||
style="@style/Button"/>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.google.android.apps.mytracks.io.sendtogoogle;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Dialog;
|
||||
@@ -40,11 +41,11 @@ import android.widget.RadioGroup;
|
||||
*/
|
||||
public class SendDialog extends Dialog {
|
||||
|
||||
private RadioButton createNewMapRadioButton;
|
||||
private RadioButton pickMapRadioButton;
|
||||
private CheckBox sendToMyMapsCheckBox;
|
||||
private CheckBox sendToFusionTablesCheckBox;
|
||||
private CheckBox sendToDocsCheckBox;
|
||||
private RadioButton newMapRadioButton;
|
||||
private RadioButton existingMapRadioButton;
|
||||
private CheckBox myMapsCheckBox;
|
||||
private CheckBox fusionTablesCheckBox;
|
||||
private CheckBox docsCheckBox;
|
||||
private OnClickListener clickListener;
|
||||
|
||||
public SendDialog(Context context) {
|
||||
@@ -57,19 +58,17 @@ public class SendDialog extends Dialog {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.mytracks_send_to_google);
|
||||
|
||||
final Button sendButton = (Button) findViewById(R.id.sendtogoogle_send_now);
|
||||
final RadioGroup groupMyMaps = (RadioGroup) findViewById(R.id.sendtogoogle_group_mymaps);
|
||||
sendToMyMapsCheckBox =
|
||||
(CheckBox) findViewById(R.id.sendtogoogle_google_mymaps);
|
||||
sendToFusionTablesCheckBox =
|
||||
(CheckBox) findViewById(R.id.sendtogoogle_google_fusiontables);
|
||||
sendToDocsCheckBox = (CheckBox) findViewById(R.id.sendtogoogle_google_docs);
|
||||
createNewMapRadioButton =
|
||||
(RadioButton) findViewById(R.id.sendtogoogle_create_new_map);
|
||||
pickMapRadioButton =
|
||||
(RadioButton) findViewById(R.id.sendtogoogle_pick_existing_map);
|
||||
final Button sendButton = (Button) findViewById(R.id.send_google_send_now);
|
||||
|
||||
Button cancel = (Button) findViewById(R.id.sendtogoogle_cancel);
|
||||
final RadioGroup myMapsGroup = (RadioGroup) findViewById(R.id.send_google_my_maps_group);
|
||||
newMapRadioButton = (RadioButton) findViewById(R.id.send_google_new_map);
|
||||
existingMapRadioButton = (RadioButton) findViewById(R.id.send_google_existing_map);
|
||||
|
||||
myMapsCheckBox = (CheckBox) findViewById(R.id.send_google_my_maps);
|
||||
fusionTablesCheckBox = (CheckBox) findViewById(R.id.send_google_fusion_tables);
|
||||
docsCheckBox = (CheckBox) findViewById(R.id.send_google_docs);
|
||||
|
||||
Button cancel = (Button) findViewById(R.id.send_google_cancel);
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
if (clickListener != null) {
|
||||
@@ -79,7 +78,7 @@ public class SendDialog extends Dialog {
|
||||
}
|
||||
});
|
||||
|
||||
Button send = (Button) findViewById(R.id.sendtogoogle_send_now);
|
||||
Button send = (Button) findViewById(R.id.send_google_send_now);
|
||||
send.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
if (clickListener != null) {
|
||||
@@ -91,80 +90,72 @@ public class SendDialog extends Dialog {
|
||||
|
||||
OnCheckedChangeListener checkBoxListener = new OnCheckedChangeListener() {
|
||||
public void onCheckedChanged(CompoundButton button, boolean checked) {
|
||||
sendButton.setEnabled(
|
||||
sendToMyMapsCheckBox.isChecked() ||
|
||||
sendToFusionTablesCheckBox.isChecked() ||
|
||||
sendToDocsCheckBox.isChecked());
|
||||
groupMyMaps.setVisibility(sendToMyMapsCheckBox.isChecked() ? View.VISIBLE : View.INVISIBLE);
|
||||
sendButton.setEnabled(myMapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|
||||
|| docsCheckBox.isChecked());
|
||||
myMapsGroup.setVisibility(myMapsCheckBox.isChecked() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
};
|
||||
sendToMyMapsCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
sendToFusionTablesCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
sendToDocsCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
|
||||
myMapsCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
fusionTablesCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
docsCheckBox.setOnCheckedChangeListener(checkBoxListener);
|
||||
|
||||
SharedPreferences prefs =
|
||||
getContext().getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = getContext().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs != null) {
|
||||
sendToMyMapsCheckBox.setChecked(
|
||||
prefs.getBoolean(
|
||||
getContext().getString(R.string.send_to_my_maps_key), true));
|
||||
sendToFusionTablesCheckBox.setChecked(
|
||||
prefs.getBoolean(
|
||||
getContext().getString(R.string.send_to_fusion_tables_key), true));
|
||||
sendToDocsCheckBox.setChecked(
|
||||
prefs.getBoolean(
|
||||
getContext().getString(R.string.send_to_docs_key), true));
|
||||
pickMapRadioButton.setChecked(
|
||||
prefs.getBoolean(
|
||||
getContext().getString(R.string.pick_existing_map_key), false));
|
||||
createNewMapRadioButton.setChecked(
|
||||
!prefs.getBoolean(
|
||||
getContext().getString(R.string.pick_existing_map_key), false));
|
||||
boolean pickExistingMap = prefs.getBoolean(
|
||||
getContext().getString(R.string.pick_existing_map_key), false);
|
||||
|
||||
newMapRadioButton.setChecked(!pickExistingMap);
|
||||
existingMapRadioButton.setChecked(pickExistingMap);
|
||||
|
||||
myMapsCheckBox.setChecked(
|
||||
prefs.getBoolean(getContext().getString(R.string.send_to_my_maps_key), true));
|
||||
fusionTablesCheckBox.setChecked(
|
||||
prefs.getBoolean(getContext().getString(R.string.send_to_fusion_tables_key), true));
|
||||
docsCheckBox.setChecked(
|
||||
prefs.getBoolean(getContext().getString(R.string.send_to_docs_key), true));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
SharedPreferences prefs =
|
||||
getContext().getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
super.onStop();
|
||||
SharedPreferences prefs = getContext().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs != null) {
|
||||
Editor editor = prefs.edit();
|
||||
if (editor != null) {
|
||||
editor.putBoolean(
|
||||
getContext().getString(R.string.send_to_my_maps_key),
|
||||
sendToMyMapsCheckBox.isChecked());
|
||||
editor.putBoolean(
|
||||
getContext().getString(R.string.send_to_fusion_tables_key),
|
||||
sendToFusionTablesCheckBox.isChecked());
|
||||
editor.putBoolean(
|
||||
getContext().getString(R.string.send_to_docs_key),
|
||||
sendToDocsCheckBox.isChecked());
|
||||
editor.putBoolean(
|
||||
getContext().getString(R.string.pick_existing_map_key),
|
||||
pickMapRadioButton.isChecked());
|
||||
editor.commit();
|
||||
editor.putBoolean(getContext().getString(R.string.pick_existing_map_key),
|
||||
existingMapRadioButton.isChecked());
|
||||
editor.putBoolean(getContext().getString(R.string.send_to_my_maps_key),
|
||||
myMapsCheckBox.isChecked());
|
||||
editor.putBoolean(getContext().getString(R.string.send_to_fusion_tables_key),
|
||||
fusionTablesCheckBox.isChecked());
|
||||
editor.putBoolean(getContext().getString(R.string.send_to_docs_key),
|
||||
docsCheckBox.isChecked());
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
}
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClickListener clickListener) {
|
||||
this.clickListener = clickListener;
|
||||
}
|
||||
|
||||
public boolean getSendToMyMaps() {
|
||||
return sendToMyMapsCheckBox.isChecked();
|
||||
public boolean getCreateNewMap() {
|
||||
return newMapRadioButton.isChecked();
|
||||
}
|
||||
|
||||
public boolean getSendToMyMaps() {
|
||||
return myMapsCheckBox.isChecked();
|
||||
}
|
||||
|
||||
public boolean getSendToFusionTables() {
|
||||
return sendToFusionTablesCheckBox.isChecked();
|
||||
return fusionTablesCheckBox.isChecked();
|
||||
}
|
||||
|
||||
public boolean getSendToDocs() {
|
||||
return sendToDocsCheckBox.isChecked();
|
||||
}
|
||||
|
||||
public boolean getCreateNewMap() {
|
||||
return createNewMapRadioButton.isChecked();
|
||||
return docsCheckBox.isChecked();
|
||||
}
|
||||
}
|
||||
+15
-14
@@ -188,11 +188,12 @@ public abstract class AntSensorManager extends SensorManager {
|
||||
private void cleanAntInterface() {
|
||||
Log.i(TAG, "Destroying AntSensorManager");
|
||||
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return;
|
||||
}
|
||||
antReceiver.releaseInterface();
|
||||
antReceiver.destroy();
|
||||
antReceiver = null;
|
||||
@@ -213,12 +214,12 @@ public abstract class AntSensorManager extends SensorManager {
|
||||
private synchronized void serviceConnected() {
|
||||
Log.d(TAG, "ANT service connected");
|
||||
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!antReceiver.claimInterface()) {
|
||||
Log.e(TAG, "failed to claim ANT interface");
|
||||
return;
|
||||
@@ -305,12 +306,12 @@ public abstract class AntSensorManager extends SensorManager {
|
||||
short deviceNumber, byte deviceType, byte txType, short channelPeriod,
|
||||
byte radioFreq, byte proxSearch) {
|
||||
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (antReceiver == null) {
|
||||
Log.e(TAG, "no ANT receiver");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Assign as slave channel on selected network (0 = public, 1 = ANT+, 2 =
|
||||
// ANTFS)
|
||||
antReceiver.ANTAssignChannel(channelNumber, AntDefine.PARAMETER_RX_NOT_TX, networkNumber);
|
||||
|
||||
Reference in New Issue
Block a user