Browse Source

Started work on Material design version of Transdroid. Certainly still bugged and need to figure out lots of (often major, liek the split action bar) design details.

material
Eric Kok 10 years ago
parent
commit
580608d37d
  1. 8
      app/build.gradle
  2. 2
      app/src/main/AndroidManifest.xml
  3. 29
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  4. 43
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  5. 17
      app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java
  6. 2
      app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java
  7. 5
      app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java
  8. 9
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
  9. 9
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
  10. 2
      app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java
  11. 4
      app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java
  12. 2
      app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
  13. 2
      app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java
  14. 2
      app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java
  15. 2
      app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
  16. 2
      app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  17. 2
      app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java
  18. 2
      app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java
  19. 2
      app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java
  20. 2
      app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java
  21. 2
      app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java
  22. 10
      app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java
  23. 1
      app/src/main/res/layout/actionbar_navigation.xml
  24. 5
      app/src/main/res/values/colors.xml
  25. 35
      app/src/main/res/values/styles_transdroid_dark.xml
  26. 45
      app/src/main/res/values/styles_transdroid_light.xml

8
app/build.gradle

@ -3,12 +3,12 @@ apply plugin: 'android-apt'
apply from: '../signing.gradle' apply from: '../signing.gradle'
android { android {
compileSdkVersion 19 compileSdkVersion 21
buildToolsVersion '20.0.0' buildToolsVersion '20.0.0'
defaultConfig { defaultConfig {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 19 targetSdkVersion 21
versionCode 216 versionCode 216
versionName '2.3.0-beta' versionName '2.3.0-beta'
} }
@ -46,9 +46,9 @@ dependencies {
compile 'org.androidannotations:androidannotations-api:3.1' compile 'org.androidannotations:androidannotations-api:3.1'
compile 'com.j256.ormlite:ormlite-core:4.48' compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48' compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.8' compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.+'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.+' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.+'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-annotations:20.0.0' compile 'com.android.support:support-annotations:20.0.0'
apt "org.androidannotations:androidannotations:3.1" apt "org.androidannotations:androidannotations:3.1"
} }

2
app/src/main/AndroidManifest.xml

@ -44,7 +44,7 @@
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@android:style/Theme.Holo" > android:theme="@style/Theme.AppCompat" >
<!-- Main activities --> <!-- Main activities -->
<activity <activity

29
app/src/main/java/org/transdroid/core/gui/DetailsActivity.java

@ -32,7 +32,6 @@ import org.androidannotations.annotations.UiThread;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.core.app.settings.*; import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent; import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;
import org.transdroid.core.gui.log.Log; import org.transdroid.core.gui.log.Log;
import org.transdroid.core.gui.navigation.Label; import org.transdroid.core.gui.navigation.Label;
import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.NavigationHelper;
@ -64,14 +63,11 @@ import org.transdroid.daemon.task.SetTrackersTask;
import org.transdroid.daemon.task.StartTask; import org.transdroid.daemon.task.StartTask;
import org.transdroid.daemon.task.StopTask; import org.transdroid.daemon.task.StopTask;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
@ -84,7 +80,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
*/ */
@EActivity(resName = "activity_details") @EActivity(resName = "activity_details")
@OptionsMenu(resName = "activity_details") @OptionsMenu(resName = "activity_details")
public class DetailsActivity extends Activity implements TorrentTasksExecutor, RefreshableActivity { public class DetailsActivity extends ActionBarActivity implements TorrentTasksExecutor, RefreshableActivity {
@Extra @Extra
@InstanceState @InstanceState
@ -103,7 +99,6 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
@Bean @Bean
protected ApplicationSettings applicationSettings; protected ApplicationSettings applicationSettings;
private IDaemonAdapter currentConnection = null; private IDaemonAdapter currentConnection = null;
private PullToRefreshAttacher pullToRefreshAttacher = null;
// Details view components // Details view components
@FragmentById(resName = "torrentdetails_fragment") @FragmentById(resName = "torrentdetails_fragment")
@ -114,7 +109,6 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -129,8 +123,8 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
} }
// Simple action bar with up, torrent name as title and refresh button // Simple action bar with up, torrent name as title and refresh button
getActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setTitle(NavigationHelper.buildCondensedFontString(torrent.getName())); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(torrent.getName()));
// Connect to the last used server // Connect to the last used server
ServerSetting lastUsed = applicationSettings.getLastUsedServer(); ServerSetting lastUsed = applicationSettings.getLastUsedServer();
@ -161,20 +155,7 @@ public class DetailsActivity extends Activity implements TorrentTasksExecutor, R
*/ */
@Override @Override
public void addRefreshableView(View view) { public void addRefreshableView(View view) {
if (pullToRefreshAttacher == null) { // TODO Add new style pull to refresh library
// Still need to initialise the PullToRefreshAttacher
Options options = new PullToRefreshAttacher.Options();
options.headerTransformer = new NoProgressHeaderTransformer();
pullToRefreshAttacher = PullToRefreshAttacher.get(this, options);
}
pullToRefreshAttacher.addRefreshableView(view, new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
// Just refresh the full screen, now that the user has pulled to refresh
pullToRefreshAttacher.setRefreshComplete();
refreshScreen();
}
});
} }
@OptionsItem(resName = "action_refresh") @OptionsItem(resName = "action_refresh")

43
app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java

@ -49,7 +49,6 @@ import org.transdroid.R;
import org.transdroid.core.app.search.*; import org.transdroid.core.app.search.*;
import org.transdroid.core.app.settings.*; import org.transdroid.core.app.settings.*;
import org.transdroid.core.gui.lists.LocalTorrent; import org.transdroid.core.gui.lists.LocalTorrent;
import org.transdroid.core.gui.lists.NoProgressHeaderTransformer;
import org.transdroid.core.gui.lists.SimpleListItem; import org.transdroid.core.gui.lists.SimpleListItem;
import org.transdroid.core.gui.log.*; import org.transdroid.core.gui.log.*;
import org.transdroid.core.gui.navigation.*; import org.transdroid.core.gui.navigation.*;
@ -97,13 +96,7 @@ import org.transdroid.daemon.task.StartTask;
import org.transdroid.daemon.task.StopTask; import org.transdroid.daemon.task.StopTask;
import org.transdroid.daemon.util.HttpHelper; import org.transdroid.daemon.util.HttpHelper;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefreshListener;
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.Options;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Intent; import android.content.Intent;
@ -111,10 +104,12 @@ import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.MenuItem.OnActionExpandListener;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.AdapterView; import android.widget.AdapterView;
@ -132,7 +127,7 @@ import de.keyboardsurfer.android.widget.crouton.Crouton;
*/ */
@EActivity(resName = "activity_torrents") @EActivity(resName = "activity_torrents")
@OptionsMenu(resName = "activity_torrents") @OptionsMenu(resName = "activity_torrents")
public class TorrentsActivity extends Activity implements OnNavigationListener, TorrentTasksExecutor, public class TorrentsActivity extends ActionBarActivity implements ActionBar.OnNavigationListener, TorrentTasksExecutor,
RefreshableActivity { RefreshableActivity {
private static final int RESULT_DETAILS = 0; private static final int RESULT_DETAILS = 0;
@ -174,7 +169,6 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
boolean firstStart = true; boolean firstStart = true;
int skipNextOnNavigationItemSelectedCalls = 2; int skipNextOnNavigationItemSelectedCalls = 2;
private MenuItem searchMenu = null; private MenuItem searchMenu = null;
private PullToRefreshAttacher pullToRefreshAttacher = null;
private IDaemonAdapter currentConnection = null; private IDaemonAdapter currentConnection = null;
// Auto refresh task // Auto refresh task
private AsyncTask<Void, Void, Void> autoRefreshTask; private AsyncTask<Void, Void, Void> autoRefreshTask;
@ -194,7 +188,6 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
// Catch any uncaught exception to log it // Catch any uncaught exception to log it
Thread.setDefaultUncaughtExceptionHandler(new LogUncaughtExceptionHandler(this, Thread.setDefaultUncaughtExceptionHandler(new LogUncaughtExceptionHandler(this,
@ -208,7 +201,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Set up navigation, with an action bar spinner, server status indicator and possibly (if room) with a filter // Set up navigation, with an action bar spinner, server status indicator and possibly (if room) with a filter
// list // list
serverStatusView = ServerStatusView_.build(this); serverStatusView = ServerStatusView_.build(this);
ActionBar actionBar = getActionBar(); ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
actionBar.setHomeButtonEnabled(false); actionBar.setHomeButtonEnabled(false);
actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowTitleEnabled(false);
@ -391,7 +384,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
stopAutoRefresh(); stopAutoRefresh();
} }
}); });
item.setOnActionExpandListener(new OnActionExpandListener() { MenuItemCompat.setOnActionExpandListener(item, new MenuItemCompat.OnActionExpandListener() {
@Override @Override
public boolean onMenuItemActionExpand(MenuItem item) { public boolean onMenuItemActionExpand(MenuItem item) {
return true; return true;
@ -404,7 +397,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
return true; return true;
} }
}); });
item.setActionView(searchView); MenuItemCompat.setActionView(item, searchView);
searchMenu = item; searchMenu = item;
} }
return true; return true;
@ -428,7 +421,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
menu.findItem(R.id.action_help).setVisible(true); menu.findItem(R.id.action_help).setVisible(true);
if (fragmentTorrents != null) if (fragmentTorrents != null)
fragmentTorrents.updateConnectionStatus(false, null); fragmentTorrents.updateConnectionStatus(false, null);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
return true; return true;
} }
@ -449,7 +442,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
menu.findItem(R.id.action_help).setVisible(false); menu.findItem(R.id.action_help).setVisible(false);
if (fragmentTorrents != null) if (fragmentTorrents != null)
fragmentTorrents.updateConnectionStatus(true, currentConnection.getType()); fragmentTorrents.updateConnectionStatus(true, currentConnection.getType());
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
return true; return true;
} }
@ -571,7 +564,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
filterSelected(selectedServer, false); filterSelected(selectedServer, false);
addFromIntent(); addFromIntent();
skipNextOnNavigationItemSelectedCalls++; // Prevent this selection from launching filterSelected() again skipNextOnNavigationItemSelectedCalls++; // Prevent this selection from launching filterSelected() again
getActionBar().setSelectedNavigationItem(position + 1); getSupportActionBar().setSelectedNavigationItem(position + 1);
} }
/** /**
@ -665,7 +658,6 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
// Adding a local .torrent file; the title we show is just the file name // Adding a local .torrent file; the title we show is just the file name
if (dataUri.getScheme().equals("file")) { if (dataUri.getScheme().equals("file")) {
addTorrentByFile(data, title); addTorrentByFile(data, title);
return;
} }
} }
@ -737,20 +729,7 @@ public class TorrentsActivity extends Activity implements OnNavigationListener,
*/ */
@Override @Override
public void addRefreshableView(View view) { public void addRefreshableView(View view) {
if (pullToRefreshAttacher == null) { // TODO Add new style pull to refresh library
// Still need to initialise the PullToRefreshAttacher
Options options = new PullToRefreshAttacher.Options();
options.headerTransformer = new NoProgressHeaderTransformer();
pullToRefreshAttacher = PullToRefreshAttacher.get(this, options);
}
pullToRefreshAttacher.addRefreshableView(view, new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
// Just refresh the full screen, now that the user has pulled to refresh
pullToRefreshAttacher.setRefreshComplete();
refreshScreen();
}
});
} }
@OptionsItem(resName = "action_refresh") @OptionsItem(resName = "action_refresh")

17
app/src/main/java/org/transdroid/core/gui/lists/NoProgressHeaderTransformer.java

@ -1,17 +0,0 @@
package org.transdroid.core.gui.lists;
import org.transdroid.R;
import uk.co.senab.actionbarpulltorefresh.library.DefaultHeaderTransformer;
import android.app.Activity;
import android.view.View;
public class NoProgressHeaderTransformer extends DefaultHeaderTransformer {
@Override
public void onViewCreated(Activity activity, View headerView) {
super.onViewCreated(activity, headerView);
setProgressBarColor(activity.getResources().getColor(R.color.green));
}
}

2
app/src/main/java/org/transdroid/core/gui/navigation/DialogHelper.java

@ -48,7 +48,7 @@ public class DialogHelper extends Activity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(dialog.getDialogLayoutId()); setContentView(dialog.getDialogLayoutId());
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
} }
@Override @Override

5
app/src/main/java/org/transdroid/core/gui/navigation/FilterListAdapter.java

@ -114,4 +114,9 @@ public class FilterListAdapter extends MergeAdapter {
notifyDataSetChanged(); notifyDataSetChanged();
} }
@Override
public int getViewTypeCount() {
return 1;
}
} }

9
app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java

@ -36,16 +36,16 @@ import org.transdroid.core.rssparser.Channel;
import org.transdroid.core.rssparser.RssParser; import org.transdroid.core.rssparser.RssParser;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils; import android.text.TextUtils;
import de.keyboardsurfer.android.widget.crouton.Crouton; import de.keyboardsurfer.android.widget.crouton.Crouton;
@EActivity(resName = "activity_rssfeeds") @EActivity(resName = "activity_rssfeeds")
public class RssfeedsActivity extends Activity { public class RssfeedsActivity extends ActionBarActivity {
// Settings and local data // Settings and local data
@Bean @Bean
@ -65,7 +65,6 @@ public class RssfeedsActivity extends Activity {
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -73,8 +72,8 @@ public class RssfeedsActivity extends Activity {
@AfterViews @AfterViews
protected void init() { protected void init() {
// Simple action bar with up button and correct title font // Simple action bar with up button and correct title font
getActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds))); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.rss_feeds)));
} }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)

9
app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java

@ -28,13 +28,13 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel; import org.transdroid.core.rssparser.Channel;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
@EActivity(resName = "activity_rssitems") @EActivity(resName = "activity_rssitems")
public class RssitemsActivity extends Activity { public class RssitemsActivity extends ActionBarActivity {
@Extra @Extra
protected Channel rssfeed = null; protected Channel rssfeed = null;
@ -49,7 +49,6 @@ public class RssitemsActivity extends Activity {
// Set the theme according to the user preference // Set the theme according to the user preference
if (SystemSettings_.getInstance_(this).useDarkTheme()) { if (SystemSettings_.getInstance_(this).useDarkTheme()) {
setTheme(R.style.TransdroidTheme_Dark); setTheme(R.style.TransdroidTheme_Dark);
getActionBar().setIcon(R.drawable.ic_activity_torrents);
} }
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@ -64,8 +63,8 @@ public class RssitemsActivity extends Activity {
} }
// Simple action bar with up button and torrent name as title // Simple action bar with up button and torrent name as title
getActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName)); getSupportActionBar().setTitle(NavigationHelper.buildCondensedFontString(rssfeedName));
// Get the intent extras and show them to the already loaded fragment // Get the intent extras and show them to the already loaded fragment
fragmentItems.update(rssfeed, false); fragmentItems.update(rssfeed, false);

2
app/src/main/java/org/transdroid/core/gui/settings/HelpSettingsActivity.java

@ -57,7 +57,7 @@ public class HelpSettingsActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML // Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_help); addPreferencesFromResource(R.xml.pref_help);

4
app/src/main/java/org/transdroid/core/gui/settings/KeyBoundPreferencesActivity.java

@ -78,14 +78,14 @@ public abstract class KeyBoundPreferencesActivity extends PreferenceActivity {
// Monitor preference changes // Monitor preference changes
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener( PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(
onPreferenceChangeListener); onPreferenceChangeListener);
}; }
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
// Stop monitoring preference changes // Stop monitoring preference changes
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener( PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(
onPreferenceChangeListener); onPreferenceChangeListener);
}; }
private OnSharedPreferenceChangeListener onPreferenceChangeListener = new OnSharedPreferenceChangeListener() { private OnSharedPreferenceChangeListener onPreferenceChangeListener = new OnSharedPreferenceChangeListener() {
@Override @Override

2
app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java

@ -166,7 +166,7 @@ public class MainSettingsActivity extends PreferenceActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
getActionBar().setDisplayHomeAsUpEnabled(true); //TODO getActionBar().setDisplayHomeAsUpEnabled(true);
prefs = getPreferenceManager().getSharedPreferences(); prefs = getPreferenceManager().getSharedPreferences();
if (getPreferenceScreen() != null) { if (getPreferenceScreen() != null) {

2
app/src/main/java/org/transdroid/core/gui/settings/NotificationSettingsActivity.java

@ -43,7 +43,7 @@ public class NotificationSettingsActivity extends PreferenceActivity implements
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the notification-related preferences from XML and update availability thereof // Load the notification-related preferences from XML and update availability thereof
addPreferencesFromResource(R.xml.pref_notifications); addPreferencesFromResource(R.xml.pref_notifications);

2
app/src/main/java/org/transdroid/core/gui/settings/RssfeedSettingsActivity.java

@ -46,7 +46,7 @@ public class RssfeedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_rssfeed, ApplicationSettings_.getInstance_(this).getMaxRssfeed()); init(R.xml.pref_rssfeed, ApplicationSettings_.getInstance_(this).getMaxRssfeed());

2
app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java

@ -52,7 +52,7 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_server, ApplicationSettings_.getInstance_(this).getMaxNormalServer()); init(R.xml.pref_server, ApplicationSettings_.getInstance_(this).getMaxNormalServer());

2
app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java

@ -160,7 +160,7 @@ public class SystemSettingsActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Just load the system-related preferences from XML // Just load the system-related preferences from XML
addPreferencesFromResource(R.xml.pref_system); addPreferencesFromResource(R.xml.pref_system);

2
app/src/main/java/org/transdroid/core/gui/settings/WebsearchSettingsActivity.java

@ -46,7 +46,7 @@ public class WebsearchSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_websearch, ApplicationSettings_.getInstance_(this).getMaxWebsearch()); init(R.xml.pref_websearch, ApplicationSettings_.getInstance_(this).getMaxWebsearch());

2
app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettingsActivity.java

@ -42,7 +42,7 @@ public class SeedstuffSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_seedstuff, init(R.xml.pref_seedbox_seedstuff,

2
app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettingsActivity.java

@ -42,7 +42,7 @@ public class XirvikDediSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikdedi, init(R.xml.pref_seedbox_xirvikdedi,

2
app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettingsActivity.java

@ -42,7 +42,7 @@ public class XirvikSemiSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirviksemi, init(R.xml.pref_seedbox_xirviksemi,

2
app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettingsActivity.java

@ -59,7 +59,7 @@ public class XirvikSharedSettingsActivity extends KeyBoundPreferencesActivity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true); // TODO getActionBar().setDisplayHomeAsUpEnabled(true);
// Load the raw preferences to show in this screen // Load the raw preferences to show in this screen
init(R.xml.pref_seedbox_xirvikshared, init(R.xml.pref_seedbox_xirvikshared,

10
app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java

@ -17,12 +17,12 @@
package org.transdroid.core.widget; package org.transdroid.core.widget;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetManager;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.CheckBox; import android.widget.CheckBox;
@ -66,7 +66,7 @@ import java.util.List;
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)
@EActivity(resName = "activity_widgetconfig") @EActivity(resName = "activity_widgetconfig")
public class ListWidgetConfigActivity extends Activity { public class ListWidgetConfigActivity extends ActionBarActivity {
// Views and adapters // Views and adapters
@ViewById @ViewById
@ -182,11 +182,11 @@ public class ListWidgetConfigActivity extends Activity {
// Set up action bar with a done button // Set up action bar with a done button
// Inspired by NoNonsenseNotes's ListWidgetConfig.java (Apache License, Version 2.0) // Inspired by NoNonsenseNotes's ListWidgetConfig.java (Apache License, Version 2.0)
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
View doneButtonFrame = getLayoutInflater().inflate(R.layout.actionbar_donebutton, null); View doneButtonFrame = getLayoutInflater().inflate(R.layout.actionbar_donebutton, null);
doneButtonFrame.findViewById(R.id.actionbar_done).setOnClickListener(doneClicked); doneButtonFrame.findViewById(R.id.actionbar_done).setOnClickListener(doneClicked);
getActionBar().setCustomView(doneButtonFrame); getSupportActionBar().setCustomView(doneButtonFrame);
} }

1
app/src/main/res/layout/actionbar_navigation.xml

@ -19,6 +19,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:minWidth="120dp"
android:paddingRight="@dimen/margin_half" > android:paddingRight="@dimen/margin_half" >
<TextView <TextView

5
app/src/main/res/values/colors.xml

@ -18,7 +18,8 @@
<resources> <resources>
<!-- General layout colours --> <!-- General layout colours -->
<color name="green">#8acc12</color> <color name="green">#80c713</color>
<color name="green_dark">#4b6617</color>
<color name="ledgreen">#7dbb21</color> <color name="ledgreen">#7dbb21</color>
<color name="crouton_error">#c81113</color> <color name="crouton_error">#c81113</color>
<color name="crouton_info">#aada62</color> <color name="crouton_info">#aada62</color>
@ -30,7 +31,7 @@
<color name="torrent_error">#de3939</color> <!-- Red --> <color name="torrent_error">#de3939</color> <!-- Red -->
<color name="torrent_other">#9e9e9e</color> <!-- Grey --> <color name="torrent_other">#9e9e9e</color> <!-- Grey -->
<color name="file_low">#c8e88e</color> <!-- Light green --> <color name="file_low">#c8e88e</color> <!-- Light green -->
<color name="file_normal">#8acc12</color> <!-- Normal green --> <color name="file_normal">#80c713</color> <!-- Normal green -->
<color name="file_high">#4b6617</color> <!-- Dark green --> <color name="file_high">#4b6617</color> <!-- Dark green -->
<color name="file_off">#9e9e9e</color> <!-- Grey --> <color name="file_off">#9e9e9e</color> <!-- Grey -->

35
app/src/main/res/values/styles_transdroid_dark.xml

@ -18,38 +18,9 @@
<resources> <resources>
<style name="Theme.Transdroid.Dark" parent="@android:style/Theme.Holo"> <style name="Theme.Transdroid.Dark" parent="Theme.AppCompat">
<item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid</item> <item name="colorPrimary">@color/green</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Dark</item> <item name="colorPrimaryDark">@color/green_dark</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Dark</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Dark</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Dark</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Dark</item>
<item name="android:panelBackground">@drawable/menu_hardkey_panel_transdroid</item>
</style>
<style name="ActionBar.Solid.Transdroid.Dark" parent="@android:style/Widget.Holo.ActionBar.Solid">
<item name="android:background">@drawable/ab_solid_transdroid</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid</item>
</style>
<style name="PopupMenu.Transdroid.Dark" parent="@android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
</style>
<style name="DropDownListView.Transdroid.Dark" parent="@android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid</item>
</style>
<style name="ActionBarTabStyle.Transdroid.Dark" parent="@android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_transdroid</item>
</style>
<style name="DropDownNav.Transdroid.Dark" parent="@android:style/Widget.Holo.Spinner">
<item name="android:background">@drawable/spinner_background_ab_transdroid</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid</item>
</style> </style>
</resources> </resources>

45
app/src/main/res/values/styles_transdroid_light.xml

@ -19,48 +19,9 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Transdroid.Light" parent="@android:style/Theme.Holo.Light"> <style name="Theme.Transdroid.Light" parent="Theme.AppCompat.Light">
<item name="android:actionBarItemBackground">@drawable/selectable_background_transdroid2</item> <item name="colorPrimary">@color/green</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Transdroid.Light</item> <item name="colorPrimaryDark">@color/green_dark</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Transdroid.Light</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Transdroid.Light</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Transdroid.Light</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Transdroid.Light</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_transdroid2</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_transdroid2</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Transdroid.Light</item>
</style>
<style name="ActionBar.Solid.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">@drawable/ab_solid_transdroid2</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_transdroid2</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_transdroid2</item>
</style>
<style name="ActionBar.Transparent.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@drawable/ab_transparent_transdroid2</item>
</style>
<style name="PopupMenu.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
</style>
<style name="DropDownListView.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_transdroid2</item>
</style>
<style name="ActionBarTabStyle.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_transdroid2</item>
</style>
<style name="DropDownNav.Transdroid.Light" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/spinner_background_ab_transdroid2</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_transdroid2</item>
<item name="android:dropDownSelector">@drawable/selectable_background_transdroid2</item>
</style>
<style name="ActionButton.CloseMode.Transdroid.Light" parent="@android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_transdroid2</item>
</style> </style>
</resources> </resources>
Loading…
Cancel
Save