turbo-native-initializer 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b02a10e9fb3bdea77c7546d6a5c7ae4da7753f86232af13a88b53725a47d67f
4
- data.tar.gz: 7be945f9a4ba16207cd4f69f9b5f56067d78f1a0dfc720f45a77c18b3d420b24
3
+ metadata.gz: b53ab2cde5fe6c5047f4cc6cfa2c8a21e217c2b226a245ba117cc110019b80ec
4
+ data.tar.gz: 7b510f82816f0ed55f4e41fc272715f14f2cc25eb44577cf9db36d0c77056504
5
5
  SHA512:
6
- metadata.gz: 7941d020b629c6ac4d2c754e666274758b972af5cb3c2481a777017f461571f6201e3fe9ba0bbe3b26bcc3baa96df7df6f9561f2a4e23327654eeb08e1a7e83a
7
- data.tar.gz: 8a0a7ce879c65945d50209d54a19535cfcb9048ed2429f79dce9ab7a6d28acabee63dc11ce6296b095fa213f9245667e60e50d8a98690e5f54fe7e1c868108df
6
+ metadata.gz: e1360efb27d8f42574fab4dcb862367a8d236f4f4c9ab9ffb452024d8a9abc8d97f99a6a5b8813e5124056828bdfed21ce9140868ac1ecb41465e78c7346a949
7
+ data.tar.gz: 62c9cfa365fcdff7053d0c7b09c148fd2d6b098113f7655801d01ee8ef39d3df4a94613fc4150ad9f875905b250a32d9770e4c205678b7b5229e19d8633e4e7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.5] - 2023-09-10
4
+
5
+ - Added android custom error screen
6
+
3
7
  ## [0.0.4] - 2023-09-09
4
8
 
5
9
  - Added accent color (iOS)
@@ -15,4 +15,8 @@ open class WebFragment : TurboWebFragment(), NavDestination {
15
15
  else -> super.onVisitErrorReceived(location, errorCode)
16
16
  }
17
17
  }
18
+
19
+ override fun createErrorView(statusCode: Int): View {
20
+ return layoutInflater.inflate(R.layout.error_web, null)
21
+ }
18
22
  }
@@ -0,0 +1,7 @@
1
+ <vector android:height="24dp" android:tint="@color/color_brand"
2
+ android:viewportHeight="24" android:viewportWidth="24"
3
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
4
+ <path android:fillColor="@android:color/white" android:pathData="M12,5.99L19.53,19H4.47L12,5.99M12,2L1,21h22L12,2L12,2z"/>
5
+ <path android:fillColor="@android:color/white" android:pathData="M13,16l-2,0l0,2l2,0z"/>
6
+ <path android:fillColor="@android:color/white" android:pathData="M13,10l-2,0l0,5l2,0z"/>
7
+ </vector>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:app="http://schemas.android.com/apk/res-auto"
4
+ xmlns:tools="http://schemas.android.com/tools"
5
+ android:layout_width="match_parent"
6
+ android:layout_height="match_parent"
7
+ android:background="?android:colorBackground">
8
+
9
+ <ImageView
10
+ android:id="@+id/imageView"
11
+ android:layout_width="match_parent"
12
+ android:layout_height="50dp"
13
+ android:layout_marginBottom="10dp"
14
+ app:layout_constraintBottom_toTopOf="@+id/error_message"
15
+ app:srcCompat="@drawable/ic_warning" />
16
+
17
+ <com.google.android.material.textview.MaterialTextView
18
+ android:id="@+id/error_message"
19
+ style="?textAppearanceDisplaySmall"
20
+ android:layout_width="match_parent"
21
+ android:layout_height="wrap_content"
22
+ android:gravity="center_horizontal"
23
+ android:text="Error loading page"
24
+ app:layout_constraintBottom_toBottomOf="parent"
25
+ app:layout_constraintTop_toTopOf="parent"
26
+ app:layout_constraintVertical_bias=".45"
27
+ tools:layout_editor_absoluteX="24dp" />
28
+
29
+ <com.google.android.material.textview.MaterialTextView
30
+ style="?textAppearanceTitleMedium"
31
+ android:layout_width="match_parent"
32
+ android:layout_height="wrap_content"
33
+ android:layout_marginTop="10dp"
34
+ android:gravity="center_horizontal"
35
+ android:text="Pull-to-refresh to try again"
36
+ app:layout_constraintTop_toBottomOf="@id/error_message"
37
+ tools:layout_editor_absoluteX="24dp" />
38
+
39
+ </androidx.constraintlayout.widget.ConstraintLayout>
@@ -5,4 +5,8 @@ import dev.hotwire.turbo.fragments.TurboWebFragment
5
5
  import dev.hotwire.turbo.nav.TurboNavGraphDestination
6
6
 
7
7
  @TurboNavGraphDestination(uri = "turbo://fragment/web")
8
- open class WebFragment : TurboWebFragment(), NavDestination
8
+ open class WebFragment : TurboWebFragment(), NavDestination {
9
+ override fun createErrorView(statusCode: Int): View {
10
+ return layoutInflater.inflate(R.layout.error_web, null)
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ <vector android:height="24dp" android:tint="@color/color_brand"
2
+ android:viewportHeight="24" android:viewportWidth="24"
3
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
4
+ <path android:fillColor="@android:color/white" android:pathData="M12,5.99L19.53,19H4.47L12,5.99M12,2L1,21h22L12,2L12,2z"/>
5
+ <path android:fillColor="@android:color/white" android:pathData="M13,16l-2,0l0,2l2,0z"/>
6
+ <path android:fillColor="@android:color/white" android:pathData="M13,10l-2,0l0,5l2,0z"/>
7
+ </vector>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:app="http://schemas.android.com/apk/res-auto"
4
+ xmlns:tools="http://schemas.android.com/tools"
5
+ android:layout_width="match_parent"
6
+ android:layout_height="match_parent"
7
+ android:background="?android:colorBackground">
8
+
9
+ <ImageView
10
+ android:id="@+id/imageView"
11
+ android:layout_width="match_parent"
12
+ android:layout_height="50dp"
13
+ android:layout_marginBottom="10dp"
14
+ app:layout_constraintBottom_toTopOf="@+id/error_message"
15
+ app:srcCompat="@drawable/ic_warning" />
16
+
17
+ <com.google.android.material.textview.MaterialTextView
18
+ android:id="@+id/error_message"
19
+ style="?textAppearanceDisplaySmall"
20
+ android:layout_width="match_parent"
21
+ android:layout_height="wrap_content"
22
+ android:gravity="center_horizontal"
23
+ android:text="Error loading page"
24
+ app:layout_constraintBottom_toBottomOf="parent"
25
+ app:layout_constraintTop_toTopOf="parent"
26
+ app:layout_constraintVertical_bias=".45"
27
+ tools:layout_editor_absoluteX="24dp" />
28
+
29
+ <com.google.android.material.textview.MaterialTextView
30
+ style="?textAppearanceTitleMedium"
31
+ android:layout_width="match_parent"
32
+ android:layout_height="wrap_content"
33
+ android:layout_marginTop="10dp"
34
+ android:gravity="center_horizontal"
35
+ android:text="Pull-to-refresh to try again"
36
+ app:layout_constraintTop_toBottomOf="@id/error_message"
37
+ tools:layout_editor_absoluteX="24dp" />
38
+
39
+ </androidx.constraintlayout.widget.ConstraintLayout>
@@ -1,3 +1,3 @@
1
1
  module TurboNativeInitializer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-native-initializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
@@ -63,7 +63,9 @@ files:
63
63
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/anim/overshoot_interpolator.xml
64
64
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/drawable/ic_close.xml
65
65
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/drawable/ic_launcher_foreground.xml
66
+ - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/drawable/ic_warning.xml
66
67
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/activity_main.xml.tt
68
+ - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/error_web.xml
67
69
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/fragment_native.xml
68
70
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/layout/fragment_web_home.xml
69
71
  - lib/turbo_native_initializer/templates/android_stack/base/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -110,7 +112,9 @@ files:
110
112
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/drawable/ic_home.xml
111
113
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/drawable/ic_launcher_foreground.xml
112
114
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/drawable/ic_settings.xml
115
+ - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/drawable/ic_warning.xml
113
116
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/activity_main.xml.tt
117
+ - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/error_web.xml
114
118
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/fragment_native.xml
115
119
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/layout/fragment_web_home.xml
116
120
  - lib/turbo_native_initializer/templates/android_tabs/base/app/src/main/res/menu/bottom_navigation_menu.xml