Ergänze weitere Animationen
parent
c8523a9e9a
commit
9b9993f2ad
File diff suppressed because one or more lines are too long
@ -0,0 +1,48 @@
|
||||
package com.cyb3rko.techniklogger.fragments
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.style.ClickableSpan
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.ScrollView
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
class AboutAnimationsFragment : Fragment() {
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
val myContext = requireContext()
|
||||
val information = listOf(
|
||||
Triple("Technical Assistance", "Jesús Suárez", "https://lottiefiles.com/29410-technical-assistance"),
|
||||
Triple("No connection animation", "Lenny Miranda Jr.", "https://lottiefiles.com/9010-no-connection-animation")
|
||||
)
|
||||
val view = ScrollView(myContext)
|
||||
val linearLayout = LinearLayout(myContext)
|
||||
linearLayout.orientation = LinearLayout.VERTICAL
|
||||
information.forEach {
|
||||
val textView = TextView(myContext)
|
||||
textView.textSize = 18f
|
||||
textView.setPaddingRelative(40, 50, 40, 0)
|
||||
val text = "${it.first}-Animation von ${it.second}"
|
||||
val spannableString = SpannableString(text)
|
||||
val clickableSpan = object: ClickableSpan() {
|
||||
override fun onClick(widget: View) {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(it.third)))
|
||||
}
|
||||
}
|
||||
spannableString.setSpan(clickableSpan, 0, it.first.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
|
||||
textView.text = spannableString
|
||||
textView.movementMethod = LinkMovementMethod.getInstance()
|
||||
linearLayout.addView(textView)
|
||||
}
|
||||
view.addView(linearLayout)
|
||||
return view
|
||||
}
|
||||
}
|
||||
@ -1,22 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/_icon_add"
|
||||
android:tint="@color/drawableTint" />
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/loading_animation"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
app:lottie_fileName="loading.json"
|
||||
app:lottie_loop="true"
|
||||
app:lottie_speed="1.5"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/_icon_add"
|
||||
android:tint="@color/drawableTint" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
Loading…
Reference in New Issue