mirror of
https://github.com/amnezia-vpn/amneziawg-android.git
synced 2026-05-17 08:26:12 +03:00
Add import disclaimer (#27)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
amneziawgVersionCode=4
|
||||
amneziawgVersionName=1.1.1
|
||||
amneziawgVersionCode=5
|
||||
amneziawgVersionName=1.1.2
|
||||
amneziawgPackageName=org.amnezia.awg
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
|
||||
@@ -7,11 +7,13 @@ package org.amnezia.awg.fragment
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewTreeObserver
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
@@ -42,6 +44,7 @@ class AddTunnelsSheet : BottomSheetDialogFragment() {
|
||||
qrcode.isEnabled = false
|
||||
qrcode.visibility = View.GONE
|
||||
}
|
||||
view.findViewById<TextView>(R.id.disclaimer)?.let { it.movementMethod = LinkMovementMethod.getInstance() }
|
||||
return view
|
||||
}
|
||||
|
||||
|
||||
@@ -63,16 +63,53 @@
|
||||
android:layout_marginEnd="@dimen/normal_margin"
|
||||
android:layout_marginRight="@dimen/normal_margin"
|
||||
android:nextFocusUp="@id/create_from_qrcode"
|
||||
android:nextFocusDown="@id/disclaimer"
|
||||
android:nextFocusForward="@id/disclaimer"
|
||||
android:text="@string/create_empty"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
app:icon="@drawable/ic_action_edit"
|
||||
app:iconPadding="@dimen/bottom_sheet_icon_padding"
|
||||
app:iconTint="?attr/colorSecondary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/delimiter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/create_from_qrcode"
|
||||
app:rippleColor="?attr/colorSecondary" />
|
||||
|
||||
<View
|
||||
android:id="@+id/delimiter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="@dimen/medium_margin"
|
||||
android:layout_marginLeft="@dimen/medium_margin"
|
||||
android:layout_marginEnd="@dimen/medium_margin"
|
||||
android:layout_marginRight="@dimen/medium_margin"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:background="?attr/colorSecondary"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/disclaimer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/create_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/disclaimer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/medium_margin"
|
||||
android:layout_marginLeft="@dimen/medium_margin"
|
||||
android:layout_marginEnd="@dimen/medium_margin"
|
||||
android:layout_marginRight="@dimen/medium_margin"
|
||||
android:nextFocusUp="@id/create_empty"
|
||||
android:text="@string/import_disclaimer"
|
||||
android:linksClickable="true"
|
||||
android:focusable="true"
|
||||
android:textAppearance="?attr/textAppearanceBodySmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textColorLink="?android:attr/textColorLink"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/delimiter" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -269,4 +269,5 @@
|
||||
<string name="biometric_prompt_private_key_title">Аутентификация для просмотра приватного ключа</string>
|
||||
<string name="biometric_auth_error">Ошибка аутентификации</string>
|
||||
<string name="biometric_auth_error_reason">Ошибка аутентификации: %s</string>
|
||||
<string name="import_disclaimer">Убедитесь, что вы получили файл конфигурации в надёжном источнике.\n\nОфициальные сервисы Amnezia доступны только на сайте <a href="https://storage.googleapis.com/amnezia/amnezia.org">amnezia.org</a>\n</string>
|
||||
</resources>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="bottom_sheet_item_height">56dp</dimen>
|
||||
<dimen name="normal_margin">8dp</dimen>
|
||||
<dimen name="medium_margin">24dp</dimen>
|
||||
<dimen name="bottom_sheet_top_padding">8dp</dimen>
|
||||
<dimen name="bottom_sheet_icon_padding">16dp</dimen>
|
||||
<dimen name="tunnel_list_placeholder_margin">16dp</dimen>
|
||||
|
||||
@@ -253,4 +253,5 @@
|
||||
<string name="biometric_prompt_private_key_title">Authenticate to view private key</string>
|
||||
<string name="biometric_auth_error">Authentication failure</string>
|
||||
<string name="biometric_auth_error_reason">Authentication failure: %s</string>
|
||||
<string name="import_disclaimer">Ensure that you obtained the configuration file from a trusted source.\n\nOfficial Amnezia services are available only at <a href="https://amnezia.org">amnezia.org</a>\n</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user