Skip to content

Commit

Permalink
compress apk with r8 and more
Browse files Browse the repository at this point in the history
  • Loading branch information
dhino12 committed Feb 9, 2023
1 parent 671d529 commit 6fdd5e4
Show file tree
Hide file tree
Showing 25 changed files with 37 additions and 251 deletions.
Binary file added Food Application.zip
Binary file not shown.
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'androidx.navigation.safeargs.kotlin'
}

apply from: '../shared_dependencies.gradle'
Expand All @@ -24,7 +23,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -50,7 +49,7 @@ android {
dependencies {
implementation project(":core")

implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0"
implementation "com.airbnb.android:lottie:$lottie_version"

}
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.foodapplication",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
16 changes: 8 additions & 8 deletions app/src/main/java/com/example/foodapplication/ui/RecipeApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ fun RecipeApp (
navArgument("title") { type = NavType.StringType }
),
) {
val idCooking = it.arguments?.getString("foodId") ?: null
val titleCooking = it.arguments?.getString("title") ?: null
val idCooking = it.arguments?.getString("foodId")
val titleCooking = it.arguments?.getString("title")

LaunchedEffect(key1 = true ) {
val intent = Intent(context, DetailFoodActivity::class.java)
Expand All @@ -201,17 +201,17 @@ fun RecipeApp (
navArgument("title") { type = NavType.StringType },
)
) {
val idArticle = it.arguments?.getString("articleId") ?: null
val tagArticle = it.arguments?.getString("tag") ?: null
val titleArticle = it.arguments?.getString("title") ?: null
val context = LocalContext.current as Activity
val idArticle = it.arguments?.getString("articleId")
val tagArticle = it.arguments?.getString("tag")
val titleArticle = it.arguments?.getString("title")
val ctx = LocalContext.current as Activity
if (idArticle != null) {
LaunchedEffect(key1 = true) {
val intent = Intent(context, DetailFoodActivity::class.java)
val intent = Intent(ctx, DetailFoodActivity::class.java)
intent.putExtra(DetailFoodActivity.EXTRA_ARTICLE_ID, idArticle)
intent.putExtra(DetailFoodActivity.EXTRA_ARTICLE_TAG, tagArticle)
intent.putExtra(DetailFoodActivity.EXTRA_ARTICLE_TITLE, titleArticle)
context.startActivity(intent)
ctx.startActivity(intent)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
Expand All @@ -33,7 +32,6 @@ fun ItemFoodsVertical(
time: String? = null,
difficulty: String? = null,
tags: String? = null,
brush: Brush? = null,
OnItemClick: () -> Unit,
) {
Card(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DetailViewModel(private val foodUseCase: FoodUseCase) : ViewModel() {
foodUseCase.getDetailCooking(title).asLiveData()
}

var articleDetail: LiveData<Resource<Article>> = Transformations.switchMap(titleArticle) { title ->
var articleDetail: LiveData<Resource<Article>> = Transformations.switchMap(titleArticle) {
foodUseCase.getArticleDetail(titleArticle.value!!).asLiveData()
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class DataToView(

private fun getActionBarSize(): Int {
val typedValue = TypedValue()
val textSizeAttr = intArrayOf(com.google.android.material.R.attr.actionBarSize)
val textSizeAttr = intArrayOf(androidx.constraintlayout.widget.R.attr.actionBarSize)
val indexOfAttrTextSize = 0
val a = context.obtainStyledAttributes(typedValue.data, textSizeAttr)
val actionBarSize = a.getDimensionPixelSize(indexOfAttrTextSize, -1)
Expand Down
Binary file removed app/src/main/res/drawable/foodrecipies.png
Binary file not shown.
Empty file modified app/src/main/res/drawable/ic_baseline_search_24.xml
100755 → 100644
Empty file.
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_dashboard_black_24dp.xml

This file was deleted.

9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_home_black_24dp.xml

This file was deleted.

Binary file removed app/src/main/res/drawable/nothing_page.png
Binary file not shown.
Binary file removed app/src/main/res/drawable/random.png
Binary file not shown.
Binary file removed app/src/main/res/drawable/search_not_founds.png
Binary file not shown.
11 changes: 0 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,5 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />

</androidx.constraintlayout.widget.ConstraintLayout>
19 changes: 0 additions & 19 deletions app/src/main/res/menu/bottom_nav_menu.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/values-land/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
<!-- <dimen name="fab_margin">48dp</dimen>-->
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-w1240dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<dimen name="fab_margin">200dp</dimen>
<!-- <dimen name="fab_margin">200dp</dimen>-->
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-w600dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<dimen name="fab_margin">48dp</dimen>
<!-- <dimen name="fab_margin">48dp</dimen>-->
</resources>
8 changes: 0 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,10 @@ buildscript {
sql_lite_chiper_version = '2.3.0'
sql_chiper_version = '4.5.3'
}

dependencies {
def nav_version = "2.4.2"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
}
}

plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false

id 'androidx.navigation.safeargs.kotlin' version '2.4.1' apply false
id 'com.android.dynamic-feature' version '7.4.0' apply false
}
3 changes: 1 addition & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'androidx.navigation.safeargs.kotlin'
}

apply from: '../shared_dependencies.gradle'
Expand All @@ -22,7 +21,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
Loading

0 comments on commit 6fdd5e4

Please sign in to comment.