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

@@ -21,6 +21,7 @@ import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
@@ -100,6 +101,7 @@ public class SetupSuccessFragment extends InstrumentedFragment {
allAppsIntent.setPackage(resolveInfo.activityInfo.packageName);
allAppsIntent.setComponent(resolveInfo.activityInfo.getComponentName());
}
activity.setTheme(R.style.Theme_SubSettings);
accessPrivateSpaceToast();
startActivity(allAppsIntent);
Log.i(TAG, "Private space setup complete");
@@ -109,7 +111,13 @@ public class SetupSuccessFragment extends InstrumentedFragment {
}
private void accessPrivateSpaceToast() {
Toast.makeText(getContext(), R.string.private_space_scrolldown_to_access,
Toast.LENGTH_SHORT).show();
Drawable drawable = getContext().getDrawable(R.drawable.ic_private_space_icon);
Toast.makeCustomToastWithIcon(
getContext(),
null /* looper */ ,
getContext().getString(R.string.private_space_scrolldown_to_access),
Toast.LENGTH_SHORT,
drawable)
.show();
}
}