add filepicker lib

This commit is contained in:
Yuriy Liskov
2024-12-28 08:50:31 +02:00
parent a11bcbb435
commit 66b0c33e24
71 changed files with 2156 additions and 3 deletions

View File

@@ -62,6 +62,7 @@ dependencies {
implementation project(':mediaserviceinterfaces')
implementation project(':youtubeapi')
implementation project(':googleapi')
implementation project(':filepicker-lib')
implementation 'io.reactivex.rxjava2:rxandroid:' + rxAndroidVersion
implementation 'io.reactivex.rxjava2:rxjava:' + rxJavaVersion

View File

@@ -2,6 +2,7 @@ package com.liskovsoft.smartyoutubetv2.common.app.presenters.dialogs.menu.provid
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import androidx.annotation.NonNull;
@@ -18,12 +19,15 @@ import com.liskovsoft.smartyoutubetv2.common.app.presenters.BrowsePresenter;
import com.liskovsoft.smartyoutubetv2.common.app.presenters.dialogs.menu.VideoMenuPresenter.VideoMenuCallback;
import com.liskovsoft.smartyoutubetv2.common.app.presenters.dialogs.menu.providers.ContextMenuProvider;
import com.liskovsoft.smartyoutubetv2.common.misc.MediaServiceManager;
import com.liskovsoft.smartyoutubetv2.common.misc.MotherActivity;
import com.liskovsoft.smartyoutubetv2.common.utils.SimpleEditDialog;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import arte.programar.materialfile.MaterialFilePicker;
public class ChannelGroupMenuProvider extends ContextMenuProvider {
private final Context mContext;
private final ChannelGroupServiceWrapper mService;
@@ -112,6 +116,16 @@ public class ChannelGroupMenuProvider extends ContextMenuProvider {
});
}, false));
options.add(UiOptionItem.from(mContext.getString(R.string.import_subscriptions_group), optionItem -> {
dialogPresenter.closeDialog();
// Show file picker
new MaterialFilePicker()
.withActivity((MotherActivity) mContext)
.withRootPath(Environment.getExternalStorageDirectory().getPath())
//.withActivityResultApi(((MotherActivity) mContext).mRegisterOnResult)
.start();
}, false));
for (ChannelGroup group : groups) {
options.add(UiOptionItem.from(group.getTitle(), optionItem -> {
BrowsePresenter presenter = BrowsePresenter.instance(mContext);

View File

@@ -680,4 +680,5 @@
<string name="screen_dimming_amount">Степень затемнения экрана</string>
<string name="screen_dimming_timeout">Тайм-аут затемнения экрана</string>
<string name="playlists_rows">Отображать раздел Плейлисты в виде строк</string>
<string name="import_subscriptions_group">Импортировать файл</string>
</resources>

View File

@@ -689,4 +689,5 @@
<string name="screen_dimming_amount">Ekran karartma miktarı</string>
<string name="screen_dimming_timeout">Ekran karartma zaman aşımı</string>
<string name="playlists_rows">Oynatma listelerini satır olarak göster</string>
<string name="import_subscriptions_group">Dosyayı içe aktar</string>
</resources>

View File

@@ -680,4 +680,5 @@
<string name="screen_dimming_amount">Величина затемнення екрана</string>
<string name="screen_dimming_timeout">Тайм-аут затемнення екрана</string>
<string name="playlists_rows">Відображати розділ Плейлисти у вигляді рядків</string>
<string name="import_subscriptions_group">Імпорт файлу</string>
</resources>

View File

@@ -687,4 +687,5 @@
<string name="screen_dimming_amount">Screen dimming amount</string>
<string name="screen_dimming_timeout">Screen dimming timeout</string>
<string name="playlists_rows">Show Playlists section as rows</string>
<string name="import_subscriptions_group">Import file</string>
</resources>

1
filepicker-lib/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,58 @@
apply from: gradle.ext.sharedModulesConstants
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
def _group = 'arte.programar'
def _version = '3.0.1'
def _versioncode = 19
def _artifact = 'materialfile'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = _group
artifactId = _artifact
version = _version
}
}
}
}
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}
android {
compileSdkVersion project.properties.compileSdkVersion
buildToolsVersion project.properties.buildToolsVersion
defaultConfig {
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode _versioncode
versionName _version
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.recyclerview:recyclerview:' + recyclerviewXLibraryVersion
implementation 'com.google.android.material:material:' + materialVersion
//implementation 'androidx.activity:activity:1.0.0'
implementation 'androidx.fragment:fragment:' + annotationXLibraryVersion
implementation project(':fragment-1.1.0')
}

17
filepicker-lib/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View File

@@ -0,0 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="arte.programar.materialfile">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application>
<activity
android:name=".ui.FilePickerActivity"
android:theme="@style/MaterialFileTheme" />
</application>
</manifest>

View File

@@ -0,0 +1,224 @@
package arte.programar.materialfile;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
//import androidx.activity.result.ActivityResultLauncher;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import arte.programar.materialfile.filter.CompositeFilter;
import arte.programar.materialfile.filter.FileFilter;
import arte.programar.materialfile.filter.HiddenFilter;
import arte.programar.materialfile.filter.PatternFilter;
import arte.programar.materialfile.ui.FilePickerActivity;
public class MaterialFilePicker {
private Activity mActivity;
private Fragment mFragment;
private androidx.fragment.app.Fragment mSupportFragment;
//private ActivityResultLauncher<Intent> mStartForResultFiles;
private Class<? extends FilePickerActivity> mFilePickerClass = FilePickerActivity.class;
private Pattern mFileFilter;
private Boolean mDirectoriesFilter = false;
private String mRootPath;
private String mCurrentPath;
private Boolean mShowHidden = false;
private Boolean mCloseable = true;
private CharSequence mTitle;
public MaterialFilePicker() {
}
/**
* Specifies activity, which will be used to
* start file picker
*/
public MaterialFilePicker withActivity(Activity activity) {
if (mSupportFragment != null || mFragment != null) {
throw new RuntimeException("You must pass either Activity, Fragment or SupportFragment");
}
mActivity = activity;
return this;
}
/**
* Specifies fragment, which will be used to
* start file picker
*/
public MaterialFilePicker withFragment(Fragment fragment) {
if (mSupportFragment != null || mActivity != null) {
throw new RuntimeException("You must pass either Activity, Fragment or SupportFragment");
}
mFragment = fragment;
return this;
}
/**
* Specifies support fragment which will be used to
* start file picker
*/
public MaterialFilePicker withSupportFragment(androidx.fragment.app.Fragment fragment) {
if (mActivity != null || mFragment != null) {
throw new RuntimeException("You must pass either Activity, Fragment or SupportFragment");
}
mSupportFragment = fragment;
return this;
}
//public MaterialFilePicker withActivityResultApi(ActivityResultLauncher<Intent> startForResultFiles) {
// mStartForResultFiles = startForResultFiles;
// return this;
//}
/**
* Hides files that matched by specified regular expression.
* Use {@link MaterialFilePicker#withFilterDirectories withFilterDirectories} method
* to enable directories filtering
*/
public MaterialFilePicker withFilter(Pattern pattern) {
mFileFilter = pattern;
return this;
}
/**
* If directoriesFilter is true directories will also be affected by filter,
* the default value of directories filter is false
*
* @see MaterialFilePicker#withFilter
*/
public MaterialFilePicker withFilterDirectories(boolean directoriesFilter) {
mDirectoriesFilter = directoriesFilter;
return this;
}
/**
* Specifies root directory for picker,
* user can't go upper that specified path
*/
public MaterialFilePicker withRootPath(String rootPath) {
mRootPath = rootPath;
return this;
}
/**
* Specifies start directory for picker,
* which will be shown to user at the beginning
*/
public MaterialFilePicker withPath(String path) {
mCurrentPath = path;
return this;
}
/**
* Show or hide hidden files in picker
*/
public MaterialFilePicker withHiddenFiles(boolean show) {
mShowHidden = show;
return this;
}
/**
* Show or hide close menu in picker
*/
public MaterialFilePicker withCloseMenu(boolean closeable) {
mCloseable = closeable;
return this;
}
/**
* Set title of picker
*/
public MaterialFilePicker withTitle(CharSequence title) {
mTitle = title;
return this;
}
public MaterialFilePicker withCustomActivity(Class<? extends FilePickerActivity> customActivityClass) {
mFilePickerClass = customActivityClass;
return this;
}
/**
* Open Material File Picker activity.
* You should set Activity or Fragment before calling this method
*
* @see MaterialFilePicker#withActivity(Activity)
* @see MaterialFilePicker#withFragment(Fragment)
* @see MaterialFilePicker#withSupportFragment(androidx.fragment.app.Fragment)
*/
public void start() {
//mStartForResultFiles.launch(getIntent());
mActivity.startActivityForResult(getIntent(), 11);
}
// Public because of https://github.com/nbsp-team/MaterialFilePicker/issues/113
public Intent getIntent() {
CompositeFilter filter = getFilter();
Intent intent = new Intent(getActivity(), mFilePickerClass);
intent.putExtra(FilePickerActivity.ARG_FILTER, filter);
intent.putExtra(FilePickerActivity.ARG_CLOSEABLE, mCloseable);
if (mRootPath != null) {
intent.putExtra(FilePickerActivity.ARG_START_FILE, new File(mRootPath));
}
if (mCurrentPath != null) {
intent.putExtra(FilePickerActivity.ARG_CURRENT_FILE, new File(mCurrentPath));
}
if (mTitle != null) {
intent.putExtra(FilePickerActivity.ARG_TITLE, mTitle);
}
return intent;
}
private Activity getActivity() {
Activity activity = null;
//if (mActivity == null && mFragment == null && mSupportFragment == null && mStartForResultFiles == null) {
if (mActivity == null && mFragment == null && mSupportFragment == null) {
throw new RuntimeException(
"You must pass Activity/Fragment by calling " +
"withActivity/withFragment/withSupportFragment and " +
"withActivityResultApi method"
);
}
if (mActivity != null) {
activity = mActivity;
} else if (mFragment != null) {
activity = mFragment.getActivity();
} else if (mSupportFragment != null) {
activity = mSupportFragment.getActivity();
}
return activity;
}
private CompositeFilter getFilter() {
final List<FileFilter> filters = new ArrayList<>();
if (!mShowHidden) {
filters.add(new HiddenFilter());
}
if (mFileFilter != null) {
filters.add(new PatternFilter(mFileFilter, mDirectoriesFilter));
}
return new CompositeFilter(filters);
}
}

View File

@@ -0,0 +1,24 @@
package arte.programar.materialfile.filter;
import java.io.File;
import java.util.List;
public class CompositeFilter implements FileFilter {
private final List<FileFilter> mFilters;
public CompositeFilter(List<FileFilter> filters) {
mFilters = filters;
}
@Override
public boolean accept(File f) {
for (FileFilter filter : mFilters) {
if (!filter.accept(f)) {
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,8 @@
package arte.programar.materialfile.filter;
import java.io.File;
import java.io.Serializable;
public interface FileFilter extends Serializable {
boolean accept(File pathname);
}

View File

@@ -0,0 +1,11 @@
package arte.programar.materialfile.filter;
import java.io.File;
public class HiddenFilter implements FileFilter {
@Override
public boolean accept(File f) {
return !f.isHidden();
}
}

View File

@@ -0,0 +1,20 @@
package arte.programar.materialfile.filter;
import java.io.File;
import java.util.regex.Pattern;
public class PatternFilter implements FileFilter {
private final Pattern mPattern;
private final boolean mDirectoriesFilter;
public PatternFilter(Pattern pattern, boolean directoriesFilter) {
mPattern = pattern;
mDirectoriesFilter = directoriesFilter;
}
@Override
public boolean accept(File f) {
return f.isDirectory() && !mDirectoriesFilter || mPattern.matcher(f.getName()).matches();
}
}

View File

@@ -0,0 +1,79 @@
package arte.programar.materialfile.ui;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.io.File;
import java.util.List;
import arte.programar.materialfile.R;
import arte.programar.materialfile.utils.FileTypeUtils;
class DirectoryAdapter extends RecyclerView.Adapter<DirectoryAdapter.DirectoryViewHolder> {
private final List<File> mFiles;
private OnItemClickListener mOnItemClickListener;
DirectoryAdapter(List<File> files) {
mFiles = files;
}
void setOnItemClickListener(OnItemClickListener listener) {
mOnItemClickListener = listener;
}
@NonNull
@Override
public DirectoryViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_file, parent, false);
return new DirectoryViewHolder(view, mOnItemClickListener);
}
@Override
public void onBindViewHolder(DirectoryViewHolder holder, int position) {
File currentFile = mFiles.get(position);
FileTypeUtils.FileType fileType = FileTypeUtils.getFileType(currentFile);
holder.mFileImage.setImageResource(fileType.getIcon());
holder.mFileSubtitle.setText(fileType.getDescription());
holder.mFileTitle.setText(currentFile.getName());
}
@Override
public int getItemCount() {
return mFiles.size();
}
File getModel(int index) {
return mFiles.get(index);
}
static class DirectoryViewHolder extends RecyclerView.ViewHolder {
private final ImageView mFileImage;
private final TextView mFileTitle;
private final TextView mFileSubtitle;
DirectoryViewHolder(View itemView, final OnItemClickListener clickListener) {
super(itemView);
itemView.setOnClickListener(v -> {
// MOD:
//clickListener.onItemClick(v, getBindingAdapterPosition());
clickListener.onItemClick(v, getAdapterPosition());
});
mFileImage = itemView.findViewById(R.id.item_file_image);
mFileTitle = itemView.findViewById(R.id.item_file_title);
mFileSubtitle = itemView.findViewById(R.id.item_file_subtitle);
}
}
}

View File

@@ -0,0 +1,109 @@
package arte.programar.materialfile.ui;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import java.io.File;
import arte.programar.materialfile.R;
import arte.programar.materialfile.filter.FileFilter;
import arte.programar.materialfile.utils.FileUtils;
import arte.programar.materialfile.widget.EmptyRecyclerView;
public class DirectoryFragment extends Fragment {
private static final String ARG_FILE = "arg_file_path";
private static final String ARG_FILTER = "arg_filter";
private View mEmptyView;
private File mFile;
private FileFilter mFilter;
private EmptyRecyclerView mDirectoryRecyclerView;
private DirectoryAdapter mDirectoryAdapter;
private FileClickListener mFileClickListener;
static DirectoryFragment getInstance(
File file,
FileFilter filter
) {
final DirectoryFragment instance = new DirectoryFragment();
final Bundle args = new Bundle();
args.putSerializable(ARG_FILE, file);
args.putSerializable(ARG_FILTER, filter);
instance.setArguments(args);
return instance;
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
mFileClickListener = (FileClickListener) context;
}
@Override
public void onDetach() {
super.onDetach();
mFileClickListener = null;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_directory, container, false);
mDirectoryRecyclerView = view.findViewById(R.id.directory_recycler_view);
mEmptyView = view.findViewById(R.id.directory_empty_view);
return view;
}
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initArgs();
initFilesList();
}
private void initFilesList() {
mDirectoryAdapter = new DirectoryAdapter(FileUtils.getFileList(mFile, mFilter));
mDirectoryAdapter.setOnItemClickListener(new ThrottleClickListener() {
@Override
void onItemClickThrottled(View view, int position) {
if (mFileClickListener != null) {
mFileClickListener.onFileClicked(mDirectoryAdapter.getModel(position));
}
}
});
mDirectoryRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mDirectoryRecyclerView.setAdapter(mDirectoryAdapter);
mDirectoryRecyclerView.setEmptyView(mEmptyView);
}
private void initArgs() {
final Bundle arguments = requireArguments();
if (arguments.containsKey(ARG_FILE)) {
mFile = (File) getArguments().getSerializable(ARG_FILE);
}
mFilter = (FileFilter) getArguments().getSerializable(ARG_FILTER);
}
interface FileClickListener {
void onFileClicked(File clickedFile);
}
}

View File

@@ -0,0 +1,259 @@
package arte.programar.materialfile.ui;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
//import com.google.android.material.color.DynamicColors;
import java.io.File;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import arte.programar.materialfile.R;
import arte.programar.materialfile.filter.FileFilter;
import arte.programar.materialfile.filter.PatternFilter;
import arte.programar.materialfile.utils.FileUtils;
public class FilePickerActivity extends AppCompatActivity implements DirectoryFragment.FileClickListener {
public static final String ARG_START_FILE = "arg_start_path";
public static final String ARG_CURRENT_FILE = "arg_current_path";
public static final String ARG_FILTER = "arg_filter";
public static final String ARG_CLOSEABLE = "arg_closeable";
public static final String ARG_TITLE = "arg_title";
public static final String STATE_START_FILE = "state_start_path";
public static final String RESULT_FILE_PATH = "result_file_path";
private static final String STATE_CURRENT_FILE = "state_current_path";
private static final int HANDLE_CLICK_DELAY = 150;
private Toolbar mToolbar;
private File mStart = null;
private File mCurrent = null;
private CharSequence mTitle;
private Boolean mCloseable = true;
private FileFilter mFilter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// MOD:
//DynamicColors.applyIfAvailable(this);
setContentView(R.layout.activity_file_picker);
if (mStart == null) {
mStart = FileUtils.getFile(getApplicationContext(), "");
mCurrent = mStart;
}
initArguments(savedInstanceState);
initViews();
initToolbar();
if (savedInstanceState == null) {
initBackStackState();
}
}
private void initArguments(Bundle savedInstanceState) {
if (getIntent().hasExtra(ARG_FILTER)) {
Serializable filter = getIntent().getSerializableExtra(ARG_FILTER);
if (filter instanceof Pattern) {
mFilter = new PatternFilter((Pattern) filter, false);
} else {
mFilter = (FileFilter) filter;
}
}
if (savedInstanceState != null) {
mStart = (File) savedInstanceState.getSerializable(STATE_START_FILE);
mCurrent = (File) savedInstanceState.getSerializable(STATE_CURRENT_FILE);
updateTitle();
} else {
if (getIntent().hasExtra(ARG_START_FILE)) {
mStart = (File) getIntent().getSerializableExtra(ARG_START_FILE);
mCurrent = mStart;
}
if (getIntent().hasExtra(ARG_CURRENT_FILE)) {
File currentFile = (File) getIntent().getSerializableExtra(ARG_CURRENT_FILE);
if (FileUtils.isParent(currentFile, mStart)) {
mCurrent = currentFile;
}
}
}
if (getIntent().hasExtra(ARG_TITLE)) {
mTitle = getIntent().getCharSequenceExtra(ARG_TITLE);
}
if (getIntent().hasExtra(ARG_CLOSEABLE)) {
mCloseable = getIntent().getBooleanExtra(ARG_CLOSEABLE, true);
}
}
private void initToolbar() {
setSupportActionBar(mToolbar);
// Truncate start of path
try {
Field f;
if (TextUtils.isEmpty(mTitle)) {
f = mToolbar.getClass().getDeclaredField("mTitleTextView");
} else {
f = mToolbar.getClass().getDeclaredField("mSubtitleTextView");
}
f.setAccessible(true);
TextView textView = (TextView) f.get(mToolbar);
textView.setEllipsize(TextUtils.TruncateAt.START);
} catch (Exception ignored) {
}
if (!TextUtils.isEmpty(mTitle)) {
setTitle(mTitle);
}
updateTitle();
}
private void initViews() {
mToolbar = findViewById(R.id.toolbar);
}
private void initBackStackState() {
final List<File> path = new ArrayList<>();
File current = mCurrent;
while (current != null) {
path.add(current);
if (current.equals(mStart)) {
break;
}
current = FileUtils.getParentOrNull(current);
}
Collections.reverse(path);
for (File file : path) {
addFragmentToBackStack(file);
}
}
private void updateTitle() {
if (getSupportActionBar() != null) {
//final String titlePath = mCurrent.getAbsolutePath();
// Show only path name
final String titlePath = mCurrent.getName();
getSupportActionBar().setDisplayHomeAsUpEnabled(!mCurrent.getPath().equals(mStart.getPath()));
if (TextUtils.isEmpty(mTitle)) {
getSupportActionBar().setTitle(titlePath);
} else {
getSupportActionBar().setSubtitle(titlePath);
}
}
}
private void addFragmentToBackStack(File file) {
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.container, DirectoryFragment.getInstance(file, mFilter))
.addToBackStack(null)
.commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// MOD: dialog onStop fix
//getMenuInflater().inflate(R.menu.menu, menu);
//menu.findItem(R.id.action_close).setVisible(mCloseable);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
// MOD: dialog onStop fix
//if (menuItem.getItemId() == android.R.id.home) {
// onBackPressed();
//} else if (menuItem.getItemId() == R.id.action_close) {
// finish();
//}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onBackPressed() {
if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
getSupportFragmentManager().popBackStack();
mCurrent = FileUtils.getParentOrNull(mCurrent);
updateTitle();
} else {
setResult(RESULT_CANCELED);
finish();
}
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable(STATE_CURRENT_FILE, mCurrent);
outState.putSerializable(STATE_START_FILE, mStart);
}
@Override
public void onFileClicked(final File clickedFile) {
new Handler().postDelayed(() -> handleFileClicked(clickedFile), HANDLE_CLICK_DELAY);
}
private void handleFileClicked(final File clickedFile) {
if (isFinishing()) {
return;
}
if (clickedFile.isDirectory()) {
mCurrent = clickedFile;
// If the user wanna go to the emulated directory, he will be taken to the
// corresponding user emulated folder.
if (mCurrent.getAbsolutePath().equals("/storage/emulated")) {
mCurrent = Environment.getExternalStorageDirectory();
}
addFragmentToBackStack(mCurrent);
updateTitle();
} else {
setResultAndFinish(clickedFile);
}
}
private void setResultAndFinish(File file) {
Intent data = new Intent();
data.putExtra(RESULT_FILE_PATH, file.getPath());
setResult(RESULT_OK, data);
finish();
}
}

View File

@@ -0,0 +1,31 @@
package arte.programar.materialfile.ui;
import android.os.SystemClock;
import android.view.View;
interface OnItemClickListener {
void onItemClick(View view, int position);
abstract class ThrottleClickListener implements OnItemClickListener {
private static final long MIN_CLICK_INTERVAL = 600;
private long mLastClickTime;
abstract void onItemClickThrottled(View view, int position);
@Override
public void onItemClick(View view, int position) {
final long currentClickTime = SystemClock.uptimeMillis();
final long elapsedTime = currentClickTime - mLastClickTime;
mLastClickTime = currentClickTime;
if (elapsedTime <= MIN_CLICK_INTERVAL) {
return;
}
onItemClickThrottled(view, position);
}
}
}

View File

@@ -0,0 +1,27 @@
package arte.programar.materialfile.ui;
import android.os.SystemClock;
import android.view.View;
abstract class ThrottleClickListener implements OnItemClickListener {
private static final long MIN_CLICK_INTERVAL = 600;
private long mLastClickTime;
abstract void onItemClickThrottled(View view, int position);
@Override
public void onItemClick(View view, int position) {
final long currentClickTime = SystemClock.uptimeMillis();
final long elapsedTime = currentClickTime - mLastClickTime;
mLastClickTime = currentClickTime;
if (elapsedTime <= MIN_CLICK_INTERVAL) {
return;
}
onItemClickThrottled(view, position);
}
}

View File

@@ -0,0 +1,23 @@
package arte.programar.materialfile.utils;
import java.io.File;
import java.util.Comparator;
public class FileComparator implements Comparator<File> {
@Override
public int compare(File f1, File f2) {
if (f1 == f2) {
return 0;
}
if (f1.isDirectory() && f2.isFile()) {
// Show directories above files
return -1;
}
if (f1.isFile() && f2.isDirectory()) {
// Show files below directories
return 1;
}
// Sort the directories alphabetically
return f1.getName().compareToIgnoreCase(f2.getName());
}
}

View File

@@ -0,0 +1,87 @@
package arte.programar.materialfile.utils;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import arte.programar.materialfile.R;
public class FileTypeUtils {
private static final Map<String, FileType> fileTypeExtensions = new HashMap<>();
static {
for (FileType fileType : FileType.values()) {
for (String extension : fileType.getExtensions()) {
fileTypeExtensions.put(extension, fileType);
}
}
}
public static FileType getFileType(File file) {
if (file.isDirectory()) {
return FileType.DIRECTORY;
}
FileType fileType = fileTypeExtensions.get(getExtension(file.getName()));
if (fileType != null) {
return fileType;
}
return FileType.FILE;
}
private static String getExtension(String fileName) {
String encoded;
try {
encoded = URLEncoder.encode(fileName, "UTF-8").replace("+", "%20");
} catch (UnsupportedEncodingException e) {
encoded = fileName;
}
return MimeTypeMap.getFileExtensionFromUrl(encoded).toLowerCase();
}
public enum FileType {
DIRECTORY(R.drawable.ic_app_directory, R.string.type_directory),
FILE(R.drawable.ic_app_file, R.string.type_document),
APK(R.drawable.ic_app_apk, R.string.type_apk, "apk"),
CERTIFICATE(R.drawable.ic_app_certificate, R.string.type_certificate, "cer", "der", "pfx", "p12", "arm", "pem"),
COMPRESS(R.drawable.ic_app_compress, R.string.type_archive, "cab", "7z", "alz", "arj", "bzip2", "bz2", "dmg", "gzip", "gz", "jar", "lz", "lzip", "lzma", "zip", "rar", "tar", "tgz"),
WORD(R.drawable.ic_app_document, R.string.type_word, "doc", "docm", "docx", "dot", "mcw", "rtf", "pages", "odt", "ott"),
DRAWING(R.drawable.ic_app_drawing, R.string.type_drawing, "ai", "cdr", "dfx", "eps", "svg", "stl", "wmf", "emf", "art", "xar"),
JSON(R.drawable.ic_app_json, R.string.type_json, "json"),
IMAGE(R.drawable.ic_app_image, R.string.type_image, "bmp", "gif", "ico", "jpeg", "jpg", "pcx", "png", "psd", "tga", "tiff", "tif", "xcf"),
MUSIC(R.drawable.ic_app_music, R.string.type_music, "aiff", "aif", "wav", "flac", "m4a", "wma", "amr", "mp2", "mp3", "wma", "aac", "mid", "m3u"),
PDF(R.drawable.ic_app_pdf, R.string.type_pdf, "pdf"),
PRESENTATION(R.drawable.ic_app_presentation, R.string.type_power_point, "pptx", "keynote", "ppt", "pps", "pot", "odp", "otp"),
SPREADSHEET(R.drawable.ic_app_spreadsheet, R.string.type_excel, "xls", "xlk", "xlsb", "xlsm", "xlsx", "xlr", "xltm", "xlw", "numbers", "ods", "ots"),
VIDEO(R.drawable.ic_app_video, R.string.type_video, "avi", "mov", "wmv", "mkv", "3gp", "f4v", "flv", "mp4", "mpeg", "webm");
private final int icon;
private final int description;
private final String[] extensions;
FileType(int icon, int description, String... extensions) {
this.icon = icon;
this.description = description;
this.extensions = extensions;
}
public String[] getExtensions() {
return extensions;
}
public int getIcon() {
return icon;
}
public int getDescription() {
return description;
}
}
}

View File

@@ -0,0 +1,71 @@
package arte.programar.materialfile.utils;
import android.content.Context;
import android.util.Log;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import arte.programar.materialfile.filter.FileFilter;
public class FileUtils {
public static final String FILE_PATH_SEPARATOR = "/";
public static List<File> getFileList(File directory, FileFilter filter) {
File[] files = directory.listFiles(filter::accept);
if (files == null) {
return new ArrayList<>();
}
List<File> result = Arrays.asList(files);
Collections.sort(result, new FileComparator());
return result;
}
@Nullable
public static File getParentOrNull(File file) {
if (file.getParent() == null) {
return null;
}
return file.getParentFile();
}
public static boolean isParent(File maybeChild, File possibleParent) {
if (!possibleParent.exists() || !possibleParent.isDirectory()) {
return false;
}
File child = maybeChild;
while (child != null) {
if (child.equals(possibleParent)) {
return true;
}
child = child.getParentFile();
}
return false;
}
public static File getFile(Context context, String path) {
String npath = path == null ? "" : path;
String absolutePath = ContextCompat.getExternalFilesDirs(context, null)[0].getPath();
if (absolutePath.contains("/Android/data")) {
int index = absolutePath.indexOf("/Android/data");
String storage = absolutePath.substring(0, index).concat(npath.length() > 0 ? FILE_PATH_SEPARATOR : "");
absolutePath = String.format(Locale.getDefault(), "%s%s", storage, npath);
}
Log.d("TAG", absolutePath);
return new File(absolutePath);
}
}

View File

@@ -0,0 +1,61 @@
package arte.programar.materialfile.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
public class EmptyRecyclerView extends RecyclerView {
@Nullable
private View mEmptyView;
@NonNull
private final AdapterDataObserver observer = new AdapterDataObserver() {
@Override
public void onChanged() {
super.onChanged();
checkIfEmpty();
}
};
public EmptyRecyclerView(Context context) {
super(context);
}
public EmptyRecyclerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public EmptyRecyclerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
void checkIfEmpty() {
final Adapter adapter = getAdapter();
if (mEmptyView != null && adapter != null) {
mEmptyView.setVisibility(adapter.getItemCount() > 0 ? GONE : VISIBLE);
}
}
@Override
public void setAdapter(@Nullable Adapter adapter) {
final Adapter oldAdapter = getAdapter();
if (oldAdapter != null) {
oldAdapter.unregisterAdapterDataObserver(observer);
}
super.setAdapter(adapter);
if (adapter != null) {
adapter.registerAdapterDataObserver(observer);
}
}
public void setEmptyView(@Nullable View mEmptyView) {
this.mEmptyView = mEmptyView;
checkIfEmpty();
}
}

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FAFAFA"
android:pathData="M3,16.74L7.76,12L3,7.26L7.26,3L12,7.76L16.74,3L21,7.26L16.24,12L21,16.74L16.74,21L12,16.24L7.26,21L3,16.74M12,13.41L16.74,18.16L18.16,16.74L13.41,12L18.16,7.26L16.74,5.84L12,10.59L7.26,5.84L5.84,7.26L10.59,12L5.84,16.74L7.26,18.16L12,13.41Z" />
</vector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item
android:id="@android:id/mask"
android:drawable="@android:color/white" />
</ripple>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/compatibility_pressed_color" android:state_pressed="true" />
<item android:drawable="@color/compatibility_focus_color" android:state_focused="true" />
<item android:drawable="@color/transparent" />
</selector>

View File

@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#84c835"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="m7.9377,7.673v1.7198c0,0.0733 0.059,0.1323 0.1323,0.1323h0.7937c0.0733,0 0.1323,-0.059 0.1323,-0.1323L8.996,7.673ZM8.2023,8.7313h0.5292v0.5292h-0.5292z" />
<path
android:fillColor="#ffffff"
android:pathData="M8.4667,2.1168L7.9375,2.1168L7.9375,2.6459L8.4667,2.6459ZM8.4667,2.6459v0.5292h0.5292L8.9958,2.6459ZM8.4667,3.1751L7.9375,3.1751L7.9375,3.7042L8.4667,3.7042ZM8.4667,3.7042v0.5292h0.5292L8.9958,3.7042ZM8.4667,4.2334L7.9375,4.2334L7.9375,4.7626L8.4667,4.7626ZM8.4667,4.7626v0.5292h0.5292L8.9958,4.7626ZM8.4667,5.2917L7.9375,5.2917L7.9375,5.8209L8.4667,5.8209ZM8.4667,5.8209v0.5292h0.5292L8.9958,5.8209ZM8.4667,6.35L7.9375,6.35L7.9375,6.8792L8.4667,6.8792ZM8.4667,6.8792L8.4667,7.4084h0.5292L8.9958,6.8792Z" />
<path
android:fillAlpha="0.5"
android:fillColor="#0c2809"
android:pathData="m10.6457,11.8283 l0.8026,-0.8026c0.1235,-0.1235 0.1235,-0.3149 0,-0.4383 -0.1235,-0.1235 -0.3149,-0.1235 -0.4383,0l-0.9137,0.9137c-0.4877,-0.2469 -1.0433,-0.3889 -1.6298,-0.3889 -0.5927,0 -1.1483,0.142 -1.6421,0.3889L5.9045,10.5874c-0.1235,-0.1235 -0.3149,-0.1235 -0.4383,0 -0.1235,0.1235 -0.1235,0.3149 0,0.4383l0.8087,0.8087c-0.9137,0.6729 -1.5125,1.7533 -1.5125,2.9818h7.4082c0,-1.2285 -0.5988,-2.3151 -1.5249,-2.988zM7.1436,13.4934h-0.5292v-0.5292h0.5292zM10.3185,13.4934h-0.5292v-0.5292h0.5292z"
android:strokeWidth="0.61735"
android:strokeAlpha="0.5" />
</vector>

View File

@@ -0,0 +1,29 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#ff5555"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M8.1125,4.9459 L7.7709,5.3867 7.2284,5.2632 7.0811,5.8001 6.5323,5.8941 6.602,6.4466 6.1308,6.7437 6.4072,7.2273 6.0853,7.6821 6.5251,8.0232 6.4026,8.5663 6.9395,8.713l0.094,0.5488 0.215,-0.0274v2.7527l1.2154,-0.8842 1.2154,0.8842V9.3858l0.0258,0.0062L9.8525,8.8551 10.4013,8.7605 10.331,8.2081 10.8022,7.9115 10.5263,7.4273 10.8477,6.973 10.4079,6.6315 10.5309,6.0889 9.994,5.9416 9.9,5.3933 9.3476,5.4631 9.0504,4.9918 8.5668,5.2678ZM8.4665,6.0853A1.3229,1.3229 0,0 1,9.7894 7.4082,1.3229 1.3229,0 0,1 8.4665,8.7311 1.3229,1.3229 0,0 1,7.1436 7.4082,1.3229 1.3229,0 0,1 8.4665,6.0853Z"
android:strokeWidth="0.264578" />
</vector>

View File

@@ -0,0 +1,45 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:fillColor="#ffd351"
android:pathData="M30,8L54,8A2,2 0,0 1,56 10L56,38A2,2 0,0 1,54 40L30,40A2,2 0,0 1,28 38L28,10A2,2 0,0 1,30 8z" />
<path
android:fillColor="#7bd57d"
android:pathData="M10,6L34,6A2,2 0,0 1,36 8L36,36A2,2 0,0 1,34 38L10,38A2,2 0,0 1,8 36L8,8A2,2 0,0 1,10 6z" />
<path
android:fillColor="#707ed0"
android:pathData="M21,12L45,12A2,2 0,0 1,47 14L47,42A2,2 0,0 1,45 44L21,44A2,2 0,0 1,19 42L19,14A2,2 0,0 1,21 12z" />
<path
android:fillColor="#c49a6c"
android:pathData="m7.16,20c-1.1966,0 -2.16,0.9175 -2.16,2.0571v30.857c0,1.7095 1.445,3.0857 3.24,3.0857h47.52c1.795,0 3.24,-1.3762 3.24,-3.0857v-30.857c0,-1.1397 -0.9634,-2.0571 -2.16,-2.0571z" />
<path
android:fillColor="#fff"
android:pathData="m32,33a2,2 0,0 0,-2 2v6a2,2 0,0 0,2 2,2 2,0 0,0 2,-2v-6a2,2 0,0 0,-2 -2zM32,40a1,1 0,0 1,1 1,1 1,0 0,1 -1,1 1,1 0,0 1,-1 -1,1 1,0 0,1 1,-1z" />
<path
android:fillColor="#f2f2f2"
android:pathData="m32,21h2v2h-2z" />
<path
android:fillColor="#e0e0e0"
android:pathData="m30,23h2v2h-2z" />
<path
android:fillColor="#f2f2f2"
android:pathData="m32,25h2v2h-2z" />
<path
android:fillColor="#e0e0e0"
android:pathData="m30,27h2v2h-2z" />
<path
android:fillColor="#f2f2f2"
android:pathData="m32,29h2v2h-2z" />
<path
android:fillColor="#e0e0e0"
android:pathData="m30,31h2v2h-2z" />
<path
android:fillColor="#a97b50"
android:pathData="m42,47c-0.554,0 -1,0.446 -1,1v4c0,0.554 0.446,1 1,1h11c0.554,0 1,-0.446 1,-1v-4c0,-0.554 -0.446,-1 -1,-1h-11zM42,47.9981h2v4h-2v-4zM45,48h1v4h-1v-4zM47,48h1v4h-1v-4zM49,48h2v4h-2v-4zM52,48h1v4h-1v-4z" />
<path
android:fillColor="#a97b50"
android:pathData="m15,44 l-2,3h1v4h2v-4h1zM17,47h1v4h2v-4h1l-2,-3zM12,52v1h10v-1z" />
</vector>

View File

@@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#4caf50"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="m8.4665,4.7415c-1.8074,0 -3.272,0.5214 -3.272,1.1655l0,0.9313c0,0.6413 1.4646,1.1627 3.272,1.1627 1.8074,0 3.272,-0.5214 3.272,-1.1627L11.7385,5.907c0,-0.6441 -1.4646,-1.1655 -3.272,-1.1655zM8.4665,4.7415"
android:strokeWidth="0.630919" />
<path
android:fillColor="#ffffff"
android:pathData="m8.4567,8.4665c-1.4646,0 -2.6989,-0.3429 -3.1177,-0.8141 -0.0955,0.1087 -0.1445,0.2258 -0.1445,0.3485l0,0.9313c0,0.6413 1.4646,1.1627 3.272,1.1627 1.8074,0 3.272,-0.5214 3.272,-1.1627L11.7385,8.0009c0,-0.1227 -0.0588,-0.2398 -0.1567,-0.3485C11.1654,8.1236 9.9213,8.4665 8.4567,8.4665ZM8.4567,8.4665"
android:strokeWidth="0.630919" />
<path
android:fillColor="#ffffff"
android:pathData="m8.4567,10.5604c-1.4646,0 -2.6989,-0.3429 -3.1177,-0.8141 -0.0955,0.1115 -0.1445,0.2286 -0.1445,0.3485l0,0.9313c0,0.6441 1.4646,1.1655 3.272,1.1655 1.8074,0 3.272,-0.5214 3.272,-1.1655L11.7385,10.0948c0,-0.1199 -0.0588,-0.237 -0.1567,-0.3485C11.1654,10.2175 9.9213,10.5604 8.4567,10.5604ZM8.4567,10.5604"
android:strokeWidth="0.630919" />
</vector>

View File

@@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<!-- Old main color: #5677fc -->
<path
android:fillColor="#999999"
android:pathData="M3.44,2.378c-0.294,0 -0.395,0.269 -0.53,0.53h-0.793a0.528,0.528 0,0 0,-0.53 0.528v5.292c0,0.293 0.237,0.53 0.53,0.53h12.7c0.293,0 0.529,-0.237 0.529,-0.53v-5.292a0.528,0.528 0,0 0,-0.53 -0.529L7.674,2.907c-0.155,-0.249 -0.236,-0.53 -0.53,-0.53z" />
<path
android:fillAlpha="0.18"
android:fillColor="#FF000000"
android:pathData="M3.44,2.378c-0.294,0 -0.395,0.269 -0.53,0.53h-0.793a0.528,0.528 0,0 0,-0.53 0.528v5.292c0,0.293 0.237,0.53 0.53,0.53h12.7c0.293,0 0.529,-0.237 0.529,-0.53v-5.292a0.528,0.528 0,0 0,-0.53 -0.529L7.674,2.907c-0.155,-0.249 -0.236,-0.53 -0.53,-0.53z"
android:strokeAlpha="0.18" />
<path
android:fillColor="#fff"
android:pathData="M2.646,3.7L14.287,3.7A0.265,0.265 0,0 1,14.552 3.965L14.552,8.462A0.265,0.265 0,0 1,14.287 8.727L2.646,8.727A0.265,0.265 0,0 1,2.381 8.462L2.381,3.965A0.265,0.265 0,0 1,2.646 3.7z" />
<path
android:fillColor="#999999"
android:pathData="m8.4671,4.2301c-0.293,0 -0.3822,0.2756 -0.5292,0.5286l-0.3101,0.5312l-6.5701,0c-0.2931,0 -0.5286,0.2361 -0.5286,0.5292l0,8.4671c0,0.2931 0.2356,0.5286 0.5286,0.5286l14.8175,0c0.2931,0 0.5286,-0.2345 0.5286,-0.5276l0,-9.5249c0,-0.294 -0.2356,-0.5323 -0.5286,-0.5323z"
android:strokeWidth="3.7796" />
<path
android:fillAlpha="0.25"
android:fillColor="#FF000000"
android:pathData="M3.969,2.64L6.614,2.64A0.265,0.2645 0,0 1,6.879 2.9045L6.879,2.9045A0.265,0.2645 0,0 1,6.614 3.169L3.969,3.169A0.265,0.2645 0,0 1,3.704 2.9045L3.704,2.9045A0.265,0.2645 0,0 1,3.969 2.64z"
android:strokeAlpha="0.25" />
<path
android:fillAlpha="0.1"
android:pathData="m16.404,11.641 l-3.1744,3.1749h2.6458c0.2931,0 0.5286,-0.2356 0.5286,-0.5286z"
android:strokeAlpha="0.1"></path>
</vector>

View File

@@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#2196f3"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="M4.7624,11.1123L4.7624,10.5832L10.054,10.5832v0.5292zM4.7624,9.5248L4.7624,8.9957L12.1706,8.9957v0.5292zM4.7624,7.9373v-0.5292L12.1706,7.4082v0.5292zM4.7624,6.3498v-0.5292L12.1706,5.8207v0.5292z"
android:strokeWidth="0.999999" />
</vector>

View File

@@ -0,0 +1,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#2b898f"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:pathData="M8.4665,8.4665m-3.9687,0a3.9687,3.9687 0,1 1,7.9373 0a3.9687,3.9687 0,1 1,-7.9373 0"
android:strokeWidth="0.749994"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.5"
android:fillColor="#ffffff"
android:pathData="m9.3093,9.7813a1.191,1.191 94.4984,0 1,-1.6845 0,1.191 1.191,94.4984 0,1 0,-1.6837 1.191,1.191 94.4984,0 1,1.6837 0,1.191 1.191,94.4984 0,1 0,1.6837z"
android:strokeAlpha="0.5" />
<path
android:fillColor="#ffffff"
android:pathData="M8.4671,5.6128A0.0945,0.0945 92.6759,0 0,8.4011 5.6413L6.8246,7.2178a2.3812,2.3812 87.9149,0 0,-0.042 0.0375,2.3812 2.3812,87.9149 0,0 0,3.3675 2.3812,2.3812 87.9149,0 0,3.3675 0,2.3812 2.3812,87.9149 0,0 0.0007,-3.3675 2.3812,2.3812 87.9149,0 0,-0.057 -0.0525C10.0908,7.1991 10.0901,7.1953 10.0863,7.1916L8.5361,5.6413A0.0945,0.0945 92.6759,0 0,8.4671 5.6128ZM8.4843,7.7488a1.191,1.191 94.4984,0 1,0.825 0.3487,1.191 1.191,94.4984 0,1 0,1.6837 1.191,1.191 94.4984,0 1,-1.6845 0,1.191 1.191,94.4984 0,1 0,-1.6837 1.191,1.191 94.4984,0 1,0.8595 -0.3487z" />
<path
android:fillColor="#ffffff"
android:pathData="M8.8833,8.3781 L8.4626,8.7988 8.0418,8.3781 7.9008,8.5183 8.3223,8.939 7.9098,9.3688 8.0418,9.5008 8.4618,9.0793 8.8833,9.5008 9.0326,9.3688 8.6028,8.939 9.0236,8.5191Z" />
</vector>

View File

@@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#f2f2f2"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#999999"
android:pathData="m8.996,4.8949v0.2646h3.1749L12.1709,4.8949ZM8.996,5.6886v0.2646h3.1749v-0.2646zM8.996,6.4824v0.2646h3.1749v-0.2646zM8.996,7.2761v0.2646h3.1749L12.1709,7.2761ZM8.996,8.0698v0.2646h3.1749v-0.2646zM4.7628,8.8636v0.2646h7.4082v-0.2646zM4.7628,9.6573v0.2646L12.171,9.9219L12.171,9.6573ZM4.7628,10.451v0.2646h7.4082v-0.2646zM4.7628,11.2448v0.2646h7.4082v-0.2646zM4.7628,12.0385v0.2646L8.996,12.3031L8.996,12.0385Z" />
<path
android:fillColor="#999999"
android:pathData="m6.388,4.6299 l-1.3053,3.4395h-0.3206v0.2646h0.926L5.688,8.0694L5.3916,8.0694l0.3093,-0.7943h1.5347l0.3089,0.7943h-0.4005v0.2646h1.3283L8.4722,8.0694h-0.3664l-1.3056,-3.4395zM6.4682,5.2254 L7.1439,7.0117h-1.3401z"
android:strokeWidth="0.066145" />
</vector>

View File

@@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#7f7fff"
android:pathData="M1.0583,3.4395L1.0583,13.4935A1.3229,1.3229 0,0 0,2.3812 14.8164L14.5518,14.8164A1.3229,1.3229 0,0 0,15.8747 13.4935L15.8747,3.4395A1.3229,1.3229 0,0 0,14.5518 2.1166L2.3812,2.1166A1.3229,1.3229 0,0 0,1.0583 3.4395z" />
<path
android:fillAlpha="0.15"
android:fillType="evenOdd"
android:pathData="m12.1706,14.8164 l3.7041,-3.7041l0,2.3812c0,0.7329 -0.59,1.3229 -1.3229,1.3229z"
android:strokeWidth="8.8191"
android:strokeAlpha="0.15"></path>
<path
android:fillAlpha="0.25"
android:fillColor="#fff"
android:pathData="m9.8556,8.202 l-1.0583,1.6283 1.5213,2.3404l2.1166,0l-2.5797,-3.9687z"
android:strokeWidth="2.8347"
android:strokeAlpha="0.25" />
<path
android:fillAlpha="0.65"
android:fillColor="#fff"
android:pathData="m6.879,6.879 l-3.4395,5.2916h6.879z"
android:strokeAlpha="0.65" />
<path
android:fillAlpha="0.65"
android:fillColor="#fff"
android:pathData="m11.377,4.7624c-0.7306,0 -1.3229,0.5923 -1.3229,1.3229 0,0.7306 0.5923,1.3229 1.3229,1.3229 0.7306,0 1.3229,-0.5923 1.3229,-1.3229 0,-0.7306 -0.5923,-1.3229 -1.3229,-1.3229z"
android:strokeAlpha="0.65" />
</vector>

View File

@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#fbc02d"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="m8.4665,5.1593c-1.7832,0 -3.3072,1.4074 -3.3072,3.3072 0,1.6536 1.1011,2.8948 2.2785,3.3072 -0.783,-0.5704 -1.5012,-1.6536 -1.5012,-2.8928 0,-1.43 0.9735,-2.4825 2.1051,-2.4825 1.0573,0 1.7832,1.071 1.787,2.068 0,0.6996 -0.541,1.2761 -0.9735,1.6536 0.7792,0 1.7508,-0.6852 1.7508,-2.066C10.6059,6.8129 9.6343,5.1593 8.4665,5.1593ZM8.4665,5.1593" />
<path
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="m8.4665,11.7737c1.7832,0 3.3072,-1.4074 3.3072,-3.3072 0,-1.6536 -1.1011,-2.8948 -2.2785,-3.3072 0.783,0.5704 1.5012,1.6536 1.5012,2.8948 0,1.4279 -0.9735,2.4784 -2.1051,2.4784 -1.0573,0 -1.7832,-1.0689 -1.787,-2.066 0,-0.6996 0.541,-1.2761 0.9735,-1.6536 -0.7792,0 -1.7508,0.6852 -1.7508,2.066 0,1.2412 0.9716,2.8948 2.1394,2.8948zM8.4665,11.7737" />
</vector>

View File

@@ -0,0 +1,62 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:fillAlpha="0.2"
android:fillColor="#FF000000"
android:pathData="M256,258m-240,0a240,240 0,1 1,480 0a240,240 0,1 1,-480 0"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:pathData="M256,260m-240,0a240,240 0,1 1,480 0a240,240 0,1 1,-480 0"
android:strokeAlpha="0.1" />
<path
android:fillAlpha="0.2"
android:fillColor="#FF000000"
android:pathData="M256,260m-240,0a240,240 0,1 1,480 0a240,240 0,1 1,-480 0"
android:strokeAlpha="0.2" />
<path
android:fillColor="#ff6d00"
android:pathData="M256,256m-240,0a240,240 0,1 1,480 0a240,240 0,1 1,-480 0" />
<path
android:fillAlpha="0.2"
android:fillColor="#fff"
android:pathData="m256,16a240,240 0,0 0,-240 240,240 240,0 0,0 0.041,1.172A240,240 0,0 1,256 18,240 240,0 0,1 495.959,256.828 240,240 0,0 0,496 256,240 240,0 0,0 256,16Z"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:pathData="M416,262L416,262A160,160 0,0 0,256 102L256,102A160,160 0,0 0,96 262L96,262A160,160 0,0 0,256 422L256,422A160,160 0,0 0,416 262z"
android:strokeAlpha="0.1" />
<path
android:fillAlpha="0.2"
android:fillColor="#FF000000"
android:pathData="M416,270L416,270A160,160 0,0 0,256 110L256,110A160,160 0,0 0,96 270L96,270A160,160 0,0 0,256 430L256,430A160,160 0,0 0,416 270z"
android:strokeAlpha="0.2" />
<path
android:fillColor="#ffbc00"
android:pathData="M416,256L416,256A160,160 0,0 0,256 96L256,96A160,160 0,0 0,96 256L96,256A160,160 0,0 0,256 416L256,416A160,160 0,0 0,416 256z" />
<path
android:fillAlpha="0.4"
android:fillColor="#fff"
android:pathData="m256,96c-88.64,0 -160,71.36 -160,160 0,0.334 0.012,0.666 0.014,1 0.535,-88.175 71.681,-159 159.99,-159s159.45,70.825 159.99,159c0.002,-0.334 0.014,-0.666 0.014,-1 0,-88.64 -71.36,-160 -160,-160z"
android:strokeAlpha="0.4" />
<path
android:fillColor="#fff"
android:pathData="M216,196h24v104h-24z" />
<path
android:fillColor="#fff"
android:pathData="M312,196h24v104h-24z" />
<path
android:fillColor="#fff"
android:pathData="M204,300m-36,0a36,36 0,1 1,72 0a36,36 0,1 1,-72 0" />
<path
android:fillColor="#fff"
android:pathData="M216,168h120v48h-120z" />
<path
android:fillColor="#fff"
android:pathData="M300,300m-36,0a36,36 0,1 1,72 0a36,36 0,1 1,-72 0" />
</vector>

View File

@@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#e84f43"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="M6.942,9.1745C7.2057,8.6577 7.5053,8.0755 7.7452,7.4909l0.0948,-0.2308C7.5267,6.068 7.3389,5.1111 7.5067,4.4924c0.0452,-0.1613 0.232,-0.2592 0.4318,-0.2592l0.1217,0.0018h0.0223c0.2735,-0.0042 0.4022,0.3437 0.4169,0.4789 0.0241,0.2253 -0.0801,0.6065 -0.0801,0.6065 0,-0.1539 0.006,-0.4027 -0.0911,-0.6173 -0.1131,-0.2484 -0.2211,-0.3967 -0.318,-0.4203 -0.0489,0.0327 -0.0964,0.1003 -0.1127,0.2304 -0.0337,0.1824 -0.0438,0.4127 -0.0438,0.5314 0,0.4194 0.0826,0.9729 0.2449,1.5436 0.0306,-0.0883 0.0575,-0.1732 0.079,-0.2528 0.0333,-0.1253 0.2448,-0.9563 0.2448,-0.9563 0,0 -0.0533,1.1061 -0.1278,1.4408 -0.016,0.0707 -0.0336,0.1407 -0.0519,0.2123 0.2676,0.7477 0.6988,1.415 1.2132,1.8953 0.2028,0.1895 0.459,0.3424 0.7014,0.4817 0.5294,-0.0756 1.0169,-0.1114 1.4235,-0.1069 0.5395,0.0071 0.9356,0.0869 1.0959,0.2449 0.0785,0.0768 0.1104,0.1695 0.1203,0.2735 0.0023,0.0404 -0.0173,0.1355 -0.0231,0.1593 0.0058,-0.0289 0.0058,-0.1708 -0.4273,-0.3091 -0.3411,-0.109 -0.9795,-0.1057 -1.7455,-0.0241 0.886,0.4335 1.7492,0.6489 2.0228,0.5197 0.0669,-0.0326 0.148,-0.1437 0.148,-0.1437 0,0 -0.0482,0.2191 -0.0828,0.2738 -0.0442,0.0595 -0.1309,0.124 -0.213,0.1457 -0.432,0.1153 -1.5566,-0.1515 -2.537,-0.7116 -1.0953,0.1613 -2.2982,0.4593 -3.2625,0.7756 -0.9475,1.6606 -1.6599,2.4232 -2.2394,2.1331L4.2239,12.5322c-0.0866,-0.0495 -0.0998,-0.1701 -0.0798,-0.2683 0.0676,-0.3306 0.4821,-0.8285 1.3147,-1.3256 0.0896,-0.0542 0.4888,-0.2653 0.4888,-0.2653 0,0 -0.2955,0.286 -0.3648,0.3422 -0.6646,0.5446 -1.1551,1.2298 -1.1428,1.4954l0.0024,0.0232c0.5645,-0.0804 1.4111,-1.2295 2.4995,-3.3591M7.2869,9.3513c-0.1818,0.3424 -0.3595,0.6598 -0.5235,0.9513C7.6708,9.9224 8.6474,9.6791 9.5772,9.5062 9.4523,9.4199 9.331,9.3286 9.2169,9.232 8.7049,8.7985 8.3145,8.2578 8.0316,7.6887 7.8521,8.1721 7.6387,8.6858 7.2869,9.3513"
android:strokeWidth="0.025916" />
</vector>

View File

@@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#f9ce1d"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="m6.3939,6.1735c-0.7793,0 -1.411,0.6317 -1.411,1.4111 0,0.7793 0.6318,1.4111 1.411,1.4111 0.7793,0 1.411,-0.6317 1.411,-1.4111L6.3939,7.5846ZM8.5106,6.5262L8.5106,7.0554L11.9501,7.0554L11.9501,6.5262ZM8.5486,8.1137 L8.5106,8.6429L11.9501,8.6429L11.9501,8.1137ZM5.3357,10.2303v0.5291h5.2914l0.0001,-0.5291z"
android:strokeWidth="0.999999" />
</vector>

View File

@@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="16.933"
android:viewportHeight="16.933">
<path
android:fillColor="#4caf50"
android:fillType="evenOdd"
android:pathData="m3.4395,1.0583c-0.7329,0 -1.3229,0.59 -1.3229,1.3229v12.171c0,0.7328 0.59,1.3229 1.3229,1.3229h10.054c0.7329,0 1.3229,-0.59 1.3229,-1.3229V4.2332L11.6415,1.0585Z"
android:strokeWidth="0.99998" />
<path
android:fillAlpha="0.35"
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M14.816,4.2331 L11.6411,1.0582v1.852c0,0.7329 0.59,1.3229 1.3229,1.3229z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.1"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m11.641,2.9104v0.1545c0,0.794 0.59,1.433 1.3229,1.433h1.852l0.0001,-0.2646 -1.8522,0c-0.7329,0 -1.3229,-0.59 -1.3229,-1.3229z"
android:strokeWidth="1.0408"
android:strokeAlpha="0.1" />
<path
android:fillColor="#ffffff"
android:pathData="M5.2915,11.1123L11.6414,11.1123L11.6414,5.8207L5.2915,5.8207ZM5.8207,6.3499h1.0583v1.0583h-1.0583zM7.4082,6.3499L11.1123,6.3499v1.0583L7.4082,7.4082ZM5.8207,7.9374h1.0583v1.0583h-1.0583zM7.4082,7.9374L11.1123,7.9374L11.1123,8.9957L7.4082,8.9957ZM5.8207,9.5249h1.0583v1.0583h-1.0583zM7.4082,9.5249L11.1123,9.5249v1.0583L7.4082,10.5832Z"
android:strokeWidth="0.999999" />
</vector>

View File

@@ -0,0 +1,39 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:fillAlpha="0.15"
android:fillColor="#FF000000"
android:fillType="evenOdd"
android:pathData="m60.0011,13.9588c0,-2.77 -2.23,-5 -5,-5l-46.0015,0c-2.77,0 -5,2.23 -5,5l0,38.0001c0,2.77 2.23,5 5,5l39.0017,0l12.0002,-12.0002z"
android:strokeWidth=".26458"
android:strokeAlpha="0.15" />
<path
android:fillColor="#748290"
android:fillType="evenOdd"
android:pathData="m60.0011,12.9999c0,-2.77 -2.23,-5 -5,-5l-46.0015,0c-2.77,0 -5,2.23 -5,5l0,38.0001c0,2.77 2.23,5 5,5l39.0017,0l12.0002,-12.0002z"
android:strokeWidth=".26458" />
<path
android:fillAlpha="0.35"
android:fillColor="#fff"
android:fillType="evenOdd"
android:pathData="m48.0009,55.9986 l11.9999,-11.9999l-6.9998,0c-2.77,0 -5,2.23 -5,5z"
android:strokeAlpha="0.35" />
<path
android:fillAlpha="0.2"
android:fillColor="#fff"
android:pathData="m6.0217,9c-1.2216,0.9099 -2.0215,2.3529 -2.0215,4h4v-4zM55.9997,9v4h4v-0.0371c-0.0119,-1.6316 -0.8074,-3.0598 -2.0195,-3.9629zM3.9997,15.0001v4h4v-4zM55.9997,15.0001v4h4v-4zM3.9997,21.0002v4h4v-4zM55.9997,21.0002v4h4v-4zM3.9997,27.0003v4h4v-4zM55.9997,27.0003v4h4v-4zM3.9997,33.0004v4h4v-4zM55.9997,33.0004v4h4v-4zM3.9997,39.0005v4h4v-4zM55.9997,39.0005v4h4v-4zM3.9997,45.0006v4h4v-4zM3.9997,51.0007c0,1.6471 0.7999,3.0901 2.0215,4h1.9785v-4z"
android:strokeAlpha="0.2" />
<path
android:fillAlpha="0.15"
android:fillColor="#FF000000"
android:pathData="m22.963,22.173c-0.5319,-0.0003 -0.9631,0.4318 -0.9628,0.9647l0,19.7571c-0.0001,0.7329 0.7836,1.1981 1.425,0.8457l18.0748,-9.8784c0.6669,-0.3658 0.6669,-1.3255 0,-1.6914l-16.2682,-8.8911 -1.807,-0.9872c-0.1416,-0.0779 -0.3006,-0.1189 -0.4622,-0.1189z"
android:strokeWidth=".035862"
android:strokeAlpha="0.15" />
<path
android:fillColor="#edeef8"
android:pathData="m22.963,21.156c-0.5319,-0.0003 -0.9631,0.4318 -0.9628,0.9647v19.757c-0.0001,0.7329 0.7836,1.1981 1.425,0.8457l18.075,-9.8784c0.6669,-0.3658 0.6669,-1.3255 0,-1.6914l-16.268,-8.8911 -1.807,-0.9872c-0.1416,-0.0779 -0.3006,-0.1189 -0.4622,-0.1189z"
android:strokeWidth=".13554" />
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M3,16.74L7.76,12L3,7.26L7.26,3L12,7.76L16.74,3L21,7.26L16.24,12L21,16.74L16.74,21L12,16.24L7.26,21L3,16.74M12,13.41L16.74,18.16L18.16,16.74L13.41,12L18.16,7.26L16.74,5.84L12,10.59L7.26,5.84L5.84,7.26L10.59,12L5.84,16.74L7.26,18.16L12,13.41Z" />
</vector>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/id_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:elevation="@dimen/appbar_elevation"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<arte.programar.materialfile.widget.EmptyRecyclerView
android:id="@+id/directory_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/directory_empty_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_gravity="center"
android:contentDescription="@android:string/yes"
android:src="@drawable/ic_app_file" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="sans-serif-medium"
android:text="@string/empty_directory_hint"
android:textColor="@color/empty_directory_hint"
android:textSize="24sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_clickable"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/item_file_image"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="16dp"
android:alpha="0.6"
android:contentDescription="@android:string/no"
android:src="@drawable/ic_app_directory" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/item_file_title"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold" />
<TextView
android:id="@+id/item_file_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty_directory_hint">Prázdná složka</string>
<string name="action_close">Zavřít</string>
<string name="type_archive">Archiv</string>
<string name="type_certificate">Certifikát</string>
<string name="type_directory">Složka</string>
<string name="type_document">Soubor</string>
<string name="type_drawing">Kresba</string>
<string name="type_excel">Tabulka</string>
<string name="type_image">Obrázek</string>
<string name="type_music">Skladba</string>
<string name="type_video">Video</string>
<string name="type_pdf">PDF dokument</string>
<string name="type_power_point">Prezentace</string>
<string name="type_word">Dokument</string>
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty_directory_hint">Leeres Verzeichnis</string>
<string name="action_close">Schließen</string>
<string name="type_archive">Archiv</string>
<string name="type_certificate">Zertifikat</string>
<string name="type_directory">Verzeichnis</string>
<string name="type_document">Dokument</string>
<string name="type_drawing">Bild</string>
<string name="type_excel">Excel Tabelle</string>
<string name="type_image">Bild</string>
<string name="type_music">Musik</string>
<string name="type_video">Video</string>
<string name="type_pdf">PDF Dokument</string>
<string name="type_power_point">Presentation</string>
<string name="type_word">Dokument</string>
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="type_certificate">Certificado</string>
<string name="action_close">Cerrar</string>
<string name="type_archive">Archivo</string>
<string name="empty_directory_hint">Carpeta vacía</string>
<string name="type_directory">Carpeta</string>
<string name="type_document">Archivo</string>
<string name="type_drawing">Foto</string>
<string name="type_excel">Excel</string>
<string name="type_image">Imagen</string>
<string name="type_music">Música</string>
<string name="type_pdf">Documento PDF</string>
<string name="type_power_point">Powerpoint</string>
<string name="type_video">Vídeo</string>
<string name="type_word">Documento Word</string>
</resources>

View File

@@ -0,0 +1,14 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@color/colorPrimaryDarkVariant</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">@color/colorPrimaryDarkVariant</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,14 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@color/colorPrimaryDarkVariant</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">@color/colorPrimaryDarkVariant</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,21 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- Status Bar Icons Light Active -->
<item name="android:windowLightStatusBar">false</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">?attr/colorSurface</item>
<!-- NavigationBar Icons Light Active -->
<item name="android:windowLightNavigationBar">false</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,21 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- Status Bar Icons Light Active -->
<item name="android:windowLightStatusBar">false</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">?attr/colorSurface</item>
<!-- NavigationBar Icons Light Active -->
<item name="android:windowLightNavigationBar">false</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Default Colors -->
<color name="textColorPrimary">#FFFFFFFF</color>
<color name="colorControlHighlight">#33ffffff</color>
<color name="empty_directory_hint">#c7c7c7</color>
<color name="compatibility_pressed_color">#1a000000</color>
<color name="compatibility_focus_color">#48000000</color>
<color name="transparent">#00000000</color>
</resources>

View File

@@ -0,0 +1,15 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base" />
<style name="MaterialFileTheme.Base" parent="Theme.Material3.Dark.NoActionBar">
</style>
<style name="MaterialFileTheme.AppBar" parent="@style/ThemeOverlay.Material3" >
<item name="colorSurface">@android:color/transparent</item>
</style>
<style name="MaterialFileTheme.Toolbar" parent="@style/ThemeOverlay.Material3.Light" />
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty_directory_hint">Файлов нет</string>
<string name="action_close">Закрыть</string>
<string name="type_directory">Каталог</string>
<string name="type_document">Файл</string>
<string name="type_certificate">Сертификат</string>
<string name="type_drawing">Рисунок</string>
<string name="type_excel">Таблица</string>
<string name="type_image">Картинка</string>
<string name="type_music">Аудиофайл</string>
<string name="type_video">Видео</string>
<string name="type_pdf">Документ PDF</string>
<string name="type_power_point">Презентация</string>
<string name="type_word">Документ</string>
<string name="type_archive">Архив</string>
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty_directory_hint">Prázdny priečinok</string>
<string name="action_close">Zavrieť</string>
<string name="type_archive">Archív</string>
<string name="type_certificate">Certifikát</string>
<string name="type_directory">Priečinok</string>
<string name="type_document">Súbor</string>
<string name="type_drawing">Kresba</string>
<string name="type_excel">Tabuľka</string>
<string name="type_image">Obrázok</string>
<string name="type_music">Skladba</string>
<string name="type_video">Video</string>
<string name="type_pdf">PDF dokument</string>
<string name="type_power_point">Prezentácia</string>
<string name="type_word">Dokument</string>
</resources>

View File

@@ -0,0 +1,7 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>

View File

@@ -0,0 +1,14 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@color/colorPrimaryDarkVariant</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">@color/colorPrimaryDarkVariant</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,17 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- Status Bar Icons Light Active -->
<item name="android:windowLightStatusBar">true</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">@color/colorPrimaryDarkVariant</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,21 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- Status Bar Icons Light Active -->
<item name="android:windowLightStatusBar">true</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">?attr/colorSurface</item>
<!-- NavigationBar Icons Light Active -->
<item name="android:windowLightNavigationBar">true</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,21 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base">
<!-- StatusBarColor -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- Status Bar Icons Light Active -->
<item name="android:windowLightStatusBar">true</item>
<!-- NavigationBarColor -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<!-- NavigationBar Icons Light Active -->
<item name="android:windowLightNavigationBar">true</item>
<!-- Flag indicating whether this Window is responsible for drawing the background -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="empty_directory_hint">无可选文件</string>
<string name="action_close"></string>
<string name="type_archive">压缩包</string>
<string name="type_certificate">证书</string>
<string name="type_directory">目录</string>
<string name="type_document">文件</string>
<string name="type_drawing">图片</string>
<string name="type_excel">EXCEL</string>
<string name="type_image">照片</string>
<string name="type_music">音乐</string>
<string name="type_pdf">PDF</string>
<string name="type_power_point">PPT</string>
<string name="type_word">WORD</string>
<string name="type_video">视频</string>
</resources>

View File

@@ -0,0 +1,3 @@
<resources>
<attr name="mfp_toolbar_theme" format="reference" />
</resources>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Default Colors -->
<color name="textColorPrimary">#212121</color>
<color name="colorControlHighlight">#4000695C</color>
<!-- (API 21 Status Bar Color) (API 23 Navigation Bar Color)-->
<color name="colorPrimaryDarkVariant">#8a000000</color>
<color name="empty_directory_hint">#c7c7c7</color>
<color name="compatibility_pressed_color">#1a000000</color>
<color name="compatibility_focus_color">#48000000</color>
<color name="transparent">#00000000</color>
</resources>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Toolbar, 4 dp baseline, https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-baseline-grids -->
<dimen name="appbar_elevation">4dp</dimen>
</resources>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="file_picker_app_name" translatable="false">MaterialFilePicker</string>
<string name="action_close">Close</string>
<string name="empty_directory_hint">Empty directory</string>
<string name="type_archive">Archive</string>
<string name="type_certificate">Certificate</string>
<string name="type_directory">Directory</string>
<string name="type_document">File</string>
<string name="type_drawing">Picture</string>
<string name="type_excel">Spreadsheet</string>
<string name="type_image">Image</string>
<string name="type_music">Music</string>
<string name="type_video">Video</string>
<string name="type_pdf">PDF document</string>
<string name="type_power_point">Presentation</string>
<string name="type_word">Document</string>
<string name="type_apk" translatable="false">APK</string>
<string name="type_json" translatable="false">JSON</string>
</resources>

View File

@@ -0,0 +1,14 @@
<resources>
<style name="MaterialFileTheme" parent="MaterialFileTheme.Base" />
<style name="MaterialFileTheme.Base" parent="Theme.Material3.Dark.NoActionBar">
</style>
<style name="MaterialFileTheme.AppBar" parent="@style/ThemeOverlay.Material3.Dark">
</style>
<style name="MaterialFileTheme.Toolbar" parent="@style/ThemeOverlay.Material3" />
</resources>

View File

@@ -1,4 +1,4 @@
include ':smarttubetv', ':common', ':chatkit', ':leanbackassistant', ':leanback-1.0.0', ':fragment-1.1.0'
include ':smarttubetv', ':common', ':chatkit', ':leanbackassistant', ':leanback-1.0.0', ':fragment-1.1.0', ':filepicker-lib'
def rootDir = settingsDir