Browse Source

Fixed crash on adding widget as well as widget layout issues (with new Material theme) and Control Service start bug on Android Lolliopo+. Fixed #218.

pull/256/head
Eric Kok 10 years ago
parent
commit
4ac0a279cc
  1. 4
      app/build.gradle
  2. 4
      app/src/main/java/org/transdroid/core/gui/DetailsActivity.java
  3. 4
      app/src/main/java/org/transdroid/core/gui/DetailsFragment.java
  4. 7
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  5. 6
      app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java
  6. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssfeedsActivity.java
  7. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsActivity.java
  8. 4
      app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java
  9. 3
      app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
  10. 7
      app/src/main/java/org/transdroid/core/gui/settings/PreferenceCompatActivity.java
  11. 41
      app/src/main/java/org/transdroid/core/widget/ListWidgetConfigActivity.java
  12. 42
      app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java
  13. 2
      app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java
  14. 9
      app/src/main/res/layout/widget_torrents_dark.xml
  15. 115
      app/src/main/res/layout/widget_torrents_light.xml
  16. 4
      app/src/main/res/values/changelog.xml
  17. 2
      app/src/main/res/values/dimens.xml
  18. 2
      app/src/main/res/values/styles.xml
  19. 2
      build.gradle

4
app/build.gradle

@ -37,8 +37,8 @@ dependencies {
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.nostra13.universalimageloader:universal-image-loader:1.9.3' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-annotations:22.1.1' compile 'com.android.support:support-annotations:22.2.0'
compile 'com.getbase:floatingactionbutton:1.8.0' compile 'com.getbase:floatingactionbutton:1.8.0'
compile 'com.afollestad:material-dialogs:0.6.3.3' compile 'com.afollestad:material-dialogs:0.6.3.3'
compile 'com.nispok:snackbar:2.10.6' compile 'com.nispok:snackbar:2.10.6'

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

@ -20,7 +20,7 @@ import android.annotation.TargetApi;
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.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import com.nispok.snackbar.Snackbar; import com.nispok.snackbar.Snackbar;
@ -84,7 +84,7 @@ import java.util.List;
*/ */
@EActivity(R.layout.activity_details) @EActivity(R.layout.activity_details)
@OptionsMenu(R.menu.activity_details) @OptionsMenu(R.menu.activity_details)
public class DetailsActivity extends ActionBarActivity implements TorrentTasksExecutor, RefreshableActivity { public class DetailsActivity extends AppCompatActivity implements TorrentTasksExecutor, RefreshableActivity {
@Extra @Extra
@InstanceState @InstanceState

4
app/src/main/java/org/transdroid/core/gui/DetailsFragment.java

@ -24,7 +24,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.ActionMenuView; import android.support.v7.widget.ActionMenuView;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
@ -487,7 +487,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen
}); });
contextualMenu.getMenu().clear(); contextualMenu.getMenu().clear();
getActivity().getMenuInflater().inflate(R.menu.fragment_details_cab_main, contextualMenu.getMenu()); getActivity().getMenuInflater().inflate(R.menu.fragment_details_cab_main, contextualMenu.getMenu());
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext(); Context themedContext = ((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext();
mode.getMenuInflater().inflate(R.menu.fragment_details_cab_secondary, menu); mode.getMenuInflater().inflate(R.menu.fragment_details_cab_secondary, menu);
selectionManagerMode = new SelectionManagerMode(themedContext, detailsList, R.plurals.navigation_filesselected); selectionManagerMode = new SelectionManagerMode(themedContext, detailsList, R.plurals.navigation_filesselected);
selectionManagerMode.setOnlyCheckClass(TorrentFile.class); selectionManagerMode.setOnlyCheckClass(TorrentFile.class);

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

@ -26,8 +26,8 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.ActionMenuView; import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.SearchView; import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
@ -145,7 +145,7 @@ import java.util.Map.Entry;
* @author Eric Kok * @author Eric Kok
*/ */
@EActivity(R.layout.activity_torrents) @EActivity(R.layout.activity_torrents)
public class TorrentsActivity extends ActionBarActivity implements TorrentTasksExecutor, RefreshableActivity { public class TorrentsActivity extends AppCompatActivity implements TorrentTasksExecutor, RefreshableActivity {
private static final int RESULT_DETAILS = 0; private static final int RESULT_DETAILS = 0;
@ -795,8 +795,7 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
protected void onBarcodeScanHandled(String barcode, String result) { protected void onBarcodeScanHandled(String barcode, String result) {
log.d(this, "Scanned barcode " + barcode + " and got " + result); log.d(this, "Scanned barcode " + barcode + " and got " + result);
if (TextUtils.isEmpty(result)) { if (TextUtils.isEmpty(result)) {
SnackbarManager.show(Snackbar.with(this).text(R.string.error_noproductforcode).colorResource(R.color.red) SnackbarManager.show(Snackbar.with(this).text(R.string.error_noproductforcode).colorResource(R.color.red).type(SnackbarType.MULTI_LINE));
.type(SnackbarType.MULTI_LINE));
} else if (result.startsWith("http") || result.startsWith("https")) { } else if (result.startsWith("http") || result.startsWith("https")) {
addTorrentByUrl(result, "QR code result"); // No torrent title known addTorrentByUrl(result, "QR code result"); // No torrent title known
} else if (result.startsWith("magnet")) { } else if (result.startsWith("magnet")) {

6
app/src/main/java/org/transdroid/core/gui/TorrentsFragment.java

@ -19,7 +19,7 @@ package org.transdroid.core.gui;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.ActionMenuView; import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.ActionMode; import android.view.ActionMode;
@ -281,7 +281,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
}); });
actionsMenu.getMenu().clear(); actionsMenu.getMenu().clear();
getActivity().getMenuInflater().inflate(R.menu.fragment_torrents_cab, actionsMenu.getMenu()); getActivity().getMenuInflater().inflate(R.menu.fragment_torrents_cab, actionsMenu.getMenu());
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext(); Context themedContext = ((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, torrentsList, R.plurals.navigation_torrentsselected); selectionManagerMode = new SelectionManagerMode(themedContext, torrentsList, R.plurals.navigation_torrentsselected);
selectionManagerMode.onCreateActionMode(mode, menu); selectionManagerMode.onCreateActionMode(mode, menu);
return true; return true;
@ -354,7 +354,7 @@ public class TorrentsFragment extends Fragment implements OnLabelPickedListener
} else if (itemId == R.id.action_setlabel) { } else if (itemId == R.id.action_setlabel) {
lastMultiSelectedTorrents = checked; lastMultiSelectedTorrents = checked;
if (currentLabels != null) { if (currentLabels != null) {
SetLabelDialog.show(getActivity(), TorrentsFragment.this,currentLabels); SetLabelDialog.show(getActivity(), TorrentsFragment.this, currentLabels);
} }
mode.finish(); mode.finish();
return true; return true;

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

@ -21,7 +21,7 @@ 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.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.TextUtils; import android.text.TextUtils;
@ -51,7 +51,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@EActivity(R.layout.activity_rssfeeds) @EActivity(R.layout.activity_rssfeeds)
public class RssfeedsActivity extends ActionBarActivity { public class RssfeedsActivity extends AppCompatActivity {
// Settings and local data // Settings and local data
@Bean @Bean

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

@ -20,7 +20,7 @@ import android.annotation.TargetApi;
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.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.AfterViews;
@ -36,7 +36,7 @@ import org.transdroid.core.gui.navigation.NavigationHelper;
import org.transdroid.core.rssparser.Channel; import org.transdroid.core.rssparser.Channel;
@EActivity(R.layout.activity_rssitems) @EActivity(R.layout.activity_rssitems)
public class RssitemsActivity extends ActionBarActivity { public class RssitemsActivity extends AppCompatActivity {
@Extra @Extra
protected Channel rssfeed = null; protected Channel rssfeed = null;

4
app/src/main/java/org/transdroid/core/gui/rss/RssitemsFragment.java

@ -27,7 +27,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.ActionMode; import android.view.ActionMode;
import android.view.Menu; import android.view.Menu;
@ -80,7 +80,7 @@ public class RssitemsFragment extends Fragment {
public boolean onCreateActionMode(ActionMode mode, Menu menu) { public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Show contextual action bar to add items in batch mode // Show contextual action bar to add items in batch mode
mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu); mode.getMenuInflater().inflate(R.menu.fragment_rssitems_cab, menu);
Context themedContext = ((ActionBarActivity) getActivity()).getSupportActionBar().getThemedContext(); Context themedContext = ((AppCompatActivity) getActivity()).getSupportActionBar().getThemedContext();
selectionManagerMode = new SelectionManagerMode(themedContext, rssitemsList, R.plurals.rss_itemsselected); selectionManagerMode = new SelectionManagerMode(themedContext, rssitemsList, R.plurals.rss_itemsselected);
selectionManagerMode.onCreateActionMode(mode, menu); selectionManagerMode.onCreateActionMode(mode, menu);
return true; return true;

3
app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java

@ -26,6 +26,7 @@ import android.provider.SearchRecentSuggestions;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -62,7 +63,7 @@ import java.util.List;
*/ */
@EActivity(R.layout.activity_search) @EActivity(R.layout.activity_search)
@OptionsMenu(R.menu.activity_search) @OptionsMenu(R.menu.activity_search)
public class SearchActivity extends ActionBarActivity implements ActionBar.OnNavigationListener { public class SearchActivity extends AppCompatActivity implements ActionBar.OnNavigationListener {
@ViewById @ViewById
protected Toolbar searchToolbar; protected Toolbar searchToolbar;

7
app/src/main/java/org/transdroid/core/gui/settings/PreferenceCompatActivity.java

@ -3,6 +3,7 @@ package org.transdroid.core.gui.settings;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceActivity; import android.preference.PreferenceActivity;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatCallback; import android.support.v7.app.AppCompatCallback;
import android.support.v7.app.AppCompatDelegate; import android.support.v7.app.AppCompatDelegate;
@ -62,4 +63,10 @@ public class PreferenceCompatActivity extends PreferenceActivity implements AppC
public void onSupportActionModeFinished(ActionMode actionMode) { public void onSupportActionModeFinished(ActionMode actionMode) {
} }
@Nullable
@Override
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
return acd.startSupportActionMode(callback);
}
} }

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

@ -22,7 +22,7 @@ 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.ActionBar;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AppCompatActivity;
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 ActionBarActivity { public class ListWidgetConfigActivity extends AppCompatActivity {
// Views and adapters // Views and adapters
@ViewById @ViewById
@ -127,14 +127,12 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
boolean reverseSort = reverseorderCheckBox.isChecked(); boolean reverseSort = reverseorderCheckBox.isChecked();
boolean showstatus = showstatusCheckBox.isChecked(); boolean showstatus = showstatusCheckBox.isChecked();
boolean useDarkTheme = darkthemeCheckBox.isChecked(); boolean useDarkTheme = darkthemeCheckBox.isChecked();
ListWidgetConfig config = ListWidgetConfig config = new ListWidgetConfig(server, statusType, sortBy, reverseSort, showstatus, useDarkTheme);
new ListWidgetConfig(server, statusType, sortBy, reverseSort, showstatus, useDarkTheme);
applicationSettings.setWidgetConfig(appWidgetId, config); applicationSettings.setWidgetConfig(appWidgetId, config);
// Return the widget configuration result // Return the widget configuration result
AppWidgetManager manager = AppWidgetManager.getInstance(ListWidgetConfigActivity.this); AppWidgetManager manager = AppWidgetManager.getInstance(ListWidgetConfigActivity.this);
manager.updateAppWidget(appWidgetId, manager.updateAppWidget(appWidgetId, ListWidgetProvider.buildRemoteViews(getApplicationContext(), appWidgetId, config));
ListWidgetProvider.buildRemoteViews(getApplicationContext(), appWidgetId, config));
manager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list); manager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list);
setResult(RESULT_OK, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)); setResult(RESULT_OK, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
finish(); finish();
@ -149,14 +147,12 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
if (getIntent() == null || getIntent().getExtras() == null || if (getIntent() == null || getIntent().getExtras() == null ||
!getIntent().hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID)) { !getIntent().hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID)) {
// Invalid configuration; return canceled result // Invalid configuration; return canceled result
setResult(RESULT_CANCELED, setResult(RESULT_CANCELED, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID));
new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID));
finish(); finish();
} }
// Get the appwidget ID we are configuring // Get the appwidget ID we are configuring
appWidgetId = appWidgetId = getIntent().getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
getIntent().getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
// Set preliminary canceled result and continue with the initialisation // Set preliminary canceled result and continue with the initialisation
setResult(RESULT_CANCELED, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)); setResult(RESULT_CANCELED, new Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
@ -166,27 +162,26 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
protected void init() { protected void init() {
// Populate the selection spinners with custom array adapters // Populate the selection spinners with custom array adapters
List<SortByListItem> sortOrders = new ArrayList<SortByListItem>(); List<SortByListItem> sortOrders = new ArrayList<>();
for (TorrentsSortBy order : TorrentsSortBy.values()) { for (TorrentsSortBy order : TorrentsSortBy.values()) {
sortOrders.add(new SortByListItem(this, order)); sortOrders.add(new SortByListItem(this, order));
} }
serverSpinner.setAdapter( serverSpinner.setAdapter(new SimpleListItemSpinnerAdapter<>(this, 0, applicationSettings.getAllServerSettings()));
new SimpleListItemSpinnerAdapter<ServerSetting>(this, 0, applicationSettings.getAllServerSettings())); filterSpinner.setAdapter(new SimpleListItemSpinnerAdapter<>(this, 0, StatusType.getAllStatusTypes(this)));
filterSpinner.setAdapter( sortSpinner.setAdapter(new SimpleListItemSpinnerAdapter<>(this, 0, sortOrders));
new SimpleListItemSpinnerAdapter<StatusTypeFilter>(this, 0, StatusType.getAllStatusTypes(this)));
sortSpinner.setAdapter(new SimpleListItemSpinnerAdapter<SortByListItem>(this, 0, sortOrders));
// TODO: Update to AndroidAnnotations 3.0 and use @CheckedChanged
reverseorderCheckBox.setOnCheckedChangeListener(reverseorderCheckedChanged); reverseorderCheckBox.setOnCheckedChangeListener(reverseorderCheckedChanged);
showstatusCheckBox.setOnCheckedChangeListener(showstatusCheckChanged); showstatusCheckBox.setOnCheckedChangeListener(showstatusCheckChanged);
torrentsList.setEmptyView(errorText); torrentsList.setEmptyView(errorText);
// 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)
if (getSupportActionBar() != null) {
getSupportActionBar().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);
getSupportActionBar().setCustomView(doneButtonFrame); getSupportActionBar().setCustomView(doneButtonFrame);
}
} }
@ -215,13 +210,12 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
} }
// Create a connection object and retrieve the live torrents // Create a connection object and retrieve the live torrents
IDaemonAdapter connection = ((ServerSetting) serverSpinner.getSelectedItem()) IDaemonAdapter connection =
.createServerAdapter(connectivityHelper.getConnectedNetworkName(), this); ((ServerSetting) serverSpinner.getSelectedItem()).createServerAdapter(connectivityHelper.getConnectedNetworkName(), this);
DaemonTaskResult result = RetrieveTask.create(connection).execute(log); DaemonTaskResult result = RetrieveTask.create(connection).execute(log);
if (result instanceof RetrieveTaskSuccessResult) { if (result instanceof RetrieveTaskSuccessResult) {
// Success; show the active torrents in the widget preview // Success; show the active torrents in the widget preview
onTorrentsRetrieved(((RetrieveTaskSuccessResult) result).getTorrents(), onTorrentsRetrieved(((RetrieveTaskSuccessResult) result).getTorrents(), ((RetrieveTaskSuccessResult) result).getLabels());
((RetrieveTaskSuccessResult) result).getLabels());
} else { } else {
// Can't connect right now; provide a nice error message // Can't connect right now; provide a nice error message
showError(false); showError(false);
@ -252,7 +246,7 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
} }
// Get the already loaded torrents and filter and sort them // Get the already loaded torrents and filter and sort them
ArrayList<Torrent> filteredTorrents = new ArrayList<Torrent>(previewTorrents.size()); ArrayList<Torrent> filteredTorrents = new ArrayList<>(previewTorrents.size());
StatusTypeFilter statusTypeFilter = (StatusTypeFilter) filterSpinner.getSelectedItem(); StatusTypeFilter statusTypeFilter = (StatusTypeFilter) filterSpinner.getSelectedItem();
boolean dormantAsInactive = systemSettings.treatDormantAsInactive(); boolean dormantAsInactive = systemSettings.treatDormantAsInactive();
for (Torrent torrent : previewTorrents) { for (Torrent torrent : previewTorrents) {
@ -266,8 +260,7 @@ public class ListWidgetConfigActivity extends ActionBarActivity {
} }
TorrentsSortBy sortBy = ((SortByListItem) sortSpinner.getSelectedItem()).getSortBy(); TorrentsSortBy sortBy = ((SortByListItem) sortSpinner.getSelectedItem()).getSortBy();
Daemon serverType = filteredTorrents.get(0).getDaemon(); Daemon serverType = filteredTorrents.get(0).getDaemon();
Collections Collections.sort(filteredTorrents, new TorrentsComparator(serverType, sortBy, reverseorderCheckBox.isChecked()));
.sort(filteredTorrents, new TorrentsComparator(serverType, sortBy, reverseorderCheckBox.isChecked()));
// Update the server status count and speeds // Update the server status count and speeds
int downcount = 0, upcount = 0, downspeed = 0, upspeed = 0; int downcount = 0, upcount = 0, downspeed = 0, upspeed = 0;

42
app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java

@ -30,14 +30,17 @@ import android.widget.RemoteViews;
import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EReceiver; import org.androidannotations.annotations.EReceiver;
import org.transdroid.R; import org.transdroid.R;
import org.transdroid.core.app.settings.*; import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.gui.*; import org.transdroid.core.app.settings.ApplicationSettings_;
import org.transdroid.core.gui.log.*; import org.transdroid.core.app.settings.ServerSetting;
import org.transdroid.core.gui.TorrentsActivity_;
import org.transdroid.core.gui.log.Log_;
import org.transdroid.core.service.ControlService; import org.transdroid.core.service.ControlService;
import org.transdroid.core.service.ControlService_;
/** /**
* The provider of a list-style Transdroid widget, which controls the general loading and (touch) event handling. The * The provider of a list-style Transdroid widget, which controls the general loading and (touch) event handling. The list rows' remote views are
* list rows' remote views are loaded in the accompanying {@link ListWidgetViewsService}. * loaded in the accompanying {@link ListWidgetViewsService}.
* @author Eric Kok * @author Eric Kok
*/ */
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)
@ -53,8 +56,8 @@ public class ListWidgetProvider extends AppWidgetProvider {
protected ApplicationSettings applicationSettings; protected ApplicationSettings applicationSettings;
/** /**
* Loads and sets up the layout for some specific app widget given the user's widget settings. Note that the views * Loads and sets up the layout for some specific app widget given the user's widget settings. Note that the views for the list view rows are
* for the list view rows are loaded separately in the {@link WidgetViewsFactory}. * loaded separately in the {@link WidgetViewsFactory}.
* @param context The app widget context, with access to resources * @param context The app widget context, with access to resources
* @param appWidgetId The specific ID of the app widget to load * @param appWidgetId The specific ID of the app widget to load
* @param config The user widget configuration, with filter and theme preferences * @param config The user widget configuration, with filter and theme preferences
@ -69,8 +72,8 @@ public class ListWidgetProvider extends AppWidgetProvider {
} }
ApplicationSettings appSettings = ApplicationSettings_.getInstance_(context); ApplicationSettings appSettings = ApplicationSettings_.getInstance_(context);
if (config.getServerId() < 0 || config.getServerId() > appSettings.getMaxOfAllServers()) { if (config.getServerId() < 0 || config.getServerId() > appSettings.getMaxOfAllServers()) {
Log_.getInstance_(context).e("ListWidgetProvider", Log_.getInstance_(context)
"Tried to set up widget " + appWidgetId + " but the bound server ID " + config.getServerId() + .e("ListWidgetProvider", "Tried to set up widget " + appWidgetId + " but the bound server ID " + config.getServerId() +
" no longer exists."); " no longer exists.");
return null; return null;
} }
@ -86,8 +89,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
rv.setRemoteAdapter(appWidgetId, R.id.torrents_list, data); rv.setRemoteAdapter(appWidgetId, R.id.torrents_list, data);
Intent open = new Intent(context, TorrentsActivity_.class); Intent open = new Intent(context, TorrentsActivity_.class);
open.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); open.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
rv.setPendingIntentTemplate(R.id.torrents_list, rv.setPendingIntentTemplate(R.id.torrents_list, PendingIntent.getActivity(context, appWidgetId, open, PendingIntent.FLAG_UPDATE_CURRENT));
PendingIntent.getActivity(context, appWidgetId, open, PendingIntent.FLAG_UPDATE_CURRENT));
rv.setEmptyView(R.id.torrents_list, R.id.error_text); rv.setEmptyView(R.id.torrents_list, R.id.error_text);
rv.setTextViewText(R.id.error_text, context.getString(R.string.widget_loading)); rv.setTextViewText(R.id.error_text, context.getString(R.string.widget_loading));
@ -103,10 +105,8 @@ public class ListWidgetProvider extends AppWidgetProvider {
start.setAction(INTENT_STARTSERVER); start.setAction(INTENT_STARTSERVER);
start.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); start.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
start.putExtra(EXTRA_SERVER, config.getServerId()); start.putExtra(EXTRA_SERVER, config.getServerId());
rv.setOnClickPendingIntent(R.id.icon_image, rv.setOnClickPendingIntent(R.id.icon_image, PendingIntent.getActivity(context, appWidgetId, start, PendingIntent.FLAG_UPDATE_CURRENT));
PendingIntent.getActivity(context, appWidgetId, start, PendingIntent.FLAG_UPDATE_CURRENT)); rv.setOnClickPendingIntent(R.id.navigation_view, PendingIntent.getActivity(context, appWidgetId, start, PendingIntent.FLAG_UPDATE_CURRENT));
rv.setOnClickPendingIntent(R.id.navigation_view,
PendingIntent.getActivity(context, appWidgetId, start, PendingIntent.FLAG_UPDATE_CURRENT));
// Set up the widgets refresh button pending intent (calling this WidgetProvider itself) // Set up the widgets refresh button pending intent (calling this WidgetProvider itself)
// Make sure that the intent is unique using a custom data path (rather than just the extras) // Make sure that the intent is unique using a custom data path (rather than just the extras)
@ -114,8 +114,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
refresh.setData(Uri.parse("intent://widget/" + appWidgetId + "/refresh")); refresh.setData(Uri.parse("intent://widget/" + appWidgetId + "/refresh"));
refresh.putExtra(EXTRA_REFRESH, appWidgetId); refresh.putExtra(EXTRA_REFRESH, appWidgetId);
refresh.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); refresh.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
rv.setOnClickPendingIntent(R.id.refresh_button, rv.setOnClickPendingIntent(R.id.refresh_button, PendingIntent.getBroadcast(context, appWidgetId, refresh, PendingIntent.FLAG_UPDATE_CURRENT));
PendingIntent.getBroadcast(context, appWidgetId, refresh, PendingIntent.FLAG_UPDATE_CURRENT));
// Set up the control (pause and resume) buttons (calling the WidgetProvider itself) // Set up the control (pause and resume) buttons (calling the WidgetProvider itself)
Intent pauseall = new Intent(context, ListWidgetProvider_.class); Intent pauseall = new Intent(context, ListWidgetProvider_.class);
@ -144,8 +143,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
// Refresh a specific app widget // Refresh a specific app widget
if (intent.hasExtra(EXTRA_REFRESH)) { if (intent.hasExtra(EXTRA_REFRESH)) {
// Manually requested a refresh for the app widget of which the ID was supplied // Manually requested a refresh for the app widget of which the ID was supplied
RemoteViews views = RemoteViews views = buildRemoteViews(context, appWidgetId, applicationSettings.getWidgetConfig(appWidgetId));
buildRemoteViews(context, appWidgetId, applicationSettings.getWidgetConfig(appWidgetId));
if (views != null) { if (views != null) {
AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, views); AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, views);
AppWidgetManager.getInstance(context).notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list); AppWidgetManager.getInstance(context).notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list);
@ -155,7 +153,8 @@ public class ListWidgetProvider extends AppWidgetProvider {
// No refresh: this is a control intent: copy the action and EXTRA_APPWIDGET_ID to start the control service // No refresh: this is a control intent: copy the action and EXTRA_APPWIDGET_ID to start the control service
if (intent.getAction().startsWith("org.transdroid.control.")) { if (intent.getAction().startsWith("org.transdroid.control.")) {
Intent action = new Intent(intent.getAction()); Intent action = new Intent(context, ControlService_.class);
action.setAction(intent.getAction());
action.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); action.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
context.startService(action); context.startService(action);
} }
@ -164,8 +163,7 @@ public class ListWidgetProvider extends AppWidgetProvider {
@Override @Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
for (int appWidgetId : appWidgetIds) { for (int appWidgetId : appWidgetIds) {
appWidgetManager.updateAppWidget(appWidgetId, appWidgetManager.updateAppWidget(appWidgetId, buildRemoteViews(context, appWidgetId, applicationSettings.getWidgetConfig(appWidgetId)));
buildRemoteViews(context, appWidgetId, applicationSettings.getWidgetConfig(appWidgetId)));
appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list); appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.torrents_list);
} }
} }

2
app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java

@ -117,7 +117,7 @@ class WidgetViewsFactory implements RemoteViewsService.RemoteViewsFactory {
// We have data; filter, sort and store it to use later when getViewAt gets called // We have data; filter, sort and store it to use later when getViewAt gets called
SystemSettings systemSettings = SystemSettings_.getInstance_(context); SystemSettings systemSettings = SystemSettings_.getInstance_(context);
ArrayList<Torrent> filteredTorrents = new ArrayList<Torrent>(); ArrayList<Torrent> filteredTorrents = new ArrayList<>();
List<Torrent> allTorrents = ((RetrieveTaskSuccessResult) result).getTorrents(); List<Torrent> allTorrents = ((RetrieveTaskSuccessResult) result).getTorrents();
for (Torrent torrent : allTorrents) { for (Torrent torrent : allTorrents) {
if (config.getStatusType().getFilterItem(context) if (config.getStatusType().getFilterItem(context)

9
app/src/main/res/layout/widget_torrents_dark.xml

@ -19,8 +19,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_dark" android:background="@color/background_dark">
android:padding="@dimen/margin_widget">
<ImageButton <ImageButton
android:id="@+id/icon_image" android:id="@+id/icon_image"
@ -86,7 +85,8 @@
android:maxLines="1" android:maxLines="1"
android:textColor="@color/text_actionbar_dark" android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_filter" /> android:textSize="@dimen/ui_navigation_filter"
tools:text="Filter" />
<TextView <TextView
android:id="@+id/server_text" android:id="@+id/server_text"
@ -98,7 +98,8 @@
android:maxLines="1" android:maxLines="1"
android:textColor="@color/text_actionbar_dark" android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_server" /> android:textSize="@dimen/ui_navigation_server"
tools:text="Server" />
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout

115
app/src/main/res/layout/widget_torrents_light.xml

@ -19,8 +19,14 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_light" android:background="@color/background_light">
android:padding="@dimen/margin_widget" >
<LinearLayout
android:id="@+id/header_wrapper"
android:layout_width="match_parent"
android:layout_height="@dimen/widget_header_height"
android:background="@color/green"
android:orientation="horizontal">
<ImageButton <ImageButton
android:id="@+id/icon_image" android:id="@+id/icon_image"
@ -32,49 +38,16 @@
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/ic_launcher" /> android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/refresh_button"
android:layout_width="@dimen/widget_header_height"
android:layout_height="@dimen/widget_header_height"
android:layout_alignParentRight="true"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_refresh"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_refresh" />
<ImageButton
android:id="@+id/pauseall_button"
android:layout_width="@dimen/widget_header_height"
android:layout_height="@dimen/widget_header_height"
android:layout_toLeftOf="@id/refresh_button"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_pauseall"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_pause" />
<ImageButton
android:id="@+id/resumeall_button"
android:layout_width="@dimen/widget_header_height"
android:layout_height="@dimen/widget_header_height"
android:layout_toLeftOf="@id/pauseall_button"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_resumeall"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_resume" />
<LinearLayout <LinearLayout
android:id="@+id/navigation_view" android:id="@+id/navigation_view"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/widget_header_height" android:layout_height="@dimen/widget_header_height"
android:layout_toLeftOf="@id/resumeall_button" android:layout_weight="1"
android:layout_toRightOf="@id/icon_image"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:orientation="vertical" android:orientation="vertical"
android:paddingRight="@dimen/margin_half" android:paddingRight="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:paddingTop="3dp" > android:paddingTop="3dp" >
<TextView <TextView
@ -84,9 +57,10 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:fontFamily="sans-serif-condensed" android:fontFamily="sans-serif-condensed"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/text_actionbar_light" android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_filter" /> android:textSize="@dimen/ui_navigation_filter"
tools:text="Filter" />
<TextView <TextView
android:id="@+id/server_text" android:id="@+id/server_text"
@ -96,17 +70,17 @@
android:ellipsize="marquee" android:ellipsize="marquee"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/text_actionbar_light" android:textColor="@color/text_actionbar_dark"
android:textIsSelectable="false" android:textIsSelectable="false"
android:textSize="@dimen/ui_navigation_server" /> android:textSize="@dimen/ui_navigation_server"
tools:text="Server"/>
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/serverstatus_view" android:id="@+id/serverstatus_view"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/widget_header_height" android:layout_height="@dimen/widget_header_height"
android:layout_toLeftOf="@id/resumeall_button" android:layout_weight="1"
android:layout_toRightOf="@id/icon_image"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:paddingTop="@dimen/ui_serverstatus_margin" android:paddingTop="@dimen/ui_serverstatus_margin"
@ -120,7 +94,7 @@
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:paddingTop="@dimen/ui_serverstatus_signmargin" android:paddingTop="@dimen/ui_serverstatus_signmargin"
android:text="↑" android:text="↑"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_sign" android:textSize="@dimen/ui_serverstatus_sign"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
@ -131,7 +105,7 @@
android:layout_toLeftOf="@id/upcount_sign" android:layout_toLeftOf="@id/upcount_sign"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_bignumber" /> android:textSize="@dimen/ui_serverstatus_bignumber" />
<TextView <TextView
@ -142,7 +116,7 @@
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:paddingTop="@dimen/ui_serverstatus_signmargin" android:paddingTop="@dimen/ui_serverstatus_signmargin"
android:text="↓" android:text="↓"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_sign" android:textSize="@dimen/ui_serverstatus_sign"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
@ -153,7 +127,7 @@
android:layout_toLeftOf="@id/downcount_sign" android:layout_toLeftOf="@id/downcount_sign"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_bignumber" /> android:textSize="@dimen/ui_serverstatus_bignumber" />
<TextView <TextView
@ -166,7 +140,7 @@
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_smallnumber" /> android:textSize="@dimen/ui_serverstatus_smallnumber" />
<TextView <TextView
@ -179,16 +153,41 @@
android:layout_marginTop="-4dip" android:layout_marginTop="-4dip"
android:fontFamily="sans-serif-light" android:fontFamily="sans-serif-light"
android:gravity="end" android:gravity="end"
android:textColor="@color/text_bright_light" android:textColor="@color/text_bright_dark"
android:textSize="@dimen/ui_serverstatus_smallnumber" /> android:textSize="@dimen/ui_serverstatus_smallnumber" />
</RelativeLayout> </RelativeLayout>
<TextView <ImageButton
android:id="@+id/topline_view" android:id="@+id/resumeall_button"
android:layout_width="match_parent" android:layout_width="@dimen/widget_header_height"
android:layout_height="2dp" android:layout_height="@dimen/widget_header_height"
android:layout_below="@id/icon_image" android:background="?android:attr/selectableItemBackground"
android:background="@color/green" /> android:contentDescription="@string/action_resumeall"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_resume" />
<ImageButton
android:id="@+id/pauseall_button"
android:layout_width="@dimen/widget_header_height"
android:layout_height="@dimen/widget_header_height"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_pauseall"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_pause" />
<ImageButton
android:id="@+id/refresh_button"
android:layout_width="@dimen/widget_header_height"
android:layout_height="@dimen/widget_header_height"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/action_refresh"
android:padding="@dimen/widget_header_padding"
android:scaleType="fitXY"
android:src="@drawable/ic_action_refresh" />
</LinearLayout>
<TextView <TextView
android:id="@+id/bottomline_view" android:id="@+id/bottomline_view"
@ -202,7 +201,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@id/bottomline_view" android:layout_above="@id/bottomline_view"
android:layout_below="@id/topline_view" android:layout_below="@id/header_wrapper"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView

4
app/src/main/res/values/changelog.xml

@ -17,6 +17,10 @@
--> -->
<resources> <resources>
<string name="system_changelog"> <string name="system_changelog">
Transdroid 2.5.2\n
- Native Dediseedbox support\n
- Prevent widget from crashing\n
\n
Transdroid 2.5.1\n Transdroid 2.5.1\n
- Improved rTorrent backwards compatibility\n - Improved rTorrent backwards compatibility\n
- UI fixes for dark theme\n - UI fixes for dark theme\n

2
app/src/main/res/values/dimens.xml

@ -51,7 +51,7 @@
<dimen name="widget_preview_height">200dp</dimen> <dimen name="widget_preview_height">200dp</dimen>
<dimen name="widget_preview_width">-1dp</dimen> <dimen name="widget_preview_width">-1dp</dimen>
<dimen name="widget_header_height">46dp</dimen> <dimen name="widget_header_height">46dp</dimen>
<dimen name="widget_header_padding">6dp</dimen> <dimen name="widget_header_padding">8dp</dimen>
<dimen name="widget_list_item_height">54dp</dimen> <dimen name="widget_list_item_height">54dp</dimen>
<dimen name="widget_list_item_padding">6dp</dimen> <dimen name="widget_list_item_padding">6dp</dimen>
<dimen name="widget_list_item_padding_left">12dp</dimen> <dimen name="widget_list_item_padding_left">12dp</dimen>

2
app/src/main/res/values/styles.xml

@ -34,6 +34,8 @@
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
<item name="android:windowShowWallpaper">true</item> <item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="windowActionBar">true</item>
<item name="windowNoTitle">false</item>
</style> </style>
<style name="DefaultToolbar"> <style name="DefaultToolbar">

2
build.gradle

@ -3,7 +3,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:1.1.0' classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
} }
} }

Loading…
Cancel
Save