Skip to content

Commit

Permalink
Improved the github repo style and more
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai-Cristian Condrea committed May 4, 2024
1 parent fd4dc04 commit a116a19
Show file tree
Hide file tree
Showing 25 changed files with 386 additions and 255 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: D4rK7355608
patreon: patreon.com/D4rK7355608
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage me"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: checkboxes
attributes:
label: Is there a StackOverflow question about this issue?
description: Please search StackOverflow if an issue with an answer already exists for the bug you encountered.
options:
- label: I have searched StackOverflow
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant logcat output
description: Please copy and paste any relevant logcat output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our Code of Conduct
options:
- label: I agree to follow this project's Code of Conduct
required: true
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Feature request
description: File a feature request
title: "[FR]: "
labels: ["enhancement", "triage me"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for this feature request.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: describe-problem
attributes:
label: Describe the problem
description: Is your feature request related to a problem? Please describe.
placeholder: I'm always frustrated when...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution
description: Please describe the solution you'd like. A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: weekly
time: "11:00"
open-pull-requests-limit: 10
26 changes: 26 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Android CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
12 changes: 5 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ dependencies {
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.runtime)
implementation(libs.androidx.runtime)
implementation(libs.androidx.runtime.livedata)
implementation(libs.androidx.runtime.rxjava2)
implementation(libs.androidx.ui.tooling.preview)
Expand All @@ -128,12 +129,16 @@ dependencies {
implementation(libs.material)
implementation(libs.app.update.ktx)
implementation(libs.review.ktx)

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics.ktx)
implementation(libs.firebase.perf)

// Image Compression
implementation(libs.compressor)
implementation(libs.glide)

// Test
testImplementation(libs.junit)
Expand All @@ -147,11 +152,4 @@ dependencies {
// TODO: Clean-up
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.gridlayout:gridlayout:1.0.0")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("com.airbnb.android:lottie:6.4.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("dev.shreyaspatil.MaterialDialog:MaterialDialog:2.2.3")
implementation("me.zhanghai.android.fastscroll:library:1.3.0")
}
Binary file not shown.
Binary file not shown.
Binary file added app/release/com.d4rk.cleaner-v1.0.0-release.apk
Binary file not shown.
37 changes: 37 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.d4rk.cleaner",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 68,
"versionName": "1.0.0",
"outputFile": "com.d4rk.cleaner-v1.0.0-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/com.d4rk.cleaner-v1.0.0-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/com.d4rk.cleaner-v1.0.0-release.dm"
]
}
],
"minSdkVersionForDexing": 26
}
5 changes: 1 addition & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@

<activity
android:name=".ui.support.SupportActivity"
android:exported="true"
android:label="@string/support_us"
android:parentActivityName=".MainActivity"
android:theme="@style/AppThemeNoActionBar" />
android:parentActivityName=".MainActivity" />

<activity
android:name=".ui.whitelist.WhitelistActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import androidx.constraintlayout.compose.ConstraintLayout
import com.d4rk.cleaner.BuildConfig
import com.d4rk.cleaner.R
import com.d4rk.cleaner.utils.Utils
import com.d4rk.cleaner.utils.bounceClick
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity

@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -149,6 +150,7 @@ fun HelpComposable(activity: HelpActivity) {
},
modifier = Modifier
.padding(6.dp)
.bounceClick()
.constrainAs(fabButton) {
bottom.linkTo(parent.bottom)
end.linkTo(parent.end)
Expand Down
54 changes: 4 additions & 50 deletions app/src/main/kotlin/com/d4rk/cleaner/ui/home/HomeComposable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ package com.d4rk.cleaner.ui.home
import android.content.Context
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.interaction.MutableInteractionSource
Expand Down Expand Up @@ -45,11 +41,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -59,8 +53,8 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.d4rk.cleaner.R
import com.d4rk.cleaner.ui.startup.StartupActivity
import com.d4rk.cleaner.utils.Utils
import com.d4rk.cleaner.utils.bounceClick
import com.google.common.io.Files.getFileExtension
import kotlinx.coroutines.launch
import java.io.File

@Composable
Expand All @@ -71,9 +65,6 @@ fun HomeComposable() {
val storageUsed by viewModel.storageUsed.observeAsState("0")
val storageTotal by viewModel.storageTotal.observeAsState("0")
val showCleaningComposable = remember { mutableStateOf(false) }
val scaleClean = remember { Animatable(1f) }
val scaleAnalyze = remember { Animatable(1f) }
val coroutineScope = rememberCoroutineScope()
Column(
modifier = Modifier.fillMaxSize()
) {
Expand Down Expand Up @@ -116,27 +107,8 @@ fun HomeComposable() {
.weight(1f)
.fillMaxHeight()
.padding(start = 16.dp , end = 8.dp)
.graphicsLayer(
scaleX = scaleClean.value,
scaleY = scaleClean.value
),
.bounceClick(),
onClick = {
coroutineScope.launch {
scaleClean.animateTo(
targetValue = 0.9f,
animationSpec = tween(
durationMillis = 100,
easing = FastOutSlowInEasing
)
)
scaleClean.animateTo(
targetValue = 1f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioMediumBouncy,
stiffness = Spring.StiffnessLow
)
)
}
Utils.openActivity(
context , StartupActivity::class.java
)
Expand All @@ -163,27 +135,8 @@ fun HomeComposable() {
.weight(1f)
.fillMaxHeight()
.padding(start = 8.dp , end = 16.dp)
.graphicsLayer(
scaleX = scaleAnalyze.value,
scaleY = scaleAnalyze.value
),
.bounceClick(),
onClick = {
coroutineScope.launch {
scaleAnalyze.animateTo(
targetValue = 0.9f,
animationSpec = tween(
durationMillis = 100,
easing = FastOutSlowInEasing
)
)
scaleAnalyze.animateTo(
targetValue = 1f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioMediumBouncy,
stiffness = Spring.StiffnessLow
)
)
}
viewModel.analyze()
showCleaningComposable.value = true
},
Expand Down Expand Up @@ -341,6 +294,7 @@ fun SelectAllComposable(
) {
val interactionSource = remember { MutableInteractionSource() }
FilterChip(
modifier = Modifier.bounceClick(),
selected = checked ,
onClick = {
onCheckedChange(! checked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StartupActivity : ComponentActivity() {
Surface(
modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background
) {
StartupComposable(this@StartupActivity)
StartupComposable()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ import androidx.compose.ui.unit.dp
import com.d4rk.cleaner.MainActivity
import com.d4rk.cleaner.R
import com.d4rk.cleaner.utils.Utils
import com.d4rk.cleaner.utils.bounceClick

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun StartupComposable(activity: StartupActivity) {
fun StartupComposable() {
val context = LocalContext.current
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(rememberTopAppBarState())
Scaffold(modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), topBar = {
Expand Down Expand Up @@ -77,7 +78,9 @@ fun StartupComposable(activity: StartupActivity) {
)
}
}
ExtendedFloatingActionButton(modifier = Modifier.align(Alignment.BottomEnd),
ExtendedFloatingActionButton(modifier = Modifier
.align(Alignment.BottomEnd)
.bounceClick(),
text = { Text(stringResource(R.string.agree)) },
onClick = {
Utils.openActivity(
Expand Down
Loading

0 comments on commit a116a19

Please sign in to comment.