|
1 | 1 | package cn.refactor.multistatelayoutdemo; |
2 | 2 |
|
3 | | -import android.animation.ObjectAnimator; |
4 | 3 | import android.content.Intent; |
5 | 4 | import android.os.Bundle; |
6 | 5 | import android.support.v7.app.AppCompatActivity; |
7 | 6 | import android.support.v7.widget.Toolbar; |
| 7 | +import android.util.Log; |
8 | 8 | import android.view.LayoutInflater; |
9 | 9 | import android.view.Menu; |
10 | 10 | import android.view.MenuItem; |
11 | 11 | import android.view.View; |
12 | | -import android.view.animation.AccelerateInterpolator; |
13 | 12 | import android.widget.Toast; |
14 | 13 |
|
15 | 14 | import cn.refactor.multistatelayout.MultiStateLayout; |
16 | | -import cn.refactor.multistatelayout.TransitionAnimatorLoader; |
17 | 15 |
|
18 | 16 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { |
19 | 17 |
|
| 18 | + private static final String TAG = MainActivity.class.getSimpleName(); |
20 | 19 | private static final int KEY_CUSTOM_NOTICE = 1024; |
21 | 20 |
|
22 | 21 | private MultiStateLayout mStateLayout; |
@@ -55,16 +54,6 @@ public void onClick(View view) { |
55 | 54 | // setup custom notice message view |
56 | 55 | View customNoticeMsgView = LayoutInflater.from(this).inflate(R.layout.layout_custom_notice, mStateLayout, false); |
57 | 56 | mStateLayout.putCustomStateView(KEY_CUSTOM_NOTICE, customNoticeMsgView); |
58 | | - |
59 | | - mStateLayout.setTransitionAnimator(new TransitionAnimatorLoader() { |
60 | | - @Override |
61 | | - public ObjectAnimator loadAnimator(View targetView) { |
62 | | - ObjectAnimator customAnimator = ObjectAnimator.ofFloat(targetView, "alpha", 0.0f, 1.0f) |
63 | | - .setDuration(500); |
64 | | - customAnimator.setInterpolator(new AccelerateInterpolator()); |
65 | | - return customAnimator; |
66 | | - } |
67 | | - }); |
68 | 57 | } |
69 | 58 |
|
70 | 59 | private void setupToolbar() { |
@@ -96,6 +85,7 @@ public boolean onMenuItemClick(MenuItem item) { |
96 | 85 | default: |
97 | 86 | break; |
98 | 87 | } |
| 88 | + Log.d(TAG, String.valueOf(mStateLayout.getState())); |
99 | 89 | return true; |
100 | 90 | } |
101 | 91 | }); |
|
0 commit comments