Skip to content

Commit

Permalink
Lots of bug fixes and small improvements
Browse files Browse the repository at this point in the history
Added "clear finished transfers" button.
Fixed torrent links not being recognized from browsers.
New "up" folder button that fixes the adjusted file position nonsense.
Light font used in a few places.
Minor UI fixes.
Code cleanup.
  • Loading branch information
DSteve595 committed Jun 2, 2014
1 parent 5e586da commit 50a50c1
Show file tree
Hide file tree
Showing 90 changed files with 624 additions and 611 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
/local.properties
/.idea/
.DS_Store
.DS_Store
/build
1 change: 0 additions & 1 deletion Put.io.iml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
2 changes: 1 addition & 1 deletion app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="httpmime-4.3.3" level="project" />
<orderEntry type="library" exported="" name="pagerslidingtabstrip-1.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-4.4.52" level="project" />
<orderEntry type="library" exported="" name="picasso-2.2.0" level="project" />
<orderEntry type="library" exported="" name="httpcore-4.3.2" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-19.1.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-19.1.0" level="project" />
<orderEntry type="library" exported="" name="play-services-4.3.23" level="project" />
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
<orderEntry type="module" module-name="aFileChooser" exported="" />
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.android.tools.build:gradle:0.10.+'
}
}

Expand All @@ -15,7 +15,7 @@ repositories {

android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
buildToolsVersion '19.1.0'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand All @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
versionCode 50
versionName "1.9.1-beta"
versionCode 53
versionName "1.9.4-beta"
}

buildTypes {
Expand All @@ -48,7 +48,7 @@ android {
dependencies {
compile 'com.android.support:support-v4:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.3.+'
compile 'com.google.android.gms:play-services:4.4.+'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.httpcomponents:httpmime:4.3.+'
compile 'org.apache.httpcomponents:httpcore:4.3.+'
Expand Down
23 changes: 20 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@
android:value=".activities.Putio"/>
</activity>
<activity android:name=".activities.Setup"/>
<activity android:name=".activities.FileDetailsActivity"/>
<activity android:name=".activities.Preferences"/>
<activity
android:name=".activities.FileDetailsActivity"
android:parentActivityName=".activities.Putio">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Putio"/>
</activity>
<activity
android:name=".activities.Preferences"
android:parentActivityName=".activities.Putio">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Putio"/>
</activity>
<activity
android:name=".activities.FileFinished"
android:theme="@style/Putio.Dialog"/>
Expand Down Expand Up @@ -104,7 +116,12 @@
</activity>
<activity
android:name=".activities.AboutActivity"
android:theme="@style/Putio.DialogOrActivity"/>
android:parentActivityName=".activities.Putio"
android:theme="@style/Putio.DialogOrActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Putio"/>
</activity>

<activity
android:name="com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerActivity"
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/java/com/stevenschoen/putionew/FilesAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,23 @@
public class FilesAdapter extends ArrayAdapter<PutioFileLayout> {

Context context;
int layoutResourceId;
List<PutioFileLayout> data = null;

public FilesAdapter(Context context, int layoutResourceId, List<PutioFileLayout> data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
public FilesAdapter(Context context, List<PutioFileLayout> data) {
super(context, R.layout.file_putio, data);
this.context = context;
this.data = data;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
FileHolder holder = null;
FileHolder holder;

if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
try {
row = inflater.inflate(layoutResourceId, parent, false);
row = inflater.inflate(R.layout.file_putio, parent, false);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public class PutioAccountInfo implements Parcelable {
public long diskAvailable;
public long diskUsed;
public long diskSize;

public PutioAccountInfo() {
super();
}

public PutioAccountInfo(String username, String email,
long diskAvailable, long diskUsed, long diskSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ public PutioFileData(boolean isShared, String name, String screenshot,
this.iconUrl = iconUrl;
this.id = id;
this.size = size;

if (contentType.matches("application/x-directory")) {
isFolder = true;
} else {
isFolder = false;
}

isFolder = contentType.matches("application/x-directory");
}

public static String[] contentTypesArray = new String[] { "file", "application/x-directory",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public class PutioFileLayout implements Parcelable {
public int iconRes;
public String iconUrl;

public PutioFileLayout() {
super();
}

public PutioFileLayout(String name, String description, int iconRes, String iconUrl) {
super();
this.name = name;
Expand All @@ -31,9 +27,6 @@ public PutioFileLayout(Parcel in) {
}

private void readFromParcel(Parcel in) {
// We just need to read back each
// field in the order that it was
// written to the parcel
this.name = in.readString();
this.description = in.readString();
this.iconRes = in.readInt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ public class PutioOpenFileService extends Service {
String filename;
int mode;

PutioUtils utils;

IntentFilter intentFilter3 = new IntentFilter(Putio.fileDownloadUpdateIntent);

@Override
public void onCreate() {
super.onCreate();

downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);

utils = new PutioUtils(null, null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ public PutioTransfersService getService() {
}

SharedPreferences sharedPrefs;

private String token;


updateTransfersTask update = new updateTransfersTask();
boolean paused = false;

PutioUtils utils;

Expand All @@ -53,11 +50,9 @@ public PutioTransfersService getService() {
public void onCreate() {
super.onCreate();

sharedPrefs = PreferenceManager
.getDefaultSharedPreferences(this);
token = sharedPrefs.getString("token", null);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);

utils = new PutioUtils(token, sharedPrefs);
utils = new PutioUtils(sharedPrefs);

handler = new Handler();
updateTransfersRunnable = new Runnable() {
Expand Down Expand Up @@ -89,7 +84,7 @@ protected PutioTransferData[] doInBackground(Void... params) {
JSONObject json;
JSONArray array;

InputStream is = null;
InputStream is;

try {
try {
Expand Down Expand Up @@ -171,10 +166,6 @@ public PutioTransferData[] getTransfers() {
return transfersInverted;
}

public void setPaused(boolean paused) {
this.paused = paused;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return Service.START_STICKY;
Expand Down
Loading

0 comments on commit 50a50c1

Please sign in to comment.