Created
July 11, 2021 06:10
-
-
Save rubenquadros/5e47dc33639cda45dbad60275a9a64c0 to your computer and use it in GitHub Desktop.
Generated binding file for activity_main.xml layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by view binder compiler. Do not edit! | |
package com.ruben.viewbindingexample.databinding; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import androidx.annotation.NonNull; | |
import androidx.annotation.Nullable; | |
import androidx.appcompat.widget.AppCompatButton; | |
import androidx.constraintlayout.widget.ConstraintLayout; | |
import androidx.viewbinding.ViewBinding; | |
import com.ruben.viewbindingexample.R; | |
import java.lang.NullPointerException; | |
import java.lang.Override; | |
import java.lang.String; | |
public final class ActivityMainBinding implements ViewBinding { | |
@NonNull | |
private final ConstraintLayout rootView; | |
@NonNull | |
public final AppCompatButton button; | |
private ActivityMainBinding(@NonNull ConstraintLayout rootView, @NonNull AppCompatButton button) { | |
this.rootView = rootView; | |
this.button = button; | |
} | |
@Override | |
@NonNull | |
public ConstraintLayout getRoot() { | |
return rootView; | |
} | |
@NonNull | |
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater) { | |
return inflate(inflater, null, false); | |
} | |
@NonNull | |
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater, | |
@Nullable ViewGroup parent, boolean attachToParent) { | |
View root = inflater.inflate(R.layout.activity_main, parent, false); | |
if (attachToParent) { | |
parent.addView(root); | |
} | |
return bind(root); | |
} | |
@NonNull | |
public static ActivityMainBinding bind(@NonNull View rootView) { | |
// The body of this method is generated in a way you would not otherwise write. | |
// This is done to optimize the compiled bytecode for size and performance. | |
int id; | |
missingId: { | |
id = R.id.button; | |
AppCompatButton button = rootView.findViewById(id); | |
if (button == null) { | |
break missingId; | |
} | |
return new ActivityMainBinding((ConstraintLayout) rootView, button); | |
} | |
String missingId = rootView.getResources().getResourceName(id); | |
throw new NullPointerException("Missing required view with ID: ".concat(missingId)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment