Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
lgallard committed Jun 26, 2015
2 parents 2280bee + a6b369a commit 6c7f1a2
Show file tree
Hide file tree
Showing 971 changed files with 2,964 additions and 153 deletions.
13 changes: 7 additions & 6 deletions qBittorrentClient/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ android {
productFlavors {
pro {
applicationId 'com.lgallardo.qbittorrentclientpro'
versionName '4.1.0'
versionName '4.1.1'
minSdkVersion 14
targetSdkVersion 21
versionCode 410
versionCode 411
archivesBaseName = "qBittorrentClient_v" + versionName
}
free {
applicationId "com.lgallardo.qbittorrentclient"
versionName '4.1.0'
versionName '4.1.1'
minSdkVersion 14
targetSdkVersion 21
versionCode 410
versionCode 411
archivesBaseName = "qBittorrentClient_v" + versionName
}
}
Expand All @@ -57,6 +57,7 @@ dependencies {
compile 'com.android.support:recyclerview-v7:22.1.1'
compile 'com.android.support:cardview-v7:22.1.1'
compile 'com.google.android.gms:play-services:7.3.0'
compile files('libs/httpcore-4.3.2.jar')
compile files('libs/httpmime-4.3.5.jar')
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile (group: 'org.apache.httpcomponents' , name: 'httpmime' , version: '4.3.5') {
exclude module: 'org.apache.httpcomponents:httpclient'}
}
5 changes: 5 additions & 0 deletions qBittorrentClient/app/proguard-rules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.** { *; }

-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -68,7 +68,7 @@ interface RefreshListener {
public void swipeRefresh();
}

public class MainActivity extends ActionBarActivity implements RefreshListener {
public class MainActivity extends AppCompatActivity implements RefreshListener {

// Torrent Info TAGs
protected static final String TAG_NAME = "name";
Expand Down Expand Up @@ -234,6 +234,19 @@ protected void onCreate(Bundle savedInstanceState) {
notification_period, alarmIntent);
}

// Set alarm for RSS checking, if not set
if (PendingIntent.getBroadcast(getApplication(), 0, new Intent(getApplication(), RSSService.class), PendingIntent.FLAG_NO_CREATE) == null) {

// Set Alarm for checking completed torrents
alarmMgr = (AlarmManager) getApplication().getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(getApplication(), RSSService.class);
alarmIntent = PendingIntent.getBroadcast(getApplication(), 0, intent, 0);

alarmMgr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime() + 5000,
AlarmManager.INTERVAL_DAY, alarmIntent);
}

if (qb_version.equals("3.2.x")) {
if (cookie == null || cookie.equals("")) {
new qBittorrentCookie().execute();
Expand Down Expand Up @@ -442,6 +455,10 @@ public void onDrawerOpened(View drawerView) {
handler = new Handler();
handler.postDelayed(m_Runnable, refresh_period);


// Load banner
loadBanner();

}

// Search bar in Material Design
Expand Down Expand Up @@ -539,14 +556,36 @@ public void onResume() {
}

}

if (fm.getBackStackEntryCount() == 0 && (fm.findFragmentByTag("secondFragment") instanceof TorrentDetailsFragment)) {

// Create the about fragment
aboutFragment = new AboutFragment();

fragmentTransaction.replace(R.id.content_frame, aboutFragment, "secondFragment");

fragmentTransaction.commit();

// Se titile
setTitle(navigationDrawerItemTitles[drawerList.getCheckedItemPosition()]);

// Close Contextual Action Bar
if (firstFragment != null && firstFragment.mActionMode != null) {
firstFragment.mActionMode.finish();
}

// Refresh current list
refreshCurrent();

}
}
catch (Exception e) {

}
}

@Override
public void onPause() {
public void onPause() {
super.onPause();
activityIsVisible = false;
}
Expand Down Expand Up @@ -716,9 +755,6 @@ private void refresh(String state) {

if (networkInfo != null && networkInfo.isConnected() && !networkInfo.isFailover()) {

// Load banner
loadBanner();

if (hostname.equals("")) {
genericOkDialog(R.string.info, R.string.about_help1);
} else {
Expand Down Expand Up @@ -782,8 +818,21 @@ private void handleIntent(Intent intent) {
refresh("completed");

}
}
catch (NullPointerException npe) {

if (intent.getStringExtra("from").equals("RSSItemActivity")) {

// Add torrent (file, url or magnet)
addTorrentByIntent(intent);

// // Activity is visble
activityIsVisible = true;

// Autorefresh
refreshCurrent();
}


} catch (NullPointerException npe) {

}
}
Expand Down Expand Up @@ -880,6 +929,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
// Add URL torrent
addUrlTorrent();
return true;
case R.id.action_rss:
// Open RSS Activity
startActivity(new Intent(getBaseContext(), com.lgallardo.qbittorrentclient.RSSFeedActivity.class));
return true;
case R.id.action_pause:
if (com.lgallardo.qbittorrentclient.TorrentDetailsFragment.hashToUpdate != null) {
pauseTorrent(com.lgallardo.qbittorrentclient.TorrentDetailsFragment.hashToUpdate);
Expand Down Expand Up @@ -2011,9 +2064,13 @@ public void swipeRefresh() {

// Set the refresh layout (refresh icon, etc)
refreshSwipeLayout();

// Actually refresh data
refreshCurrent();

// Load banner
loadBanner();

}

}
Expand All @@ -2035,7 +2092,7 @@ public void disableRefreshSwipeLayout(){
if (com.lgallardo.qbittorrentclient.TorrentDetailsFragment.mSwipeRefreshLayout != null) {
com.lgallardo.qbittorrentclient.TorrentDetailsFragment.mSwipeRefreshLayout.setRefreshing(false);
com.lgallardo.qbittorrentclient.TorrentDetailsFragment.mSwipeRefreshLayout.clearAnimation();
com.lgallardo.qbittorrentclient.TorrentDetailsFragment .mSwipeRefreshLayout.setEnabled(true);
com.lgallardo.qbittorrentclient.TorrentDetailsFragment.mSwipeRefreshLayout.setEnabled(true);
}

listViewRefreshing = false;
Expand Down Expand Up @@ -2136,6 +2193,8 @@ protected String doInBackground(String... params) {

try {

httpStatusCode = 0;

jParser.postCommand(params[0], params[1]);

} catch (JSONParserStatusCodeException e) {
Expand Down Expand Up @@ -2285,7 +2344,7 @@ protected void onPostExecute(String result) {
}
}

// Here is where the action happens
// Here is where the action happens
private class qBittorrentTask extends AsyncTask<String, Integer, Torrent[]> {

@Override
Expand Down Expand Up @@ -2389,7 +2448,7 @@ protected Torrent[] doInBackground(String... params) {
} catch (JSONParserStatusCodeException e) {
httpStatusCode = e.getCode();
torrents = null;
Log.e("JSONParserStatusCode", e.toString());
Log.e("JSONParserStatusCode >", e.toString());

} catch (Exception e) {
torrents = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
android:layout_below="@+id/app_bar"
android:gravity="end"
android:orientation="horizontal"
android:paddingBottom="5dp">
android:paddingBottom="5dp"
android:paddingRight="2dp">


<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
Contributors:
Luis M. Gallardo D.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:context=".TorrentActionsActivity">
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ScrollView
android:id="@+id/scrollView1"
Expand Down Expand Up @@ -465,4 +464,4 @@
</LinearLayout>
</ScrollView>

</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
Contributors:
Luis M. Gallardo D.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:context=".TorrentActionsActivity">
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">


<ScrollView
android:id="@+id/scrollView1"
Expand Down Expand Up @@ -422,4 +422,4 @@

</ScrollView>

</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
Contributors:
Luis M. Gallardo D.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:context=".TorrentActionsActivity">
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">


<ScrollView
android:id="@+id/scrollView1"
Expand Down Expand Up @@ -466,4 +466,4 @@

</ScrollView>

</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
Contributors:
Luis M. Gallardo D.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:context=".TorrentActionsActivity">
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">


<ScrollView
android:id="@+id/scrollView1"
Expand Down Expand Up @@ -422,4 +422,4 @@

</ScrollView>

</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingRight="5dp"
android:background="?dropShadowBackground"
android:elevation="1dp"
android:layout_below="@+id/app_bar"
Expand Down
8 changes: 8 additions & 0 deletions qBittorrentClient/app/src/free/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,12 @@
<string name="settings_qbittorrent_header_dialog_sumary">Velocidades y totales de subida/bajada</string>
<string name="help_rate_summary">Por favor califica la aplicación en Google Play</string>
<string name="help_rate_title">Califica esta aplicación</string>
<string name="action_addRss">Añadir RSS</string>
<string name="action_edit">Editar</string>
<string name="action_rss">RSS</string>
<string name="checkbox_autodownload_rss">Descargar nuevos torrents automáticamente?</string>
<string name="checkbox_notifynew_rss">Notificar nuevos torrents?</string>
<string name="dialog_add_rss">RSS url</string>
<string name="dialog_label_rss">Nombre </string>
<string name="error_rss">No se pudo obtener RSS</string>
</resources>
8 changes: 8 additions & 0 deletions qBittorrentClient/app/src/free/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,12 @@
<string name="settings_qbittorrent_header_dialog_sumary">Transférer/vitesses de téléchargement et les totaux</string>
<string name="help_rate_summary">Se il vous plaît évaluer l\'application dans Google Play</string>
<string name="help_rate_title">Évaluer l\'application</string>
<string name="action_addRss">Ajouter RSS</string>
<string name="action_edit">Modifier</string>
<string name="action_rss">RSS</string>
<string name="checkbox_autodownload_rss">Téléchargez de nouveaux torrents automatiquement?</string>
<string name="checkbox_notifynew_rss">Notifier nouvelles torrents?</string>
<string name="dialog_add_rss">RSS url</string>
<string name="dialog_label_rss">Nom</string>
<string name="error_rss">Impossible d\'obtenir RSS</string>
</resources>
8 changes: 8 additions & 0 deletions qBittorrentClient/app/src/free/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,12 @@
<string name="settings_qbittorrent_header_dialog_sumary">Carica / velocità di download e totali</string>
<string name="help_rate_summary">Si prega di valutare l\'applicazione in Google PlayPoPl</string>
<string name="help_rate_title">Valuta questa applicazione</string>
<string name="action_addRss">Aggiungere RSS</string>
<string name="action_edit">Modifica</string>
<string name="action_rss">RSS</string>
<string name="checkbox_autodownload_rss">Scarica nuovi torrents automaticamente?</string>
<string name="checkbox_notifynew_rss">Notifica nuove torrents?</string>
<string name="dialog_add_rss">RSS url</string>
<string name="dialog_label_rss">Nome</string>
<string name="error_rss">Impossibile ottenere RSS</string>
</resources>
Loading

0 comments on commit 6c7f1a2

Please sign in to comment.