Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #12

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dc8bb6d
Updated gradle files
saulmm Jun 14, 2015
fcd7556
Added pre-21 styles
saulmm Jun 14, 2015
e043578
Created coordinator activity structure
saulmm Jun 14, 2015
1a53d72
Added CoordinatorLayout AppBarLayout and scroll attributes
saulmm Jun 14, 2015
079f2fb
added necessary icons
saulmm Jul 22, 2015
b408008
Added navigation view on MainActivity
saulmm Aug 4, 2015
8a0e663
Now the DrawerLayout overlaps the status bar
saulmm Aug 12, 2015
4cb6be1
Added HomeFragment
saulmm Aug 12, 2015
86959b4
Added working navigation view and elevation fragment access
saulmm Aug 18, 2015
dfba370
Refactored elevationfragment
saulmm Aug 18, 2015
cb0426f
Merge branch 'feature/add_navigation_view' into develop
saulmm Aug 18, 2015
193a114
Refactored colorActivity
saulmm Aug 19, 2015
265afae
Changed layout and behaviour from ColorActivity
saulmm Aug 23, 2015
3f67653
End ColorActivity refactorizations
saulmm Aug 23, 2015
2ada889
Merge branch 'feature/refactor_color_activity' into develop
saulmm Aug 23, 2015
56a4c1c
Refactorizations on activity transitions layouts
saulmm Aug 23, 2015
dc8f740
Improved Transition activities
saulmm Sep 11, 2015
8f3142c
Linked Transitions Activity with MainActivity
saulmm Sep 11, 2015
444af2d
Merge branch 'feature/refactor_transitions_activities' into develop
saulmm Sep 11, 2015
8e9207a
Refactored colors
saulmm Oct 3, 2015
adc1678
Refactored MainActivity
saulmm Oct 3, 2015
c524af2
Deleted DialerActivity and menu entry
saulmm Oct 4, 2015
b190176
Deleted dealer stuff and unused resources
saulmm Oct 4, 2015
2f98119
Merge branch 'feature/minor_ui_details' into develop
saulmm Oct 4, 2015
ef82f5b
Added ic_cards file & CardsFragment
saulmm Oct 4, 2015
4da703c
Deleted useles classes
saulmm Oct 4, 2015
8b14a41
Improved cards
saulmm Oct 4, 2015
be3ceca
Changed main activity
saulmm Oct 4, 2015
68ff42e
Merge branch 'feature/fragment_cards' into develop
saulmm Oct 4, 2015
3e97400
Fixed bad indentantion and code style
saulmm Oct 6, 2015
82eaec5
Multiple refactorizations, mostly on the reveal activities
saulmm Oct 6, 2015
237c3e1
Multiple refactorizations, deleted a huge amount of resources, change…
saulmm Oct 6, 2015
538d810
Merge branch 'feature/fix-global-issues' into develop
saulmm Oct 6, 2015
de7b306
Improved Transitions
saulmm Oct 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "20.0.0"
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.saulmm.material.myapplication"
minSdkVersion 21
targetSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand All @@ -16,7 +16,9 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'

}
76 changes: 36 additions & 40 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.saulmm.material" >

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label=""
android:theme="@style/AppTheme" >

<activity android:name="com.saulmm.material.activities.TransitionFirstActivity"
android:theme="@style/TransitionSampleActivity">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="com.saulmm.material.activities.TransitionSecondActivity"
android:theme="@style/TransitionSampleSecondActivity"/>

<activity android:name="com.saulmm.material.activities.SlidingActivity" >
</activity>
<activity
android:name="com.saulmm.material.activities.DialerSampleActivity"
android:screenOrientation="portrait" >

</activity>
<activity
android:name="com.saulmm.material.activities.ColorActivity"
android:label="@string/title_activity_color" />
<activity
android:name="com.saulmm.material.activities.ElevationSampleActivity"
android:label="@string/title_activity_elevation_sample" >


</activity>
</application>

<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.saulmm.material"
>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MaterialExamplesTheme"
>
<activity
android:name=".activities.MainActivity"
android:theme="@style/MaterialExamplesTheme.Translucent"
>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<activity android:name=".activities.TransitionFirstActivity"/>
<activity android:name=".activities.TransitionSecondActivity"/>

<activity android:name=".activities.RevealFirstActivity"
android:theme="@style/MaterialExamplesTheme.Translucent"
/>

<activity
android:name=".activities.RevealSecondActivity"
android:theme="@style/ColorActivityTheme2"
/>

<activity android:name=".activities.CardsActivity"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.saulmm.material.activities;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import com.saulmm.material.R;

public class CardsActivity extends AppCompatActivity implements View.OnClickListener {
private View mActionViewPrimary;
private View mActionViewSecondary;
private View mContentView;
private int mContentViewHeight;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_cards);

mContentView = findViewById(R.id.view_card_raw_content);
mActionViewPrimary = findViewById(R.id.view_card_raw_action_primary);
mActionViewSecondary = findViewById(R.id.view_card_raw_action_secondary);
mActionViewSecondary.setOnClickListener(this);
mActionViewPrimary.setOnClickListener(this);

mContentView.getViewTreeObserver().addOnPreDrawListener(
new ViewTreeObserver.OnPreDrawListener() {
@Override public boolean onPreDraw() {
mContentView.getViewTreeObserver().removeOnPreDrawListener(this);

final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
final int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);

mContentView.measure(widthSpec, heightSpec);
mContentViewHeight = mContentView.getHeight();
mContentView.setVisibility(View.GONE);

return true;
}
});
}

@Override
public void onClick(View v) {
if (v.getId() == R.id.view_card_raw_action_primary) {
if (mContentView.getVisibility() == View.GONE) expandContentView();
else collapseContentView();

} else if (v.getId() == R.id.view_card_raw_action_secondary) {
mContentView.setVisibility(View.GONE);
}
}

private void collapseContentView() {
ValueAnimator valueHeightAnimator = ValueAnimator.ofInt(mContentViewHeight, 0);
valueHeightAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override public void onAnimationUpdate(ValueAnimator animation) {
ViewGroup.LayoutParams lp = mContentView.getLayoutParams();
lp.height = (Integer) animation.getAnimatedValue();
mContentView.setLayoutParams(lp);
}
});

valueHeightAnimator.start();
valueHeightAnimator.addListener(new AnimatorListenerAdapter() {
@Override public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mContentView.setVisibility(View.GONE);
}
});
}

private void expandContentView() {
mContentView.setVisibility(View.VISIBLE);
ValueAnimator valueHeightAnimator = ValueAnimator.ofInt(0, mContentViewHeight);
valueHeightAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override public void onAnimationUpdate(ValueAnimator animation) {
ViewGroup.LayoutParams lp = mContentView.getLayoutParams();
lp.height = (Integer) animation.getAnimatedValue();
mContentView.setLayoutParams(lp);
}
});

valueHeightAnimator.start();
}
}
162 changes: 0 additions & 162 deletions app/src/main/java/com/saulmm/material/activities/ColorActivity.java

This file was deleted.

Loading