Browse Source

Added animated logo at LoginActivity, though still needs optimization (add a dleay, perhaps change speed)

pull/24/head
Ezerous 8 years ago
parent
commit
3baf622879
  1. 1
      app/build.gradle
  2. 22
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  3. BIN
      app/src/main/res/drawable/logo_animated.gif
  4. BIN
      app/src/main/res/drawable/logo_try_no_letter.png
  5. BIN
      app/src/main/res/drawable/thmmy_material_somehow.png
  6. 27
      app/src/main/res/layout/activity_login.xml

1
app/build.gradle

@ -42,6 +42,7 @@ dependencies {
transitive = true
}
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
}
apply plugin: 'com.google.gms.google-services'

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

@ -11,9 +11,14 @@ import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Toast;
import java.io.IOException;
import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.main.MainActivity;
import mthmmy.utils.Report;
import pl.droidsonroids.gif.AnimationListener;
import pl.droidsonroids.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView;
import static gr.thmmy.mthmmy.session.SessionManager.CONNECTION_ERROR;
import static gr.thmmy.mthmmy.session.SessionManager.EXCEPTION;
@ -86,6 +91,23 @@ public class LoginActivity extends BaseActivity {
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
}
});
GifDrawable gifFromPath = null;
try {
gifFromPath = new GifDrawable( getResources(), R.drawable.logo_animated );
gifFromPath.setSpeed(0.75f);
gifFromPath.addAnimationListener(new AnimationListener() {
@Override
public void onAnimationCompleted(int loopNumber) {
recreate();
}
});
} catch (IOException e) {
e.printStackTrace();
}
GifImageView gifImageView = (GifImageView) findViewById(R.id.logo);
gifImageView.setImageDrawable(gifFromPath);
}
@Override

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
app/src/main/res/drawable/logo_try_no_letter.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

BIN
app/src/main/res/drawable/thmmy_material_somehow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

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

@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:background="@color/background">
<ScrollView
android:id="@+id/inner_scroll_view"
@ -21,29 +22,17 @@
<Space
android:layout_width="match_parent"
android:layout_height="25dp"/>
android:layout_height="100dp"/>
<ImageView
android:id="@+id/thmmyLogo"
<pl.droidsonroids.gif.GifImageView
android:layout_width="match_parent"
android:layout_height="144dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="0dp"
android:contentDescription="@string/thmmy_img_description"
android:src="@drawable/logo_try_no_letter"/>
<ImageView
android:id="@+id/thmmy3dImg"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="0dp"
android:contentDescription="@string/thmmy_img_description"
android:src="@drawable/thmmy_material_somehow"/>
android:layout_height="match_parent"
android:id="@+id/logo"
/>
<Space
android:layout_width="match_parent"
android:layout_height="10dp"/>
android:layout_height="50dp"/>
<!-- Username Label -->
<android.support.design.widget.TextInputLayout

Loading…
Cancel
Save