Browse Source

Fixes in tablet and dark version of the new UI.

pull/222/merge v2.5.1
Eric Kok 10 years ago
parent
commit
25f741260f
  1. 8
      app/build.gradle
  2. 10
      app/src/main/java/org/transdroid/core/gui/TorrentsActivity.java
  3. 21
      app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java
  4. 5
      app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java
  5. 2
      app/src/main/java/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  6. 6
      app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java
  7. 2
      app/src/main/res/layout/activity_torrents.xml
  8. 6
      app/src/main/res/values-v21/styles.xml
  9. 5
      app/src/main/res/values/attrs.xml
  10. 4
      app/src/main/res/values/changelog.xml
  11. 2
      app/src/main/res/values/styles.xml

8
app/build.gradle

@ -8,8 +8,8 @@ android { @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 219
versionName '2.5.0-beta2'
versionCode 221
versionName '2.5.1'
}
buildTypes {
release {
@ -37,8 +37,8 @@ dependencies { @@ -37,8 +37,8 @@ dependencies {
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:support-annotations:20.0.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-annotations:22.1.1'
compile 'com.getbase:floatingactionbutton:1.8.0'
compile 'com.afollestad:material-dialogs:0.6.3.3'
compile 'com.nispok:snackbar:2.10.6'

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

@ -455,8 +455,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -455,8 +455,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
// No connection yet; hide all menu options except settings
if (currentConnection == null) {
torrentsToolbar.setNavigationIcon(null);
if (selectionToolbar != null)
selectionToolbar.setVisibility(View.GONE);
addmenuButton.setVisibility(View.GONE);
actionsToolbar.setVisibility(View.GONE);
if (filtersList != null)
filtersList.setVisibility(View.GONE);
filterSearch.setVisibility(View.GONE);
torrentsToolbar.getMenu().findItem(R.id.action_search).setVisible(false);
torrentsToolbar.getMenu().findItem(R.id.action_rss).setVisible(false);
torrentsToolbar.getMenu().findItem(R.id.action_settings).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
@ -474,8 +479,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE @@ -474,8 +479,13 @@ public class TorrentsActivity extends ActionBarActivity implements TorrentTasksE
// There is a connection (read: settings to some server known)
if (drawerToggle != null)
torrentsToolbar.setNavigationIcon(R.drawable.ic_action_drawer);
if (selectionToolbar != null)
selectionToolbar.setVisibility(View.VISIBLE);
addmenuButton.setVisibility(View.VISIBLE);
actionsToolbar.setVisibility(View.VISIBLE);
if (filtersList != null)
filtersList.setVisibility(View.VISIBLE);
filterSearch.setVisibility(View.VISIBLE);
boolean addByFile = Daemon.supportsAddByFile(currentConnection.getType());
addmenuFileButton.setVisibility(addByFile ? View.VISIBLE : View.GONE);
// Primary toolbar menu

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

@ -23,6 +23,7 @@ import android.net.Uri; @@ -23,6 +23,7 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.SearchRecentSuggestions;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
@ -74,8 +75,6 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav @@ -74,8 +75,6 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav
@Bean
protected ApplicationSettings applicationSettings;
@Bean
protected NavigationHelper navigationHelper;
@Bean
protected SearchHelper searchHelper;
@SystemService
protected SearchManager searchManager;
@ -159,15 +158,15 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav @@ -159,15 +158,15 @@ public class SearchActivity extends ActionBarActivity implements ActionBar.OnNav
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
if (navigationHelper.enableSearchUi()) {
// Add an expandable SearchView to the action bar
MenuItem item = menu.findItem(R.id.action_search);
final SearchView searchView = new SearchView(searchToolbar.getContext());
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
item.setActionView(searchView);
searchMenu = item;
}
// Add an expandable SearchView to the action bar
MenuItem item = menu.findItem(R.id.action_search);
final SearchView searchView = new SearchView(searchToolbar.getContext());
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setQueryRefinementEnabled(true);
//searchView.setIconified(false);
searchView.setIconifiedByDefault(false);
MenuItemCompat.setActionView(item, searchView);
searchMenu = item;
return true;
}

5
app/src/main/java/org/transdroid/core/gui/search/SearchResultsFragment.java

@ -21,6 +21,7 @@ import android.content.Context; @@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
@ -198,6 +199,10 @@ public class SearchResultsFragment extends Fragment { @@ -198,6 +199,10 @@ public class SearchResultsFragment extends Fragment {
if (checked.size() > 1) {
Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first.getName()), Toast.LENGTH_LONG).show();
}
if (TextUtils.isEmpty(first.getDetailsUrl())) {
Toast.makeText(getActivity(), getString(R.string.error_invalid_url_form, first.getName()), Toast.LENGTH_LONG).show();
return false;
}
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getDetailsUrl())));
return true;
} else {

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

@ -179,6 +179,8 @@ public class SystemSettingsActivity extends PreferenceCompatActivity { @@ -179,6 +179,8 @@ public class SystemSettingsActivity extends PreferenceCompatActivity {
@OnActivityResult(BarcodeHelper.ACTIVITY_BARCODE_QRSETTINGS)
public void onQrCodeScanned(int resultCode, Intent data) {
// We should have received Intent extras with the QR-decoded data representing Transdroid settings
if (data == null || !data.hasExtra("SCAN_RESULT"))
return; // Cancelled scan; ignore
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SystemSettingsActivity.this);
String contents = data.getStringExtra("SCAN_RESULT");
String formatName = data.getStringExtra("SCAN_RESULT_FORMAT");

6
app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java

@ -178,7 +178,7 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -178,7 +178,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
byte[] bytes = baos.toByteArray();
int size = (int) file.length() * 2;
final int XMLRPC_EXTRA_PADDING = 1280;
if (version >= 904) {
if (version >= 907) {
makeRtorrentCall(log, "network.xmlrpc.size_limit.set", new Object[]{size + XMLRPC_EXTRA_PADDING});
makeRtorrentCall(log, "load.raw_start", new Object[]{bytes});
} else {
@ -191,7 +191,7 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -191,7 +191,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Request to add a torrent by URL
String url = ((AddByUrlTask) task).getUrl();
if (version >= 904) {
if (version >= 907) {
makeRtorrentCall(log, "load.start", new String[]{"", url});
} else {
makeRtorrentCall(log, "load_start", new String[]{url});
@ -202,7 +202,7 @@ public class RtorrentAdapter implements IDaemonAdapter { @@ -202,7 +202,7 @@ public class RtorrentAdapter implements IDaemonAdapter {
// Request to add a magnet link by URL
String magnet = ((AddByMagnetUrlTask) task).getUrl();
if (version >= 904) {
if (version >= 907) {
makeRtorrentCall(log, "load.start", new String[]{"", magnet});
} else {
makeRtorrentCall(log, "load_start", new String[]{magnet});

2
app/src/main/res/layout/activity_torrents.xml

@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
android:layout_width="@dimen/ui_filters_list"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
android:background="?attr/drawer_background"
android:orientation="vertical">
<ListView

6
app/src/main/res/values-v21/styles.xml

@ -17,11 +17,13 @@ @@ -17,11 +17,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TransdroidTheme" parent="Theme.Transdroid.Light">
<item name="activatable_background">?android:attr/activatedBackgroundIndicator</item>
<item name="drawer_background">@color/background_light</item>
<item name="activatable_background">@drawable/activatable_background</item>
</style>
<style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark">
<item name="activatable_background">?android:attr/selectableItemBackground</item>
<item name="drawer_background">@color/background_dark</item>
<item name="activatable_background">@drawable/activatable_background</item>
</style>
<style name="DefaultToolbar">

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

@ -22,8 +22,9 @@ @@ -22,8 +22,9 @@
</declare-styleable>
<!-- Themeable drawables-->
<attr name="loading_progress" format="reference"/>
<attr name="activatable_background" format="reference"/>
<attr name="drawer_background" format="reference" />
<attr name="loading_progress" format="reference" />
<attr name="activatable_background" format="reference" />
<attr name="text_bright" format="reference" />
<attr name="text_actionbar" format="reference" />
<attr name="text_actionbar_secondary" format="reference" />

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

@ -17,6 +17,10 @@ @@ -17,6 +17,10 @@
-->
<resources>
<string name="system_changelog">
Transdroid 2.5.1\n
- Improved rTorrent backwards compatibility\n
- UI fixes for dark theme\n
\n
Transdroid 2.5.0-beta2\n
- tTorrent support\n
- Fixed qBittorrent 3.2+ ratio bug\n

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

@ -17,10 +17,12 @@ @@ -17,10 +17,12 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TransdroidTheme" parent="Theme.Transdroid.Light">
<item name="drawer_background">@color/background_light</item>
<item name="activatable_background">@drawable/activatable_background</item>
</style>
<style name="TransdroidTheme.Dark" parent="Theme.Transdroid.Dark">
<item name="drawer_background">@color/background_dark</item>
<item name="activatable_background">@drawable/activatable_background</item>
</style>

Loading…
Cancel
Save