New loading/default app icon (kudos to mray)
This commit is contained in:
parent
8e54bb95c5
commit
c7ace4ff8e
1524
media/fdroid-logo-2013/default-app.svg
Normal file
1524
media/fdroid-logo-2013/default-app.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 49 KiB |
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
<ImageView android:id="@+id/icon"
|
<ImageView android:id="@+id/icon"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:layout_width="50dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="48dp"
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="4dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
@ -49,8 +49,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@id/icon"
|
android:layout_toRightOf="@id/icon"
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="4dp" />
|
||||||
android:paddingBottom="2dp" />
|
|
||||||
|
|
||||||
<TextView android:id="@+id/status"
|
<TextView android:id="@+id/status"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
@ -108,7 +108,7 @@ public class DB {
|
|||||||
public App() {
|
public App() {
|
||||||
name = "Unknown";
|
name = "Unknown";
|
||||||
summary = "Unknown application";
|
summary = "Unknown application";
|
||||||
icon = "noicon.png";
|
icon = null;
|
||||||
id = "unknown";
|
id = "unknown";
|
||||||
license = "Unknown";
|
license = "Unknown";
|
||||||
category = "Uncategorized";
|
category = "Uncategorized";
|
||||||
|
@ -82,32 +82,14 @@ public class FDroidApp extends Application {
|
|||||||
DB.initDB(ctx);
|
DB.initDB(ctx);
|
||||||
UpdateService.schedule(ctx);
|
UpdateService.schedule(ctx);
|
||||||
|
|
||||||
DisplayImageOptions defaultOptions;
|
DisplayImageOptions options = new DisplayImageOptions.Builder()
|
||||||
int threads;
|
|
||||||
|
|
||||||
// Parameters for 2.2 and below
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.GINGERBREAD) {
|
|
||||||
defaultOptions = new DisplayImageOptions.Builder()
|
|
||||||
.cacheInMemory(true)
|
.cacheInMemory(true)
|
||||||
.cacheOnDisc(true)
|
.cacheOnDisc(true)
|
||||||
.showImageOnLoading(android.R.color.transparent)
|
.showImageOnLoading(R.drawable.ic_repo_app_default)
|
||||||
.bitmapConfig(Bitmap.Config.RGB_565)
|
.showImageForEmptyUri(R.drawable.ic_repo_app_default)
|
||||||
.imageScaleType(ImageScaleType.NONE)
|
|
||||||
.build();
|
|
||||||
threads = 2;
|
|
||||||
}
|
|
||||||
// Parameters for 2.3 and above
|
|
||||||
else {
|
|
||||||
defaultOptions = new DisplayImageOptions.Builder()
|
|
||||||
.cacheInMemory(true)
|
|
||||||
.cacheOnDisc(true)
|
|
||||||
.showImageOnLoading(android.R.color.transparent)
|
|
||||||
.displayer(new FadeInBitmapDisplayer(200, true, true, false))
|
.displayer(new FadeInBitmapDisplayer(200, true, true, false))
|
||||||
.bitmapConfig(Bitmap.Config.RGB_565)
|
.bitmapConfig(Bitmap.Config.RGB_565)
|
||||||
.imageScaleType(ImageScaleType.NONE)
|
|
||||||
.build();
|
.build();
|
||||||
threads = Runtime.getRuntime().availableProcessors() * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(ctx)
|
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(ctx)
|
||||||
.discCache(new UnlimitedDiscCache(
|
.discCache(new UnlimitedDiscCache(
|
||||||
@ -117,12 +99,10 @@ public class FDroidApp extends Application {
|
|||||||
return imageUri.substring(
|
return imageUri.substring(
|
||||||
imageUri.lastIndexOf('/') + 1);
|
imageUri.lastIndexOf('/') + 1);
|
||||||
} } ))
|
} } ))
|
||||||
.defaultDisplayImageOptions(defaultOptions)
|
.defaultDisplayImageOptions(options)
|
||||||
.threadPoolSize(threads)
|
.threadPoolSize(Runtime.getRuntime().availableProcessors() * 2)
|
||||||
.build();
|
.build();
|
||||||
ImageLoader.getInstance().init(config);
|
ImageLoader.getInstance().init(config);
|
||||||
Log.d("FDroid", "Universal Image Loader started with "
|
|
||||||
+ threads + " threads");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Context ctx;
|
Context ctx;
|
||||||
@ -183,9 +163,10 @@ public class FDroidApp extends Application {
|
|||||||
|
|
||||||
List<DB.Repo> repos = db.getRepos();
|
List<DB.Repo> repos = db.getRepos();
|
||||||
for (DB.App app : apps) {
|
for (DB.App app : apps) {
|
||||||
|
if (app.icon == null) continue;
|
||||||
for (DB.Repo repo : repos) {
|
for (DB.Repo repo : repos) {
|
||||||
DB.Apk bestApk = app.apks.get(0);
|
int latestRepo = app.apks.get(0).repo;
|
||||||
if (repo.id == bestApk.repo) {
|
if (repo.id == latestRepo) {
|
||||||
app.iconUrl = repo.address + "/icons/" + app.icon;
|
app.iconUrl = repo.address + "/icons/" + app.icon;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -202,10 +183,11 @@ public class FDroidApp extends Application {
|
|||||||
|
|
||||||
List<DB.Repo> repos = db.getRepos();
|
List<DB.Repo> repos = db.getRepos();
|
||||||
for (DB.App app : apps) {
|
for (DB.App app : apps) {
|
||||||
|
if (app.icon == null) continue;
|
||||||
if (!invalidApps.contains(app.id)) continue;
|
if (!invalidApps.contains(app.id)) continue;
|
||||||
for (DB.Repo repo : repos) {
|
for (DB.Repo repo : repos) {
|
||||||
DB.Apk bestApk = app.apks.get(0);
|
int latestRepo = app.apks.get(0).repo;
|
||||||
if (repo.id == bestApk.repo) {
|
if (repo.id == latestRepo) {
|
||||||
app.iconUrl = repo.address + "/icons/" + app.icon;
|
app.iconUrl = repo.address + "/icons/" + app.icon;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user