Skip to content

Commit

Permalink
Updated overview UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarnagiris committed Oct 20, 2014
1 parent 2b93424 commit d8d51bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
###Version: 0.11.4
- ```new``` Small UI improvements on home screen.
- ```fix``` Fixed account balance calculation.
- ```fix``` In categories report instead of 0% when rounded down now there is <1%

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.code44.finance.ui.overview;

import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;

import com.code44.finance.R;
import com.code44.finance.adapters.NavigationAdapter;
Expand Down Expand Up @@ -74,24 +72,10 @@ public static OverviewFragment newInstance() {
accounts_V = (AccountsView) view.findViewById(R.id.accounts_V);

// Setup
newTransaction_FAB.setColorFilter(getResources().getColor(R.color.dark_transparent));
newTransaction_FAB.setOnClickListener(this);
overviewGraph_V.setOnClickListener(this);
accounts_V.setOnClickListener(this);

// Animate
if (savedInstanceState == null) {
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override public void onGlobalLayout() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
//noinspection deprecation
view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
animateIn();
}
});
}
}

@Override public void onActivityCreated(Bundle savedInstanceState) {
Expand Down Expand Up @@ -158,23 +142,6 @@ public static OverviewFragment newInstance() {
getLoaderManager().restartLoader(LOADER_TRANSACTIONS, null, this);
}

private void animateIn() {
// Prepare for animation
overviewGraphContainer_V.setTranslationY(-overviewGraph_V.getHeight());
newTransaction_FAB.setScaleX(0.0f);
newTransaction_FAB.setScaleY(0.0f);
container_V.setAlpha(0.0f);

// Animation constants
final long startDelay = 500;
final long duration = 250;

// Animate
overviewGraphContainer_V.animate().translationY(0).setDuration(duration).setStartDelay(startDelay).start();
newTransaction_FAB.animate().scaleX(1).scaleY(1).rotation(360).setDuration(duration).setStartDelay(startDelay).start();
container_V.animate().alpha(1).setDuration(duration).setStartDelay(startDelay).start();
}

private void onTransactionsLoaded(Cursor cursor) {
final Map<Category, Long> expenses = new HashMap<>();
if (cursor.moveToFirst()) {
Expand Down
4 changes: 3 additions & 1 deletion financius/src/main/res/layout/fragment_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
android:layout_marginRight="@dimen/keyline"
android:layout_marginTop="@dimen/btn_fab_half_negative"
android:elevation="@dimen/elevation_fab"
android:scaleType="centerInside"
android:src="@drawable/ic_action_new"
tools:ignore="RtlHardcoded,UnusedAttribute" />
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:tint="@color/dark_transparent" />
</RelativeLayout>
1 change: 1 addition & 0 deletions financius/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<color name="accent_transparent">#8fcddc39</color>
<color name="accent_dark">#afb42b</color>
<color name="accent_dark_transparent">#8fafb42b</color>
<color name="dark_transparent">#8f000000</color>

<color name="bg_window">#f0f0f0</color>
<color name="bg_primary">#fafafa</color>
Expand Down

0 comments on commit d8d51bd

Please sign in to comment.