Skip to content

Commit

Permalink
Merge pull request #11 from frogobox/develop/android-ci-enhance-update
Browse files Browse the repository at this point in the history
DEVELOP :: Update android CI
  • Loading branch information
amirisback authored Jun 15, 2023
2 parents d7bc29d + a8834ea commit d77ce7c
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/android-ci-generated-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
Expand All @@ -30,9 +30,11 @@ jobs:
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
Expand All @@ -35,9 +35,11 @@ jobs:
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew
Expand All @@ -48,13 +50,4 @@ jobs:

# Run Build Project
- name: Build gradle project
run: ./gradlew build

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDebug

# Create Bundle AAB Release
# Noted for main module build [main_project_module]:bundleRelease
- name: Build app bundle release (AAB) - ${{ env.main_project_module }} module
run: ./gradlew ${{ env.main_project_module }}:bundleRelease
run: ./gradlew build
19 changes: 15 additions & 4 deletions app/src/main/java/com/frogobox/webview/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.frogobox.webview.ui.main

import android.os.Bundle
import com.frogobox.sdk.ext.gone
import com.frogobox.sdk.ext.showLogD
import com.frogobox.sdk.ext.visible
import com.frogobox.webview.ConfigApp
import com.frogobox.webview.ConfigApp.URL_LINK_WEBSITE
Expand Down Expand Up @@ -54,9 +53,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
})
}

private fun setupUI() {
private fun setupLoadWeb() {
binding.apply {

mainWebview.loadUrlExt(URL_LINK_WEBSITE, object : WebViewCallback {

override fun onShowProgress() {
Expand All @@ -78,11 +76,24 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {

override fun onFailed() {
// Activate this if you want failed view
// containerFailedView.failedView.visible()
containerFailedView.failedView.visible()
}

})
}
}

private fun setupUI() {
binding.apply {

containerFailedView.ivClose.setOnClickListener {
containerFailedView.failedView.gone()
setupLoadWeb()
}

setupLoadWeb()
}

}

}
4 changes: 2 additions & 2 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:width="64dp"
android:height="64dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_failed_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="64dp" android:viewportHeight="511.76"
android:viewportWidth="511.76" android:width="64dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M436.9,74.87c-99.84,-99.82 -262.21,-99.82 -362.05,0c-99.8,99.82 -99.8,262.23 0,362.05c49.92,49.9 115.48,74.84 181.04,74.84s131.09,-24.94 181.01,-74.84C536.72,337.1 536.72,174.69 436.9,74.87zM361.46,331.32c8.34,8.34 8.34,21.82 0,30.17c-4.16,4.16 -9.62,6.25 -15.08,6.25c-5.46,0 -10.92,-2.09 -15.08,-6.25l-75.41,-75.43l-75.39,75.41c-4.18,4.16 -9.64,6.25 -15.08,6.25c-5.46,0 -10.92,-2.09 -15.08,-6.25c-8.34,-8.34 -8.34,-21.84 0,-30.17l75.39,-75.41l-75.41,-75.41c-8.34,-8.34 -8.34,-21.84 0,-30.17c8.32,-8.34 21.82,-8.34 30.17,0l75.41,75.41l75.41,-75.41c8.34,-8.34 21.82,-8.34 30.17,0c8.34,8.32 8.34,21.82 0,30.17l-75.41,75.41L361.46,331.32z"/>
</vector>
30 changes: 30 additions & 0 deletions app/src/main/res/drawable/ic_failed_web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M322.94,62.64l178.74,309.58C508.23,383.58 512,396.74 512,410.79c0,42.67 -34.59,77.26 -77.26,77.26H256L194.19,256L256,23.95C284.62,23.95 309.59,39.52 322.94,62.64z"
android:fillColor="#3B4145"/>
<path
android:pathData="M189.06,62.64L10.32,372.23C3.77,383.58 0,396.74 0,410.79c0,42.67 34.59,77.26 77.26,77.26H256V23.95C227.38,23.95 202.41,39.52 189.06,62.64z"
android:fillColor="#525A61"/>
<path
android:pathData="M474.91,387.68L296.18,78.1c-8.06,-13.96 -22.85,-22.77 -38.85,-23.22l152.87,402.27h24.54c25.56,0 46.36,-20.8 46.36,-46.36C481.1,402.68 478.95,394.68 474.91,387.68z"
android:fillColor="#FFB751"/>
<path
android:pathData="M444.85,387.68c3.49,7.01 5.34,15 5.34,23.12c0,25.56 -17.93,46.36 -39.99,46.36H77.26c-25.56,0 -46.36,-20.8 -46.36,-46.36c0,-8.12 2.14,-16.11 6.18,-23.12l178.74,-309.58c8.28,-14.34 23.67,-23.25 40.18,-23.25c0.44,0 0.89,0.01 1.33,0.03c13.73,0.54 26.41,9.32 33.33,23.22L444.85,387.68z"
android:fillColor="#FFD764"/>
<path
android:pathData="M256,354.13v51.51c14.23,0 25.75,-11.53 25.75,-25.75C281.76,365.66 270.23,354.13 256,354.13z"
android:fillColor="#3B4145"/>
<path
android:pathData="M256,354.13c2.84,0 5.15,11.53 5.15,25.75c0,14.23 -2.31,25.75 -5.15,25.75c-14.23,0 -25.75,-11.53 -25.75,-25.75C230.24,365.66 241.77,354.13 256,354.13z"
android:fillColor="#525A61"/>
<path
android:pathData="M256,132.65V323.23c14.23,0 25.75,-11.54 25.75,-25.75V158.4C281.76,144.17 270.23,132.65 256,132.65z"
android:fillColor="#3B4145"/>
<path
android:pathData="M256,132.65c2.84,0 5.15,11.53 5.15,25.75v139.07c0,14.22 -2.31,25.75 -5.15,25.75c-14.23,0 -25.75,-11.54 -25.75,-25.75V158.4C230.24,144.17 241.77,132.65 256,132.65z"
android:fillColor="#525A61"/>
</vector>
42 changes: 36 additions & 6 deletions app/src/main/res/layout/view_failed.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/failed_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:src="@drawable/ic_frogo_cracked" />
android:id="@+id/iv_close"
android:layout_width="@dimen/frogo_dimen_24dp"
android:layout_height="@dimen/frogo_dimen_24dp"
android:layout_marginBottom="@dimen/frogo_dimen_16dp"
android:src="@drawable/ic_failed_close"
app:layout_constraintBottom_toTopOf="@id/container_failed_view"
app:layout_constraintEnd_toEndOf="@id/container_failed_view" />

</RelativeLayout>
<LinearLayout
android:id="@+id/container_failed_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="@dimen/frogo_dimen_64dp"
android:layout_height="@dimen/frogo_dimen_64dp"
android:src="@drawable/ic_failed_web" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Internal Server Error"
android:textColor="@color/frogoColorBlack"
android:textSize="@dimen/frogo_dimen_font_16sp" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
7 changes: 4 additions & 3 deletions app/src/main/res/layout/view_progress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
android:id="@+id/progress_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="gone">

<ProgressBar
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" />
android:layout_width="@dimen/frogo_dimen_64dp"
android:layout_height="@dimen/frogo_dimen_64dp"
android:layout_centerInParent="true" />

</RelativeLayout>

0 comments on commit d77ce7c

Please sign in to comment.