Merge branch 'libre-tube:master' into master

This commit is contained in:
XelXen 2022-06-12 15:56:52 +05:30 committed by GitHub
commit eb6eec245f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 27 deletions

View File

@ -13,7 +13,6 @@ import android.widget.TextView
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.github.libretube.BuildConfig import com.github.libretube.BuildConfig
import com.github.libretube.R import com.github.libretube.R
import com.github.libretube.util.checkUpdate
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
class AboutFragment : Fragment() { class AboutFragment : Fragment() {
@ -65,10 +64,6 @@ class AboutFragment : Fragment() {
.show() .show()
true true
} }
val update = view.findViewById<LinearLayout>(R.id.update)
update?.setOnClickListener {
checkUpdate(childFragmentManager)
}
} }
private fun openLinkFromHref(link: String) { private fun openLinkFromHref(link: String) {

View File

@ -6,10 +6,12 @@ import androidx.fragment.app.Fragment
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import com.github.libretube.BuildConfig
import com.github.libretube.R import com.github.libretube.R
import com.github.libretube.isCurrentViewMainSettings import com.github.libretube.isCurrentViewMainSettings
import com.github.libretube.requireMainActivityRestart import com.github.libretube.requireMainActivityRestart
import com.github.libretube.util.ThemeHelper import com.github.libretube.util.ThemeHelper
import com.github.libretube.util.checkUpdate
class MainSettings : PreferenceFragmentCompat() { class MainSettings : PreferenceFragmentCompat() {
val TAG = "SettingsFragment" val TAG = "SettingsFragment"
@ -67,6 +69,13 @@ class MainSettings : PreferenceFragmentCompat() {
navigateSettings(newFragment) navigateSettings(newFragment)
true true
} }
val update = findPreference<Preference>("update")
update?.title = getString(R.string.version, BuildConfig.VERSION_NAME)
update?.setOnPreferenceClickListener {
checkUpdate(childFragmentManager)
true
}
} }
private fun navigateSettings(newFragment: Fragment) { private fun navigateSettings(newFragment: Fragment) {

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="420.83"
android:viewportHeight="420.83"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M210.31,32.5C164.41,32.5 120.8,50 87.53,81.77 54.37,113.43 34.86,155.97 32.62,201.54c-0.11,2.31 0.72,4.57 2.32,6.25 1.6,1.68 3.81,2.63 6.13,2.63l38.23,0c4.46,0 8.15,-3.46 8.44,-7.92 4.12,-64.44 57.96,-114.92 122.58,-114.92 67.73,0 122.83,55.1 122.83,122.84 0,67.73 -55.1,122.84 -122.83,122.84 -15.31,0 -30.25,-2.78 -44.39,-8.26l14.68,-13.04c2.27,-1.99 3.31,-5.04 2.72,-8.01 -0.59,-2.96 -2.71,-5.39 -5.57,-6.36l-95.54,-27.52c-2.86,-0.97 -6.02,-0.34 -8.29,1.65 -2.27,1.99 -3.31,5.04 -2.72,8L91.44,373.38c0.59,2.96 2.71,5.39 5.57,6.36 2.86,0.97 6.02,0.34 8.29,-1.65l15.73,-13.78c27.01,15.7 57.88,24.01 89.27,24.01 98.1,0 177.91,-79.81 177.91,-177.91C388.22,112.31 308.41,32.5 210.31,32.5Z"
android:strokeWidth="1" />
<path
android:fillColor="#FF000000"
android:pathData="m197.48,233.65l100.2,0c2.33,0 4.23,-1.9 4.23,-4.23l0,-25.37c0,-2.33 -1.9,-4.23 -4.23,-4.23l-70.6,0l0,-76.94c0,-2.33 -1.9,-4.23 -4.23,-4.23l-25.37,0c-2.33,0 -4.23,1.9 -4.23,4.23l0,106.54c0,2.33 1.9,4.23 4.23,4.23z"
android:strokeWidth="1" />
</vector>

View File

@ -11,7 +11,7 @@
android:id="@+id/back_imageButton" android:id="@+id/back_imageButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="4dp" android:layout_marginLeft="6dp"
android:layout_marginVertical="10dp" android:layout_marginVertical="10dp"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:src="@drawable/ic_arrow_back" /> android:src="@drawable/ic_arrow_back" />

View File

@ -134,26 +134,6 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/update"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="20dp" android:paddingVertical="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/update"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/update_summary" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -143,7 +143,7 @@
<string name="live">Live</string> <string name="live">Live</string>
<string name="no_replies">This comment has no replies.</string> <string name="no_replies">This comment has no replies.</string>
<string name="authors">Authors</string> <string name="authors">Authors</string>
<string name="authors_summary">Get to know team LibreTube and how it all happens.</string> <string name="authors_summary">Get to know team LibreTube and all its contributors helping to improve the app.</string>
<string name="download_folder">Name</string> <string name="download_folder">Name</string>
<string name="download_folder_summary">The name of the folder downloaded media is stored in.</string> <string name="download_folder_summary">The name of the folder downloaded media is stored in.</string>
<string name="internal_storage">Internal storage</string> <string name="internal_storage">Internal storage</string>
@ -169,4 +169,6 @@
<string name="empty_instance">You have to fill in the name and the API url.</string> <string name="empty_instance">You have to fill in the name and the API url.</string>
<string name="clear_customInstances">Clear custom instances</string> <string name="clear_customInstances">Clear custom instances</string>
<string name="invalid_url">Please enter a valid url</string> <string name="invalid_url">Please enter a valid url</string>
<string name="version">Version %1$s</string>
<string name="about_summary">Get to know team LibreTube and how it all happens.</string>
</resources> </resources>

View File

@ -57,8 +57,15 @@
<Preference <Preference
android:icon="@drawable/ic_info" android:icon="@drawable/ic_info"
app:key="about" app:key="about"
app:summary="@string/about_summary"
app:title="@string/about" /> app:title="@string/about" />
<Preference
android:icon="@drawable/ic_update"
app:key="update"
app:summary="@string/update_summary"
app:title="App version" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>