diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index 6debaa2..d67d0e1 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -67,7 +67,7 @@ @@ -77,8 +77,7 @@ diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 75ce1a6..36963b9 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/README.md b/README.md index 8907c3f..0b80ad5 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ Grab the [latest version](https://github.com/kaczmarkiewiczp/rcloneExplorer/rele Credits/Libraries ----------------- -- [About Libraries](https://github.com/mikepenz/AboutLibraries) - AboutLibraries is a library to offer some information of libraries. +- [Color Picker](https://github.com/jaredrummler/ColorPicker) - A highly customizable color picker for Android. - [ExFile Picker](https://github.com/bartwell/ExFilePicker) - Open source Android library. Implement choosing files and directories in your application. -- [Floating Action Button SpeedDial](https://github.com/leinardi/FloatingActionButtonSpeedDial) - A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification -- [Font Awesome Icons](https://fontawesome.com/) - The iconic SVG, font, and CSS toolkit +- [Floating Action Button SpeedDial](https://github.com/leinardi/FloatingActionButtonSpeedDial) - A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification. +- [Font Awesome Icons](https://fontawesome.com/) - The iconic SVG, font, and CSS toolkit/ - [Markdown View](https://github.com/falnatsheh/MarkdownView) - MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview. -- [Material Design Icons](https://github.com/Templarian/MaterialDesign) - 2200+ Material Design Icons from the Community +- [Material Design Icons](https://github.com/Templarian/MaterialDesign) - 2200+ Material Design Icons from the Community. - [rclone](https://github.com/ncw/rclone) - "rsync for cloud storage" -- [Toasty](https://github.com/GrenderG/Toasty) - The usual Toast, but with steroids +- [Toasty](https://github.com/GrenderG/Toasty) - The usual Toast, but with steroids. - Icon made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [Flaticon](https://www.flaticon.com) diff --git a/app/build.gradle b/app/build.gradle index a051750..28ed3a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ca.pkay.rcloneexplorer" minSdkVersion 21 targetSdkVersion 27 - versionCode 8 - versionName "1.1.1" + versionCode 9 + versionName "1.2.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -32,10 +32,11 @@ dependencies { implementation 'com.android.support:design:27.1.1' implementation "com.leinardi.android:speed-dial:1.0-alpha03" implementation 'ru.bartwell:exfilepicker:2.4' - implementation "com.mikepenz:aboutlibraries:6.0.8" implementation 'us.feras.mdv:markdownview:1.1.0' implementation 'jp.wasabeef:recyclerview-animators:2.3.0' implementation 'com.github.GrenderG:Toasty:1.3.0' + implementation 'com.android.support:support-v4:27.1.1' + implementation 'com.jaredrummler:colorpicker:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d4166e8..12943a5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,6 +19,7 @@ android:theme="@style/AppTheme.NoActionBar"> + @@ -45,14 +46,19 @@ android:name=".AboutActivity" android:label="@string/title_activity_about" android:theme="@style/AppTheme.NoActionBar" /> - - - + android:parentActivityName=".AboutActivity" + android:theme="@style/AppTheme.NoActionBar" /> + + \ No newline at end of file diff --git a/app/src/main/assets/changelog.md b/app/src/main/assets/changelog.md index aea2bd2..a9d807c 100644 --- a/app/src/main/assets/changelog.md +++ b/app/src/main/assets/changelog.md @@ -1,3 +1,11 @@ +### 1.2.0 +* **New:** Settings! + * **New:** Custom primary and accent colors +* **New:** Group notifications together +* **New:** "Open as" option in the menu + +*** + ### 1.1.1 * **Fix:** Hide hash calculations for crypt remotes * **Fix:** Crash when rclone fails diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/AboutActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/AboutActivity.java index 592fb6d..04aa567 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/AboutActivity.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/AboutActivity.java @@ -1,25 +1,26 @@ package ca.pkay.rcloneexplorer; +import android.app.ActivityManager; import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; +import android.preference.PreferenceManager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; -import android.widget.Toast; -import com.mikepenz.aboutlibraries.Libs; -import com.mikepenz.aboutlibraries.LibsBuilder; public class AboutActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + applyTheme(); setContentView(R.layout.activity_about); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); @@ -66,6 +67,19 @@ public void onClick(View v) { }); } + private void applyTheme() { + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + int customPrimaryColor = sharedPreferences.getInt("pref_key_color_primary", -1); + int customAccentColor = sharedPreferences.getInt("pref_key_color_accent", -1); + getTheme().applyStyle(CustomColorHelper.getPrimaryColorTheme(this, customPrimaryColor), true); + getTheme().applyStyle(CustomColorHelper.getAccentColorTheme(this, customAccentColor), true); + + // set recents app color to the primary color + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_round); + ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, customPrimaryColor); + setTaskDescription(taskDesc); + } + @Override public boolean onSupportNavigateUp() { onBackPressed(); @@ -78,13 +92,8 @@ private void showChangelog() { } private void showOpenSourceLibraries() { - new LibsBuilder() - .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR) - .withActivityTitle(getString(R.string.credits_libraries)) - .withAutoDetect(false) - .withLibraries() - .withExcludedLibraries() - .start(this); + Intent librariesIntent = new Intent(this, AboutLibsActivity.class); + startActivity(librariesIntent); } private void openAppGitHubLink() { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/AboutLibsActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/AboutLibsActivity.java new file mode 100644 index 0000000..cf19203 --- /dev/null +++ b/app/src/main/java/ca/pkay/rcloneexplorer/AboutLibsActivity.java @@ -0,0 +1,141 @@ +package ca.pkay.rcloneexplorer; + +import android.app.ActivityManager; +import android.content.Intent; +import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.net.Uri; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.Toolbar; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import ca.pkay.rcloneexplorer.RecyclerViewAdapters.AboutLibrariesAdapter; + +public class AboutLibsActivity extends AppCompatActivity implements AboutLibrariesAdapter.OnClickListener { + + private List libraryNames; + private Map libraryUrls; + private Map libraryLicences; + private Map libraryLicenceUrls; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + applyTheme(); + setContentView(R.layout.activity_about_libs); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setDisplayShowHomeEnabled(true); + } + + createData(); + RecyclerView recyclerView = findViewById(R.id.about_libs_list); + recyclerView.setHasFixedSize(true); + RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); + recyclerView.setLayoutManager(layoutManager); + AboutLibrariesAdapter aboutLibrariesAdapter = new AboutLibrariesAdapter(libraryNames, libraryUrls, libraryLicences, libraryLicenceUrls, this); + recyclerView.setAdapter(aboutLibrariesAdapter); + } + + @Override + public boolean onSupportNavigateUp() { + onBackPressed(); + return true; + } + + private void applyTheme() { + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + int customPrimaryColor = sharedPreferences.getInt("pref_key_color_primary", -1); + int customAccentColor = sharedPreferences.getInt("pref_key_color_accent", -1); + getTheme().applyStyle(CustomColorHelper.getPrimaryColorTheme(this, customPrimaryColor), true); + getTheme().applyStyle(CustomColorHelper.getAccentColorTheme(this, customAccentColor), true); + + // set recents app color to the primary color + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_round); + ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, customPrimaryColor); + setTaskDescription(taskDesc); + } + + private void createData() { + libraryNames = new ArrayList<>(); + libraryUrls = new HashMap<>(); + libraryLicences = new HashMap<>(); + libraryLicenceUrls = new HashMap<>(); + + String androidSupportLibraries = "Android Support Libraries"; + libraryNames.add(androidSupportLibraries); + libraryUrls.put(androidSupportLibraries, "https://developer.android.com/topic/libraries/support-library/"); + libraryLicences.put(androidSupportLibraries, "Licensed under Apache-2.0"); + libraryLicenceUrls.put(androidSupportLibraries, "http://www.apache.org/licenses/LICENSE-2.0"); + + String colorPicker = "Color Picker"; + libraryNames.add(colorPicker); + libraryUrls.put(colorPicker, "https://github.com/jaredrummler/ColorPicker"); + libraryLicences.put(colorPicker, "Licensed under Apache-2.0"); + libraryLicenceUrls.put(colorPicker, "https://github.com/jaredrummler/ColorPicker/blob/master/LICENSE"); + + String exFilePicker = "ExFile Picker"; + libraryNames.add(exFilePicker); + libraryUrls.put(exFilePicker, "https://github.com/bartwell/ExFilePicker"); + libraryLicences.put(exFilePicker, "Licensed under MIT"); + libraryLicenceUrls.put(exFilePicker, "https://github.com/bartwell/ExFilePicker/blob/master/LICENSE"); + + String floatingActionButtonSpeedDial = "Floating Action Button Speed Dial"; + libraryNames.add(floatingActionButtonSpeedDial); + libraryUrls.put(floatingActionButtonSpeedDial, "https://github.com/leinardi/FloatingActionButtonSpeedDial"); + libraryLicences.put(floatingActionButtonSpeedDial, "Licensed under Apache-2.0"); + libraryLicenceUrls.put(floatingActionButtonSpeedDial, "https://github.com/leinardi/FloatingActionButtonSpeedDial/blob/master/LICENSE"); + + String fontAwesome = "Font Awesome"; + libraryNames.add(fontAwesome); + libraryUrls.put(fontAwesome, "https://fontawesome.com/"); + libraryLicences.put(fontAwesome, "Licensed under CC BY 4.0"); + libraryLicenceUrls.put(fontAwesome, "https://fontawesome.com/license"); + + String markDownView = "MarkDown View"; + libraryNames.add(markDownView); + libraryUrls.put(markDownView, "https://github.com/falnatsheh/MarkdownView"); + libraryLicences.put(markDownView, "Licensed under Apache-2.0"); + libraryLicenceUrls.put(markDownView, "https://github.com/falnatsheh/MarkdownView/blob/master/license.txt"); + + String materialDesignIcons = "Material Design"; + libraryNames.add(materialDesignIcons); + libraryUrls.put(materialDesignIcons, "https://github.com/Templarian/MaterialDesign"); + libraryLicences.put(materialDesignIcons, "Licensed under SIL Open Font 1.1"); + libraryLicenceUrls.put(materialDesignIcons, "http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web"); + + String rclone = "Rclone"; + libraryNames.add(rclone); + libraryUrls.put(rclone, "https://github.com/ncw/rclone"); + libraryLicences.put(rclone, "Licensed under MIT"); + libraryLicenceUrls.put(rclone, "https://github.com/ncw/rclone/blob/master/COPYING"); + + String toasty = "Toasty"; + libraryNames.add(toasty); + libraryUrls.put(toasty, "https://github.com/GrenderG/Toasty"); + libraryLicences.put(toasty, "Licensed under LGPL-3.0"); + libraryLicenceUrls.put(toasty, "https://github.com/GrenderG/Toasty/blob/master/LICENSE"); + } + + @Override + public void onLibraryClick(String url) { + Uri uri = Uri.parse(url); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + if (intent.resolveActivity(getPackageManager()) != null) { + startActivity(intent); + } + } +} diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/AppCompatPreferenceActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/AppCompatPreferenceActivity.java new file mode 100644 index 0000000..37b5673 --- /dev/null +++ b/app/src/main/java/ca/pkay/rcloneexplorer/AppCompatPreferenceActivity.java @@ -0,0 +1,123 @@ +package ca.pkay.rcloneexplorer; + +import android.app.ActivityManager; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Bundle; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; +import android.support.annotation.LayoutRes; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatDelegate; +import android.support.v7.widget.Toolbar; +import android.view.MenuInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls + * to be used with AppCompat. + */ +public abstract class AppCompatPreferenceActivity extends PreferenceActivity { + + private AppCompatDelegate mDelegate; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getDelegate().installViewFactory(); + getDelegate().onCreate(savedInstanceState); + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + int customPrimaryColor = sharedPreferences.getInt("pref_key_color_primary", -1); + int customAccentColor = sharedPreferences.getInt("pref_key_color_accent", -1); + getTheme().applyStyle(CustomColorHelper.getPrimaryColorTheme(this, customPrimaryColor), true); + getTheme().applyStyle(CustomColorHelper.getAccentColorTheme(this, customAccentColor), true); + // set recents app color to the primary color + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_round); + ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, customPrimaryColor); + setTaskDescription(taskDesc); + super.onCreate(savedInstanceState); + } + + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + getDelegate().onPostCreate(savedInstanceState); + } + + public ActionBar getSupportActionBar() { + return getDelegate().getSupportActionBar(); + } + + public void setSupportActionBar(@Nullable Toolbar toolbar) { + getDelegate().setSupportActionBar(toolbar); + } + + @Override + public MenuInflater getMenuInflater() { + return getDelegate().getMenuInflater(); + } + + @Override + public void setContentView(@LayoutRes int layoutResID) { + getDelegate().setContentView(layoutResID); + } + + @Override + public void setContentView(View view) { + getDelegate().setContentView(view); + } + + @Override + public void setContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().setContentView(view, params); + } + + @Override + public void addContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().addContentView(view, params); + } + + @Override + protected void onPostResume() { + super.onPostResume(); + getDelegate().onPostResume(); + } + + @Override + protected void onTitleChanged(CharSequence title, int color) { + super.onTitleChanged(title, color); + getDelegate().setTitle(title); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + getDelegate().onConfigurationChanged(newConfig); + } + + @Override + protected void onStop() { + super.onStop(); + getDelegate().onStop(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + getDelegate().onDestroy(); + } + + public void invalidateOptionsMenu() { + getDelegate().invalidateOptionsMenu(); + } + + private AppCompatDelegate getDelegate() { + if (mDelegate == null) { + mDelegate = AppCompatDelegate.create(this, null); + } + return mDelegate; + } +} diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/ChangelogActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/ChangelogActivity.java index 5905625..dfb7bba 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/ChangelogActivity.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/ChangelogActivity.java @@ -1,6 +1,11 @@ package ca.pkay.rcloneexplorer; +import android.app.ActivityManager; +import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Bundle; +import android.preference.PreferenceManager; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; @@ -13,6 +18,7 @@ public class ChangelogActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + applyTheme(); setContentView(R.layout.activity_changelog); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); @@ -26,6 +32,19 @@ protected void onCreate(Bundle savedInstanceState) { markdownView.loadMarkdownFile("file:///android_asset/changelog.md"); } + private void applyTheme() { + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + int customPrimaryColor = sharedPreferences.getInt("pref_key_color_primary", -1); + int customAccentColor = sharedPreferences.getInt("pref_key_color_accent", -1); + getTheme().applyStyle(CustomColorHelper.getPrimaryColorTheme(this, customPrimaryColor), true); + getTheme().applyStyle(CustomColorHelper.getAccentColorTheme(this, customAccentColor), true); + + // set recents app color to the primary color + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_round); + ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, customPrimaryColor); + setTaskDescription(taskDesc); + } + @Override public boolean onSupportNavigateUp() { onBackPressed(); diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/CustomColorHelper.java b/app/src/main/java/ca/pkay/rcloneexplorer/CustomColorHelper.java new file mode 100644 index 0000000..d6eb121 --- /dev/null +++ b/app/src/main/java/ca/pkay/rcloneexplorer/CustomColorHelper.java @@ -0,0 +1,128 @@ +package ca.pkay.rcloneexplorer; + +import android.content.Context; + +public class CustomColorHelper { + + public static int getPrimaryColorTheme(Context context, int color) { + if (context.getResources().getColor(R.color.colorPrimary_Red) == color) { + return R.style.CustomPrimaryRed; + } + if (context.getResources().getColor(R.color.colorPrimary_Pink) == color) { + return R.style.CustomPrimaryPink; + } + if (context.getResources().getColor(R.color.colorPrimary_Purple) == color) { + return R.style.CustomPrimaryPurple; + } + if (context.getResources().getColor(R.color.colorPrimary_DeepPurple) == color) { + return R.style.CustomPrimaryDeepPurple; + } + if (context.getResources().getColor(R.color.colorPrimary_Indigo) == color) { + return R.style.CustomPrimaryIndigo; + } + if (context.getResources().getColor(R.color.colorPrimary_Blue) == color) { + return R.style.CustomPrimaryBlue; + } + if (context.getResources().getColor(R.color.colorPrimaryLight_Blue) == color) { + return R.style.CustomPrimaryLightBlue; + } + if (context.getResources().getColor(R.color.colorPrimary_Cyan) == color) { + return R.style.CustomPrimaryCyan; + } + if (context.getResources().getColor(R.color.colorPrimary_Teal) == color) { + return R.style.CustomPrimaryTeal; + } + if (context.getResources().getColor(R.color.colorPrimary_Green) == color) { + return R.style.CustomPrimaryGreen; + } + if (context.getResources().getColor(R.color.colorPrimary_LightGreen) == color) { + return R.style.CustomPrimaryLightGreen; + } + if (context.getResources().getColor(R.color.colorPrimary_Lime) == color) { + return R.style.CustomPrimaryLime; + } + if (context.getResources().getColor(R.color.colorPrimary_Yellow) == color) { + return R.style.CustomPrimaryYellow; + } + if (context.getResources().getColor(R.color.colorPrimary_Amber) == color) { + return R.style.CustomPrimaryAmber; + } + if (context.getResources().getColor(R.color.colorPrimary_Orange) == color) { + return R.style.CustomPrimaryOrange; + } + if (context.getResources().getColor(R.color.colorPrimary_DeepOrange) == color) { + return R.style.CustomPrimaryDeepOrange; + } + if (context.getResources().getColor(R.color.colorPrimary_Brown) == color) { + return R.style.CustomPrimaryBrown; + } + if (context.getResources().getColor(R.color.colorPrimary_Grey) == color) { + return R.style.CustomPrimaryGrey; + } + if (context.getResources().getColor(R.color.colorPrimary_BlueGrey) == color) { + return R.style.CustomPrimaryBlueGrey; + } + return R.style.CustomPrimaryGreen; + } + + public static int getAccentColorTheme(Context context, int color) { + if (context.getResources().getColor(R.color.colorAccent_Red) == color) { + return R.style.CustomAccentRed; + } + if (context.getResources().getColor(R.color.colorAccent_Pink) == color) { + return R.style.CustomAccentPink; + } + if (context.getResources().getColor(R.color.colorAccent_Purple) == color) { + return R.style.CustomAccentPurple; + } + if (context.getResources().getColor(R.color.colorAccent_DeepPurple) == color) { + return R.style.CustomAccentDeepPurple; + } + if (context.getResources().getColor(R.color.colorAccent_Indigo) == color) { + return R.style.CustomAccentIndigo; + } + if (context.getResources().getColor(R.color.colorAccent_Blue) == color) { + return R.style.CustomAccentBlue; + } + if (context.getResources().getColor(R.color.colorAccent_LightBlue) == color) { + return R.style.CustomAccentLightBlue; + } + if (context.getResources().getColor(R.color.colorAccent_Cyan) == color) { + return R.style.CustomAccentCyan; + } + if (context.getResources().getColor(R.color.colorAccent_Teal) == color) { + return R.style.CustomAccentTeal; + } + if (context.getResources().getColor(R.color.colorAccent_Green) == color) { + return R.style.CustomAccentGreen; + } + if (context.getResources().getColor(R.color.colorAccent_LightGreen) == color) { + return R.style.CustomAccentLightGreen; + } + if (context.getResources().getColor(R.color.colorAccent_Lime) == color) { + return R.style.CustomAccentLime; + } + if (context.getResources().getColor(R.color.colorAccent_Yellow) == color) { + return R.style.CustomAccentYellow; + } + if (context.getResources().getColor(R.color.colorAccent_Amber) == color) { + return R.style.CustomAccentAmber; + } + if (context.getResources().getColor(R.color.colorAccent_Orange) == color) { + return R.style.CustomAccentOrange; + } + if (context.getResources().getColor(R.color.colorAccent_DeepOrange) == color) { + return R.style.CustomAccentDeepOrange; + } + if (context.getResources().getColor(R.color.colorAccent_Brown) == color) { + return R.style.CustomAccentBrown; + } + if (context.getResources().getColor(R.color.colorAccent_Grey) == color) { + return R.style.CustomAccentGrey; + } + if (context.getResources().getColor(R.color.colorAccent_BlueGrey) == color) { + return R.style.CustomAccentBlueGrey; + } + return R.style.CustomAccentOrange; + } +} diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java b/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java index 7538942..172b860 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java @@ -17,6 +17,7 @@ import android.support.v7.app.AlertDialog; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -177,10 +178,14 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c } Context context = view.getContext(); + + final TypedValue primaryLightColorValue = new TypedValue (); + context.getTheme ().resolveAttribute (R.attr.colorPrimaryLight, primaryLightColorValue, true); + RecyclerView recyclerView = view.findViewById(R.id.file_explorer_list); recyclerView.setItemAnimator(new LandingAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(context)); - recyclerViewAdapter = new FileExplorerRecyclerViewAdapter(directoryContent, view.findViewById(R.id.empty_folder_view), this); + recyclerViewAdapter = new FileExplorerRecyclerViewAdapter(directoryContent, view.findViewById(R.id.empty_folder_view), this, primaryLightColorValue.data); recyclerView.setAdapter(recyclerViewAdapter); fab = view.findViewById(R.id.fab); @@ -206,6 +211,11 @@ public void onClick(View v) { breadcrumbView.setVisibility(View.VISIBLE); breadcrumbView.addCrumb(remote, "//" + remote); + final TypedValue accentColorValue = new TypedValue (); + context.getTheme ().resolveAttribute (R.attr.colorAccent, accentColorValue, true); + view.findViewById(R.id.bottom_bar).setBackgroundColor(accentColorValue.data); + view.findViewById(R.id.move_bar).setBackgroundColor(accentColorValue.data); + setBottomBarClickListeners(view); isRunning = true; diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java index 1ded884..a57713a 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java @@ -3,15 +3,20 @@ import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; +import android.app.ActivityManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; +import android.content.SharedPreferences; import android.content.pm.PackageManager; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.net.ConnectivityManager; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; +import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; @@ -57,6 +62,7 @@ public class MainActivity extends AppCompatActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + applyTheme(); context = this; setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); @@ -96,6 +102,19 @@ public void onClick(View v) { } + private void applyTheme() { + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + int customPrimaryColor = sharedPreferences.getInt("pref_key_color_primary", -1); + int customAccentColor = sharedPreferences.getInt("pref_key_color_accent", -1); + getTheme().applyStyle(CustomColorHelper.getPrimaryColorTheme(this, customPrimaryColor), true); + getTheme().applyStyle(CustomColorHelper.getAccentColorTheme(this, customAccentColor), true); + + // set recents app color to the primary color + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_round); + ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, customPrimaryColor); + setTaskDescription(taskDesc); + } + @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -151,6 +170,10 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) { importConfigFile(); } break; + case R.id.nav_settings: + Intent settingsIntent = new Intent(this, SettingsActivity.class); + startActivity(settingsIntent); + break; case R.id.nav_about: Intent aboutIntent = new Intent(this, AboutActivity.class); startActivity(aboutIntent); diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/AboutLibrariesAdapter.java b/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/AboutLibrariesAdapter.java new file mode 100644 index 0000000..f199140 --- /dev/null +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/AboutLibrariesAdapter.java @@ -0,0 +1,145 @@ +package ca.pkay.rcloneexplorer.RecyclerViewAdapters; + +import android.support.annotation.NonNull; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import java.util.List; +import java.util.Map; + +import ca.pkay.rcloneexplorer.R; + +public class AboutLibrariesAdapter extends RecyclerView.Adapter { + + private final int CONTENT_TYPE = 0; + private final int FOOTER_TYPE = 1; + private final List libraryNames; + private final Map libraryUrls; + private final Map libraryLicences; + private final Map libraryLicenceUrls; + private final OnClickListener listener; + + public interface OnClickListener { + void onLibraryClick(String url); + } + + public AboutLibrariesAdapter(List libNames, Map libUrls, Map libLicences, Map libLicenceUrls, OnClickListener l) { + this.libraryNames = libNames; + this.libraryUrls = libUrls; + this.libraryLicences = libLicences; + this.libraryLicenceUrls = libLicenceUrls; + this.listener = l; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + if (viewType == CONTENT_TYPE) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.about_libraries_item, parent, false); + return new ContentViewHolder(view); + } + + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.about_icon_item, parent, false); + return new FooterViewHolder(view); + } + + @Override + public int getItemViewType(int position) { + if (position == libraryNames.size()) { + return FOOTER_TYPE; + } + return CONTENT_TYPE; + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof ContentViewHolder) { + setContent(holder, position); + } else if (holder instanceof FooterViewHolder) { + setFooter(holder); + } + } + + private void setContent(RecyclerView.ViewHolder viewHolder, int position) { + ContentViewHolder holder = (ContentViewHolder) viewHolder; + String libraryName = libraryNames.get(position); + final String libraryUrl = libraryUrls.get(libraryName); + String libraryLicence = libraryLicences.get(libraryName); + final String libraryLicenceUrl = libraryLicenceUrls.get(libraryName); + + holder.libraryName.setText(libraryName); + if (libraryUrl != null) { + holder.libraryLicence.setText(libraryLicence); + } + if (libraryUrl != null) { + holder.libraryName.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + listener.onLibraryClick(libraryUrl); + } + }); + } + if (libraryLicenceUrl != null) { + holder.libraryLicence.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + listener.onLibraryClick(libraryLicenceUrl); + } + }); + } + } + + private void setFooter(RecyclerView.ViewHolder viewHolder) { + FooterViewHolder holder = (FooterViewHolder) viewHolder; + + holder.smashIcons.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + listener.onLibraryClick("https://www.flaticon.com/authors/smashicons"); + + } + }); + + holder.flatIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + listener.onLibraryClick("https://www.flaticon.com/"); + } + }); + } + + @Override + public int getItemCount() { + if (libraryNames == null) { + return 1; + } + return libraryNames.size() + 1; + } + + class ContentViewHolder extends RecyclerView.ViewHolder { + + final TextView libraryName; + final TextView libraryLicence; + + ContentViewHolder(View itemView) { + super(itemView); + this.libraryName = itemView.findViewById(R.id.library_name); + this.libraryLicence = itemView.findViewById(R.id.library_licence); + } + } + + class FooterViewHolder extends RecyclerView.ViewHolder { + + final TextView smashIcons; + final TextView flatIcon; + + FooterViewHolder(View itemView) { + super(itemView); + this.smashIcons = itemView.findViewById(R.id.smashicons); + this.flatIcon = itemView.findViewById(R.id.flaticon); + } + } +} diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/FileExplorerRecyclerViewAdapter.java b/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/FileExplorerRecyclerViewAdapter.java index 8813b0f..629e310 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/FileExplorerRecyclerViewAdapter.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/RecyclerViewAdapters/FileExplorerRecyclerViewAdapter.java @@ -2,6 +2,7 @@ import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -17,6 +18,7 @@ public class FileExplorerRecyclerViewAdapter extends RecyclerView.Adapter { private List files; + private int selectionColor; private View emptyView; private OnClickListener listener; private Boolean isInSelectMode; @@ -29,10 +31,11 @@ public interface OnClickListener { void onFilesSelected(boolean selection); } - public FileExplorerRecyclerViewAdapter(List files, View emptyView, OnClickListener listener) { + public FileExplorerRecyclerViewAdapter(List files, View emptyView, OnClickListener listener, int selectionColor) { this.files = files; this.emptyView = emptyView; this.listener = listener; + this.selectionColor = selectionColor; isInSelectMode = false; selectedItems = new ArrayList<>(); isInMoveMode = false; @@ -65,7 +68,7 @@ public void onBindViewHolder(@NonNull final ViewHolder holder, int position) { if (isInSelectMode) { if (selectedItems.contains(item)) { - holder.view.setBackgroundColor(holder.view.getResources().getColor(R.color.colorPrimaryLight)); + holder.view.setBackgroundColor(selectionColor); } else { holder.view.setBackgroundColor(holder.view.getResources().getColor(R.color.white)); } @@ -228,7 +231,7 @@ private void onLongClickAction(FileItem item, ViewHolder holder) { } else { selectedItems.add(item); isInSelectMode = true; - holder.view.setBackgroundColor(holder.view.getResources().getColor(R.color.colorPrimaryLight)); + holder.view.setBackgroundColor(selectionColor); listener.onFilesSelected(true); } } diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/SettingsActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/SettingsActivity.java new file mode 100644 index 0000000..8a3cfac --- /dev/null +++ b/app/src/main/java/ca/pkay/rcloneexplorer/SettingsActivity.java @@ -0,0 +1,190 @@ +package ca.pkay.rcloneexplorer; + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.Intent; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.preference.PreferenceFragment; +import android.preference.PreferenceManager; +import android.view.MenuItem; +import android.widget.Toast; + +import java.util.List; + +import es.dmoral.toasty.Toasty; + +/** + * A {@link PreferenceActivity} that presents a set of application settings. On + * handset devices, settings are presented as a single list. On tablets, + * settings are split by category, with category headers shown to the left of + * the list of settings. + *

+ * See + * Android Design: Settings for design guidelines and the Settings + * API Guide for more information on developing a Settings UI. + */ +public class SettingsActivity extends AppCompatPreferenceActivity { + + /** + * A preference value change listener that updates the preference's summary + * to reflect its new value. + */ + private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object value) { + String stringValue = value.toString(); + preference.setSummary(stringValue); + return true; + } + }; + + /** + * Helper method to determine if the device has an extra-large screen. For + * example, 10" tablets are extra-large. + */ + private static boolean isXLargeTablet(Context context) { + return (context.getResources().getConfiguration().screenLayout + & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE; + } + + /** + * Binds a preference's summary to its value. More specifically, when the + * preference's value is changed, its summary (line of text below the + * preference title) is updated to reflect the value. The summary is also + * immediately updated upon calling this method. The exact display format is + * dependent on the type of preference. + * + * @see #sBindPreferenceSummaryToValueListener + */ + private static void bindPreferenceSummaryToValue(Preference preference) { + // Set the listener to watch for value changes. + preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener); + + // Trigger the listener immediately with the preference's + // current value. + sBindPreferenceSummaryToValueListener.onPreferenceChange(preference, + PreferenceManager + .getDefaultSharedPreferences(preference.getContext()) + .getString(preference.getKey(), "")); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setupActionBar(); + } + + /** + * Set up the {@link android.app.ActionBar}, if the API is available. + */ + private void setupActionBar() { + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + // Show the Up button in the action bar. + actionBar.setDisplayHomeAsUpEnabled(true); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean onIsMultiPane() { + return isXLargeTablet(this); + } + + /** + * {@inheritDoc} + */ + @Override + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public void onBuildHeaders(List

target) { + loadHeadersFromResource(R.xml.pref_headers, target); + } + + /** + * This method stops fragment injection in malicious applications. + * Make sure to deny any unknown fragments here. + */ + protected boolean isValidFragment(String fragmentName) { + return PreferenceFragment.class.getName().equals(fragmentName) + || GeneralPreferenceFragment.class.getName().equals(fragmentName) + || LookAndFeelFragment.class.getName().equals(fragmentName); + } + + public static class LookAndFeelFragment extends PreferenceFragment { + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.pref_look_and_feel); + setHasOptionsMenu(true); + setListener(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if (id == android.R.id.home) { + startActivity(new Intent(getActivity(), SettingsActivity.class)); + return true; + } + return super.onOptionsItemSelected(item); + } + + private void setListener() { + final Context context = getActivity(); + + findPreference("pref_key_color_primary").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + Toasty.info(context, context.getString(R.string.restart_required), Toast.LENGTH_LONG, true).show(); + return true; + } + }); + findPreference("pref_key_color_accent").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + Toasty.info(context, context.getString(R.string.restart_required), Toast.LENGTH_LONG, true).show(); + return true; + } + }); + } + } + + /** + * This fragment shows general preferences only. It is used when the + * activity is showing a two-pane settings UI. + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public static class GeneralPreferenceFragment extends PreferenceFragment { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.pref_general); + setHasOptionsMenu(true); + + // Bind the summaries of EditText/List/Dialog/Ringtone preferences + // to their values. When their values change, their summaries are + // updated to reflect the new value, per the Android Design + // guidelines. + bindPreferenceSummaryToValue(findPreference("pref_key_stream_max")); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if (id == android.R.id.home) { + startActivity(new Intent(getActivity(), SettingsActivity.class)); + return true; + } + return super.onOptionsItemSelected(item); + } + } +} diff --git a/app/src/main/res/drawable/ic_look_and_feel.xml b/app/src/main/res/drawable/ic_look_and_feel.xml new file mode 100644 index 0000000..f75e2fb --- /dev/null +++ b/app/src/main/res/drawable/ic_look_and_feel.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml new file mode 100644 index 0000000..ace746c --- /dev/null +++ b/app/src/main/res/drawable/ic_settings.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/about_icon_item.xml b/app/src/main/res/layout/about_icon_item.xml new file mode 100644 index 0000000..e78eb17 --- /dev/null +++ b/app/src/main/res/layout/about_icon_item.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + diff --git a/app/src/main/res/layout/about_libraries_item.xml b/app/src/main/res/layout/about_libraries_item.xml new file mode 100644 index 0000000..ff1f424 --- /dev/null +++ b/app/src/main/res/layout/about_libraries_item.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_about_libs.xml b/app/src/main/res/layout/activity_about_libs.xml new file mode 100644 index 0000000..ab16747 --- /dev/null +++ b/app/src/main/res/layout/activity_about_libs.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/content_about.xml index 3f7082d..45a58fe 100644 --- a/app/src/main/res/layout/content_about.xml +++ b/app/src/main/res/layout/content_about.xml @@ -53,11 +53,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/app_version" + android:textColor="@color/colorPrimaryText" android:textStyle="bold"/> + android:layout_height="wrap_content" + android:textColor="@color/colorSecondaryText" /> @@ -85,11 +87,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/rclone_version" + android:textColor="@color/colorPrimaryText" android:textStyle="bold"/> + android:layout_height="wrap_content" + android:textColor="@color/colorSecondaryText" /> @@ -132,6 +136,7 @@ android:paddingStart="32dp" android:paddingEnd="0dp" android:text="@string/changelog" + android:textColor="@color/colorPrimaryText" android:textStyle="bold"/> @@ -158,6 +163,7 @@ android:paddingStart="32dp" android:paddingEnd="0dp" android:text="@string/credits_libraries" + android:textColor="@color/colorPrimaryText" android:textStyle="bold"/> @@ -183,6 +189,7 @@ android:layout_height="wrap_content" android:text="@string/star_on_github" android:textStyle="bold" + android:textColor="@color/colorPrimaryText" android:paddingStart="32dp" android:paddingEnd="0dp"/> @@ -210,6 +217,7 @@ android:paddingStart="32dp" android:paddingEnd="0dp" android:text="@string/report_a_bug" + android:textColor="@color/colorPrimaryText" android:textStyle="bold"/> @@ -253,6 +261,7 @@ android:layout_height="wrap_content" android:text="@string/author_name" android:textStyle="bold" + android:textColor="@color/colorPrimaryText" android:paddingStart="32dp" android:paddingEnd="0dp"/> @@ -278,6 +287,7 @@ android:layout_height="wrap_content" android:text="@string/follow_on_github" android:textStyle="bold" + android:textColor="@color/colorPrimaryText" android:paddingStart="32dp" android:paddingEnd="0dp"/> diff --git a/app/src/main/res/layout/content_about_libs.xml b/app/src/main/res/layout/content_about_libs.xml new file mode 100644 index 0000000..2b15e51 --- /dev/null +++ b/app/src/main/res/layout/content_about_libs.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_file_properties.xml b/app/src/main/res/layout/dialog_file_properties.xml index b02c703..781cee8 100644 --- a/app/src/main/res/layout/dialog_file_properties.xml +++ b/app/src/main/res/layout/dialog_file_properties.xml @@ -11,30 +11,37 @@ @@ -42,6 +49,8 @@ android:id="@+id/file_size" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textColor="@color/colorSecondaryText" + android:textIsSelectable="true" tools:text="12 MB"/> @@ -62,12 +71,14 @@ @@ -79,6 +90,7 @@ @@ -86,6 +98,7 @@ android:id="@+id/file_sha1" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textColor="@color/colorSecondaryText" android:text="@string/tap_to_calculate"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_file_explorer_item.xml b/app/src/main/res/layout/fragment_file_explorer_item.xml index bd880f0..a18919c 100644 --- a/app/src/main/res/layout/fragment_file_explorer_item.xml +++ b/app/src/main/res/layout/fragment_file_explorer_item.xml @@ -9,27 +9,24 @@ android:background="?selectableItemBackground" android:layout_marginBottom="1dp"> - - - + android:layout_height="76dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + tools:src="@drawable/ic_file" + android:layout_gravity="center_vertical" + android:contentDescription="@string/file_icon" /> + android:layout_marginEnd="16dp" + android:layout_centerVertical="true"> + android:paddingTop="4dp" > - \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml index e2ddb65..fb174a3 100644 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -22,6 +22,11 @@ android:icon="@drawable/ic_import" android:title="@string/import_rclone_config" /> + true @color/colorPrimaryDark + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-v27/styles.xml b/app/src/main/res/values-v27/styles.xml index ab7e6e5..65ceb1c 100644 --- a/app/src/main/res/values-v27/styles.xml +++ b/app/src/main/res/values-v27/styles.xml @@ -7,4 +7,251 @@ @android:color/white true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/about_libraries_exfile_picker.xml b/app/src/main/res/values/about_libraries_exfile_picker.xml deleted file mode 100644 index 2af1458..0000000 --- a/app/src/main/res/values/about_libraries_exfile_picker.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Artem Bazhanov - https://github.com/bartwell/ - ExFile Picker - Open source Android library. Implement choosing files and directories in your application. - - https://github.com/bartwell/ExFilePicker/ - MIT - true - https://github.com/bartwell/ExFilePicker/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_floating_action_button_speed_dial.xml b/app/src/main/res/values/about_libraries_floating_action_button_speed_dial.xml deleted file mode 100644 index ad6dc19..0000000 --- a/app/src/main/res/values/about_libraries_floating_action_button_speed_dial.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Roberto Leinardi - https://github.com/leinardi/ - Floating Action Button Speed Dial - A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification - - https://github.com/leinardi/FloatingActionButtonSpeedDial/ - apache_2_0 - true - https://github.com/leinardi/FloatingActionButtonSpeedDial/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_fontawesome.xml b/app/src/main/res/values/about_libraries_fontawesome.xml deleted file mode 100644 index 6e21fb8..0000000 --- a/app/src/main/res/values/about_libraries_fontawesome.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Fort Awesome - https://github.com/FortAwesome/ - Font Awesome - The iconic SVG, font, and CSS toolkit - - https://fontawesome.com/ - CC BY 4.0 License - true - https://github.com/FortAwesome/Font-Awesome/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_icon.xml b/app/src/main/res/values/about_libraries_icon.xml deleted file mode 100644 index 46e2650..0000000 --- a/app/src/main/res/values/about_libraries_icon.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Smashicons - https://www.flaticon.com/authors/smashicons/ - Smashicons - Icons made by Smashicons from Flaticon, licensed by Creative Commons BY 3.0 - - https://www.flaticon.com/ - Creative Commons BY 3.0 - true - https://www.flaticon.com/authors/smashicons/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_markdown_view.xml b/app/src/main/res/values/about_libraries_markdown_view.xml deleted file mode 100644 index 8d252a0..0000000 --- a/app/src/main/res/values/about_libraries_markdown_view.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Feras Alnatsheh - https://github.com/falnatsheh/ - Markdown View - MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview. - - https://github.com/falnatsheh/MarkdownView/ - apache_2.0 - true - https://github.com/falnatsheh/MarkdownView/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_materialdesign.xml b/app/src/main/res/values/about_libraries_materialdesign.xml deleted file mode 100644 index 07de5dd..0000000 --- a/app/src/main/res/values/about_libraries_materialdesign.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Austin Andrews - https://github.com/Templarian/ - Material Design - 2200+ Material Design Icons from the Community - - https://github.com/Templarian/MaterialDesign/ - - true - https://github.com/Templarian/MaterialDesign/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_rclone.xml b/app/src/main/res/values/about_libraries_rclone.xml deleted file mode 100644 index 7a6f67e..0000000 --- a/app/src/main/res/values/about_libraries_rclone.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Nick Craig-Wood - https://www.craig-wood.com/nick/ - rclone - "rsync for cloud storage" - Google Drive, Amazon Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Cloudfiles, Google Cloud Storage, Yandex Files - - https://rclone.org/ - MIT - true - https://github.com/ncw/rclone/ - \ No newline at end of file diff --git a/app/src/main/res/values/about_libraries_toasty.xml b/app/src/main/res/values/about_libraries_toasty.xml deleted file mode 100644 index d66229a..0000000 --- a/app/src/main/res/values/about_libraries_toasty.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Daniel Morales - https://github.com/GrenderG/ - Toasty - The usual Toast, but with steroids - - https://github.com/GrenderG/Toasty/ - lgpl_3 - true - https://github.com/GrenderG/Toasty/ - \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..a9ca802 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 2d45829..a06bb4f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -8,4 +8,88 @@ #FFFFFF #DDDDDD #E0E0E0 + + #212121 + #757575 + #BDBDBD + + #F44336 + #D32F2F + #FFCDD2 + #E91E63 + #C2185B + #F8BBD0 + #9C27B0 + #7B1FA2 + #E1BEE7 + #673AB7 + #512DA8 + #D1C4E9 + #3F51B5 + #303F9F + #303F9F + #2196F3 + #1976D2 + #BBDEFB + #03A9F4 + #0288D1 + #B3E5FC + #00BCD4 + #0097A7 + #B2EBF2 + #009688 + #00796B + #B2DFDB + #4CAF50 + #388E3C + #C8E6C9 + #8BC34A + #689F38 + #DCEDC8 + #CDDC39 + #AFB42B + #F0F4C3 + #FFEB3B + #FBC02D + #FFF9C4 + #FFC107 + #FFA000 + #FFECB3 + #FF9800 + #F57C00 + #FFE0B2 + #FF5722 + #E64A19 + #FFCCBC + #795548 + #5D4037 + #D7CCC8 + #9E9E9E + #616161 + #F5F5F5 + #607D8B + #455A64 + #CFD8DC + + #FF5252 + #FF4081 + #E040FB + #7C4DFF + #536DFE + #448AFF + #03A9F4 + #00BCD4 + #009688 + #4CAF50 + #8BC34A + #CDDC39 + #FFEB3B + #FFC107 + #FF9800 + #FF5722 + #795548 + #9E9E9E + #607D8B + + diff --git a/app/src/main/res/values/custom_color_choices.xml b/app/src/main/res/values/custom_color_choices.xml new file mode 100644 index 0000000..c1b55d2 --- /dev/null +++ b/app/src/main/res/values/custom_color_choices.xml @@ -0,0 +1,46 @@ + + + + @color/colorPrimary_Red + @color/colorPrimary_Pink + @color/colorPrimary_Purple + @color/colorPrimary_DeepPurple + @color/colorPrimary_Indigo + @color/colorPrimary_Blue + @color/colorPrimary_LightBlue + @color/colorPrimary_Cyan + @color/colorPrimary_Teal + @color/colorPrimary_Green + @color/colorPrimary_LightGreen + @color/colorPrimary_Lime + @color/colorPrimary_Yellow + @color/colorPrimary_Amber + @color/colorPrimary_Orange + @color/colorPrimary_DeepOrange + @color/colorPrimary_Brown + @color/colorPrimary_Grey + @color/colorPrimary_BlueGrey + + + + @color/colorAccent_Red + @color/colorAccent_Pink + @color/colorAccent_Purple + @color/colorAccent_DeepPurple + @color/colorAccent_Indigo + @color/colorAccent_Blue + @color/colorAccent_LightBlue + @color/colorAccent_Cyan + @color/colorAccent_Teal + @color/colorAccent_Green + @color/colorAccent_LightGreen + @color/colorAccent_Lime + @color/colorAccent_Yellow + @color/colorAccent_Amber + @color/colorAccent_Orange + @color/colorAccent_DeepOrange + @color/colorAccent_Brown + @color/colorAccent_Grey + @color/colorAccent_BlueGrey + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1587628..448e26d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -123,4 +123,17 @@ Audio Video Image + Settings + General + Primary Color + Accent Color + Look and Feel + App restart required + Select a primary color + Select an accent color + AboutLibsActivity + App icon made by + Smashicons + from + Flaticon diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 545b9c6..5972764 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -17,4 +17,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml new file mode 100644 index 0000000..f2552cf --- /dev/null +++ b/app/src/main/res/xml/pref_general.xml @@ -0,0 +1,11 @@ + + + + diff --git a/app/src/main/res/xml/pref_headers.xml b/app/src/main/res/xml/pref_headers.xml new file mode 100644 index 0000000..1869cdc --- /dev/null +++ b/app/src/main/res/xml/pref_headers.xml @@ -0,0 +1,15 @@ + + + + +
+ +
+ + diff --git a/app/src/main/res/xml/pref_look_and_feel.xml b/app/src/main/res/xml/pref_look_and_feel.xml new file mode 100644 index 0000000..4da17fd --- /dev/null +++ b/app/src/main/res/xml/pref_look_and_feel.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file