Merge "Fix the transition of the up-button." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
20fa1428bc
@@ -238,12 +238,10 @@ public class SettingsActivity extends SettingsBaseActivity
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
final MaterialSharedAxis enterTransition = new MaterialSharedAxis(
|
||||
MaterialSharedAxis.X, /* forward */true);
|
||||
enterTransition.addTarget(R.id.content_parent);
|
||||
getWindow().setEnterTransition(enterTransition);
|
||||
|
||||
final MaterialSharedAxis returnTransition = new MaterialSharedAxis(
|
||||
MaterialSharedAxis.X, /* forward */false);
|
||||
returnTransition.addTarget(R.id.content_parent);
|
||||
getWindow().setReturnTransition(returnTransition);
|
||||
}
|
||||
|
||||
|
@@ -32,11 +32,13 @@ import android.util.ArraySet;
|
||||
import android.util.FeatureFlagUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.Toolbar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -167,6 +169,17 @@ public class SettingsBaseActivity extends FragmentActivity {
|
||||
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
final int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
// Make the up button behave the same as the back button.
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
if (mCollapsingToolbarLayout != null) {
|
||||
|
Reference in New Issue
Block a user