Bugfix / Refactoring
This commit is contained in:
parent
db751ecc64
commit
bbbcdfdb4a
7 changed files with 11 additions and 39 deletions
|
@ -60,7 +60,7 @@ public class ScreenshotTest {
|
||||||
private NewsReaderListActivity activity;
|
private NewsReaderListActivity activity;
|
||||||
private NewsReaderListFragment nrlf;
|
private NewsReaderListFragment nrlf;
|
||||||
private NewsReaderDetailFragment nrdf;
|
private NewsReaderDetailFragment nrdf;
|
||||||
private int itemPos = 5;
|
private int itemPos = 0;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
|
|
|
@ -73,23 +73,23 @@ public class GetImageThreaded implements ImageLoadingListener
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
|
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
|
||||||
NotifyDownloadFinished();
|
NotifyDownloadFinished(null);
|
||||||
Log.d(TAG, "Failed to load file: " + imageUri);
|
Log.d(TAG, "Failed to load file: " + imageUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||||
NotifyDownloadFinished();
|
NotifyDownloadFinished(loadedImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingCancelled(String imageUri, View view) {
|
public void onLoadingCancelled(String imageUri, View view) {
|
||||||
NotifyDownloadFinished();
|
NotifyDownloadFinished(null);
|
||||||
Log.d(TAG, "Cancelled: " + imageUri);
|
Log.d(TAG, "Cancelled: " + imageUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NotifyDownloadFinished() {
|
private void NotifyDownloadFinished(Bitmap bitmap) {
|
||||||
if(imageDownloadFinished != null)
|
if(imageDownloadFinished != null)
|
||||||
imageDownloadFinished.DownloadFinished(ThreadId);
|
imageDownloadFinished.DownloadFinished(ThreadId, bitmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,18 +73,11 @@ public class FavIconHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetImageThreaded giAsync = new GetImageThreaded(feed.getFaviconUrl(), favIconDownloadFinished, feed.getId());
|
new GetImageThreaded(feed.getFaviconUrl(), favIconDownloadFinished, feed.getId()).start();
|
||||||
|
|
||||||
giAsync.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageDownloadFinished favIconDownloadFinished = new ImageDownloadFinished() {
|
ImageDownloadFinished favIconDownloadFinished = new ImageDownloadFinished() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void DownloadFinished(long AsynkTaskId) {
|
|
||||||
DownloadFinished(AsynkTaskId, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void DownloadFinished(long AsynkTaskId, Bitmap bitmap) {
|
public void DownloadFinished(long AsynkTaskId, Bitmap bitmap) {
|
||||||
if(bitmap != null) {
|
if(bitmap != null) {
|
||||||
|
|
|
@ -25,6 +25,5 @@ package de.luhmer.owncloudnewsreader.helper;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
public interface ImageDownloadFinished {
|
public interface ImageDownloadFinished {
|
||||||
void DownloadFinished(long AsynkTaskId);
|
|
||||||
void DownloadFinished(long AsynkTaskId, Bitmap bitmap);
|
void DownloadFinished(long AsynkTaskId, Bitmap bitmap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,21 +89,6 @@ public class InsertIntoDatabase {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if(feeds.get(i).getLink().equals(oldFeed.getLink()))
|
|
||||||
{
|
|
||||||
if(!feeds.get(i).getFeedTitle().equals(oldFeed.getFeedTitle()))
|
|
||||||
{
|
|
||||||
oldFeed.setFeedTitle(feeds.get(i).getFeedTitle());
|
|
||||||
}
|
|
||||||
//Set the avg color after sync again.
|
|
||||||
oldFeed.setAvgColour(oldFeeds.get(i).getAvgColour());
|
|
||||||
dbConn.updateFeed(oldFeed);
|
|
||||||
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
if(!found)
|
if(!found)
|
||||||
{
|
{
|
||||||
|
|
|
@ -192,7 +192,7 @@ public class DownloadImagesService extends IntentService {
|
||||||
ImageDownloadFinished imgDownloadFinished = new ImageDownloadFinished() {
|
ImageDownloadFinished imgDownloadFinished = new ImageDownloadFinished() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void DownloadFinished(long ThreadId) {
|
public void DownloadFinished(long AsynkTaskId, Bitmap bitmap) {
|
||||||
int count = maxCount - linksToImages.size();
|
int count = maxCount - linksToImages.size();
|
||||||
|
|
||||||
if(maxCount == count) {
|
if(maxCount == count) {
|
||||||
|
@ -208,10 +208,5 @@ public class DownloadImagesService extends IntentService {
|
||||||
StartNextDownloadInQueue();
|
StartNextDownloadInQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void DownloadFinished(long AsynkTaskId, Bitmap bitmap) {
|
|
||||||
DownloadFinished(AsynkTaskId);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ app_package_name 'de.luhmer.owncloudnewsreader'
|
||||||
app_apk_path 'News-Android-App/build/outputs/apk/News-Android-App-debug-unaligned.apk'
|
app_apk_path 'News-Android-App/build/outputs/apk/News-Android-App-debug-unaligned.apk'
|
||||||
tests_apk_path 'News-Android-App/build/outputs/apk/News-Android-App-debug-androidTest-unaligned.apk'
|
tests_apk_path 'News-Android-App/build/outputs/apk/News-Android-App-debug-androidTest-unaligned.apk'
|
||||||
|
|
||||||
locales ['en-US', 'fr-FR', 'it-IT']
|
locales ['en-US', 'de-DE', 'fr-FR', 'it-IT']
|
||||||
|
|
||||||
# clear all previously generated screenshots in your local output directory before creating new ones
|
# clear all previously generated screenshots in your local output directory before creating new ones
|
||||||
clear_previous_screenshots true
|
clear_previous_screenshots true
|
||||||
|
|
Loading…
Reference in a new issue