Add XML icons, add XML button icon, refactor button
This commit is contained in:
parent
e46b93f0ec
commit
cb4fec980b
2
.idea/deploymentTargetDropDown.xml
generated
2
.idea/deploymentTargetDropDown.xml
generated
@ -15,7 +15,7 @@
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-02-16T23:14:28.483192164Z" />
|
||||
<timeTargetWasSelectedWithDropDown value="2024-02-19T08:27:46.302081639Z" />
|
||||
</State>
|
||||
</entry>
|
||||
</value>
|
||||
|
||||
@ -11,8 +11,8 @@ android {
|
||||
applicationId = "cz.bugsy.passwordzebra"
|
||||
minSdk = 29
|
||||
targetSdk = 34
|
||||
versionCode = 6
|
||||
versionName = "1.5.0"
|
||||
versionCode = 7
|
||||
versionName = "1.6.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import kotlin.random.Random
|
||||
@ -14,7 +13,6 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var generateButton: Button
|
||||
private lateinit var passwordTextView: TextView
|
||||
private lateinit var iconImageView: ImageView
|
||||
private lateinit var switchWithoutSpaces: com.google.android.material.switchmaterial.SwitchMaterial
|
||||
private lateinit var switchSpecialChars: com.google.android.material.switchmaterial.SwitchMaterial
|
||||
private lateinit var passwordLengthPicker: android.widget.NumberPicker
|
||||
@ -25,8 +23,6 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
generateButton = findViewById(R.id.generateButton)
|
||||
passwordTextView = findViewById(R.id.passwordTextView)
|
||||
//iconImageView = findViewById(R.id.iconImageView)
|
||||
generateButton = findViewById(R.id.generateButton)
|
||||
switchWithoutSpaces = findViewById(R.id.switchWithoutSpaces)
|
||||
switchSpecialChars = findViewById(R.id.switchSpecialChars)
|
||||
passwordLengthPicker = findViewById(R.id.passwordLengthPicker)
|
||||
|
||||
5
app/src/main/res/drawable-night/pw_generate.xml
Normal file
5
app/src/main/res/drawable-night/pw_generate.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M480,800q-134,0 -227,-93t-93,-227q0,-134 93,-227t227,-93q69,0 132,28.5T720,270v-110h80v280L520,440v-80h168q-32,-56 -87.5,-88T480,240q-100,0 -170,70t-70,170q0,100 70,170t170,70q77,0 139,-44t87,-116h84q-28,106 -114,173t-196,67Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable-night/pw_letter_spacing.xml
Normal file
5
app/src/main/res/drawable-night/pw_letter_spacing.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M160,800v-640h80v640h-80ZM720,800v-640h80v640h-80ZM294,680l150,-400h72l150,400h-69l-36,-102L399,578l-36,102h-69ZM420,520h120l-58,-166h-4l-58,166Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable-night/pw_special_character.xml
Normal file
5
app/src/main/res/drawable-night/pw_special_character.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M120,840v-120h200q-84,-45 -132,-125t-48,-175q0,-142 99,-241t241,-99q142,0 241,99t99,241q0,95 -48,175T640,720h200v120L520,840v-204q78,-14 129,-75t51,-141q0,-92 -64,-156t-156,-64q-92,0 -156,64t-64,156q0,80 51,141t129,75v204L120,840Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable-night/pw_straighten.xml
Normal file
5
app/src/main/res/drawable-night/pw_straighten.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FFFFFFFF" android:pathData="M160,720q-33,0 -56.5,-23.5T80,640v-320q0,-33 23.5,-56.5T160,240h640q33,0 56.5,23.5T880,320v320q0,33 -23.5,56.5T800,720L160,720ZM160,640h640v-320L680,320v160h-80v-160h-80v160h-80v-160h-80v160h-80v-160L160,320v320ZM280,480h80,-80ZM440,480h80,-80ZM600,480h80,-80ZM480,480Z"/>
|
||||
</vector>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB |
@ -1,6 +1,6 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke android:width="1dip" android:color="#4fa5d5"/>
|
||||
<stroke android:width="1dip" android:color="@color/material_dynamic_primary80"/>
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
|
||||
5
app/src/main/res/drawable/pw_generate.xml
Normal file
5
app/src/main/res/drawable/pw_generate.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M480,800q-134,0 -227,-93t-93,-227q0,-134 93,-227t227,-93q69,0 132,28.5T720,270v-110h80v280L520,440v-80h168q-32,-56 -87.5,-88T480,240q-100,0 -170,70t-70,170q0,100 70,170t170,70q77,0 139,-44t87,-116h84q-28,106 -114,173t-196,67Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/pw_letter_spacing.xml
Normal file
5
app/src/main/res/drawable/pw_letter_spacing.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M160,800v-640h80v640h-80ZM720,800v-640h80v640h-80ZM294,680l150,-400h72l150,400h-69l-36,-102L399,578l-36,102h-69ZM420,520h120l-58,-166h-4l-58,166Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/pw_special_character.xml
Normal file
5
app/src/main/res/drawable/pw_special_character.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M120,840v-120h200q-84,-45 -132,-125t-48,-175q0,-142 99,-241t241,-99q142,0 241,99t99,241q0,95 -48,175T640,720h200v120L520,840v-204q78,-14 129,-75t51,-141q0,-92 -64,-156t-156,-64q-92,0 -156,64t-64,156q0,80 51,141t129,75v204L120,840Z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/pw_straighten.xml
Normal file
5
app/src/main/res/drawable/pw_straighten.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="960" android:viewportWidth="960"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M160,720q-33,0 -56.5,-23.5T80,640v-320q0,-33 23.5,-56.5T160,240h640q33,0 56.5,23.5T880,320v320q0,33 -23.5,56.5T800,720L160,720ZM160,640h640v-320L680,320v160h-80v-160h-80v160h-80v-160h-80v160h-80v-160L160,320v320ZM280,480h80,-80ZM440,480h80,-80ZM600,480h80,-80ZM480,480Z"/>
|
||||
</vector>
|
||||
@ -3,7 +3,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
tools:context=".MainActivity"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="2dp">
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
@ -37,14 +39,14 @@
|
||||
android:id="@+id/passwordTextView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="150dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/password_background"
|
||||
android:gravity="center"
|
||||
android:minHeight="150dp"
|
||||
android:padding="16dp"
|
||||
android:text=""
|
||||
android:background="@drawable/password_background"
|
||||
android:textSize="24sp"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -55,20 +57,20 @@
|
||||
android:id="@+id/passwordLengthLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginBottom="76dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@string/textview_password_length"
|
||||
app:layout_constraintBottom_toTopOf="@id/switchWithoutSpaces"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/passwordLengthPicker"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline4"
|
||||
app:layout_constraintTop_toTopOf="@+id/passwordLengthPicker" />
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/passwordLengthPicker"
|
||||
android:layout_width="69dp"
|
||||
android:layout_height="178dp"
|
||||
android:layout_marginStart="81dp"
|
||||
android:layout_marginEnd="72dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/switchWithoutSpaces"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/guideline5"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/passwordLengthLabel"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@ -76,29 +78,42 @@
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/switchWithoutSpaces"
|
||||
android:layout_width="267dp"
|
||||
android:layout_width="299dp"
|
||||
android:layout_height="48dp"
|
||||
android:text="@string/switch_without_spaces"
|
||||
style="@style/Widget.Material3.CompoundButton.MaterialSwitch"
|
||||
app:layout_constraintBottom_toTopOf="@id/switchSpecialChars"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="@id/guideline4" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/switchSpecialChars"
|
||||
android:layout_width="267dp"
|
||||
android:layout_width="299dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:text="@string/switch_special_characters"
|
||||
style="@style/Widget.Material3.CompoundButton.MaterialSwitch"
|
||||
app:layout_constraintBottom_toTopOf="@id/generateButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="@id/guideline4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/generateButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
app:iconGravity="textTop"
|
||||
android:padding="0dp"
|
||||
app:cornerRadius="16dp"
|
||||
app:iconPadding="0dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:layout_marginBottom="44dp"
|
||||
android:text="@string/generate_button_text"
|
||||
android:tooltipText="@string/button_generate_text"
|
||||
android:contentDescription="@string/button_generate_description"
|
||||
app:icon="@drawable/pw_generate"
|
||||
app:iconSize="0dp"
|
||||
app:backgroundColor="@color/design_default_color_primary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
@ -111,6 +126,62 @@
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/passwordLengthLabel"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintTop_toTopOf="@+id/passwordLengthLabel"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:srcCompat="@drawable/pw_straighten" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/switchWithoutSpaces"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintTop_toTopOf="@+id/switchWithoutSpaces"
|
||||
app:layout_constraintVertical_bias="0.8"
|
||||
app:srcCompat="@drawable/pw_letter_spacing" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/switchSpecialChars"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintTop_toTopOf="@+id/switchSpecialChars"
|
||||
app:layout_constraintVertical_bias="0.625"
|
||||
app:srcCompat="@drawable/pw_special_character" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="16dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="65dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="364dp" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Password Zebra</string>
|
||||
<string name="generate_button_text">Generovat</string>
|
||||
<string name="button_generate_text">Generovat</string>
|
||||
<string name="info_text">Dotekem zkopírujete text do schránky</string>
|
||||
<string name="textview_password_length">Délka hesla</string>
|
||||
<string name="switch_without_spaces">Kopírovat bez mezer</string>
|
||||
<string name="switch_special_characters">Přidat speciální znaky</string>
|
||||
<string name="button_generate_description">Vytvořit nové heslo</string>
|
||||
</resources>
|
||||
@ -1,8 +1,9 @@
|
||||
<resources>
|
||||
<string name="app_name">Password Zebra</string>
|
||||
<string name="generate_button_text">Generate</string>
|
||||
<string name="button_generate_text">Generate</string>
|
||||
<string name="info_text">Tap to copy password to clipboard</string>
|
||||
<string name="textview_password_length">Password Length</string>
|
||||
<string name="switch_without_spaces">Copy Without Spaces</string>
|
||||
<string name="switch_special_characters">Add Special Characters</string>
|
||||
<string name="button_generate_description">Generate new password</string>
|
||||
</resources>
|
||||
Loading…
x
Reference in New Issue
Block a user