diff options
| author | Brian <bpcampbell@gmail.com> | 2013-01-06 08:50:09 -1000 |
|---|---|---|
| committer | Brian <bpcampbell@gmail.com> | 2013-01-06 08:50:09 -1000 |
| commit | a7703165cd8b67870069054d192507ec0369b20d (patch) | |
| tree | 0c26c26ac4b1b81c857bcda1120050618e660e56 /main/src/cgeo/geocaching/CacheDetailActivity.java | |
| parent | 4302a5521d410a3fb9f387dbedf0636d6f536f5a (diff) | |
| parent | 54e7924aea1a8ebf1a0bd7a3ee1509803d4face0 (diff) | |
| download | cgeo-a7703165cd8b67870069054d192507ec0369b20d.zip cgeo-a7703165cd8b67870069054d192507ec0369b20d.tar.gz cgeo-a7703165cd8b67870069054d192507ec0369b20d.tar.bz2 | |
Merge branch 'fix_2290_radio' of git://github.com/triakcz/c-geo-opensource into triakcz-fix_2290_radio
Diffstat (limited to 'main/src/cgeo/geocaching/CacheDetailActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 2b64924..37a24ad 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -84,13 +84,11 @@ import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; -import android.widget.CheckBox; -import android.widget.CompoundButton; -import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; +import android.widget.RadioButton; import android.widget.ScrollView; import android.widget.TextView; import android.widget.TextView.BufferType; @@ -2251,10 +2249,10 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc /** * A dialog to allow the user to select reseting coordinates local/remote/both. */ - private class ResetCacheCoordinatesDialog extends AlertDialog implements OnCheckedChangeListener { + private class ResetCacheCoordinatesDialog extends AlertDialog { - final CheckBox uploadOption; - final CheckBox resetLocalyOption; + final RadioButton resetBoth; + final RadioButton resetLocal; public ResetCacheCoordinatesDialog(final cgCache cache, final cgWaypoint wpt, final Activity activity) { super(activity); @@ -2262,17 +2260,13 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc View layout = activity.getLayoutInflater().inflate(R.layout.reset_cache_coords_dialog, null); setView(layout); - uploadOption = (CheckBox) layout.findViewById(R.id.upload); - resetLocalyOption = (CheckBox) layout.findViewById(R.id.local); + resetLocal = (RadioButton) layout.findViewById(R.id.reset_cache_coordinates_local); + resetBoth = (RadioButton) layout.findViewById(R.id.reset_cache_coordinates_local_and_remote); if (ConnectorFactory.getConnector(cache).supportsOwnCoordinates()) { - uploadOption.setChecked(true); - uploadOption.setVisibility(View.VISIBLE); + resetBoth.setVisibility(View.VISIBLE); } - uploadOption.setOnCheckedChangeListener(this); - resetLocalyOption.setOnCheckedChangeListener(this); - layout.findViewById(R.id.reset).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -2290,23 +2284,17 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc remoteFinished = true; } - if ((localFinished || !resetLocalyOption.isChecked()) && (remoteFinished || !uploadOption.isChecked())) { + if ((localFinished) && (remoteFinished || !resetBoth.isChecked())) { p.dismiss(); notifyDataSetChanged(); } } }; - new ResetCoordsThread(cache, h, wpt, resetLocalyOption.isChecked(), uploadOption.isChecked(), p).start(); + new ResetCoordsThread(cache, h, wpt, resetLocal.isChecked() || resetBoth.isChecked(), resetBoth.isChecked(), p).start(); } }); } - - @Override - public void onCheckedChanged(CompoundButton arg0, boolean arg1) { - findViewById(R.id.reset).setEnabled( - (uploadOption.isChecked() || resetLocalyOption.isChecked())); - } } private class ResetCoordsThread extends Thread { |
