Skip to content

Commit b939b50

Browse files
committed
Usability improvements
1 parent 6e1ee3f commit b939b50

File tree

9 files changed

+119
-95
lines changed

9 files changed

+119
-95
lines changed

App/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
applicationId "org.astonbitecode.rustkeylock"
1313
minSdk 30
1414
targetSdk 35
15-
versionCode 1700
16-
versionName "0.17.0"
15+
versionCode 1701
16+
versionName "0.17.1"
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
}

App/src/main/java/org/astonbitecode/rustkeylock/fragments/EnterPassword.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
// along with rust-keylock. If not, see <http://www.gnu.org/licenses/>.
1616
package org.astonbitecode.rustkeylock.fragments;
1717

18+
import android.graphics.drawable.Drawable;
19+
import android.widget.ImageView;
1820
import android.widget.ProgressBar;
1921
import org.astonbitecode.rustkeylock.R;
2022
import org.astonbitecode.rustkeylock.api.InterfaceWithRust;
@@ -30,6 +32,7 @@
3032
import android.widget.Button;
3133
import android.widget.EditText;
3234

35+
import static android.view.View.INVISIBLE;
3336
import static android.view.View.VISIBLE;
3437

3538
public class EnterPassword extends Fragment implements OnClickListener, BackButtonHandler {
@@ -38,6 +41,7 @@ public class EnterPassword extends Fragment implements OnClickListener, BackButt
3841
private transient EditText passwordText;
3942
private transient EditText numberText;
4043
private transient ProgressBar progressBarDecrypting;
44+
private transient ImageView rklLogo;
4145
private transient Button buttonDecrypt;
4246

4347
public EnterPassword() {
@@ -70,6 +74,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
7074
b.setOnClickListener(this);
7175
this.progressBarDecrypting = rootView.findViewById(R.id.progressBar_decrypting);
7276
this.buttonDecrypt = rootView.findViewById(R.id.buttonDecrypt);
77+
this.rklLogo = rootView.findViewById(R.id.changableImage);
78+
this.rklLogo.setVisibility(VISIBLE);
79+
this.progressBarDecrypting.setVisibility(INVISIBLE);
7380

7481
return rootView;
7582
}
@@ -88,6 +95,7 @@ public void onClick(View view) {
8895
} else {
8996
try {
9097
int num = Integer.parseInt(numString);
98+
this.rklLogo.setVisibility(INVISIBLE);
9199
this.progressBarDecrypting.setVisibility(VISIBLE);
92100
this.buttonDecrypt.setEnabled(false);
93101
InterfaceWithRust.INSTANCE.set_password(pass, num);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<rotate
5+
android:drawable="@drawable/ic_launcher"
6+
android:fillAfter="true"
7+
android:fromDegrees="0"
8+
android:pivotX="50%"
9+
android:pivotY="50%"
10+
android:toDegrees="360"/>
11+
</item>
12+
</layer-list>

App/src/main/res/layout/fragment_change_password.xml

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
android:id="@+id/ChangePasswordLayout"
4-
android:layout_width="match_parent"
5-
android:layout_height="match_parent"
6-
android:gravity="center|top"
7-
android:orientation="vertical"
8-
android:paddingBottom="@dimen/activity_vertical_margin"
9-
android:paddingLeft="@dimen/activity_horizontal_margin"
10-
android:paddingRight="@dimen/activity_horizontal_margin"
11-
android:paddingTop="@dimen/activity_vertical_margin"
12-
tools:context="org.astonbitecode.rustkeylock.MainActivity" >
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:id="@+id/ChangePasswordLayout"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:gravity="center|top"
7+
android:orientation="vertical"
8+
android:paddingBottom="@dimen/activity_vertical_margin"
9+
android:paddingLeft="@dimen/activity_horizontal_margin"
10+
android:paddingRight="@dimen/activity_horizontal_margin"
11+
android:paddingTop="@dimen/activity_vertical_margin"
12+
tools:context="org.astonbitecode.rustkeylock.MainActivity">
1313

1414
<TextView
15-
android:id="@+id/welcomeLabelChangePassword"
16-
android:layout_width="wrap_content"
17-
android:layout_height="wrap_content"
18-
android:text="Master password setup"
19-
android:textAppearance="?android:attr/textAppearanceLarge" />
15+
android:id="@+id/welcomeLabelChangePassword"
16+
android:layout_width="wrap_content"
17+
android:layout_height="wrap_content"
18+
android:text="Master password setup"
19+
android:textAppearance="?android:attr/textAppearanceLarge"/>
2020

2121
<ScrollView
22-
android:id="@+id/scrollViewChangePassword"
23-
android:layout_width="match_parent"
24-
android:layout_height="wrap_content"
25-
android:gravity="center|top" >
26-
27-
<LinearLayout
22+
android:id="@+id/scrollViewChangePassword"
2823
android:layout_width="match_parent"
2924
android:layout_height="wrap_content"
30-
android:layout_marginTop="33sp"
31-
android:gravity="center|top"
32-
android:orientation="vertical" >
25+
android:gravity="center|top">
3326

34-
<TextView
35-
android:id="@+id/passwordLabelChangePassword1"
36-
android:layout_width="wrap_content"
27+
<LinearLayout
28+
android:layout_width="match_parent"
3729
android:layout_height="wrap_content"
38-
android:text="Please provide your Password"
39-
android:textAppearance="?android:attr/textAppearanceSmall" />
30+
android:layout_marginTop="33sp"
31+
android:gravity="center|top"
32+
android:orientation="vertical">
33+
34+
<TextView
35+
android:id="@+id/passwordLabelChangePassword1"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:text="Please provide your Password"
39+
android:textAppearance="?android:attr/textAppearanceSmall"/>
4040

4141
<EditText
4242
android:id="@+id/editPasswordChangePassword1"
@@ -45,63 +45,63 @@
4545
android:inputType="textPassword"
4646
tools:ignore="Autofill">
4747

48-
<requestFocus />
48+
<requestFocus/>
4949
</EditText>
5050

5151
<TextView
52-
android:id="@+id/passwordLabelChangePassword2"
53-
android:layout_width="wrap_content"
54-
android:layout_height="wrap_content"
55-
android:layout_marginTop="6sp"
56-
android:text="Please re-enter your Password"
57-
android:textAppearance="?android:attr/textAppearanceSmall" />
52+
android:id="@+id/passwordLabelChangePassword2"
53+
android:layout_width="wrap_content"
54+
android:layout_height="wrap_content"
55+
android:layout_marginTop="6sp"
56+
android:text="Please re-enter your Password"
57+
android:textAppearance="?android:attr/textAppearanceSmall"/>
5858

5959
<EditText
60-
android:id="@+id/editPasswordChangePassword2"
61-
android:layout_width="match_parent"
62-
android:layout_height="wrap_content"
63-
android:inputType="textPassword"
64-
tools:ignore="Autofill" />
60+
android:id="@+id/editPasswordChangePassword2"
61+
android:layout_width="match_parent"
62+
android:layout_height="wrap_content"
63+
android:inputType="textPassword"
64+
tools:ignore="Autofill"/>
6565

6666
<TextView
67-
android:id="@+id/favoriteNumberLabelChangePassword1"
68-
android:layout_width="wrap_content"
69-
android:layout_height="wrap_content"
70-
android:layout_marginTop="6sp"
71-
android:text="What is your favorite number?"
72-
android:textAppearance="?android:attr/textAppearanceSmall" />
67+
android:id="@+id/favoriteNumberLabelChangePassword1"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
70+
android:layout_marginTop="6sp"
71+
android:text="What is your favorite number?"
72+
android:textAppearance="?android:attr/textAppearanceSmall"/>
7373

7474
<EditText
75-
android:id="@+id/editFavoriteNumberChangePassword1"
76-
android:layout_width="match_parent"
77-
android:layout_height="wrap_content"
78-
android:inputType="numberPassword"
79-
tools:ignore="Autofill" />
75+
android:id="@+id/editFavoriteNumberChangePassword1"
76+
android:layout_width="match_parent"
77+
android:layout_height="wrap_content"
78+
android:inputType="numberPassword"
79+
tools:ignore="Autofill"/>
8080

8181
<TextView
82-
android:id="@+id/favoriteNumberLabelChangePassword2"
83-
android:layout_width="wrap_content"
84-
android:layout_height="wrap_content"
85-
android:layout_marginTop="6sp"
86-
android:text="Please re-enter your favorite number"
87-
android:textAppearance="?android:attr/textAppearanceSmall" />
82+
android:id="@+id/favoriteNumberLabelChangePassword2"
83+
android:layout_width="wrap_content"
84+
android:layout_height="wrap_content"
85+
android:layout_marginTop="6sp"
86+
android:text="Please re-enter your favorite number"
87+
android:textAppearance="?android:attr/textAppearanceSmall"/>
8888

8989
<EditText
90-
android:id="@+id/editFavoriteNumberChangePassword2"
91-
android:layout_width="match_parent"
92-
android:layout_height="wrap_content"
93-
android:inputType="numberPassword"
94-
tools:ignore="Autofill" />
90+
android:id="@+id/editFavoriteNumberChangePassword2"
91+
android:layout_width="match_parent"
92+
android:layout_height="wrap_content"
93+
android:inputType="numberPassword"
94+
tools:ignore="Autofill"/>
9595

9696
<Button
97-
android:id="@+id/buttonApplyChanges"
98-
android:layout_width="wrap_content"
99-
android:layout_height="wrap_content"
100-
android:layout_gravity="right"
101-
android:layout_marginTop="18sp"
102-
android:background="@android:color/transparent"
103-
android:drawableTop="@drawable/arrow_right"
104-
android:text="Apply" />
97+
android:id="@+id/buttonApplyChanges"
98+
android:layout_width="wrap_content"
99+
android:layout_height="wrap_content"
100+
android:layout_gravity="right"
101+
android:layout_marginTop="18sp"
102+
android:background="@android:color/transparent"
103+
android:drawableTop="@drawable/arrow_right"
104+
android:text="Apply"/>
105105
</LinearLayout>
106106
</ScrollView>
107107

App/src/main/res/layout/fragment_enter_password.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,24 @@
7373
android:drawableTop="@drawable/arrow_right"
7474
android:text="Decrypt"/>
7575

76-
<ImageView
77-
android:id="@+id/changableImage"
78-
android:layout_width="wrap_content"
79-
android:layout_height="wrap_content"
80-
android:src="@drawable/ic_launcher"
81-
android:contentDescription="rust-keylock"/>
76+
<RelativeLayout android:layout_height="100dp" android:layout_width="100dp"
77+
android:gravity="center|top">
78+
<ImageView
79+
android:id="@+id/changableImage"
80+
android:layout_width="100dp"
81+
android:layout_height="100dp"
82+
android:layout_centerHorizontal="true"
83+
android:src="@drawable/ic_launcher"
84+
android:contentDescription="rust-keylock"/>
85+
<ProgressBar
86+
android:id="@+id/progressBar_decrypting"
87+
android:layout_width="100dp"
88+
android:layout_height="100dp"
89+
android:layout_centerHorizontal="true"
90+
android:indeterminateDrawable="@drawable/rotating_rkl"/>
91+
</RelativeLayout>
92+
8293
</LinearLayout>
8394
</ScrollView>
84-
<ProgressBar
85-
android:id="@+id/progressBar_decrypting"
86-
android:layout_width="wrap_content"
87-
android:layout_height="wrap_content"
88-
android:minHeight="33dp"
89-
android:minWidth="33dp"
90-
android:visibility="invisible"/>
9195

9296
</LinearLayout>

App/src/main/res/layout/fragment_list_entries.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
android:layout_gravity="center"
77
android:gravity="top"
88
android:orientation="vertical"
9-
android:paddingBottom="16dp"
10-
android:paddingLeft="16dp"
11-
android:paddingRight="16dp"
12-
android:paddingTop="16dp"
9+
android:paddingBottom="@dimen/activity_vertical_margin"
10+
android:paddingLeft="@dimen/activity_horizontal_margin"
11+
android:paddingRight="@dimen/activity_horizontal_margin"
12+
android:paddingTop="@dimen/activity_vertical_margin"
1313
tools:context="org.astonbitecode.rustkeylock.MainActivity">
1414

1515
<RelativeLayout

App/src/main/res/values/dimens.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
<!-- Default screen margins, per the Android Design guidelines. -->
44
<dimen name="activity_horizontal_margin">16dp</dimen>
5-
<dimen name="activity_vertical_margin">16dp</dimen>
5+
<dimen name="activity_vertical_margin">32dp</dimen>
66

77
</resources>

App/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Base application theme, dependent on API level. This theme is replaced
55
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
66
-->
7-
<style name="AppBaseTheme" parent="android:Theme.Light">
7+
<style name="AppBaseTheme" parent="android:Theme.Material.Light.DarkActionBar">
88
<!--
99
Theme customizations available in newer API levels can go in
1010
res/values-vXX/styles.xml, while customizations related to

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.12.0' apply false
4-
id 'com.android.library' version '8.12.0' apply false
3+
id 'com.android.application' version '8.12.3' apply false
4+
id 'com.android.library' version '8.12.3' apply false
55
}
66

77
task clean(type: Delete) {

0 commit comments

Comments
 (0)