|
|
@ -20,25 +20,31 @@ import org.androidannotations.annotations.EActivity; |
|
|
|
import org.androidannotations.annotations.OptionsItem; |
|
|
|
import org.androidannotations.annotations.OptionsItem; |
|
|
|
import org.androidannotations.annotations.OptionsMenu; |
|
|
|
import org.androidannotations.annotations.OptionsMenu; |
|
|
|
import org.transdroid.core.R; |
|
|
|
import org.transdroid.core.R; |
|
|
|
import org.transdroid.core.app.settings.*; |
|
|
|
import org.transdroid.core.app.settings.ApplicationSettings_; |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.TargetApi; |
|
|
|
import android.annotation.TargetApi; |
|
|
|
|
|
|
|
import android.app.AlertDialog; |
|
|
|
|
|
|
|
import android.app.Dialog; |
|
|
|
|
|
|
|
import android.content.DialogInterface; |
|
|
|
|
|
|
|
import android.content.DialogInterface.OnClickListener; |
|
|
|
import android.content.Intent; |
|
|
|
import android.content.Intent; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.Build; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Activity that allows for a configuration of some RSS feed. The key can be supplied to update an |
|
|
|
* Activity that allows for a configuration of some RSS feed. The key can be supplied to update an existing RSS feed |
|
|
|
* existing RSS feed setting instead of creating a new one. |
|
|
|
* setting instead of creating a new one. |
|
|
|
* @author Eric Kok |
|
|
|
* @author Eric Kok |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@EActivity |
|
|
|
@EActivity |
|
|
|
@OptionsMenu(resName="activity_deleteableprefs") |
|
|
|
@OptionsMenu(resName = "activity_deleteableprefs") |
|
|
|
public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity { |
|
|
|
public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
private static final int DIALOG_CONFIRMREMOVE = 0; |
|
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
|
|
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
@Override |
|
|
|
|
|
|
|
public void onCreate(Bundle savedInstanceState) { |
|
|
|
|
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
|
|
|
|
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
|
|
|
|
|
|
|
|
|
|
@ -57,10 +63,25 @@ public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity { |
|
|
|
MainSettingsActivity_.intent(this).flags(Intent.FLAG_ACTIVITY_CLEAR_TOP).start(); |
|
|
|
MainSettingsActivity_.intent(this).flags(Intent.FLAG_ACTIVITY_CLEAR_TOP).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@OptionsItem(resName = "action_removesettings") |
|
|
|
@OptionsItem(resName = "action_removesettings") |
|
|
|
protected void removeSettings() { |
|
|
|
protected void removeSettings() { |
|
|
|
ApplicationSettings_.getInstance_(this).removeRssfeedSettings(key); |
|
|
|
showDialog(DIALOG_CONFIRMREMOVE); |
|
|
|
finish(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Dialog onCreateDialog(int id) { |
|
|
|
|
|
|
|
switch (id) { |
|
|
|
|
|
|
|
case DIALOG_CONFIRMREMOVE: |
|
|
|
|
|
|
|
return new AlertDialog.Builder(this).setMessage(R.string.pref_confirmremove) |
|
|
|
|
|
|
|
.setPositiveButton(android.R.string.ok, new OnClickListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
|
|
|
|
ApplicationSettings_.getInstance_(RssfeedSettingsActivity.this).removeRssfeedSettings(key); |
|
|
|
|
|
|
|
finish(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).setNegativeButton(android.R.string.cancel, null).create(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|