Skip to content

Commit b257076

Browse files
author
kirill
committed
Reveal version update and deprecated methods removed
1 parent 0c516f8 commit b257076

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
buildToolsVersion "28.0.3"
1010

1111
defaultConfig {
12-
minSdkVersion 15
12+
minSdkVersion 16
1313
targetSdkVersion 28
1414
versionCode 1
1515
versionName "1.0"
@@ -26,5 +26,5 @@ dependencies {
2626
implementation project(':library')
2727
implementation fileTree(dir: 'libs', include: ['*.jar'])
2828
implementation 'com.android.support:appcompat-v7:28.0.0'
29-
implementation 'com.github.ozodrukh:CircularReveal:1.0.4'
29+
implementation 'com.github.ozodrukh:CircularReveal:2.1.0'
3030
}

app/src/main/java/yalantis/com/sidemenu/sample/MainActivity.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package yalantis.com.sidemenu.sample;
22

3+
import android.animation.Animator;
34
import android.content.res.Configuration;
45
import android.graphics.Color;
56
import android.graphics.drawable.BitmapDrawable;
@@ -17,7 +18,6 @@
1718
import java.util.ArrayList;
1819
import java.util.List;
1920

20-
import io.codetail.animation.SupportAnimator;
2121
import io.codetail.animation.ViewAnimationUtils;
2222
import yalantis.com.sidemenu.interfaces.Resourceble;
2323
import yalantis.com.sidemenu.interfaces.ScreenShotable;
@@ -30,7 +30,6 @@ public class MainActivity extends AppCompatActivity implements ViewAnimator.View
3030
private DrawerLayout drawerLayout;
3131
private ActionBarDrawerToggle drawerToggle;
3232
private List<SlideMenuItem> list = new ArrayList<>();
33-
private ContentFragment contentFragment;
3433
private ViewAnimator viewAnimator;
3534
private int res = R.drawable.content_music;
3635
private LinearLayout linearLayout;
@@ -40,13 +39,13 @@ public class MainActivity extends AppCompatActivity implements ViewAnimator.View
4039
protected void onCreate(Bundle savedInstanceState) {
4140
super.onCreate(savedInstanceState);
4241
setContentView(R.layout.activity_main);
43-
contentFragment = ContentFragment.newInstance(R.drawable.content_music);
42+
ContentFragment contentFragment = ContentFragment.newInstance(R.drawable.content_music);
4443
getSupportFragmentManager().beginTransaction()
4544
.replace(R.id.content_frame, contentFragment)
4645
.commit();
47-
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
46+
drawerLayout = findViewById(R.id.drawer_layout);
4847
drawerLayout.setScrimColor(Color.TRANSPARENT);
49-
linearLayout = (LinearLayout) findViewById(R.id.left_drawer);
48+
linearLayout = findViewById(R.id.left_drawer);
5049
linearLayout.setOnClickListener(new View.OnClickListener() {
5150
@Override
5251
public void onClick(View v) {
@@ -81,7 +80,7 @@ private void createMenuList() {
8180

8281

8382
private void setActionBar() {
84-
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
83+
Toolbar toolbar = findViewById(R.id.toolbar);
8584
setSupportActionBar(toolbar);
8685
getSupportActionBar().setHomeButtonEnabled(true);
8786
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -112,7 +111,7 @@ public void onDrawerOpened(View drawerView) {
112111
super.onDrawerOpened(drawerView);
113112
}
114113
};
115-
drawerLayout.setDrawerListener(drawerToggle);
114+
drawerLayout.addDrawerListener(drawerToggle);
116115
}
117116

118117
@Override
@@ -151,11 +150,11 @@ private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPos
151150
this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music;
152151
View view = findViewById(R.id.content_frame);
153152
int finalRadius = Math.max(view.getWidth(), view.getHeight());
154-
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
153+
Animator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
155154
animator.setInterpolator(new AccelerateInterpolator());
156155
animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION);
157156

158-
findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
157+
findViewById(R.id.content_overlay).setBackground(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
159158
animator.start();
160159
ContentFragment contentFragment = ContentFragment.newInstance(this.res);
161160
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit();

0 commit comments

Comments
 (0)