convert about to cardviews

This commit is contained in:
Bnyro 2022-07-03 14:43:29 +02:00
parent 0c63d836c9
commit c59b719b92
5 changed files with 139 additions and 83 deletions

View File

@ -16,6 +16,7 @@ import com.github.libretube.util.AUTHORS_URL
import com.github.libretube.util.CONTRIBUTING_URL import com.github.libretube.util.CONTRIBUTING_URL
import com.github.libretube.util.DONATE_URL import com.github.libretube.util.DONATE_URL
import com.github.libretube.util.PIPED_GITHUB_URL import com.github.libretube.util.PIPED_GITHUB_URL
import com.github.libretube.util.ThemeHelper
import com.github.libretube.util.WEBSITE_URL import com.github.libretube.util.WEBSITE_URL
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
@ -33,6 +34,7 @@ class AboutFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val settingsActivity = activity as SettingsActivity val settingsActivity = activity as SettingsActivity
settingsActivity.changeTopBarText(getString(R.string.about)) settingsActivity.changeTopBarText(getString(R.string.about))
@ -48,7 +50,7 @@ class AboutFragment : Fragment() {
binding.donate.setOnClickListener { binding.donate.setOnClickListener {
openLinkFromHref(DONATE_URL) openLinkFromHref(DONATE_URL)
} }
binding.contributing.setOnClickListener { binding.github.setOnClickListener {
openLinkFromHref(CONTRIBUTING_URL) openLinkFromHref(CONTRIBUTING_URL)
} }
binding.license.setOnClickListener { binding.license.setOnClickListener {

View File

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
style="@style/roundedImageViewRounded" app:shapeAppearanceOverlay="@style/CircleImageView"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:src="@mipmap/ic_launcher" /> android:src="@mipmap/ic_launcher_round" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -26,107 +27,137 @@
android:textSize="27sp" android:textSize="27sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout <com.google.android.material.card.MaterialCardView
android:id="@+id/website" android:id="@+id/website"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/website"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/website_summary" /> android:text="@string/website"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/website_summary" />
<LinearLayout </LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/contributing" android:id="@+id/contributing"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/contributing"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/contributing_summary" /> android:text="@string/contributing"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/contributing_summary" />
<LinearLayout </LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/authors" android:id="@+id/authors"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/authors"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/authors_summary" /> android:text="@string/authors"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/authors_summary" />
<LinearLayout </LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/piped" android:id="@+id/piped"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/piped"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/piped_summary" /> android:text="@string/piped"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/piped_summary" />
<LinearLayout </LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/donate" android:id="@+id/donate"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/donate"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/donate_summary" /> android:text="@string/donate"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/donate_summary" />
<LinearLayout </LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/license" android:id="@+id/license"
style="@style/AboutItem"> style="@style/AboutCard">
<TextView <LinearLayout
android:layout_width="match_parent" style="@style/AboutItem">
android:layout_height="match_parent"
android:text="@string/license"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/license_summary" /> android:text="@string/license"
android:textStyle="bold" />
</LinearLayout> <TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/license_summary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>

View File

@ -281,7 +281,10 @@
style="@style/Widget.Material3.CardView.Elevated" style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
app:cardCornerRadius="18dp"> app:cardCornerRadius="18dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout

View File

@ -214,4 +214,5 @@
<string name="auth_instance_summary">Use a different instance for authenticated calls.</string> <string name="auth_instance_summary">Use a different instance for authenticated calls.</string>
<string name="auth_instances">Choose an auth instance</string> <string name="auth_instances">Choose an auth instance</string>
<string name="hls">Auto</string> <string name="hls">Auto</string>
<string name="github">GitHub</string>
</resources> </resources>

View File

@ -2,8 +2,17 @@
<resources> <resources>
<style name="roundedImageViewRounded"> <style name="roundedImageViewRounded">
<item name="cornerFamily">rounded</item> <item name="cornerFamily">rounded</item>
<item name="cornerSize">10%</item> <item name="cornerSize">10%</item>
</style>
<style name="CircleImageView">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style> </style>
<style name="OLED"> <style name="OLED">
@ -28,11 +37,21 @@
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:paddingLeft">20dp</item> <item name="android:layout_marginLeft">20dp</item>
<item name="android:paddingRight">20dp</item> <item name="android:layout_marginRight">20dp</item>
<item name="android:paddingTop">12dp</item> <item name="android:layout_marginTop">12dp</item>
<item name="android:paddingBottom">12dp</item> <item name="android:layout_marginBottom">12dp</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="AboutCard" parent="Widget.Material3.CardView.Elevated">
<item name="android:layout_margin">5dp</item>
<item name="strokeWidth">0dp</item>
<item name="cardCornerRadius">20dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="cardElevation">5dp</item>
</style> </style>