Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.

Commit

Permalink
- added the option to create Virtual Albums
Browse files Browse the repository at this point in the history
- minor Bug fixes
  • Loading branch information
kollerlukas committed Sep 18, 2017
1 parent ff2b74a commit 51a7594
Show file tree
Hide file tree
Showing 48 changed files with 1,274 additions and 219 deletions.
8 changes: 7 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,16 @@

<activity
android:name=".ui.ExcludePathsActivity"
android:label="@string/edit"
android:label="@string/excluded_paths"
android:launchMode="singleTop"
android:theme="@style/CameraRoll.Theme.ExcludePaths" />

<activity
android:name=".ui.VirtualAlbumsActivity"
android:label="@string/virtual_albums"
android:launchMode="singleTop"
android:theme="@style/CameraRoll.Theme.VirtualDirectories" />

<activity android:name=".IntentReceiver">
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,6 @@ private void setColors(InfoUtil.ColorsItem colorsItem) {
private void setColor(CardView card, TextView text, int color) {
if (Color.alpha(color) == 0) {
//color not found
/*int transparent = ContextCompat.getColor(card.getContext(),
android.R.color.transparent);
card.setCardBackgroundColor(transparent);
text.setText("N/A");*/
card.setVisibility(View.GONE);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
Expand All @@ -24,6 +23,7 @@
import us.koller.cameraroll.R;
import us.koller.cameraroll.data.models.Album;
import us.koller.cameraroll.data.models.AlbumItem;
import us.koller.cameraroll.data.models.VirtualAlbum;
import us.koller.cameraroll.data.provider.MediaProvider;
import us.koller.cameraroll.ui.widget.ParallaxImageView;
import us.koller.cameraroll.util.animators.ColorFade;
Expand Down Expand Up @@ -80,7 +80,7 @@ public void setAlbum(Album album) {
.setVisibility(album.isHidden() ? View.VISIBLE : View.GONE);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !(album instanceof VirtualAlbum)) {
ImageView removableStorageIndicator = itemView.findViewById(R.id.removable_storage_indicator);
if (removableStorageIndicator != null) {
try {
Expand All @@ -89,7 +89,6 @@ public void setAlbum(Album album) {
removableStorageIndicator
.setVisibility(removable ? View.VISIBLE : View.GONE);
} catch (IllegalArgumentException e) {
Toast.makeText(itemView.getContext(), "Error while trying to load the image", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
}
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/java/us/koller/cameraroll/data/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Settings {
private boolean use8BitColor;
private boolean cameraShortcut;
private Uri removableStorageTreeUri;
private boolean virtualDirectories;

private static Settings instance;

Expand Down Expand Up @@ -82,6 +83,10 @@ private Settings(Context context) {
removableStorageTreeUri = Uri.parse(sharedPreferences.getString(
context.getString(R.string.pref_key_removable_storage_treeUri),
""));

virtualDirectories = sharedPreferences.getBoolean(
context.getString(R.string.pref_key_virtual_directories),
true);
}

/*Getter & Setter*/
Expand Down Expand Up @@ -235,6 +240,16 @@ public Uri getRemovableStorageTreeUri() {
return removableStorageTreeUri;
}

public boolean getVirtualDirectories() {
return virtualDirectories;
}

public void setVirtualDirectories(Context context, boolean virtualDirectories) {
this.virtualDirectories = virtualDirectories;
saveBoolean(context, context.getString(R.string.pref_key_virtual_directories),
virtualDirectories);
}

public void setRemovableStorageTreeUri(Context context, Uri removableStorageTreeUri) {
this.removableStorageTreeUri = removableStorageTreeUri;
saveString(context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,15 @@ public int describeContents() {
return 0;
}

@SuppressWarnings("unused")
public void onProgress(final int progress, final int totalNumber) {
NotificationCompat.Builder notifBuilder = getNotificationBuilder();
if (progress >= 0) {
/*if (progress >= 0) {
notifBuilder.setProgress(totalNumber, progress, false);
} else {
notifBuilder.setProgress(0, 0, true);
}
}*/
notifBuilder.setProgress(0, 0, true);
NotificationManager manager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(NOTIFICATION_ID, notifBuilder.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public ArrayList<AlbumItem> getAlbumItems() {
}

@SuppressWarnings("unchecked")
private Album(Parcel parcel) {
public Album(Parcel parcel) {
path = parcel.readString();
hidden = parcel.readInt();
albumItems = new ArrayList<>();
Expand Down
Loading

0 comments on commit 51a7594

Please sign in to comment.