0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Add AnkiWeb logo

This commit is contained in:
Sneha Datta 2024-09-19 22:06:21 +05:30
parent 5bf4326bb0
commit 10761bf161
5 changed files with 113 additions and 23 deletions

View File

@ -58,7 +58,8 @@ open class MyAccount : AnkiActivity() {
var toolbar: Toolbar? = null var toolbar: Toolbar? = null
private lateinit var passwordLayout: TextInputLayout private lateinit var passwordLayout: TextInputLayout
private lateinit var ankidroidLogo: ImageView private lateinit var ankiweb: ImageView
private lateinit var ankiwebLogo: ImageView
// if the 'remove account' fragment is open, close it first // if the 'remove account' fragment is open, close it first
private val onRemoveAccountBackCallback = object : OnBackPressedCallback(false) { private val onRemoveAccountBackCallback = object : OnBackPressedCallback(false) {
@ -110,9 +111,11 @@ open class MyAccount : AnkiActivity() {
switchToState(STATE_LOG_IN) switchToState(STATE_LOG_IN)
} }
if (isScreenSmall && this.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (isScreenSmall && this.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
ankidroidLogo.visibility = View.GONE ankiweb.visibility = View.GONE
ankiweb.visibility = View.GONE
} else { } else {
ankidroidLogo.visibility = View.VISIBLE ankiweb.visibility = View.VISIBLE
ankiweb.visibility = View.VISIBLE
} }
onBackPressedDispatcher.addCallback(this, onRemoveAccountBackCallback) onBackPressedDispatcher.addCallback(this, onRemoveAccountBackCallback)
} }
@ -181,7 +184,8 @@ open class MyAccount : AnkiActivity() {
userNameLayout = it.findViewById(R.id.username_layout) userNameLayout = it.findViewById(R.id.username_layout)
password = it.findViewById(R.id.password) password = it.findViewById(R.id.password)
passwordLayout = it.findViewById(R.id.password_layout) passwordLayout = it.findViewById(R.id.password_layout)
ankidroidLogo = it.findViewById(R.id.ankidroid_logo) ankiweb = it.findViewById(R.id.ankiweb)
ankiwebLogo = it.findViewById(R.id.ankidroid_logo)
} }
val loginButton = loginToMyAccountView.findViewById<Button>(R.id.login_button) val loginButton = loginToMyAccountView.findViewById<Button>(R.id.login_button)
loginToMyAccountView.findViewById<Button>(R.id.privacy_policy_button).apply { loginToMyAccountView.findViewById<Button>(R.id.privacy_policy_button).apply {
@ -262,7 +266,8 @@ open class MyAccount : AnkiActivity() {
findViewById<Button>(R.id.privacy_policy_button).apply { findViewById<Button>(R.id.privacy_policy_button).apply {
setOnClickListener { openAnkiDroidPrivacyPolicy() } setOnClickListener { openAnkiDroidPrivacyPolicy() }
} }
ankidroidLogo = findViewById(R.id.ankidroid_logo) ankiweb = findViewById(R.id.ankiweb)
ankiwebLogo = findViewById(R.id.ankidroid_logo)
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@ -287,9 +292,11 @@ open class MyAccount : AnkiActivity() {
override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
if (isScreenSmall && newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { if (isScreenSmall && newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
ankidroidLogo.visibility = View.GONE ankiweb.visibility = View.GONE
ankiweb.visibility = View.GONE
} else { } else {
ankidroidLogo.visibility = View.VISIBLE ankiweb.visibility = View.VISIBLE
ankiweb.visibility = View.VISIBLE
} }
} }

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="180dp"
android:height="36dp"
android:viewportWidth="205"
android:viewportHeight="45">
<path
android:fillColor="#25272A"
android:pathData="M177.946 36V1.09091H181.969V13.9773H182.31C182.605 13.5227 183.014 12.9432 183.537 12.2386C184.071 11.5227 184.832 10.8864 185.821 10.3295C186.821 9.76137 188.173 9.47728 189.878 9.47728C192.082 9.47728 194.026 10.0284 195.707 11.1307C197.389 12.233 198.702 13.7955 199.645 15.8182C200.588 17.8409 201.06 20.2273 201.06 22.9773C201.06 25.75 200.588 28.1534 199.645 30.1875C198.702 32.2102 197.395 33.7784 195.724 34.892C194.054 35.9943 192.128 36.5455 189.946 36.5455C188.264 36.5455 186.918 36.267 185.906 35.7102C184.895 35.142 184.116 34.5 183.571 33.7841C183.026 33.0568 182.605 32.4545 182.31 31.9773H181.832V36H177.946ZM181.901 22.9091C181.901 24.8864 182.19 26.6307 182.77 28.142C183.349 29.642 184.196 30.8182 185.31 31.6705C186.423 32.5114 187.787 32.9318 189.401 32.9318C191.082 32.9318 192.486 32.4886 193.611 31.6023C194.747 30.7045 195.599 29.5 196.168 27.9886C196.747 26.4659 197.037 24.7727 197.037 22.9091C197.037 21.0682 196.753 19.4091 196.185 17.9318C195.628 16.4432 194.781 15.267 193.645 14.4034C192.52 13.5284 191.105 13.0909 189.401 13.0909C187.764 13.0909 186.389 13.5057 185.276 14.3352C184.162 15.1534 183.321 16.3011 182.753 17.7784C182.185 19.2443 181.901 20.9545 181.901 22.9091Z" />
<path
android:fillColor="#25272A"
android:pathData="M160.44 36.5455C157.918 36.5455 155.741 35.9886 153.912 34.875C152.094 33.75 150.69 32.1818 149.702 30.1705C148.724 28.1477 148.236 25.7955 148.236 23.1136C148.236 20.4318 148.724 18.0682 149.702 16.0227C150.69 13.9659 152.065 12.3636 153.827 11.2159C155.599 10.0568 157.668 9.47727 160.031 9.47727C161.395 9.47727 162.741 9.70454 164.071 10.1591C165.401 10.6136 166.611 11.3523 167.702 12.375C168.793 13.3864 169.662 14.7273 170.31 16.3977C170.957 18.0682 171.281 20.125 171.281 22.5682V24.2727H151.099V20.7955H167.19C167.19 19.3182 166.895 18 166.304 16.8409C165.724 15.6818 164.895 14.767 163.815 14.0966C162.747 13.4261 161.486 13.0909 160.031 13.0909C158.429 13.0909 157.043 13.4886 155.872 14.2841C154.713 15.0682 153.821 16.0909 153.196 17.3523C152.571 18.6136 152.259 19.9659 152.259 21.4091V23.7273C152.259 25.7045 152.599 27.3807 153.281 28.7557C153.974 30.1193 154.935 31.1591 156.162 31.875C157.389 32.5795 158.815 32.9318 160.44 32.9318C161.497 32.9318 162.452 32.7841 163.304 32.4886C164.168 32.1818 164.912 31.7273 165.537 31.125C166.162 30.5114 166.645 29.75 166.986 28.8409L170.872 29.9318C170.463 31.25 169.776 32.4091 168.81 33.4091C167.844 34.3977 166.651 35.1705 165.23 35.7273C163.81 36.2727 162.213 36.5455 160.44 36.5455Z" />
<path
android:fillColor="#25272A"
android:pathData="M113.224 36L103.679 1.09091H107.974L115.27 29.5227H115.611L123.043 1.09091H127.815L135.247 29.5227H135.588L142.884 1.09091H147.179L137.634 36H133.27L125.565 8.18182H125.293L117.588 36H113.224Z" />
<path
android:fillColor="#25272A"
android:pathData="M93.3068 36V9.81818H97.3296V36H93.3068ZM95.3523 5.45455C94.5682 5.45455 93.892 5.1875 93.3239 4.65341C92.767 4.11932 92.4886 3.47727 92.4886 2.72727C92.4886 1.97727 92.767 1.33523 93.3239 0.801135C93.892 0.267045 94.5682 0 95.3523 0C96.1364 0 96.8068 0.267045 97.3636 0.801135C97.9318 1.33523 98.2159 1.97727 98.2159 2.72727C98.2159 3.47727 97.9318 4.11932 97.3636 4.65341C96.8068 5.1875 96.1364 5.45455 95.3523 5.45455Z" />
<path
android:fillColor="#25272A"
android:pathData="M70.9474 26.4545L70.8793 21.4773H71.6974L83.152 9.81818H88.1293L75.9247 22.1591H75.5838L70.9474 26.4545ZM67.1974 36V1.09091H71.2202V36H67.1974ZM83.8338 36L73.6065 23.0455L76.4702 20.25L88.9474 36H83.8338Z" />
<path
android:fillColor="#25272A"
android:pathData="M43.142 20.25V36H39.1193V9.81818H43.0057V13.9091H43.3466C43.9602 12.5795 44.892 11.5114 46.142 10.7045C47.392 9.88636 49.0057 9.47727 50.983 9.47727C52.7557 9.47727 54.3068 9.84091 55.6364 10.5682C56.9659 11.2841 58 12.375 58.7386 13.8409C59.4773 15.2955 59.8466 17.1364 59.8466 19.3636V36H55.8239V19.6364C55.8239 17.5795 55.2898 15.9773 54.2216 14.8295C53.1534 13.6705 51.6875 13.0909 49.8239 13.0909C48.5398 13.0909 47.3921 13.3693 46.3807 13.9261C45.3807 14.483 44.5909 15.2955 44.0114 16.3636C43.4318 17.4318 43.142 18.7273 43.142 20.25Z" />
<path
android:fillColor="#25272A"
android:pathData="M8.6591 36H4.22728L17.0455 1.09091H21.4091L34.2273 36H29.7955L19.3636 6.61364H19.0909L8.6591 36ZM10.2955 22.3636H28.1591V26.1136H10.2955V22.3636Z" />
</vector>

View File

@ -0,0 +1,26 @@
<vector xmlns:aapt="http://schemas.android.com/aapt"
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="192dp"
android:height="192dp"
android:viewportHeight="250"
android:viewportWidth="192">
<group
android:scaleX="1"
android:scaleY="1.3"
android:translateX="0"
android:translateY="0">
<path
android:name="path_21"
android:pathData="M 17.198 96.019 C 17.198 52.483 52.482 17.198 95.981 17.198 C 139.514 17.198 174.802 52.483 174.802 96.019 C 174.802 139.536 139.514 174.802 95.981 174.802 C 52.482 174.802 17.198 139.536 17.198 96.019 Z">
<path />
<path
android:name="path_22"
android:pathData="M 84.424 33.869 C 83.424 33.869 82.324 33.969 81.324 34.269 C 77.124 35.669 75.024 39.669 74.024 43.369 C 73.024 47.069 72.824 51.169 72.724 55.269 C 72.624 59.369 72.524 63.569 72.224 66.969 C 71.924 70.369 71.024 72.869 70.524 73.569 C 70.024 74.269 67.824 75.869 64.724 77.169 C 61.624 78.569 57.724 79.869 53.824 81.269 C 49.924 82.669 46.124 84.169 42.824 86.169 C 39.624 88.169 36.424 91.369 36.424 95.869 C 36.424 100.369 39.524 103.469 42.824 105.569 C 46.124 107.669 49.824 109.069 53.724 110.569 C 57.624 111.969 61.524 113.269 64.624 114.669 C 67.724 116.069 69.924 117.569 70.424 118.269 C 70.924 118.969 71.724 121.569 72.024 124.969 C 72.324 128.369 72.424 132.469 72.524 136.669 C 72.624 140.769 72.924 144.869 73.824 148.569 C 74.724 152.269 76.824 156.269 81.024 157.669 C 85.224 159.069 89.224 157.069 92.224 154.569 C 95.224 152.069 97.824 148.969 100.324 145.769 C 102.824 142.569 105.324 139.169 107.624 136.669 C 109.924 134.169 112.024 132.469 112.924 132.269 C 113.724 131.969 116.424 132.069 119.724 132.769 C 123.024 133.469 127.024 134.769 130.924 135.869 C 134.924 136.969 138.824 138.069 142.624 138.269 C 146.424 138.469 150.824 137.769 153.524 134.169 C 156.124 130.569 155.524 126.169 154.124 122.569 C 152.724 118.969 150.524 115.569 148.224 112.169 C 145.924 108.769 143.524 105.369 141.824 102.469 C 140.124 99.569 139.224 96.969 139.224 96.069 C 139.224 95.069 140.324 92.069 142.524 88.669 C 144.624 85.269 147.524 81.369 150.024 77.569 C 152.024 74.569 153.724 71.469 154.824 68.369 C 155.824 65.169 156.124 61.269 153.824 58.069 C 151.224 54.469 146.824 53.769 142.924 53.969 C 139.124 54.169 135.124 55.269 131.124 56.369 C 127.124 57.469 123.224 58.769 119.924 59.469 C 116.624 60.169 113.924 60.169 113.124 59.969 C 112.324 59.769 110.124 58.069 107.824 55.569 C 105.524 52.969 103.124 49.669 100.624 46.369 C 98.124 43.069 95.524 39.969 92.524 37.469 C 90.224 35.569 87.424 33.969 84.424 33.869 L 84.424 33.869 Z"
android:strokeColor="#00BAFF"
android:strokeWidth="8" />
</path>
</group>
</vector>

View File

@ -27,13 +27,29 @@
android:gravity="top" android:gravity="top"
> >
<!-- TODO JS choose a standardized padding to use here --> <!-- TODO JS choose a standardized padding to use here -->
<ImageView <LinearLayout
android:id="@+id/ankidroid_logo" android:layout_width="wrap_content"
android:layout_width="200dp" android:layout_height="wrap_content"
app:srcCompat="@drawable/ankidroid_logo" android:orientation="horizontal"
android:layout_marginBottom="@dimen/input_layout_padding" android:layout_gravity="center">
android:layout_gravity="center" <ImageView
android:layout_height="200dp" /> android:id="@+id/ankiweb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
app:srcCompat="@drawable/ankiweb"
android:layout_marginBottom="@dimen/input_layout_padding"
android:layout_gravity="center" />
<ImageView
android:id="@+id/ankiweb_logo"
android:layout_width="150dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ankiweb_logo"
android:layout_marginBottom="@dimen/input_layout_padding"
android:layout_gravity="center" />
</LinearLayout>
<!--<com.ichi2.ui.FixedTextView--> <!--<com.ichi2.ui.FixedTextView-->
<!--android:id="@+id/sign_in"--> <!--android:id="@+id/sign_in"-->

View File

@ -25,15 +25,27 @@
android:padding="15dp" android:padding="15dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
> >
<LinearLayout
<ImageView android:layout_width="wrap_content"
android:id="@+id/ankidroid_logo" android:layout_height="wrap_content"
android:layout_width="200dp" android:orientation="horizontal"
app:srcCompat="@drawable/ankidroid_logo" android:layout_gravity="center">
android:layout_marginBottom="0dp" <ImageView
android:layout_gravity="center" android:id="@+id/ankiweb"
android:layout_height="200dp" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
android:layout_marginStart="20dp"
app:srcCompat="@drawable/ankiweb"
android:layout_marginBottom="@dimen/input_layout_padding"
android:layout_gravity="center" />
<ImageView
android:id="@+id/ankiweb_logo"
android:layout_width="150dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ankiweb_logo"
android:layout_marginBottom="@dimen/input_layout_padding"
android:layout_gravity="center" />
</LinearLayout>
<com.ichi2.ui.FixedTextView <com.ichi2.ui.FixedTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"