Rename the Community section to Help and add a FAQ

This commit is contained in:
Bnyro 2023-01-17 19:32:19 +01:00
parent 1433578cb0
commit 187086d2d8
8 changed files with 52 additions and 15 deletions

View File

@ -44,7 +44,7 @@
android:label="@string/settings" /> android:label="@string/settings" />
<activity <activity
android:name=".ui.activities.CommunityActivity" android:name=".ui.activities.HelpActivity"
android:label="@string/settings" /> android:label="@string/settings" />
<activity <activity

View File

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

View File

@ -4,34 +4,39 @@ import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import com.github.libretube.constants.DISCORD_URL import com.github.libretube.constants.DISCORD_URL
import com.github.libretube.constants.FAQ_URL
import com.github.libretube.constants.MATRIX_URL import com.github.libretube.constants.MATRIX_URL
import com.github.libretube.constants.REDDIT_URL import com.github.libretube.constants.REDDIT_URL
import com.github.libretube.constants.TELEGRAM_URL import com.github.libretube.constants.TELEGRAM_URL
import com.github.libretube.constants.TWITTER_URL import com.github.libretube.constants.TWITTER_URL
import com.github.libretube.databinding.ActivityCommunityBinding import com.github.libretube.databinding.ActivityHelpBinding
import com.github.libretube.ui.base.BaseActivity import com.github.libretube.ui.base.BaseActivity
class CommunityActivity : BaseActivity() { class HelpActivity : BaseActivity() {
private lateinit var binding: ActivityCommunityBinding private lateinit var binding: ActivityHelpBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
binding = ActivityCommunityBinding.inflate(layoutInflater) binding = ActivityHelpBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
binding.toolbar.setNavigationOnClickListener { binding.toolbar.setNavigationOnClickListener {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
} }
binding.telegram.setOnClickListener { binding.faq.setOnClickListener {
openLinkFromHref(TELEGRAM_URL) openLinkFromHref(FAQ_URL)
} }
binding.matrix.setOnClickListener { binding.matrix.setOnClickListener {
openLinkFromHref(MATRIX_URL) openLinkFromHref(MATRIX_URL)
} }
binding.telegram.setOnClickListener {
openLinkFromHref(TELEGRAM_URL)
}
binding.discord.setOnClickListener { binding.discord.setOnClickListener {
openLinkFromHref(DISCORD_URL) openLinkFromHref(DISCORD_URL)
} }

View File

@ -359,9 +359,9 @@ class MainActivity : BaseActivity() {
startActivity(aboutIntent) startActivity(aboutIntent)
true true
} }
R.id.action_community -> { R.id.action_help -> {
val communityIntent = Intent(this, CommunityActivity::class.java) val helpIntent = Intent(this, HelpActivity::class.java)
startActivity(communityIntent) startActivity(helpIntent)
true true
} }
else -> super.onOptionsItemSelected(item) else -> super.onOptionsItemSelected(item)

View File

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,19h-2v-2h2v2zM15.07,11.25l-0.9,0.92C13.45,12.9 13,13.5 13,15h-2v-0.5c0,-1.1 0.45,-2.1 1.17,-2.83l1.24,-1.26c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2L8,9c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,0.88 -0.36,1.68 -0.93,2.25z" />
</vector>

View File

@ -26,18 +26,18 @@
app:shapeAppearance="@style/CircleImageView" /> app:shapeAppearance="@style/CircleImageView" />
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/telegram" android:id="@+id/faq"
style="@style/AboutCard"> style="@style/AboutCard">
<LinearLayout style="@style/AboutItem"> <LinearLayout style="@style/AboutItem">
<ImageView <ImageView
style="@style/AboutImageView" style="@style/AboutImageView"
android:src="@drawable/ic_telegram" /> android:src="@drawable/ic_help" />
<TextView <TextView
style="@style/AboutTextView" style="@style/AboutTextView"
android:text="@string/telegram" /> android:text="@string/faq" />
</LinearLayout> </LinearLayout>
@ -61,6 +61,24 @@
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/telegram"
style="@style/AboutCard">
<LinearLayout style="@style/AboutItem">
<ImageView
style="@style/AboutImageView"
android:src="@drawable/ic_telegram" />
<TextView
style="@style/AboutTextView"
android:text="@string/telegram" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/discord" android:id="@+id/discord"
style="@style/AboutCard"> style="@style/AboutCard">

View File

@ -16,8 +16,8 @@
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/action_community" android:id="@+id/action_help"
android:title="@string/community" android:title="@string/help"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item

View File

@ -442,6 +442,8 @@
<string name="audio_only_mode_summary">Turn LibreTube into a music player.</string> <string name="audio_only_mode_summary">Turn LibreTube into a music player.</string>
<string name="sleep_timer">Sleep timer</string> <string name="sleep_timer">Sleep timer</string>
<string name="skip_silence">Skip silence</string> <string name="skip_silence">Skip silence</string>
<string name="help">Help</string>
<string name="faq">FAQ</string>
<!-- Notification channel strings --> <!-- Notification channel strings -->
<string name="download_channel_name">Download Service</string> <string name="download_channel_name">Download Service</string>