Browse Source

LoginActivity improvements

pull/70/head
Ezerous 5 years ago
parent
commit
1168cff3d1
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 3
      app/build.gradle
  2. 3
      app/proguard-rules.pro
  3. 3
      app/src/main/assets/mit_libraries.html
  4. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  5. BIN
      app/src/main/res/drawable/logo_animated.gif
  6. 16
      app/src/main/res/layout/activity_login.xml

3
app/build.gradle

@ -84,7 +84,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.exifinterface:exifinterface:1.2.0' implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.firebase:firebase-analytics:17.4.2' implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-messaging:20.2.0' implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.snatik:storage:2.1.0' implementation 'com.snatik:storage:2.1.0'
@ -96,7 +96,6 @@ dependencies {
implementation 'com.mikepenz:materialdrawer:6.1.1' implementation 'com.mikepenz:materialdrawer:6.1.1'
implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar' implementation 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar'
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar' implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
implementation 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'//TODO: deprecated! implementation 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'//TODO: deprecated!
implementation 'com.github.chrisbanes:PhotoView:2.3.0' implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'me.zhanghai.android.materialprogressbar:library:1.4.2' implementation 'me.zhanghai.android.materialprogressbar:library:1.4.2'

3
app/proguard-rules.pro

@ -43,9 +43,6 @@
<fields>; <fields>;
} }
# android-gif-drawable
-keep public class pl.droidsonroids.gif.GifIOException{<init>(int, java.lang.String);}
# JSoup # JSoup
-keep class org.jsoup.** -keep class org.jsoup.**

3
app/src/main/assets/mit_libraries.html

@ -8,9 +8,6 @@
<li> <li>
<h5><a href="https://jsoup.org">jsoup</a>&nbsp;v1.13.1 (Copyright ©2009-2020, Jonathan Hedley &lt;jonathan@hedley.net&gt;)</h5> <h5><a href="https://jsoup.org">jsoup</a>&nbsp;v1.13.1 (Copyright ©2009-2020, Jonathan Hedley &lt;jonathan@hedley.net&gt;)</h5>
</li> </li>
<li>
<h5><a href="https://github.com/koral--/android-gif-drawable">android-gif-drawable</a>&nbsp;v1.2.19 (Copyright ©2013 -2020 Karol Wrótniak, Droids on Roids)</h5>
</li>
<li> <li>
<h5><a href="https://github.com/bignerdranch/expandable-recycler-view">Expandable RecyclerView</a>&nbsp;v3.0.0-RC1 (Copyright ©2015, Big Nerd Ranch)</h5> <h5><a href="https://github.com/bignerdranch/expandable-recycler-view">Expandable RecyclerView</a>&nbsp;v3.0.0-RC1 (Copyright ©2015, Big Nerd Ranch)</h5>
</li> </li>

6
app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java

@ -6,6 +6,7 @@ import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.Toast; import android.widget.Toast;
@ -13,6 +14,7 @@ import android.widget.Toast;
import androidx.appcompat.widget.AppCompatButton; import androidx.appcompat.widget.AppCompatButton;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.bumptech.glide.Glide;
import com.google.firebase.analytics.FirebaseAnalytics; import com.google.firebase.analytics.FirebaseAnalytics;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
@ -35,6 +37,7 @@ public class LoginActivity extends BaseActivity {
private AppCompatButton btnLogin; private AppCompatButton btnLogin;
private EditText inputUsername; private EditText inputUsername;
private EditText inputPassword; private EditText inputPassword;
private ImageView logo;
private String username; private String username;
private String password; private String password;
/* --Graphics End-- */ /* --Graphics End-- */
@ -56,6 +59,9 @@ public class LoginActivity extends BaseActivity {
inputPassword = findViewById(R.id.password); inputPassword = findViewById(R.id.password);
btnLogin = findViewById(R.id.btnLogin); btnLogin = findViewById(R.id.btnLogin);
AppCompatButton btnGuest = findViewById(R.id.btnContinueAsGuest); AppCompatButton btnGuest = findViewById(R.id.btnContinueAsGuest);
logo = findViewById(R.id.logo);
Glide.with(this).load(R.drawable.logo_animated).into(logo);
//Login button Click Event //Login button Click Event
btnLogin.setOnClickListener(view -> { btnLogin.setOnClickListener(view -> {

BIN
app/src/main/res/drawable/logo_animated.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 KiB

After

Width:  |  Height:  |  Size: 453 KiB

16
app/src/main/res/layout/activity_login.xml

@ -24,21 +24,20 @@
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="0.4"/> android:layout_weight="0.45"/>
<pl.droidsonroids.gif.GifImageView <ImageView
android:id="@+id/logo" android:id="@+id/logo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:contentDescription="@string/thmmy_img_description" android:contentDescription="@string/thmmy_img_description"
android:src="@drawable/logo_animated"
/> />
<Space <Space
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="0.45"/> android:layout_weight="0.35"/>
<!-- Username Label --> <!-- Username Label -->
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
@ -49,8 +48,9 @@
android:id="@+id/username" android:id="@+id/username"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="@string/hint_username" android:hint="@string/hint_username"
android:inputType="textPersonName"/> android:autofillHints="username" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<Space <Space
@ -62,14 +62,16 @@
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:passwordToggleEnabled="true"> app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/primary_text">
<EditText <EditText
android:id="@+id/password" android:id="@+id/password"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="@string/hint_password" android:hint="@string/hint_password"
android:inputType="textPassword"/> android:autofillHints="password" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<Space <Space

Loading…
Cancel
Save