Skip to content

Commit

Permalink
Merge pull request #36 from roozbehzarei/dev
Browse files Browse the repository at this point in the history
Release v2.2.0
  • Loading branch information
roozbehzarei authored Dec 12, 2023
2 parents 0fd00af + 7ddf263 commit 58f679e
Show file tree
Hide file tree
Showing 33 changed files with 901 additions and 307 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://www.buymeacoffee.com/roozbehzarei
custom: https://roozbehzarei.me/
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@
</a>
</p>

Filester lets you share files with everyone, everywhere, whenever you want! Imagine a cloud storage
app that doesn't show ads, collect your data nor require creating an account! With Filester, you're
always one click away from uploading infinite huge files to the internet and share them with the
world.
Filester is the ultimate cloud storage app for Android. No annoying ads, no sneaky data collection, no account required! Just one click and you’re ready to go.

**Features:**

* Free for use
* No-logs policy
* All formats supported
* Privacy-friendly
* All file formats supported
* No size limitations
* Multilingual
* Runs on Android 5.0 and later

![screenshots](https://user-images.githubusercontent.com/55883200/190531625-88746a7e-bf8b-4feb-840f-dc4d6f6d8480.png)
Expand Down Expand Up @@ -60,8 +58,7 @@ the [releases section](https://github.com/roozbehzarei/filester/releases/latest)

## Contributors

* [Ahoora Fakhrian](https://linktr.ee/ahoora) (logo design)
* [Artin Fakhrian](https://linktr.ee/artin_fakhrian) (logo design)
* [Ahoora Fakhrian](https://www.linkedin.com/in/ahoorafakhrian) (logo design)
* [Open source community](https://github.com/roozbehzarei/filester/graphs/contributors)

## License
Expand Down
39 changes: 21 additions & 18 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ plugins {

android {
namespace = "com.roozbehzarei.filester"
compileSdk = 33
compileSdk = 34

defaultConfig {
applicationId = "com.roozbehzarei.filester"
minSdk = 21
targetSdk = 33
versionCode = 4
versionName = "2.1.0"
targetSdk = 34
versionCode = 5
versionName = "2.2.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -26,21 +26,21 @@ android {
viewBinding = true
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
androidResources {
generateLocaleConfig = true
}
Expand All @@ -54,6 +54,7 @@ dependencies {
val retrofitVersion = "2.9.0"
val workVersion = "2.8.1"
val roomVersion = "2.5.2"
val preferenceVersion = "1.2.0"

implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.appcompat:appcompat:1.6.1")
Expand Down Expand Up @@ -85,4 +86,6 @@ dependencies {
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation("com.google.firebase:firebase-perf-ktx")
// Preference
implementation("androidx.preference:preference-ktx:$preferenceVersion")
}
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 4,
"versionName": "2.1.0",
"versionCode": 5,
"versionName": "2.2.0",
"outputFile": "app-release.apk"
}
],
Expand Down
21 changes: 19 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,36 @@
android:supportsRtl="true"
android:theme="@style/Theme.Filester.Starting">

<receiver
android:name=".FilesterBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="FILESTER_STOP_UPLOAD" />
</intent-filter>
</receiver>

<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />

<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>

<meta-data
android:name="firebase_performance_logcat_enabled"
android:value="true" />

<activity
android:name=".ui.MainActivity"
android:launchMode="singleTask"
android:exported="true">
android:exported="true"
android:launchMode="singleTask">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.roozbehzarei.filester

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import androidx.work.WorkManager
import com.roozbehzarei.filester.viewmodel.KEY_WORK

class FilesterBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent?.action == "FILESTER_STOP_UPLOAD") {
val workManager = context?.let { WorkManager.getInstance(it) }
workManager?.cancelUniqueWork(KEY_WORK)
}
}
}
36 changes: 32 additions & 4 deletions app/src/main/java/com/roozbehzarei/filester/HistoryListAdapter.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
package com.roozbehzarei.filester

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.roozbehzarei.filester.database.File
import com.roozbehzarei.filester.databinding.FileItemViewBinding

class HistoryListAdapter(private val onItemClicked: (File) -> Unit) :
class HistoryListAdapter(private val onItemClicked: (File, Int?) -> Unit) :
ListAdapter<File, HistoryListAdapter.FileViewHolder>(DiffCallback()) {

private lateinit var binding: FileItemViewBinding
private var selectedItemPosition: Int? = null

class FileViewHolder(private val binding: FileItemViewBinding) :
inner class FileViewHolder(private val binding: FileItemViewBinding) :
RecyclerView.ViewHolder(binding.root) {
fun bind(item: File) {
binding.apply {
with(binding) {
textName.text = item.fileName
textSize.text = item.fileSize.toString() + " MB"
if (root.isSelected) {
itemLayoutDivider.visibility = View.VISIBLE
itemActionsLayout.visibility = View.VISIBLE
} else {
itemLayoutDivider.visibility = View.GONE
itemActionsLayout.visibility = View.GONE
}
itemShareViewHolder.setOnClickListener {
onItemClicked(item, 0)
}
itemCopyViewHolder.setOnClickListener {
onItemClicked(item, 1)
}
itemDeleteViewHolder.setOnClickListener {
onItemClicked(item, 2)
}
}
}
}
Expand All @@ -31,8 +49,18 @@ class HistoryListAdapter(private val onItemClicked: (File) -> Unit) :

override fun onBindViewHolder(holder: FileViewHolder, position: Int) {
val currentItem = getItem(position)
holder.itemView.isSelected = selectedItemPosition == holder.adapterPosition
holder.itemView.setOnClickListener {
onItemClicked(currentItem)
selectedItemPosition = if (it.isSelected) {
null
} else {
selectedItemPosition?.let { position ->
notifyItemChanged(position)
}
holder.adapterPosition
}
onItemClicked(currentItem, null)
notifyItemChanged(position)
}
holder.bind(currentItem)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.roozbehzarei.filester.database

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
Expand All @@ -15,4 +16,7 @@ interface FileDao {
@Query("SELECT * FROM file")
fun getAll(): Flow<List<File>>

@Delete
suspend fun delete(file: File)

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.roozbehzarei.filester.database

data class MainUiState(
// A pair of file name and its deletion status
val isFileDeleted: Boolean = false
)
29 changes: 15 additions & 14 deletions app/src/main/java/com/roozbehzarei/filester/ui/AboutFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ import com.roozbehzarei.filester.BuildConfig
import com.roozbehzarei.filester.R
import com.roozbehzarei.filester.databinding.FragmentAboutBinding

private const val GITHUB_URL = "https://roozbehzarei.me/project/filester/"
private const val DONATE_URL = "https://www.buymeacoffee.com/roozbehzarei/"
private const val TRANSFER_URL = "https://transfer.sh/"
private const val WEBSITE_URL = "https://roozbehzarei.me/project/filester"
private const val DONATE_URL = "https://roozbehzarei.me/donate"
private const val PRIVACY_POLICY_URL = "https://roozbehzarei.me/filester/privacy-policy"

class AboutFragment : Fragment() {

// Binding object instance with access to the views in the fragment_about.xml layout
private lateinit var binding: FragmentAboutBinding

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View {
// Inflate the layout XML file and return a binding object instance
binding = FragmentAboutBinding.inflate(inflater, container, false)
Expand All @@ -35,24 +33,27 @@ class AboutFragment : Fragment() {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.linkDonation.setOnClickListener {
openLink(DONATE_URL)

binding.websiteViewHolder.setOnClickListener {
openLink(WEBSITE_URL)
}
binding.linkWebsite.setOnClickListener {
openLink(GITHUB_URL)

binding.donateViewHolder.setOnClickListener {
openLink(DONATE_URL)
}
binding.linkTransfer.setOnClickListener {
openLink(TRANSFER_URL)

binding.privacyPolicyViewHolder.setOnClickListener {
openLink(PRIVACY_POLICY_URL)
}

}

/**
* Open the passed [url] in browser
*/
private fun openLink(url: String) {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse(url)
Intent.ACTION_VIEW, Uri.parse(url)
)
startActivity(intent)
}
Expand Down
Loading

0 comments on commit 58f679e

Please sign in to comment.