add weblate to about fragment

This commit is contained in:
Bnyro 2022-07-31 14:57:23 +02:00
parent 5f98cda835
commit 1fe6965611
5 changed files with 101 additions and 0 deletions

View File

@ -12,6 +12,7 @@ const val WEBSITE_URL = "https://libre-tube.github.io/"
const val DONATE_URL = "https://github.com/libre-tube/LibreTube#donate"
const val GITHUB_URL = "https://github.com/libre-tube/LibreTube"
const val PIPED_GITHUB_URL = "https://github.com/TeamPiped/Piped"
const val WEBLATE_URL = "https://hosted.weblate.org/projects/libretube/libretube/"
/**
* Social media links for the community fragment

View File

@ -13,6 +13,7 @@ import com.github.libretube.DONATE_URL
import com.github.libretube.GITHUB_URL
import com.github.libretube.PIPED_GITHUB_URL
import com.github.libretube.R
import com.github.libretube.WEBLATE_URL
import com.github.libretube.WEBSITE_URL
import com.github.libretube.activities.SettingsActivity
import com.github.libretube.databinding.FragmentAboutBinding
@ -55,6 +56,15 @@ class AboutFragment : Fragment() {
true
}
binding.translate.setOnClickListener {
openLinkFromHref(WEBLATE_URL)
}
binding.translate.setOnLongClickListener {
val text = context?.getString(R.string.translate_summary)!!
showSnackBar(text)
true
}
binding.donate.setOnClickListener {
openLinkFromHref(DONATE_URL)
}

View File

@ -0,0 +1,70 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="300"
android:viewportHeight="300">
<path
android:fillType="nonZero"
android:pathData="m177.25,187.61c-2.89,-0.01 -5.77,-0.6 -8.48,-1.78 -6.11,-2.66 -11.49,-7.69 -15.87,-14.49 1.25,-2.22 2.37,-4.52 3.38,-6.85 4.41,-10.24 6.5,-21.46 6.66,-32.59 -0.02,-0.22 -0.04,-0.44 -0.06,-0.66l-0.01,-0.57c-0.01,-4.37 -0.67,-8.79 -2.18,-12.91 -1.73,-4.75 -4.49,-9.5 -8.86,-11.35 -0.8,-0.34 -1.63,-0.48 -2.46,-0.46 -5.5,-10.29 -5.68,-20.15 0,-29.54 0.1,0 0.21,0 0.31,0 6.7,0.07 13.34,2.14 19.02,5.75 15.47,9.83 23.18,29 23.35,47.82 0,0.22 -0,0.44 -0.01,0.66h0.09c-0.02,19.89 -4.8,40.05 -14.87,56.98zM142.95,218.82c-14.45,5.94 -31.23,5.62 -45.55,-1.03C80.92,210.15 68.33,195.29 60.58,178.32 47.32,149.3 47.01,114.6 59.59,85.14 69.04,88.92 77.44,82.9 77.44,82.9c0,0 -0.02,9.26 8.95,13.9 -9.2,21.56 -8.98,47.17 0.24,68.17 4.44,10.11 11.22,19.52 20.62,24.84 3.35,1.9 7.04,3.13 10.83,3.59 0.01,0.02 0.03,0.04 0.04,0.07 6.7,10.45 15.13,19.16 24.83,25.35z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="147.14"
android:endY="132.2"
android:startX="50.39"
android:startY="132.2"
android:type="linear">
<item
android:color="#FF00D2E6"
android:offset="0" />
<item
android:color="#FF2ECCAA"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.3"
android:fillType="evenOdd"
android:pathData="m177.24,187.61c-2.89,-0.02 -5.76,-0.6 -8.48,-1.78 -6.11,-2.66 -11.5,-7.69 -15.87,-14.5 1.25,-2.22 2.38,-4.52 3.38,-6.86 1.33,-3.09 2.45,-6.26 3.36,-9.5 2.13,-7.5 30.38,2.02 26.07,14.37 -2.22,6.37 -5.04,12.51 -8.47,18.27zM142.94,218.83c-14.45,5.94 -31.22,5.62 -45.54,-1.03 -16.48,-7.65 0.45,-33.3 9.85,-27.98 3.35,1.9 7.04,3.12 10.83,3.59 0.02,0.02 0.03,0.05 0.05,0.07 6.69,10.45 15.13,19.15 24.82,25.35z"
android:strokeAlpha="0.3">
<aapt:attr name="android:fillColor">
<gradient
android:endX="166.07"
android:endY="173.98"
android:startX="107.01"
android:startY="194.56"
android:type="linear">
<item
android:color="#00000000"
android:offset="0" />
<item
android:color="#FF000000"
android:offset="0.51" />
<item
android:color="#00000000"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillType="nonZero"
android:pathData="m106.76,130.63c-0.01,-0.22 -0.01,-0.44 -0.01,-0.66C106.93,111.15 114.64,91.98 130.11,82.15 135.79,78.54 142.43,76.47 149.13,76.39c0.1,-0 0.21,-0 0.31,-0L149.44,105.93c-0.83,-0.02 -1.67,0.12 -2.46,0.46 -4.38,1.85 -7.13,6.6 -8.86,11.35 -1.5,4.12 -2.17,8.54 -2.18,12.91l-0.01,0.57c-0.01,0.22 -0.03,0.44 -0.06,0.66 0.16,11.13 2.26,22.35 6.66,32.59 4.93,11.47 12.78,22.03 23.85,26.85 8.35,3.64 17.61,2.78 25.18,-1.51 9.4,-5.32 16.18,-14.73 20.62,-24.84 9.22,-21.01 9.44,-46.62 0.24,-68.17 8.97,-4.64 8.95,-13.9 8.95,-13.9 0,0 8.4,6.02 17.85,2.24 12.58,29.47 12.27,64.16 -0.99,93.18 -7.75,16.97 -20.34,31.83 -36.82,39.48 -14.67,6.81 -31.91,6.98 -46.59,0.58C141.62,212.63 130.89,202.27 123.17,190.23 111.99,172.79 106.7,151.55 106.68,130.63Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="151.82"
android:endY="134.64"
android:startX="248.41"
android:startY="134.64"
android:type="linear">
<item
android:color="#FF1FA385"
android:offset="0" />
<item
android:color="#FF2ECCAA"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
</vector>

View File

@ -81,6 +81,24 @@
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/translate"
style="@style/AboutCard">
<LinearLayout style="@style/AboutItem">
<ImageView
style="@style/AboutImageView"
android:src="@drawable/ic_weblate" />
<TextView
style="@style/AboutTextView"
android:text="@string/translate" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/donate"
style="@style/AboutCard">

View File

@ -284,4 +284,6 @@
<string name="network_all">All networks</string>
<string name="network_metered">Metered</string>
<string name="network_wifi">WiFi only</string>
<string name="translate">Translate</string>
<string name="translate_summary">Help by translating the app to the language you speak</string>
</resources>