Author: Adam <git@apiote.xyz>
add about screen
app/build.gradle | 4 app/src/main/AndroidManifest.xml | 3 app/src/main/java/xyz/apiote/bimba/czwek/AboutActivity.kt | 11 app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt | 5 app/src/main/res/drawable/code.xml | 10 app/src/main/res/drawable/mastodon.xml | 9 app/src/main/res/drawable/translate.xml | 10 app/src/main/res/drawable/website.xml | 10 app/src/main/res/layout/activity_about.xml | 121 app/src/main/res/menu/drawer.xml | 3 app/src/main/res/values/strings.xml | 7 app/src/main/res/values/themes.xml | 5
diff --git a/app/build.gradle b/app/build.gradle index 4b8987eea786c06b3fadaede92fd3866394315b4..faa8684e2576949773a42f3d141acb52524496c0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,10 @@ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resourceConfigurations += ["en", "pl", "it"] } + applicationVariants.configureEach { variant -> + variant.resValue "string", "versionName", variant.versionName + } + buildTypes { release { minifyEnabled false diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 34244b2f156b3b4cf5e7b08aaa4cbde4605fba80..2714bb3942edb3cf3ad94de74d9cacc8b8a5eca8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,9 @@ android:supportsRtl="true" android:theme="@style/Theme.Bimba.Style" tool:targetApi="33"> <activity + android:name=".AboutActivity" + android:exported="false" /> + <activity android:name=".search.LineGraphActivity" android:exported="false" android:theme="@style/Theme.Bimba.Style.NoActionBar" /> diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/AboutActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/AboutActivity.kt new file mode 100644 index 0000000000000000000000000000000000000000..f6a08ac8f9b39c3cd16fe97e934301c3dc48a66c --- /dev/null +++ b/app/src/main/java/xyz/apiote/bimba/czwek/AboutActivity.kt @@ -0,0 +1,11 @@ +package xyz.apiote.bimba.czwek + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity + +class AboutActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_about) + } +} \ No newline at end of file diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt index 7e0490b3e6a0528cba0feee33d54c246b51fdd6a..76d0caa48af1122b8b7f89b2beab8543cedfd5d9 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt @@ -28,6 +28,7 @@ import androidx.navigation.ui.setupWithNavController import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.openlocationcode.OpenLocationCode +import xyz.apiote.bimba.czwek.AboutActivity import xyz.apiote.bimba.czwek.R import xyz.apiote.bimba.czwek.dashboard.ui.home.HomeFragment import xyz.apiote.bimba.czwek.dashboard.ui.map.MapFragment @@ -95,6 +96,10 @@ } R.id.drawer_cities -> { startActivity(Intent(this, FeedChooserActivity::class.java)) + } + + R.id.drawer_about -> { + startActivity(Intent(this, AboutActivity::class.java)) } } false diff --git a/app/src/main/res/drawable/code.xml b/app/src/main/res/drawable/code.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f6bdc053e65936ee69282027d522c7f37810d3b --- /dev/null +++ b/app/src/main/res/drawable/code.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:tint="?attr/colorOnSurface" + android:width="24dp" + android:height="24dp" + android:viewportWidth="960" + android:viewportHeight="960"> + <path + android:fillColor="@android:color/white" + android:pathData="M320,720L80,480L320,240L377,297L193,481L376,664L320,720ZM640,720L583,663L767,479L584,296L640,240L880,480L640,720Z"/> +</vector> diff --git a/app/src/main/res/drawable/mastodon.xml b/app/src/main/res/drawable/mastodon.xml new file mode 100644 index 0000000000000000000000000000000000000000..6dc0ac25eeb3fc0bac6f74620110326f0d40247f --- /dev/null +++ b/app/src/main/res/drawable/mastodon.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:tint="?attr/colorOnSurface" android:width="74dp" + android:height="79dp" + android:viewportWidth="74" + android:viewportHeight="79"> + <path + android:pathData="M73.701,17.959C72.562,9.62 65.177,3.049 56.424,1.775C54.947,1.56 49.352,0.777 36.39,0.777H36.293C23.328,0.777 20.546,1.56 19.07,1.775C10.56,3.013 2.789,8.918 0.903,17.356C-0.004,21.511 -0.1,26.118 0.068,30.344C0.308,36.404 0.355,42.453 0.914,48.489C1.301,52.498 1.975,56.475 2.932,60.39C4.724,67.622 11.979,73.64 19.088,76.094C26.698,78.655 34.882,79.08 42.724,77.322C43.587,77.124 44.44,76.895 45.283,76.634C47.187,76.038 49.42,75.371 51.062,74.2C51.084,74.184 51.103,74.163 51.116,74.138C51.129,74.114 51.136,74.087 51.137,74.059V68.211C51.136,68.185 51.13,68.16 51.118,68.136C51.107,68.113 51.09,68.093 51.069,68.077C51.049,68.061 51.025,68.05 50.999,68.045C50.974,68.039 50.947,68.039 50.922,68.045C45.898,69.226 40.749,69.818 35.584,69.809C26.694,69.809 24.303,65.657 23.618,63.929C23.068,62.435 22.719,60.876 22.579,59.293C22.577,59.267 22.583,59.24 22.593,59.216C22.604,59.192 22.621,59.17 22.642,59.153C22.663,59.137 22.688,59.125 22.714,59.119C22.74,59.113 22.768,59.114 22.794,59.121C27.735,60.294 32.799,60.886 37.881,60.884C39.104,60.884 40.322,60.884 41.545,60.853C46.656,60.711 52.044,60.454 57.073,59.487C57.198,59.463 57.324,59.442 57.431,59.41C65.364,57.911 72.913,53.205 73.68,41.29C73.709,40.82 73.78,36.376 73.78,35.889C73.784,34.235 74.322,24.153 73.701,17.959ZM61.493,47.692H53.151V27.586C53.151,23.353 51.359,21.194 47.714,21.194C43.706,21.194 41.699,23.748 41.699,28.792V39.797H33.408V28.792C33.408,23.748 31.397,21.194 27.389,21.194C23.765,21.194 21.955,23.353 21.952,27.586V47.692H13.618V26.975C13.618,22.742 14.716,19.379 16.912,16.887C19.177,14.4 22.149,13.123 25.837,13.123C30.106,13.123 33.333,14.739 35.483,17.966L37.559,21.395L39.638,17.966C41.788,14.739 45.014,13.123 49.277,13.123C52.961,13.123 55.933,14.4 58.206,16.887C60.402,19.377 61.5,22.74 61.5,26.975L61.493,47.692Z" + android:fillColor="@android:color/white"/> +</vector> diff --git a/app/src/main/res/drawable/translate.xml b/app/src/main/res/drawable/translate.xml new file mode 100644 index 0000000000000000000000000000000000000000..3cb0562ed74d831acc8e7169a3014a47ed1e531a --- /dev/null +++ b/app/src/main/res/drawable/translate.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="960" + android:viewportHeight="960" + android:tint="?attr/colorOnSurface"> + <path + android:fillColor="@android:color/white" + android:pathData="M476,880L658,400L742,400L924,880L840,880L797,758L603,758L560,880L476,880ZM160,760L104,704L306,502Q271,467 242.5,422Q214,377 190,320L274,320Q294,359 314,388Q334,417 362,446Q395,413 430.5,353.5Q466,294 484,240L40,240L40,160L320,160L320,80L400,80L400,160L680,160L680,240L564,240Q543,312 501,388Q459,464 418,504L514,602L484,684L362,559L160,760ZM628,688L772,688L700,484L628,688Z"/> +</vector> diff --git a/app/src/main/res/drawable/website.xml b/app/src/main/res/drawable/website.xml new file mode 100644 index 0000000000000000000000000000000000000000..9d8ddedf38427156d88e71973d55df551e44d2a3 --- /dev/null +++ b/app/src/main/res/drawable/website.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="960" + android:viewportHeight="960" + android:tint="?attr/colorOnSurface"> + <path + android:fillColor="@android:color/white" + android:pathData="M480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,800Q614,800 707,707Q800,614 800,480Q800,473 799.5,465.5Q799,458 799,453Q794,482 772,501Q750,520 720,520L640,520Q607,520 583.5,496.5Q560,473 560,440L560,400L400,400L400,320Q400,287 423.5,263.5Q447,240 480,240L520,240L520,240Q520,217 532.5,199.5Q545,182 563,171Q543,166 522.5,163Q502,160 480,160Q346,160 253,253Q160,346 160,480Q160,480 160,480Q160,480 160,480L360,480Q426,480 473,527Q520,574 520,640L520,680L400,680L400,790Q420,795 439.5,797.5Q459,800 480,800Z"/> +</vector> diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml new file mode 100644 index 0000000000000000000000000000000000000000..474ef1e56d4b6241fbf035576c2e02d3f6156cfb --- /dev/null +++ b/app/src/main/res/layout/activity_about.xml @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".AboutActivity"> + + <com.google.android.material.imageview.ShapeableImageView + android:id="@+id/logo" + android:layout_width="100dp" + android:layout_height="100dp" + android:layout_marginTop="32dp" + android:background="@color/bimba_grey" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:shapeAppearanceOverlay="@style/roundedImageView" + app:srcCompat="@drawable/ic_launcher_foreground" /> + + <TextView + android:id="@+id/app_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:text="@string/app_name" + android:textAppearance="@style/TextAppearance.AppCompat.Display1" + app:layout_constraintEnd_toEndOf="@+id/logo" + app:layout_constraintStart_toStartOf="@+id/logo" + app:layout_constraintTop_toBottomOf="@+id/logo" /> + + <TextView + android:id="@+id/version" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/versionName" + app:layout_constraintEnd_toEndOf="@+id/app_name" + app:layout_constraintStart_toStartOf="@+id/app_name" + app:layout_constraintTop_toBottomOf="@+id/app_name" /> + + <TextView + android:id="@+id/description" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="48dp" + android:layout_marginEnd="8dp" + android:text="@string/app_description" + android:textAppearance="@style/TextAppearance.AppCompat.Body1" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/app_name" /> + + <androidx.constraintlayout.helper.widget.Flow + android:id="@+id/links" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="32dp" + android:layout_marginEnd="8dp" + app:constraint_referenced_ids="website,code,translate,mastodon" + app:flow_horizontalGap="16dp" + app:flow_horizontalStyle="packed" + app:flow_verticalGap="4dp" + app:flow_wrapMode="chain" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/description" /> + + <Button + android:contentDescription="@string/website_button_description" + android:id="@+id/website" + style="@style/Widget.Material3.Button.IconButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:ignore="MissingConstraints" + app:icon="@drawable/website" /> + + <Button + android:contentDescription="@string/code_button_description" + android:id="@+id/code" + style="@style/Widget.Material3.Button.IconButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:ignore="MissingConstraints" + app:icon="@drawable/code" /> + + <Button + android:contentDescription="@string/mastodon_button_description" + android:id="@+id/mastodon" + style="@style/Widget.Material3.Button.IconButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:ignore="MissingConstraints" + app:icon="@drawable/mastodon" /> + + <Button + android:contentDescription="@string/translation_button_description" + android:id="@+id/translate" + style="@style/Widget.Material3.Button.IconButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:ignore="MissingConstraints" + app:icon="@drawable/translate" /> + + <TextView + android:id="@+id/credits" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="32dp" + android:layout_marginEnd="8dp" + android:autoLink="web" + android:text="@string/credits" + android:textAppearance="@style/TextAppearance.AppCompat.Body1" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/links" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/menu/drawer.xml b/app/src/main/res/menu/drawer.xml index c2c482251655905e710cf0e56cf9f92cbe102bd6..6aa4cd40617cbc62655fc57af593549f6d4016a1 100644 --- a/app/src/main/res/menu/drawer.xml +++ b/app/src/main/res/menu/drawer.xml @@ -24,4 +24,7 @@ android:title="@string/title_cities" /> </menu> </item> <!-- other settings --> + <item + android:id="@+id/drawer_about" + android:title="@string/title_about"/> </menu> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0538126175160cd68b1a0a9f5f75a746c136a43f..4ef13134bf545a274dab57a52410b86a6729f898 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -100,4 +100,11 @@Stop on demand <string name="stop_stub_in_zone">Stop in zone %1$s</string> <string name="vehicle_headsign_content_description">%1$s towards %2$s</string> <string name="departure_headsign">» %1$s</string> + <string name="credits">Font yellowcircle8 (https://git.apiote.xyz/yellowcircle8.git) based on Railway Sans © Greg Fleming, OFL-1.1 https://github.com/davelab6/Railway-Sans\n\n Mastodon icon (https://github.com/mastodon/joinmastodon) © Mastodon contributors, AGPL-3.0-or-later\n\n Bimba logo created by https://github.com/tebriz159\n\n Material icons © Google, Apache-2.0\n\n Map data © OpenStreetMap contributors, ODbL-1.0</string> + <string name="title_about">About</string> + <string name="translation_button_description">link to translations service</string> + <string name="app_description">FLOSS public transport passenger companion; a timetable in your pocket.</string> + <string name="website_button_description">link to website</string> + <string name="code_button_description">link to source code</string> + <string name="mastodon_button_description">link to Mastodon</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 5d7a61c5a50c76c98a30067b9ff98cb88c358f11..d2d028dc2a2b307a95da612b39c9f73808299b92 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -67,4 +67,9 @@