Bimba.git

commit ffcbcbc4085d82c66cb5c110cd936a7b0dbb72b3

Author: Adam Pioterek <adam.pioterek@protonmail.ch>

Splash screen

 app/src/main/AndroidManifest.xml | 20 +-
 app/src/main/java/ml/adamsprogs/bimba/NoDbActivity.kt | 12 +
 app/src/main/java/ml/adamsprogs/bimba/SplashActivity.kt | 17 ++
 app/src/main/res/drawable/logo_96.xml | 24 +++
 app/src/main/res/drawable/nodb.xml | 67 +++++++++++
 app/src/main/res/drawable/splash_screen.xml | 9 +
 app/src/main/res/layout/activity_nodb.xml | 14 ++
 app/src/main/res/values/styles.xml | 8 


diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8b46aadd10b48588229b5dfe08364b0c8320b3de..84217dda388216e606314352638831a0d2d80baa 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -11,13 +11,7 @@         android:icon="@drawable/logo"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
-        <activity android:name=".MainActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
+        <activity android:name=".MainActivity" />
 
         <service
             android:name=".TimetableDownloader"
@@ -26,7 +20,17 @@
         <activity
             android:name=".StopActivity"
             android:label="@string/title_activity_stop"
-            android:theme="@style/AppTheme"></activity>
+            android:theme="@style/AppTheme" />
+        <activity
+            android:name=".SplashActivity"
+            android:theme="@style/SplashTheme">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".NoDbActivity" />
     </application>
 
 </manifest>
\ No newline at end of file




diff --git a/app/src/main/java/ml/adamsprogs/bimba/NoDbActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/NoDbActivity.kt
new file mode 100644
index 0000000000000000000000000000000000000000..1fa7b24531f948df29521998f3d51067d29018c1
--- /dev/null
+++ b/app/src/main/java/ml/adamsprogs/bimba/NoDbActivity.kt
@@ -0,0 +1,12 @@
+package ml.adamsprogs.bimba
+
+import android.support.v7.app.AppCompatActivity
+import android.os.Bundle
+
+class NoDbActivity : AppCompatActivity() {
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_nodb)
+    }
+}




diff --git a/app/src/main/java/ml/adamsprogs/bimba/SplashActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/SplashActivity.kt
new file mode 100644
index 0000000000000000000000000000000000000000..168ec598511fdd5f348ca221fd61338d388dfe61
--- /dev/null
+++ b/app/src/main/java/ml/adamsprogs/bimba/SplashActivity.kt
@@ -0,0 +1,17 @@
+package ml.adamsprogs.bimba
+
+import android.support.v7.app.AppCompatActivity
+import android.os.Bundle
+import android.content.Intent
+
+
+class SplashActivity : AppCompatActivity() {
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        //todo if no db
+        //startActivity(Intent(this, NoDbActivity::class.java))
+        startActivity(Intent(this, MainActivity::class.java))
+        finish()
+    }
+}




diff --git a/app/src/main/res/drawable/logo_96.xml b/app/src/main/res/drawable/logo_96.xml
new file mode 100644
index 0000000000000000000000000000000000000000..854575ea8837fcbb29cf10b37abe26f29af11f17
--- /dev/null
+++ b/app/src/main/res/drawable/logo_96.xml
@@ -0,0 +1,24 @@
+<vector android:height="96dp" android:viewportHeight="512.0"
+    android:viewportWidth="512.0" android:width="96dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillAlpha="1" android:fillColor="#17ff00"
+        android:pathData="M0.1,0.1h511.7v511.7h-511.7z"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.26262632"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M257.1,53.7m-40.6,0a40.6,40.6 49.3,1 1,81.3 0a40.6,40.6 49.3,1 1,-81.3 0"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.26458332"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M262.9,450.9m-40.6,0a40.6,40.6 105.4,1 1,81.3 0a40.6,40.6 0,1 1,-81.3 0"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.26458332"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M47.4,256.3l14.2,-14.2l211.1,211.1l-14.2,14.2z"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.08697488"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M258.5,45.1l14.2,14.2l-211.1,211.1l-14.2,-14.2z"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.08697488"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M469.6,256.3l-14.2,14.2l-211.1,-211.1l14.2,-14.2z"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.08697488"/>
+    <path android:fillAlpha="1" android:fillColor="#ffff00"
+        android:pathData="M258.5,467.4l-14.2,-14.2l211.1,-211.1l14.2,14.2z"
+        android:strokeAlpha="0" android:strokeColor="#ffffff" android:strokeWidth="0.08697488"/>
+</vector>




diff --git a/app/src/main/res/drawable/nodb.xml b/app/src/main/res/drawable/nodb.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4255d8d033055c251983dfa0c42184f1fb987d6d
--- /dev/null
+++ b/app/src/main/res/drawable/nodb.xml
@@ -0,0 +1,67 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="285dp"
+        android:height="508dp"
+        android:viewportWidth="285.75"
+        android:viewportHeight="508.0">
+    <path
+        android:pathData="M0,0V508H285.75V0Z"
+        android:fillAlpha="1"
+        android:strokeColor="#00000000"
+        android:fillColor="#f5f5f5"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="M118.39,10.65h11.8v45.79h-11.8z"
+        android:fillAlpha="1"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="M118.39,95.69h11.8v45.79h-11.8z"
+        android:fillAlpha="1"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="M118.39,180.74h11.8v45.79h-11.8z"
+        android:fillAlpha="1"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="M118.39,265.78h11.8v45.79h-11.8z"
+        android:fillAlpha="1"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="M157.97,342.48l6.86,-9.59l37.36,26.6l-6.86,9.59z"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillAlpha="1"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.06666672"/>
+    <path
+        android:pathData="M227.37,391.87l6.86,-9.59l37.36,26.6l-6.86,9.59z"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillAlpha="1"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.06666672"/>
+    <path
+        android:pathData="m242.98,155.61v32.85h27.21v-33.83h4.92L271.5,22.16L156.09,22.16l-3.61,132.47h4.92v33.83h27.21v-32.85zM260.68,35.24 L262.65,85.61h-99.01l1.97,-50.37z"
+        android:fillAlpha="1"
+        android:fillType="evenOdd"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+    <path
+        android:pathData="m151.43,218.53h17.63c3.49,0 6.09,0.16 7.81,0.49 1.71,0.33 3.25,1.01 4.6,2.06 1.35,1.04 2.48,2.43 3.38,4.16 0.9,1.73 1.35,3.68 1.35,5.83 -0,2.33 -0.56,4.47 -1.67,6.42 -1.11,1.95 -2.62,3.41 -4.53,4.38 2.69,0.88 4.75,2.39 6.2,4.52 1.44,2.13 2.17,4.63 2.17,7.51 -0,2.27 -0.47,4.47 -1.4,6.61 -0.93,2.14 -2.21,3.85 -3.82,5.13 -1.61,1.28 -3.61,2.07 -5.97,2.36 -1.48,0.18 -5.06,0.29 -10.74,0.34h-15.01zM160.34,226.82v11.52h5.84c3.47,0 5.63,-0.06 6.47,-0.17 1.52,-0.2 2.72,-0.8 3.6,-1.78 0.87,-0.99 1.31,-2.28 1.31,-3.89 -0,-1.54 -0.38,-2.79 -1.13,-3.76 -0.75,-0.96 -1.87,-1.55 -3.35,-1.75 -0.88,-0.11 -3.42,-0.17 -7.61,-0.17zM160.34,246.64v13.32h8.24c3.21,0 5.24,-0.1 6.11,-0.31 1.32,-0.27 2.4,-0.93 3.23,-1.99 0.83,-1.05 1.25,-2.46 1.25,-4.23 -0,-1.5 -0.32,-2.76 -0.96,-3.81 -0.64,-1.04 -1.57,-1.8 -2.78,-2.28 -1.21,-0.48 -3.85,-0.71 -7.9,-0.71zM195.87,218.53h8.91v26.99c0,4.28 0.11,7.06 0.33,8.33 0.38,2.04 1.29,3.68 2.72,4.91 1.43,1.23 3.39,1.85 5.88,1.85 2.53,0 4.43,-0.58 5.72,-1.75 1.28,-1.17 2.06,-2.6 2.32,-4.3 0.26,-1.7 0.39,-4.52 0.39,-8.46v-27.56h8.91v26.17c-0,5.98 -0.24,10.21 -0.72,12.68 -0.48,2.47 -1.37,4.55 -2.66,6.25 -1.29,1.7 -3.02,3.05 -5.19,4.06 -2.17,1.01 -4.99,1.51 -8.48,1.51 -4.21,0 -7.41,-0.55 -9.58,-1.65 -2.18,-1.1 -3.9,-2.53 -5.16,-4.28 -1.26,-1.76 -2.1,-3.6 -2.5,-5.52 -0.58,-2.85 -0.87,-7.07 -0.87,-12.64zM238.2,252.14 L246.86,251.19c0.52,3.29 1.58,5.7 3.17,7.24 1.59,1.54 3.75,2.31 6.45,2.31 2.87,0 5.03,-0.69 6.48,-2.06 1.45,-1.37 2.18,-2.97 2.18,-4.81 0,-1.18 -0.31,-2.18 -0.92,-3.01 -0.61,-0.83 -1.68,-1.55 -3.2,-2.16 -1.04,-0.41 -3.42,-1.13 -7.13,-2.18 -4.77,-1.34 -8.12,-2.98 -10.05,-4.93 -2.71,-2.74 -4.06,-6.08 -4.06,-10.03 0,-2.54 0.64,-4.91 1.91,-7.12 1.27,-2.21 3.11,-3.89 5.51,-5.05 2.4,-1.16 5.29,-1.73 8.68,-1.73 5.54,0 9.7,1.37 12.5,4.11 2.8,2.74 4.27,6.4 4.41,10.98l-8.91,0.44c-0.38,-2.56 -1.2,-4.4 -2.45,-5.52 -1.25,-1.12 -3.13,-1.68 -5.64,-1.68 -2.59,0 -4.61,0.6 -6.08,1.8 -0.94,0.77 -1.41,1.8 -1.41,3.09 -0,1.18 0.44,2.19 1.32,3.02 1.12,1.06 3.85,2.18 8.18,3.33 4.33,1.16 7.54,2.35 9.61,3.59 2.08,1.23 3.7,2.92 4.87,5.06 1.17,2.14 1.76,4.79 1.76,7.94 -0,2.85 -0.7,5.53 -2.11,8.02 -1.4,2.49 -3.39,4.34 -5.96,5.56 -2.57,1.21 -5.77,1.82 -9.6,1.82 -5.58,0 -9.86,-1.46 -12.85,-4.37 -2.99,-2.91 -4.77,-7.15 -5.36,-12.73z"
+        android:fillAlpha="1"
+        android:strokeColor="#00000000"
+        android:fillColor="#ffffff"
+        android:strokeWidth="1.09682584"/>
+</vector>




diff --git a/app/src/main/res/drawable/splash_screen.xml b/app/src/main/res/drawable/splash_screen.xml
new file mode 100644
index 0000000000000000000000000000000000000000..dc5fed0e3d4845acc7ba2d06adf62c57b5353ca2
--- /dev/null
+++ b/app/src/main/res/drawable/splash_screen.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@color/colorPrimary" />
+    <item
+        android:gravity="center"
+        android:drawable="@drawable/logo_96"/>
+
+</layer-list>
\ No newline at end of file




diff --git a/app/src/main/res/layout/activity_nodb.xml b/app/src/main/res/layout/activity_nodb.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f0993ec7fbeada126ebe5beb61b07c5c98369970
--- /dev/null
+++ b/app/src/main/res/layout/activity_nodb.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/nodb">
+
+    <android.support.v7.widget.Toolbar
+        android:id="@+id/toolbar2"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="?attr/colorPrimary"
+        android:minHeight="?attr/actionBarSize"
+        android:theme="?attr/actionBarTheme" />
+</LinearLayout>
\ No newline at end of file




diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 84afd02b1243e739b01443d453476dc5669fcea4..81de51acbb294dd281e548fb6cc51c463401e194 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,12 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
-    <!-- Base application theme. -->
     <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
-        <!-- Customize your theme here. -->
         <item name="colorPrimary">@color/colorPrimary</item>
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
         <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="android:windowBackground">@drawable/splash_screen</item>
     </style>
 
     <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />