diff --git a/CHANGELOG.md b/CHANGELOG.md index 1547d658..27c2c2d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,5 @@ Change Log ========== -Version 5.3.0 *(2018-11-29)* ----------------------------- - - * [Feature] New way to open up the Filestack Picker! Use `FilestackPicker.Builder` class to customize your picker easily. - * [Feature] A way to set Picker's theme is now available. Use `Theme.Builder` class to set your own color scheme to a picker. - * [Feature] Picker's version is now available in the picker's menu. This feature can be disabled using `FilestackPicker.Builder`. - * [UI change] Files descriptions are now formatted in a better way (e.g: 15360 is now properly displayed as 15kB). - * [UI fix] Menu options are now properly hidden in places that doesn't require them. - * Tester module supports all of the new features introduced. Head to Settings to see new configuration options. - Version 5.2.0 *(2018-10-15)* ---------------------------- diff --git a/README.md b/README.md index f7d2e89f..160fe959 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@

- + - - + +

@@ -21,7 +21,7 @@ ## Install ```gradle -implementation 'com.filestack:filestack-android:5.3.0' +implementation 'com.filestack:filestack-android:5.1.0' ``` ## Tester and Samples @@ -202,13 +202,6 @@ if (savedInstanceState == null) { } ``` -## Theming -Filestack Android SDK provides a theming mechanism for Filestack Picker screen. - -Setting a theme requires passing a `Theme` to `Filestack.Builder#theme(Theme)` method call. -`Theme` objects can be constructed with a `Theme.Builder` instance. -If theme is not set, a default one will be used. - ## Native UI At present this SDK doesn't offer many customization options, but the [Java SDK][java-sdk] can be used to build a native UI. This SDK adds UI and diff --git a/filestack/build.gradle b/filestack/build.gradle index 09b419d4..831175bb 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' group = 'com.filestack' -version = '5.3.0' +version = '5.2.0' project.archivesBaseName = 'filestack-android' android { diff --git a/filestack/src/main/java/com/filestack/android/FsActivity.java b/filestack/src/main/java/com/filestack/android/FsActivity.java index 206adf66..269126aa 100644 --- a/filestack/src/main/java/com/filestack/android/FsActivity.java +++ b/filestack/src/main/java/com/filestack/android/FsActivity.java @@ -311,10 +311,10 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) { switch (source) { case Sources.CAMERA: - fragment = CameraFragment.newInstance(theme); + fragment = new CameraFragment(); break; case Sources.DEVICE: - fragment = LocalFilesFragment.newInstance(allowMultipleFiles, theme); + fragment = LocalFilesFragment.newInstance(allowMultipleFiles); break; } diff --git a/filestack/src/main/java/com/filestack/android/Theme.java b/filestack/src/main/java/com/filestack/android/Theme.java index 5b65d366..bc8dfcbb 100644 --- a/filestack/src/main/java/com/filestack/android/Theme.java +++ b/filestack/src/main/java/com/filestack/android/Theme.java @@ -47,47 +47,26 @@ public static class Builder { int accentColor = Color.parseColor("#FF9800"); int textColor = Color.parseColor("#89000000"); - /** - * Title of the Picker. - */ public Builder title(String title) { this.title = title; return this; } - /** - * Background color. Displayed in lists and a navigation drawer. - * Used also as a text color for toolbar title and - * buttons on authorization/local/camera screens. - * @param backgroundColor int representation of a color - */ public Builder backgroundColor(@ColorInt int backgroundColor) { this.backgroundColor = backgroundColor; return this; } - /** - * Accent color. Used as a color for toolbar, selection markers and navigation drawer items. - * @param accentColor int representation of a color - */ public Builder accentColor(@ColorInt int accentColor) { this.accentColor = accentColor; return this; } - /** - * Text color. Used as a color for text in camera/local/authorization/file list screens. - * @param textColor int representation of a color - */ public Builder textColor(@ColorInt int textColor) { this.textColor = textColor; return this; } - /** - * Builds a new theme based on provided parameters. - * @return new {@link Theme} instance - */ public Theme build() { return new Theme(this); } diff --git a/filestack/src/main/java/com/filestack/android/internal/CameraFragment.java b/filestack/src/main/java/com/filestack/android/internal/CameraFragment.java index dc65f96f..f8613f93 100644 --- a/filestack/src/main/java/com/filestack/android/internal/CameraFragment.java +++ b/filestack/src/main/java/com/filestack/android/internal/CameraFragment.java @@ -3,27 +3,22 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.ColorStateList; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; -import android.support.v4.view.ViewCompat; -import android.support.v4.widget.ImageViewCompat; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.ViewGroup; import android.widget.Button; -import android.widget.ImageView; import com.filestack.Sources; import com.filestack.android.FsConstants; import com.filestack.android.R; import com.filestack.android.Selection; -import com.filestack.android.Theme; import java.io.File; import java.io.IOException; @@ -37,21 +32,10 @@ */ public class CameraFragment extends Fragment implements BackButtonListener, View.OnClickListener { - public static CameraFragment newInstance(Theme theme) { - Bundle args = new Bundle(); - args.putParcelable(ARG_THEME, theme); - CameraFragment fragment = new CameraFragment(); - fragment.setArguments(args); - return fragment; - } - private static final String TYPE_PHOTO = "photo"; private static final String TYPE_VIDEO = "video"; private static final String PREF_PATH = "path"; private static final String PREF_NAME= "name"; - private static final String ARG_THEME = "theme"; - - private Theme theme; @Nullable @Override @@ -74,14 +58,10 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c videoButton.setVisibility(View.GONE); } } - theme = getArguments().getParcelable(ARG_THEME); - photoButton.setTextColor(theme.getBackgroundColor()); - ViewCompat.setBackgroundTintList(photoButton, ColorStateList.valueOf(theme.getAccentColor())); - ViewCompat.setBackgroundTintList(videoButton, ColorStateList.valueOf(theme.getAccentColor())); - videoButton.setTextColor(theme.getBackgroundColor()); + photoButton.setOnClickListener(this); videoButton.setOnClickListener(this); - ImageViewCompat.setImageTintList((ImageView) root.findViewById(R.id.icon), ColorStateList.valueOf(theme.getTextColor())); + return root; } diff --git a/filestack/src/main/java/com/filestack/android/internal/LocalFilesFragment.java b/filestack/src/main/java/com/filestack/android/internal/LocalFilesFragment.java index 48585b18..deae32d6 100644 --- a/filestack/src/main/java/com/filestack/android/internal/LocalFilesFragment.java +++ b/filestack/src/main/java/com/filestack/android/internal/LocalFilesFragment.java @@ -4,26 +4,20 @@ import android.content.ClipData; import android.content.ContentResolver; import android.content.Intent; -import android.content.res.ColorStateList; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.OpenableColumns; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; -import android.support.v4.view.ViewCompat; -import android.support.v4.widget.ImageViewCompat; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; -import android.widget.ImageView; import com.filestack.android.FsConstants; import com.filestack.android.R; import com.filestack.android.Selection; -import com.filestack.android.Theme; import java.util.ArrayList; @@ -38,13 +32,11 @@ public class LocalFilesFragment extends Fragment implements View.OnClickListener { private static final String ARG_ALLOW_MULTIPLE_FILES = "multipleFiles"; private static final int READ_REQUEST_CODE = RESULT_FIRST_USER; - private static final String ARG_THEME = "theme"; - public static Fragment newInstance(boolean allowMultipleFiles, Theme theme) { + public static Fragment newInstance(boolean allowMultipleFiles) { Fragment fragment = new LocalFilesFragment(); Bundle args = new Bundle(); args.putBoolean(ARG_ALLOW_MULTIPLE_FILES, allowMultipleFiles); - args.putParcelable(ARG_THEME, theme); fragment.setArguments(args); return fragment; } @@ -53,12 +45,7 @@ public static Fragment newInstance(boolean allowMultipleFiles, Theme theme) { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) { View view = inflater.inflate(R.layout.filestack__fragment_local_files, container, false); - Button openGalleryButton = view.findViewById(R.id.select_gallery); - openGalleryButton.setOnClickListener(this); - Theme theme = getArguments().getParcelable(ARG_THEME); - ViewCompat.setBackgroundTintList(openGalleryButton, ColorStateList.valueOf(theme.getAccentColor())); - openGalleryButton.setTextColor(theme.getBackgroundColor()); - ImageViewCompat.setImageTintList((ImageView) view.findViewById(R.id.icon), ColorStateList.valueOf(theme.getTextColor())); + view.findViewById(R.id.select_gallery).setOnClickListener(this); return view; }