Browse Source

Animated Logo fixed

pull/24/head
Ezerous 8 years ago
parent
commit
de7343eb0f
  1. 22
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  2. BIN
      app/src/main/res/drawable/logo_animated.gif
  3. 1
      app/src/main/res/layout/activity_login.xml

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

@ -11,14 +11,9 @@ import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.Toast; import android.widget.Toast;
import java.io.IOException;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.main.MainActivity; import gr.thmmy.mthmmy.activities.main.MainActivity;
import mthmmy.utils.Report; 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.CONNECTION_ERROR;
import static gr.thmmy.mthmmy.session.SessionManager.EXCEPTION; import static gr.thmmy.mthmmy.session.SessionManager.EXCEPTION;
@ -91,23 +86,6 @@ public class LoginActivity extends BaseActivity {
overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
} }
}); });
//GIF logo init
GifImageView gifImageView = (GifImageView) findViewById(R.id.logo);
try {
final GifDrawable gifFromPath = new GifDrawable(getResources(), R.drawable.logo_animated);
gifFromPath.setSpeed(0.7f);
gifFromPath.addAnimationListener(new AnimationListener() {
@Override
public void onAnimationCompleted(int loopNumber) {
gifFromPath.reset();
}
});
gifImageView.setImageDrawable(gifFromPath);
} catch (IOException e) {
Report.wtf(TAG,"IO at animated logo (?)");
}
} }
@Override @Override

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 514 KiB

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

@ -28,6 +28,7 @@
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:src="@drawable/logo_animated"
android:id="@+id/logo" android:id="@+id/logo"
/> />

Loading…
Cancel
Save