Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #46 from Team-Ladefuchs/42-acknowledgement-screen
Browse files Browse the repository at this point in the history
Add Third Party Notice
  • Loading branch information
Thorsten1 authored Dec 4, 2022
2 parents 95b68a1 + 86739ce commit 9a731f7
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class AboutFragment : Fragment() {
findNavController().navigate(R.id.action_navigation_about_to_imprint)
}

view.findViewById<Button>(app.ladefuchs.android.R.id.ack_button).setOnClickListener {
findNavController().navigate(app.ladefuchs.android.R.id.action_navigation_about_to_acknowledgement)
}

//Hiding settings and making them collapsible
val settingsFragmentView = view.findViewById<View>(R.id.settingsFragment)
val settingsDisclosureTriangle = view.findViewById<ImageView>(R.id.disclosure_triangle)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package app.ladefuchs.android.ui.acknowledgement

import android.os.Bundle
import android.text.method.LinkMovementMethod
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageButton
import android.widget.TextView
import androidx.navigation.fragment.findNavController
import app.ladefuchs.android.R


class Acknowledgement : Fragment() {
companion object {
fun newInstance() = Acknowledgement()
}

private lateinit var viewModel: AcknowledgementViewModel

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {

return inflater.inflate(R.layout.fragment_acknowledgement, container, false)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
val acknowledgementText = view.findViewById(R.id.acknowledgement_text) as TextView
acknowledgementText.movementMethod = LinkMovementMethod.getInstance()

view.findViewById<ImageButton>(app.ladefuchs.android.R.id.back_button).setOnClickListener {
findNavController().navigate(app.ladefuchs.android.R.id.action_acknowledgement_to_navigation_about)
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app.ladefuchs.android.ui.acknowledgement

import androidx.lifecycle.ViewModel

class AcknowledgementViewModel : ViewModel() {
// TODO: Implement the ViewModel
}
21 changes: 20 additions & 1 deletion Ladefuchs/app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,30 @@
android:textAllCaps="false"
android:textColor="@color/TextColorDisabled"
android:textStyle="normal"
app:layout_constraintBottom_toTopOf="@id/version_info"
app:layout_constraintBottom_toTopOf="@id/ack_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/handcrafted" />

<Button
android:id="@+id/ack_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/UIColorDark"
android:fontFamily="@font/roboto"
android:minWidth="0dp"
android:minHeight="0dp"
android:paddingBottom="5dp"
android:text="@string/acknowledgement_header"
android:textAllCaps="false"
android:textColor="@color/TextColorDisabled"
android:textStyle="normal"
app:layout_constraintBottom_toTopOf="@id/version_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/imprint_button" />

<TextView
android:id="@+id/version_info"
android:layout_width="0dp"
Expand Down
71 changes: 71 additions & 0 deletions Ladefuchs/app/src/main/res/layout/fragment_acknowledgement.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:background="@color/PrimaryBackground"
tools:context=".Acknowledgement">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/ladefuchs_logo"
android:layout_width="84dp"
android:layout_height="78dp"
android:layout_marginTop="8dp"
android:contentDescription="@string/ladefuchs_logo_description"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_ladefuchs_logo" />

<ImageButton
android:id="@+id/back_button"
android:layout_width="32dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:background="@color/PrimaryBackground"
app:srcCompat="@drawable/abc_vector_test"
android:tint="@color/TextColorDark"
app:layout_constraintBottom_toTopOf="@+id/acknowledgement_header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/acknowledgement_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/TableColorDark"
android:fontFamily="sans-serif-black"
android:text="@string/acknowledgement_header"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="@color/colorAccent"
android:textSize="30sp"
app:layout_constraintBottom_toTopOf="@+id/acknowledgement_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ladefuchs_logo" />

<TextView
android:id="@+id/acknowledgement_text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:text="@string/acknowledgement_text"
android:textAlignment="textStart"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/acknowledgement_header" />

</androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>
11 changes: 11 additions & 0 deletions Ladefuchs/app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<action
android:id="@+id/action_navigation_about_to_imprint"
app:destination="@id/imprint" />
<action
android:id="@+id/action_navigation_about_to_acknowledgement"
app:destination="@id/acknowledgement" />
</fragment>

<fragment
Expand Down Expand Up @@ -61,5 +64,13 @@
android:id="@+id/action_imprint_to_navigation_about"
app:destination="@id/navigation_about" />
</fragment>
<fragment
android:id="@+id/acknowledgement"
android:name="app.ladefuchs.android.ui.acknowledgement.Acknowledgement"
android:label="Acknowledgement">
<action
android:id="@+id/action_acknowledgement_to_navigation_about"
app:destination="@id/navigation_about" />
</fragment>

</navigation>
9 changes: 9 additions & 0 deletions Ladefuchs/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@
<string name="twitter_roddi"><a href="https://twitter.com/roddi">@roddi</a></string>
<string name="handcrafted">Handgefertigt aus ♥️ zur Elektromobilität in \n👑 Aachen, 🥨 Fürstenfeldbruck, 🏰 Ludwigsburg, \n⚒️ Ahlen und 🐻 Berlin.</string>
<string name="imprint_header">Impressum</string>
<string name="acknowledgement_header">Third-Party Notices</string>
<string name="imprint_text">Angaben gemäß § 5 TMG:\nBastian Wölfle\nSchwabenstraße 11\n82256 Fürstenfeldbruck\n\nKontakt:\nTelefon: +49-8141-5092502\nE-Mail: [email protected]\n\nVerantwortlich für den Inhalt nach § 55 Abs. 2 RStV:\nBastian Wölfle\nSchwabenstraße 11\n82256 Fürstenfeldbruck\n\n\nQuelle: Impressum-Generator von anwalt.de</string>
<string name="acknowledgement_text">
\t• <a href="https://github.com/cbeust/klaxon/blob/master/LICENSE.txt">Klaxon: 5.0.1</a>\n
\t• <a href="https://github.com/takisoft/preferencex-android/blob/master/LICENSE">AndroidX Preference eXtended: 1.1.0</a>\n
\t• <a href="https://github.com/vinc3m1/RoundedImageView/blob/main/LICENSE">RoundedImageView: 2.3.0</a>\n
\t• <a href="https://github.com/AigeStudio/WheelPicker/blob/master/LICENSE">WheelPicker: 1.1.3</a>\n
\t• <a href="https://square.github.io/okhttp/#license">OkHttp: 4.9.0</a>\n
\t• <a href="https://github.com/hdodenhof/CircleImageView/blob/master/LICENSE.txt">CircleImageView: 3.1.0</a>\n
</string>
<string name="impressum">Impressum</string>
<string name="dialog_ok">OK</string>
<string name="chargecard_title">Wähle Deine Karten</string>
Expand Down

0 comments on commit 9a731f7

Please sign in to comment.