add reveal animation to settings button

This commit is contained in:
Andrew Dolgov 2015-12-01 19:43:23 +03:00
parent 655b3e873e
commit 52adc29715
3 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,8 @@ package org.fox.ttrss;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.app.Fragment;
import android.support.v7.widget.SwitchCompat;
import android.util.TypedValue;
@ -51,7 +53,12 @@ public abstract class BaseFeedlistFragment extends Fragment {
try {
Intent intent = new Intent(getActivity(),
PreferencesActivity.class);
startActivityForResult(intent, 0);
ActivityOptionsCompat options = ActivityOptionsCompat
.makeSceneTransitionAnimation(getActivity(), v, "SETTINGS_REVEAL");
ActivityCompat.startActivityForResult(getActivity(), intent, 0, options.toBundle());
} catch (Exception e) {
}

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:transitionName="SETTINGS_REVEAL"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -28,6 +28,7 @@
android:clickable="true"
android:layout_marginBottom="16dp"
android:layout_marginRight="12dp"
android:transitionName="SETTINGS_REVEAL"
android:background="@drawable/ripple" />
<LinearLayout