Add "Help us Translate Session" button

This commit is contained in:
nielsandriesse 2021-05-19 13:47:04 +10:00
parent 5a1cd99612
commit e79d23c910
2 changed files with 36 additions and 46 deletions

View File

@ -86,12 +86,11 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
publicKeyTextView.text = hexEncodedPublicKey
copyButton.setOnClickListener { copyPublicKey() }
shareButton.setOnClickListener { sharePublicKey() }
linkedDevicesButtonTopSeparator.visibility = View.GONE
linkedDevicesButton.visibility = View.GONE
privacyButton.setOnClickListener { showPrivacySettings() }
notificationsButton.setOnClickListener { showNotificationSettings() }
chatsButton.setOnClickListener { showChatSettings() }
sendInvitationButton.setOnClickListener { sendInvitation() }
helpTranslateButton.setOnClickListener { helpTranslate() }
seedButton.setOnClickListener { showSeed() }
clearAllDataButton.setOnClickListener { clearAllData() }
versionTextView.text = String.format(getString(R.string.version_s), "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})")
@ -292,6 +291,16 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
startActivity(intent)
}
private fun helpTranslate() {
try {
val url = "https://crowdin.com/project/session-android"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
} catch (e: Exception) {
Toast.makeText(this, "Can't open URL", Toast.LENGTH_LONG).show()
}
}
private fun showSeed() {
SeedDialog().show(supportFragmentManager, "Recovery Phrase Dialog")
}

View File

@ -111,11 +111,6 @@
android:layout_marginTop="@dimen/large_spacing"
android:background="?android:dividerHorizontal" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="?android:dividerHorizontal" />
<TextView
android:id="@+id/privacyButton"
android:layout_width="match_parent"
@ -160,40 +155,6 @@
android:text="@string/activity_settings_chats_button_title" />
<View
android:id="@+id/linkedDevicesButtonTopSeparator"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="?android:dividerHorizontal" />
<TextView
android:id="@+id/linkedDevicesButton"
android:layout_width="match_parent"
android:layout_height="@dimen/setting_button_height"
android:background="@drawable/setting_button_background"
android:textColor="@color/text"
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
android:text="@string/activity_settings_devices_button_title" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="?android:dividerHorizontal" />
<TextView
android:id="@+id/sendInvitationButton"
android:layout_width="match_parent"
android:layout_height="@dimen/setting_button_height"
android:background="@drawable/setting_button_background"
android:textColor="@color/text"
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
android:text="@string/activity_settings_invite_button_title" />
<View
android:id="@+id/seedButtonTopSeparator"
android:layout_width="match_parent"
android:layout_height="1px"
android:background="?android:dividerHorizontal" />
@ -231,21 +192,39 @@
android:layout_marginBottom="@dimen/medium_spacing"
android:background="?android:dividerHorizontal" />
<TextView
android:id="@+id/sendInvitationButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text"
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
android:text="@string/activity_settings_invite_button_title" />
<TextView
android:id="@+id/helpTranslateButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_spacing"
android:textColor="@color/text"
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
android:text="Help us Translate Session" />
<TextView
android:id="@+id/versionTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_spacing"
android:layout_marginBottom="@dimen/medium_spacing"
android:gravity="center"
android:text="@string/version_s"
android:textColor="@color/text"
android:alpha="0.6"
android:textSize="@dimen/very_small_font_size" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginBottom="@dimen/medium_spacing" />
</LinearLayout>
</ScrollView>
@ -254,6 +233,7 @@
android:animateLayoutChanges="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/loader"
android:layout_width="match_parent"
@ -272,4 +252,5 @@
</RelativeLayout>
</FrameLayout>
</RelativeLayout>