Layout files messed up after adding recycler view Unable to eddit and code is gone replaced with java
I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.
RecyclerView.Adapter {
public List<BlogPost> blog_list;
public BlogRecyclerAdapter(List<BlogPost> blog_list) {
this.blog_list = blog_list;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);
}
@Override
public int getItemCount() {
return blog_list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private View mView;
private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;
public ViewHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setDescText(String descText) {
descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);
}
public void setBlogImage(String downloadUri) {
blogImageView = mView.findViewById(R.id.Post_image_view);
StorageReference filepath = mImageStorage.child("profile_images").child(curren
here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try
java

add a comment |
I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.
RecyclerView.Adapter {
public List<BlogPost> blog_list;
public BlogRecyclerAdapter(List<BlogPost> blog_list) {
this.blog_list = blog_list;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);
}
@Override
public int getItemCount() {
return blog_list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private View mView;
private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;
public ViewHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setDescText(String descText) {
descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);
}
public void setBlogImage(String downloadUri) {
blogImageView = mView.findViewById(R.id.Post_image_view);
StorageReference filepath = mImageStorage.child("profile_images").child(curren
here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try
java

Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10
add a comment |
I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.
RecyclerView.Adapter {
public List<BlogPost> blog_list;
public BlogRecyclerAdapter(List<BlogPost> blog_list) {
this.blog_list = blog_list;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);
}
@Override
public int getItemCount() {
return blog_list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private View mView;
private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;
public ViewHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setDescText(String descText) {
descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);
}
public void setBlogImage(String downloadUri) {
blogImageView = mView.findViewById(R.id.Post_image_view);
StorageReference filepath = mImageStorage.child("profile_images").child(curren
here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try
java

I implemented a recycler view into my app. I decided to make a change to the layout files and when I did all of them except for a few recently created ones looked this.
RecyclerView.Adapter {
public List<BlogPost> blog_list;
public BlogRecyclerAdapter(List<BlogPost> blog_list) {
this.blog_list = blog_list;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String desc_data = blog_list.get(position).getDesc();
holder.setDescText(desc_data);
}
@Override
public int getItemCount() {
return blog_list.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private View mView;
private TextView descView;
private ImageView blogImageView;
private StorageReference mImageStorage;
private DatabaseReference mUserDatabase;
public ViewHolder(View itemView) {
super(itemView);
mView = itemView;
}
public void setDescText(String descText) {
descView = mView.findViewById(R.id.blog_desc);
descView.setText(descText);
}
public void setBlogImage(String downloadUri) {
blogImageView = mView.findViewById(R.id.Post_image_view);
StorageReference filepath = mImageStorage.child("profile_images").child(curren
here are a few examples of the other XML files https://snag.gy/hbXBcZ.jpg https://snag.gy/TmXFzQ.jpg I am very confused on what has caused this and i am at a loss on what to try
java

java

asked Jan 2 at 0:01
user9495575
Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10
add a comment |
Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10
Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10
Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999893%2flayout-files-messed-up-after-adding-recycler-view-unable-to-eddit-and-code-is-go%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999893%2flayout-files-messed-up-after-adding-recycler-view-unable-to-eddit-and-code-is-go%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Restore the old files within your IDE or your version control system.
– Thorbjørn Ravn Andersen
Jan 2 at 2:10