Change icon for Private Space unlocked and setup success toast

Change is made to show customised icon in Toast message shown by using
Toast.makeCustomToastWithIcon()

Screenshots :
go/ss/AcaRQUJQfh79wDw.png
go/ss/5j4oD8xydwX7HTX.png

Bug: 329391204
Bug: 309575523
Test: Manual
Change-Id: I336d7d0419b1de60024e584e943a725662b446a9
This commit is contained in:
josephpv
2024-03-15 11:30:44 +00:00
committed by Joseph Vincent
parent 85cc4cd821
commit 4cc915ad64
4 changed files with 57 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.privatespace;
import static com.android.settings.privatespace.PrivateSpaceAuthenticationActivity.EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED;
import android.app.settings.SettingsEnums;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
@@ -38,7 +39,14 @@ public class PrivateSpaceDashboardFragment extends DashboardFragment {
if (icicle == null
&& getIntent().getBooleanExtra(EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED, false)) {
Log.i(TAG, "Private space unlocked showing toast");
Toast.makeText(getContext(), R.string.private_space_unlocked, Toast.LENGTH_SHORT)
Drawable drawable =
getContext().getDrawable(R.drawable.ic_private_space_unlock_icon);
Toast.makeCustomToastWithIcon(
getContext(),
null /* looper */,
getContext().getString(R.string.private_space_unlocked),
Toast.LENGTH_SHORT,
drawable)
.show();
}
}