-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/4.0' into update-contribution-guidelines
- Loading branch information
Showing
162 changed files
with
3,974 additions
and
1,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
`v3.8.5` supports Android 4.0 and above. | ||
`v4.x.x` would only support Android 4.4 and above. | ||
|
||
Andorid devices that runs Android versions less that Android 4.4 | ||
(Android KitKat) would not recieve any more updates (the latest | ||
supported version would be `v3.8.5`). | ||
|
||
## Reporting a Vulnerability | ||
|
||
Feel free to contact us via `[email protected]`. | ||
- please CC the maintainers too: `[email protected]` `[email protected]` `[email protected]` `[email protected]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,10 +53,10 @@ | |
import android.view.ViewGroup; | ||
import android.view.animation.Animation; | ||
import android.view.animation.AnimationUtils; | ||
import android.widget.ImageButton; | ||
import android.widget.ImageView; | ||
import android.widget.Toast; | ||
|
||
import androidx.appcompat.widget.AppCompatImageButton; | ||
import androidx.appcompat.widget.AppCompatImageView; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
/** Created by Arpit on 25-01-2015 edited by Emmanuel Messulam<[email protected]> */ | ||
|
@@ -127,7 +127,7 @@ public ArrayList<Integer> getCheckedItemPositions() { | |
* @param position the position of the item | ||
* @param imageView the circular {@link CircleGradientDrawable} that is to be animated | ||
*/ | ||
private void toggleChecked(int position, ImageView imageView) { | ||
private void toggleChecked(int position, AppCompatImageView imageView) { | ||
compressedExplorerFragment.stopAnim(); | ||
stoppedAnimation = true; | ||
|
||
|
@@ -204,7 +204,7 @@ public CompressedItemViewHolder onCreateViewHolder(ViewGroup parent, int viewTyp | |
} else if (viewType == TYPE_ITEM) { | ||
View v = mInflater.inflate(R.layout.rowlayout, parent, false); | ||
CompressedItemViewHolder vh = new CompressedItemViewHolder(v); | ||
ImageButton about = v.findViewById(R.id.properties); | ||
AppCompatImageButton about = v.findViewById(R.id.properties); | ||
about.setVisibility(View.INVISIBLE); | ||
return vh; | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
app/src/main/java/com/amaze/filemanager/adapters/SearchRecyclerViewAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* Copyright (C) 2014-2023 Arpit Khurana <[email protected]>, Vishal Nehra <[email protected]>, | ||
* Emmanuel Messulam<[email protected]>, Raymond Lai <airwave209gt at gmail.com> and Contributors. | ||
* | ||
* This file is part of Amaze File Manager. | ||
* | ||
* Amaze File Manager is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.amaze.filemanager.adapters | ||
|
||
import android.content.Context | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.appcompat.widget.AppCompatTextView | ||
import androidx.core.content.ContextCompat | ||
import androidx.recyclerview.widget.DiffUtil | ||
import androidx.recyclerview.widget.ListAdapter | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.amaze.filemanager.R | ||
import com.amaze.filemanager.application.AppConfig | ||
import com.amaze.filemanager.filesystem.HybridFileParcelable | ||
import com.amaze.filemanager.ui.activities.MainActivity | ||
import com.amaze.filemanager.ui.colors.ColorPreference | ||
import java.util.Random | ||
|
||
class SearchRecyclerViewAdapter : | ||
ListAdapter<HybridFileParcelable, SearchRecyclerViewAdapter.ViewHolder>( | ||
|
||
object : DiffUtil.ItemCallback<HybridFileParcelable>() { | ||
override fun areItemsTheSame( | ||
oldItem: HybridFileParcelable, | ||
newItem: HybridFileParcelable | ||
): Boolean { | ||
return oldItem.path == newItem.path && oldItem.name == newItem.name | ||
} | ||
|
||
override fun areContentsTheSame( | ||
oldItem: HybridFileParcelable, | ||
newItem: HybridFileParcelable | ||
): Boolean { | ||
return oldItem.path == newItem.path && oldItem.name == newItem.name | ||
} | ||
} | ||
) { | ||
override fun onCreateViewHolder(parent: ViewGroup, type: Int): ViewHolder { | ||
val v: View = LayoutInflater.from(parent.context) | ||
.inflate(R.layout.search_row_item, parent, false) | ||
return ViewHolder(v) | ||
} | ||
|
||
override fun onBindViewHolder(holder: SearchRecyclerViewAdapter.ViewHolder, position: Int) { | ||
val item = getItem(position) | ||
|
||
holder.fileNameTV.text = item.name | ||
holder.filePathTV.text = item.path.substring(0, item.path.lastIndexOf("/")) | ||
|
||
holder.colorView.setBackgroundColor(getRandomColor(holder.colorView.context)) | ||
|
||
val colorPreference = | ||
(AppConfig.getInstance().mainActivityContext as MainActivity).currentColorPreference | ||
|
||
if (item.isDirectory) { | ||
holder.colorView.setBackgroundColor(colorPreference.primaryFirstTab) | ||
} else { | ||
holder.colorView.setBackgroundColor(colorPreference.accent) | ||
} | ||
} | ||
|
||
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { | ||
|
||
val fileNameTV: AppCompatTextView | ||
val filePathTV: AppCompatTextView | ||
val colorView: View | ||
|
||
init { | ||
|
||
fileNameTV = view.findViewById(R.id.searchItemFileNameTV) | ||
filePathTV = view.findViewById(R.id.searchItemFilePathTV) | ||
colorView = view.findViewById(R.id.searchItemSampleColorView) | ||
|
||
view.setOnClickListener { | ||
|
||
val item = getItem(adapterPosition) | ||
|
||
if (!item.isDirectory) { | ||
item.openFile( | ||
AppConfig.getInstance().mainActivityContext as MainActivity?, | ||
false | ||
) | ||
} else { | ||
(AppConfig.getInstance().mainActivityContext as MainActivity?) | ||
?.goToMain(item.path) | ||
} | ||
|
||
(AppConfig.getInstance().mainActivityContext as MainActivity?) | ||
?.appbar?.searchView?.hideSearchView() | ||
} | ||
} | ||
} | ||
|
||
private fun getRandomColor(context: Context): Int { | ||
return ContextCompat.getColor( | ||
context, | ||
ColorPreference.availableColors[ | ||
Random().nextInt( | ||
ColorPreference.availableColors.size - 1 | ||
) | ||
] | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.