federicoiosue / Omni-Notes

Open source note-taking application for Android
https://omninotes.app
GNU General Public License v3.0
2.68k stars 1.11k forks source link

crash while switching the note layout #785

Closed tappdesign closed 3 years ago

tappdesign commented 3 years ago

while switching the note from expanded layout to "simple" application crash.

in NoteAdapter.java is always expanded layout created

public NoteViewHolder onCreateViewHolder (@NonNull ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.note_layout_expanded, parent, false);
    return new NoteViewHolder(view);
  }

maybe has to be changed this way:

@NonNull
  @Override
  public NoteViewHolder onCreateViewHolder (@NonNull ViewGroup parent, int viewType) {
    View view;
    if (expandedView) {
      view = LayoutInflater.from(parent.getContext()).inflate(R.layout.note_layout_expanded, parent, false);
    } else {
      view = LayoutInflater.from(parent.getContext()).inflate(R.layout.note_layout, parent, false);
    }
federicoiosue commented 3 years ago

Hi there,

I didn't tested but your solution is fine to me. Would you like to contribute by making a pull request on your own, following the guidelines?

tappdesign commented 3 years ago

Do I need permission for it? Pushing to new created branch returned 403 - denied to tappdesign

federicoiosue commented 3 years ago

Do I need permission for it? Pushing to new created branch returned 403 - denied to tappdesign

You've done well by creating a pull request instead of directly pushing your feature branch to my remote