Skip to content

Commit

Permalink
Link to FAQ in the app TeamNewPipe#4447
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuu2990 committed Oct 21, 2022
1 parent 02deaa0 commit f2664d9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 17 deletions.
10 changes: 10 additions & 0 deletions app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class AboutActivity : AppCompatActivity() {
setSupportActionBar(aboutBinding.aboutToolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)

// val button = findViewById<View>(R.id.faq_link) as Button
// button.setOnClickListener(myListener)

// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
val mAboutStateAdapter = AboutStateAdapter(this)
Expand All @@ -45,6 +48,12 @@ class AboutActivity : AppCompatActivity() {
}.attach()
}

// private val myListener = View.OnClickListener {
// val uri = Uri.parse("https://www.anu.edu.au/")
// val intent = Intent(Intent.ACTION_VIEW, uri)
// startActivity(intent)
// }

override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == android.R.id.home) {
finish()
Expand Down Expand Up @@ -78,6 +87,7 @@ class AboutActivity : AppCompatActivity() {
aboutDonationLink.openLink(R.string.donation_url)
aboutWebsiteLink.openLink(R.string.website_url)
aboutPrivacyPolicyLink.openLink(R.string.privacy_policy_url)
faqLink.openLink(R.string.faq_url)
return root
}
}
Expand Down
60 changes: 44 additions & 16 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="55dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginBottom="0dp"
android:contentDescription="@string/app_name"
android:src="@mipmap/ic_launcher" />

Expand All @@ -26,7 +26,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/app_name"
android:textAppearance="@android:style/TextAppearance.Large" />
android:textAppearance="@android:style/TextAppearance.Large"
android:textSize="20sp" />


<org.schabi.newpipe.views.NewPipeTextView
Expand All @@ -41,13 +42,36 @@
<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingBottom="0dp"
android:text="@string/app_description" />

<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/newPipeTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:text="@string/faq_title"
android:textAppearance="@android:style/TextAppearance.Medium" />

<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/newPipeTextView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:text="@string/faq_description" />

<Button
android:id="@+id/faq_link"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="33dp"
android:layout_gravity="end"
android:text="@string/faq"
android:textSize="8sp" />

<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="0dp"
android:text="@string/contribution_title"
android:textAppearance="@android:style/TextAppearance.Medium" />

Expand All @@ -60,14 +84,15 @@
android:id="@+id/about_github_link"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="33dp"
android:layout_gravity="end"
android:text="@string/view_on_github" />
android:text="@string/view_on_github"
android:textSize="8sp" />

<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingTop="0dp"
android:text="@string/donation_title"
android:textAppearance="@android:style/TextAppearance.Medium" />

Expand All @@ -80,14 +105,15 @@
android:id="@+id/about_donation_link"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="29dp"
android:layout_gravity="end"
android:text="@string/give_back" />
android:text="@string/give_back"
android:textSize="8sp" />

<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingTop="0dp"
android:text="@string/website_title"
android:textAppearance="@android:style/TextAppearance.Medium" />

Expand All @@ -100,14 +126,15 @@
android:id="@+id/about_website_link"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="32dp"
android:layout_gravity="end"
android:text="@string/open_in_browser" />
android:text="@string/open_in_browser"
android:textSize="8sp" />

<org.schabi.newpipe.views.NewPipeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingTop="0dp"
android:text="@string/privacy_policy_title"
android:textAppearance="@android:style/TextAppearance.Medium" />

Expand All @@ -120,9 +147,10 @@
android:id="@+id/about_privacy_policy_link"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="33dp"
android:layout_gravity="end"
android:text="@string/read_privacy_policy" />
android:text="@string/read_privacy_policy"
android:textSize="8sp" />

</LinearLayout>
</androidx.core.widget.NestedScrollView>
1 change: 1 addition & 0 deletions app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<string name="donation_url">https://newpipe.net/donate/</string>
<string name="website_url">https://newpipe.net/</string>
<string name="privacy_policy_url">https://newpipe.net/legal/privacy/</string>
<string name="faq_url">https://newpipe.net/FAQ/</string>
<string name="service_kiosk_string">%1$s/%2$s</string>
<string name="youtube">YouTube</string>
<string name="soundcloud">SoundCloud</string>
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
<string name="title_activity_about">About NewPipe</string>
<string name="title_licenses">Third-party Licenses</string>
<string name="copyright">© %1$s by %2$s under %3$s</string>
<string name="tab_about">About</string>
<string name="tab_about">About \u0026 FAQ</string>
<string name="tab_licenses">Licenses</string>
<string name="app_description">Libre lightweight streaming on Android.</string>
<string name="contribution_title">Contribute</string>
Expand All @@ -365,6 +365,9 @@
<string name="app_license_title">NewPipe\'s License</string>
<string name="app_license">NewPipe is copyleft libre software: You can use, study, share, and improve it at will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</string>
<string name="read_full_license">Read license</string>
<string name="faq_title">Frequently asked questions</string>
<string name="faq_description">View this website and you\'ll find answers to the questions we get asked the most about NewPipe.</string>
<string name="faq">view on website</string>
<!-- History -->
<string name="title_activity_history">History</string>
<string name="action_history">History</string>
Expand Down

0 comments on commit f2664d9

Please sign in to comment.