Skip to content

Commit

Permalink
Animated setup screens, added back buttom from login screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaitoAnderson committed Nov 2, 2013
1 parent b169e79 commit 88c7cdd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
24 changes: 22 additions & 2 deletions Skrumaz/src/main/java/com/skrumaz/app/Login.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.skrumaz.app;

import android.app.ActionBar;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
Expand All @@ -10,6 +11,7 @@
import android.util.Base64;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
Expand Down Expand Up @@ -90,13 +92,31 @@ public void onClick(View v) {
new GetUser().execute();
};
});

// Add back button icon
ActionBar actionbar = getActionBar();
actionbar.setDisplayHomeAsUpEnabled(true);
actionbar.setTitle("Login");
}

@Override
public void onBackPressed() {
returnToWelcome();
}

public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
returnToWelcome();
return true;
}
return false;
}

private void returnToWelcome() {
// Sent to Welcome
Intent welcome = new Intent(getApplicationContext(), Welcome.class);
startActivity(welcome);
startActivity(new Intent(getApplicationContext(), Welcome.class));
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.fade_out);
finish(); // Remove Activity from Stack
}

Expand Down
4 changes: 2 additions & 2 deletions Skrumaz/src/main/java/com/skrumaz/app/Welcome.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ protected void SetService(Service service) {
Preferences.setService(getBaseContext(), service);

// Sent to Login
Intent login = new Intent(getApplicationContext(), Login.class);
startActivity(login);
startActivity(new Intent(getApplicationContext(), Login.class));
overridePendingTransition(R.anim.slide_in_right, android.R.anim.fade_out);
finish(); // Remove Activity from Stack
}
}
8 changes: 8 additions & 0 deletions Skrumaz/src/main/res/anim/slide_in_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="50%p" android:toXDelta="0"
android:duration="@android:integer/config_mediumAnimTime"/>
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_mediumAnimTime" />
</set>

0 comments on commit 88c7cdd

Please sign in to comment.