1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
|
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.view.selectiontoolbar;
import android.annotation.NonNull;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.Parcelable;
import com.android.internal.util.DataClass;
import java.util.List;
/**
* The class holds menu information for render service to render the selection toolbar.
*
* @hide
*/
@DataClass(genToString = true, genEqualsHashCode = true)
public final class ShowInfo implements Parcelable {
/**
* The token that is used to identify the selection toolbar. This is initially set to 0
* until a selection toolbar has been created for the showToolbar request.
*/
private final long mWidgetToken;
/**
* If the toolbar menu items need to be re-layout.
*/
private final boolean mLayoutRequired;
/**
* The menu items to be rendered in the selection toolbar.
*/
@NonNull
private final List<ToolbarMenuItem> mMenuItems;
/**
* A rect specifying where the selection toolbar on the screen.
*/
@NonNull
private final Rect mContentRect;
/**
* A recommended maximum suggested width of the selection toolbar.
*/
private final int mSuggestedWidth;
/**
* The portion of the screen that is available to the selection toolbar.
*/
@NonNull
private final Rect mViewPortOnScreen;
/**
* The host application's input token, this allows the remote render service to transfer
* the touch focus to the host application.
*/
@NonNull
private final IBinder mHostInputToken;
/**
* If the host application uses light theme.
*/
private final boolean mIsLightTheme;
// Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
//
// To regenerate run:
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/view/selectiontoolbar/ShowInfo.java
//
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
// Settings > Editor > Code Style > Formatter Control
//@formatter:off
/**
* Creates a new ShowInfo.
*
* @param widgetToken
* The token that is used to identify the selection toolbar. This is initially set to 0
* until a selection toolbar has been created for the showToolbar request.
* @param layoutRequired
* If the toolbar menu items need to be re-layout.
* @param menuItems
* The menu items to be rendered in the selection toolbar.
* @param contentRect
* A rect specifying where the selection toolbar on the screen.
* @param suggestedWidth
* A recommended maximum suggested width of the selection toolbar.
* @param viewPortOnScreen
* The portion of the screen that is available to the selection toolbar.
* @param hostInputToken
* The host application's input token, this allows the remote render service to transfer
* the touch focus to the host application.
* @param isLightTheme
* If the host application uses light theme.
*/
@DataClass.Generated.Member
public ShowInfo(
long widgetToken,
boolean layoutRequired,
@NonNull List<ToolbarMenuItem> menuItems,
@NonNull Rect contentRect,
int suggestedWidth,
@NonNull Rect viewPortOnScreen,
@NonNull IBinder hostInputToken,
boolean isLightTheme) {
this.mWidgetToken = widgetToken;
this.mLayoutRequired = layoutRequired;
this.mMenuItems = menuItems;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMenuItems);
this.mContentRect = contentRect;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mContentRect);
this.mSuggestedWidth = suggestedWidth;
this.mViewPortOnScreen = viewPortOnScreen;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mViewPortOnScreen);
this.mHostInputToken = hostInputToken;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mHostInputToken);
this.mIsLightTheme = isLightTheme;
// onConstructed(); // You can define this method to get a callback
}
/**
* The token that is used to identify the selection toolbar. This is initially set to 0
* until a selection toolbar has been created for the showToolbar request.
*/
@DataClass.Generated.Member
public long getWidgetToken() {
return mWidgetToken;
}
/**
* If the toolbar menu items need to be re-layout.
*/
@DataClass.Generated.Member
public boolean isLayoutRequired() {
return mLayoutRequired;
}
/**
* The menu items to be rendered in the selection toolbar.
*/
@DataClass.Generated.Member
public @NonNull List<ToolbarMenuItem> getMenuItems() {
return mMenuItems;
}
/**
* A rect specifying where the selection toolbar on the screen.
*/
@DataClass.Generated.Member
public @NonNull Rect getContentRect() {
return mContentRect;
}
/**
* A recommended maximum suggested width of the selection toolbar.
*/
@DataClass.Generated.Member
public int getSuggestedWidth() {
return mSuggestedWidth;
}
/**
* The portion of the screen that is available to the selection toolbar.
*/
@DataClass.Generated.Member
public @NonNull Rect getViewPortOnScreen() {
return mViewPortOnScreen;
}
/**
* The host application's input token, this allows the remote render service to transfer
* the touch focus to the host application.
*/
@DataClass.Generated.Member
public @NonNull IBinder getHostInputToken() {
return mHostInputToken;
}
/**
* If the host application uses light theme.
*/
@DataClass.Generated.Member
public boolean isIsLightTheme() {
return mIsLightTheme;
}
@Override
@DataClass.Generated.Member
public String toString() {
// You can override field toString logic by defining methods like:
// String fieldNameToString() { ... }
return "ShowInfo { " +
"widgetToken = " + mWidgetToken + ", " +
"layoutRequired = " + mLayoutRequired + ", " +
"menuItems = " + mMenuItems + ", " +
"contentRect = " + mContentRect + ", " +
"suggestedWidth = " + mSuggestedWidth + ", " +
"viewPortOnScreen = " + mViewPortOnScreen + ", " +
"hostInputToken = " + mHostInputToken + ", " +
"isLightTheme = " + mIsLightTheme +
" }";
}
@Override
@DataClass.Generated.Member
public boolean equals(@android.annotation.Nullable Object o) {
// You can override field equality logic by defining either of the methods like:
// boolean fieldNameEquals(ShowInfo other) { ... }
// boolean fieldNameEquals(FieldType otherValue) { ... }
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@SuppressWarnings("unchecked")
ShowInfo that = (ShowInfo) o;
//noinspection PointlessBooleanExpression
return true
&& mWidgetToken == that.mWidgetToken
&& mLayoutRequired == that.mLayoutRequired
&& java.util.Objects.equals(mMenuItems, that.mMenuItems)
&& java.util.Objects.equals(mContentRect, that.mContentRect)
&& mSuggestedWidth == that.mSuggestedWidth
&& java.util.Objects.equals(mViewPortOnScreen, that.mViewPortOnScreen)
&& java.util.Objects.equals(mHostInputToken, that.mHostInputToken)
&& mIsLightTheme == that.mIsLightTheme;
}
@Override
@DataClass.Generated.Member
public int hashCode() {
// You can override field hashCode logic by defining methods like:
// int fieldNameHashCode() { ... }
int _hash = 1;
_hash = 31 * _hash + Long.hashCode(mWidgetToken);
_hash = 31 * _hash + Boolean.hashCode(mLayoutRequired);
_hash = 31 * _hash + java.util.Objects.hashCode(mMenuItems);
_hash = 31 * _hash + java.util.Objects.hashCode(mContentRect);
_hash = 31 * _hash + mSuggestedWidth;
_hash = 31 * _hash + java.util.Objects.hashCode(mViewPortOnScreen);
_hash = 31 * _hash + java.util.Objects.hashCode(mHostInputToken);
_hash = 31 * _hash + Boolean.hashCode(mIsLightTheme);
return _hash;
}
@Override
@DataClass.Generated.Member
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
int flg = 0;
if (mLayoutRequired) flg |= 0x2;
if (mIsLightTheme) flg |= 0x80;
dest.writeInt(flg);
dest.writeLong(mWidgetToken);
dest.writeParcelableList(mMenuItems, flags);
dest.writeTypedObject(mContentRect, flags);
dest.writeInt(mSuggestedWidth);
dest.writeTypedObject(mViewPortOnScreen, flags);
dest.writeStrongBinder(mHostInputToken);
}
@Override
@DataClass.Generated.Member
public int describeContents() { return 0; }
/** @hide */
@SuppressWarnings({"unchecked", "RedundantCast"})
@DataClass.Generated.Member
/* package-private */ ShowInfo(@NonNull android.os.Parcel in) {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
int flg = in.readInt();
boolean layoutRequired = (flg & 0x2) != 0;
boolean isLightTheme = (flg & 0x80) != 0;
long widgetToken = in.readLong();
List<ToolbarMenuItem> menuItems = new java.util.ArrayList<>();
in.readParcelableList(menuItems, ToolbarMenuItem.class.getClassLoader());
Rect contentRect = (Rect) in.readTypedObject(Rect.CREATOR);
int suggestedWidth = in.readInt();
Rect viewPortOnScreen = (Rect) in.readTypedObject(Rect.CREATOR);
IBinder hostInputToken = (IBinder) in.readStrongBinder();
this.mWidgetToken = widgetToken;
this.mLayoutRequired = layoutRequired;
this.mMenuItems = menuItems;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMenuItems);
this.mContentRect = contentRect;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mContentRect);
this.mSuggestedWidth = suggestedWidth;
this.mViewPortOnScreen = viewPortOnScreen;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mViewPortOnScreen);
this.mHostInputToken = hostInputToken;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mHostInputToken);
this.mIsLightTheme = isLightTheme;
// onConstructed(); // You can define this method to get a callback
}
@DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<ShowInfo> CREATOR
= new Parcelable.Creator<ShowInfo>() {
@Override
public ShowInfo[] newArray(int size) {
return new ShowInfo[size];
}
@Override
public ShowInfo createFromParcel(@NonNull android.os.Parcel in) {
return new ShowInfo(in);
}
};
@DataClass.Generated(
time = 1645108384245L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/selectiontoolbar/ShowInfo.java",
inputSignatures = "private final long mWidgetToken\nprivate final boolean mLayoutRequired\nprivate final @android.annotation.NonNull java.util.List<android.view.selectiontoolbar.ToolbarMenuItem> mMenuItems\nprivate final @android.annotation.NonNull android.graphics.Rect mContentRect\nprivate final int mSuggestedWidth\nprivate final @android.annotation.NonNull android.graphics.Rect mViewPortOnScreen\nprivate final @android.annotation.NonNull android.os.IBinder mHostInputToken\nprivate final boolean mIsLightTheme\nclass ShowInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genEqualsHashCode=true)")
@Deprecated
private void __metadata() {}
//@formatter:on
// End of generated code
}
|