diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-09-02 15:13:00 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-09-02 15:13:00 +0200 |
commit | 1f594ad311b8f72fb78f14d137dfb53f59b03f85 (patch) | |
tree | 86390d3f87c2c8da8614e122f7d584c4775c264e /src/de/danoeh/antennapod/activity | |
parent | 730ba3cc26d65a2f4c6c8f2489ea98beab10364b (diff) | |
download | AntennaPod-1f594ad311b8f72fb78f14d137dfb53f59b03f85.zip |
Upload changes instead of whole subscription list
Diffstat (limited to 'src/de/danoeh/antennapod/activity')
-rw-r--r-- | src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 74695f38c..94f3d5527 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.activity.gpoddernet; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; @@ -19,6 +20,7 @@ import de.danoeh.antennapod.preferences.GpodnetPreferences; import de.danoeh.antennapod.preferences.UserPreferences; import de.danoeh.antennapod.service.GpodnetSyncService; +import java.security.SecureRandom; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReference; @@ -32,6 +34,8 @@ import java.util.concurrent.atomic.AtomicReference; public class GpodnetAuthenticationActivity extends ActionBarActivity { private static final String TAG = "GpodnetAuthenticationActivity"; + private static final String CURRENT_STEP = "current_step"; + private ViewFlipper viewFlipper; private static final int STEP_DEFAULT = -1; @@ -78,6 +82,10 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { } } + @Override + public void onConfigurationChanged(Configuration newConfig) { + } + private void setupLoginView(View view) { final EditText username = (EditText) view.findViewById(R.id.etxtUsername); final EditText password = (EditText) view.findViewById(R.id.etxtPassword); @@ -167,7 +175,7 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { if (gpodnetDevices != null) { List<String> deviceNames = new ArrayList<String>(); for (GpodnetDevice device : gpodnetDevices) { - deviceNames.add(device.getId()); + deviceNames.add(device.getCaption()); } spinnerDevices.setAdapter(new ArrayAdapter<String>(GpodnetAuthenticationActivity.this, android.R.layout.simple_spinner_dropdown_item, deviceNames)); @@ -244,6 +252,7 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { } }); + deviceID.setText(generateDeviceID()); chooseDevice.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -254,6 +263,18 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { }); } + + private String generateDeviceID() { + final int DEVICE_ID_LENGTH = 10; + StringBuilder buffer = new StringBuilder(DEVICE_ID_LENGTH); + SecureRandom random = new SecureRandom(); + for (int i = 0; i < DEVICE_ID_LENGTH; i++) { + buffer.append(random.nextInt(10)); + + } + return buffer.toString(); + } + private boolean checkDeviceIDText(EditText deviceID, TextView txtvError, List<GpodnetDevice> devices) { String text = deviceID.getText().toString(); if (text.length() == 0) { |